You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sébastien Geindre <se...@meteo.fr> on 2007/01/29 15:49:36 UTC

pass parameters from sitemap to flowscript, and fork scriptshell thread

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.


-- 
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre@meteo.fr
05 61 07 84 93




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


Re: pass parameters from sitemap to flowscript, and fork scriptshellthread

Posted by Jeroen Reijn <j....@hippo.nl>.
Sébastien,

yes you can use the loadDocument() function as well if you want. It does 
sort of the same.

I'm afraid I don't have an example of the fork shell script thread with 
a dom. But with I think that you can find enough examples of Java 
classes that pass on a DOM or a String to a shell script on the net.

Kind regards,

Jeroen Reijn

Sébastien Geindre wrote:
> Merci !!
> 
> And what about use loadDocument() ??
> 
> function exec() {
>    var document = loadDocument("cocoon:/gml2txt-pipeline");
>    cocoon.sendPage("show-result-pipeline", {"bizData" : document} );
> }
> 
> 
> Do you have any example about the Java call (fork shell script thread 
> with var document as param) ??
> 
> Sébastien.
> 
> Jeroen Reijn a écrit :
>> 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
>>
>>
> 
> 

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


Re: pass parameters from sitemap to flowscript, and fork scriptshellthread

Posted by Sébastien Geindre <se...@meteo.fr>.
Merci !!

And what about use loadDocument() ??

function exec() {
    var document = loadDocument("cocoon:/gml2txt-pipeline");
    cocoon.sendPage("show-result-pipeline", {"bizData" : document} );
}


Do you have any example about the Java call (fork shell script thread 
with var document as param) ??

Sébastien.

Jeroen Reijn a écrit :
> 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
>
>


-- 
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre@meteo.fr
05 61 07 84 93




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


Re: pass parameters from sitemap to flowscript, and fork scriptshell thread

Posted by Jeroen Reijn <j....@hippo.nl>.
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