You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ge...@mckinsey.com on 2002/07/15 18:24:42 UTC

trigger multiple pipelines in Cocoon

I was just wondering how one would actually execute multiple pipelines from
one browser session.  Specifically, I want to be able to write multiple
files from one submit of a form on an html page.  I have an html page with
an embedded javascript that just parses in contents of a textarea in a a
form and tries to call a pipeline several times with different arguments so
that the pipeline with the SourceWritingTransformer will write to multiple
files.  The javascript is below:
<SCRIPT language="javascript">
     var input;
     var stringArray = new Array();
     function submit(token, j)
     {
          Metadata.action = "/cocoon/test/metadata" + j + ".xsp?KO=" +
token;
          Metadata.submit();
     }
     function parse()
     {
          input = document.Metadata.textinput.value;
          var index = 0, beginMark = 0, endMark = 0;
          var stopCondition = input.length;

          //begin parsing the textarea contents
          for (i = 0; i <= stopCondition ; i = i + 1)
          {
               ......code......
          }

          //call the submit function for every token that I have parsed

          for ( j = 0; j <= index; j= j + 1)
          {
               alert(stringArray[j]);
               submit(stringArray[j], j);
          }
     }
</SCRIPT>

and a pipeline that looks like this :

<map:match pattern="test/*.xsp">

      <map:act type="request">
        <map:parameter name="parameters" value="true"/>
        <map:generate type ="serverpages" src
="testExamples/dynamic/metadata.xsp"/>
        <map:transform type="sql">
            <map:parameter name="use-connection" value="dev_database"/>
        </map:transform>
        <map:transform src="testExamples/stylesheets/metadata.xsl"/>
        <map:transform type="xslt-with-params" src
="testExamples/stylesheets/source.xsl">
          <map:parameter name="ID" value="{KO}"/>
        </map:transform>
      </map:act>
      <map:transform type="tofile">
          <map:parameter name="serializer" value="xml"/>
      </map:transform>
      <map:serialize type="xml"/>
   </map:match>

This does not seem to be working as only the last token is processed
through the pipeline.  Can only one pipeline be triggered by one connection
to cocoon?  Is that the issue or is it that the form Post method can only
send out one request per webpage?  Any help on how to do this more
effeciently or cleaner would be greatly appreciated.

And I'm sorry for being rude and not having thanked people for helping me
on my last request just seem to have gotten caught up coding.  Thank you
Rossell Olivier and Sylvain Wallez for help with the SWT. Just upgraded to
Cocoon 2.0.2 and it worked out of the box...haven't tried the context issue
out though.


Thanks,

Gerardo

+---------------------------------------------------------+
This message may contain confidential and/or privileged
information.  If you are not the addressee or authorized to
receive this for the addressee, you must not use, copy,
disclose or take any action based on this message or any
information herein.  If you have received this message in
error, please advise the sender immediately by reply e-mail
and delete this message.  Thank you for your cooperation.
+---------------------------------------------------------+


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>