cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Pötz <reinhard_po...@gmx.net>
Subject RE: reading xml from pipeline into a flow script
Date Mon, 30 Jun 2003 10:38:13 GMT

This will work but not with the upcoming Flow Object Model. You won't
have access to the environment any more. If you are interested in the
FOM you find a reference here:
http://wiki.cocoondev.org/Wiki.jsp?page=FOM (be aware that this is a
working document and may change!!!)

So currently the easiest way is
{
...
     var uri = "cocoon://blablabla";
	var resolver = cocoon.componentManager.lookup(
Packages.org.apache.cocoon.environment.SourceResolver.ROLE );
	var srce = resolver.resolveURI( uri );
	cocoon.componentManager.release( resolver );
	var dom =
Packages.org.apache.cocoon.components.source.SourceUtil.toDOM( srce );
...
}

which will probably change with FOM to

{
...
     var uri = "cocoon://blablabla";
	var resolver = cocoon.getComponent(
Packages.org.apache.cocoon.environment.SourceResolver.ROLE );
	var srce = resolver.resolveURI( uri );
	// release of the component (not defined yet
	var dom =
Packages.org.apache.cocoon.components.source.SourceUtil.toDOM( srce );
...
}

Hope this helps!

Reinhard



> -----Original Message-----
> From: Frank Taffelt [mailto:frank.taffelt@interface-business.de] 
> Sent: Monday, June 30, 2003 9:34 AM
> To: cocoon-users@xml.apache.org
> Subject: Re: reading xml from pipeline into a flow script
> 
> 
> you can use this snippet:
> 
> function getString(src) {
>     try {
>          var is =  
> cocoon.environment.resolveURI(src).getInputStream();
>          return 
> Packages.org.apache.cocoon.components.language.markup.xsp.XSPU
> til.getContent
> s(is);
>     }
>     catch(ex) {
>         print("ex:" + ex);
>     }
>     return null;
> 
> 
> }
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Mime
View raw message