cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Volkm@r" <plsdontre...@arcor.de>
Subject Re: "redirect-to" result of a transformation
Date Mon, 04 Apr 2005 16:51:52 GMT
Adam Ratcliffe wrote:
> You could do this from flowscript. Basically what you'd need to do is process
> the request in the flow layer and use the cocoon object's processPipelineTo()
> method to retrieve the output of the pipeline and redirect from there.
> 
> <map:match pattern="myPattern">
> 	<map:call function="processLinks"/>
> </map:match>
> 
> function processLinks() {
> 	var uri = cocoon.request.getParameter("Quelle");
> 	var output = new Packages.java.io.ByteArrayOutputStream();
> 	cocoon.processPipelineTo(uri, output);
> 	var redirectUri = output.toString();
> 	cocoon.redirectTo(redirectUri);
> }
> 
> HTH
> Adam

I've followed your proposal and now I'm getting this error message:

--------------------------------------
An Error Occurred

at processLinks (file:/path/to/script/redirect.flow, Line 4): expected a 
java.io.OutputStream instead of null

org.apache.avalon.framework.CascadingRuntimeException: 
"file:/path/to/script/redirect.flow", line 4: uncaught JavaScript 
exception: at processLinks (file:/path/to/script/redirect.flow, Line 4): 
expected a java.io.OutputStream instead of null

cause: org.mozilla.javascript.JavaScriptException: at processLinks 
(file:/path/to/script/redirect.flow, Line 4): expected a 
java.io.OutputStream instead of null
--------------------------------------

Obviously the function "processPipelineTo" is missing one of three 
arguments. I'm completely new to flowscripts and I'd like to learn how 
to solve this.

How do I get the missing argument?

And where can I put the xpath expression extracting the URL from the 
webpage  fetched by "request.getParameter"?

-- 
Volkm@r


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


Mime
View raw message