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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to