cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeroen Reijn <j.re...@hippo.nl>
Subject Re: pass parameters from sitemap to flowscript, and fork scriptshell thread
Date Mon, 29 Jan 2007 15:43:20 GMT
Hi Sébastien,

You allmost had it, but I think you need to split up the pattern into 2 
things:

<map:match pattern="process-result-pipeline">
   <map:call function="exec"/>
</map:match>

And then in your flowscript:

function exec() {

   var pipeutil = 
cocoon.createObject(Packages.org.apache.cocoon.components.flow.util.PipelineUtil);
   var domResult = pipeutil.processToDOM("gml2xml-pipeline", {});
   var param = domResult;
   var results = // Java call, to fork shell script thread (param)
   cocoon.sendPage("show-result-pipeline", {"bizData" : results} );
}

In the flow example above your pipeline will have stored as a DOM object 
in your function and you could handle the DOM to string conversion in 
your Java class, but I think this points you in the right direction.

If you have more questions, feel free to ask!

Kind regards,

Jeroen Reijn


Sébastien Geindre wrote:
> Hi cocooners !
> 
> I'd like to execute a script Shell which needs xmlData as feed parameter.
> I thought that a flowscript could call java thread which fork shell 
> script thread.
> 
> So i need to pass xmlData from generator to function in flowscript.
> How can i do this ?
> sitemap :
>    <map:match pattern="process-result-pipeline">
>               <map:generate src="cocoon:/gml2xml-pipeline"/>
>               <map:call function="exec">
>                   <map:parameter name="xmlData" value="???"/>
>               </map:call>
>     </map:match>
> 
> flowscript:
> function exec() {
>   var param = cocoon.parameters.xmlData;
>   var results = // Java call, to fork shell script thread (param)
>   cocoon.sendPage("show-result-pipeline", {"bizData" : results} );
> }
> 
> Merci à tous.
> 
> 

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


Mime
View raw message