cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Hermann <christoph.herm...@guschtel.de>
Subject Re: Using the output of a pipeline to call another pipeline?
Date Fri, 30 Sep 2005 09:07:28 GMT
Derek Hohls schrieb:

Hello,

> Thank's for the replies,
> Both using an action, and using a flowscript seem promising, but also
> problematic.
> 
> For the flowscript solution to work, I need to read the xQuery result
> from a cocoon pipeline. Unfortunately, cocoon.processPipelineTo() does
> not work as in this example:
> readImage() {
> // get request uri in here somehow
> var realfile =
> cocoon.processPipelineTo("flow/locateimage"+cocoon.getRequestUri());
> 
> //parse response
> var realFilename = getFilenameFromResponse(realfile);
> 
> Cocoon.sendPage("flow/readimage/"+realFileName");
> }
> processPipelineTo wants an outputstream to send the response to,
> rather than storing it in a variable, as I need to do. Is there a way
> around this?

Just do it like this (if i got you right):

var output = new Packages.java.io.ByteArrayOutputStream();
cocoon.processPipelineTo("flow/locateimage"+cocoon.getRequestUri(),null,output);

var realFilename = getFilenameFromResponse(output.toString());
// or whatever you want to do with it

HTH
Christoph

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


Mime
View raw message