cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timur Izhbulatov <...@yxo.ru>
Subject [ Flow ] Using continuations
Date Mon, 09 Aug 2004 13:41:38 GMT
Hi all! 

I was searching this mailing list and have found the message [1] where the 
problem was described which is very similar to the one I have faced with.
I just can't get what is the difference between calling one flow pipeline 
from another and incapsulating the same code in one flow script. 

As I already mentioned in my previous message [2], when I use single 
pipeline I have a problem with back button. So I considered this approach as 
wrong one.
And when I call cocoon.sendPageAndWait("another-pipeline"), I don't know how 
to return to the caller script. I don't understand how could I use 
continuation in this case. 

Below are my sitemap and flow script snippets: 

     <map:match pattern="edit-new/*">
       <map:call function="editClientNew">
         <map:parameter name="form-definition"
           value="forms/select-docs_form.xml" />
         <map:parameter name="data-base"
           value="xmldb:xindice-embed:///db/caclient/" />
         <map:parameter name="client-id"
           value="{1}" />
       </map:call>
     </map:match> 

function editClientNew() {
   var form     = new Form(cocoon.parameters["form-definition"]);
   var clientID = cocoon.parameters["client-id"]; 

   form.showForm("select-docs-display-pipeline"); 

   // show a form for each document in the selection list
   var list = form.getModel().list;
   for(i = 0; i < list.length; i++) {
       cocoon.sendPageAndWait("edit-new/" + clientID + "/" + list[i]);
   }
   cocoon.sendPage("home.html");
} 

     <map:match pattern="edit-new/*/*">
       <map:call function="showForm">
         <map:parameter name="form-definition" value="forms/{2}_form.xml"/>
         <map:parameter name="doc-name" value="{2}"/>
         <map:parameter name="bindingURI" value="forms/{2}_bind.xml"/>
         <map:parameter name="dataURI"
           value="xmldb:xindice-embed:///db/caclient/{1}"/>
       </map:call>
     </map:match> 

function showForm() {
   var form = new Form(cocoon.parameters["form-definition"]);
   var bindingURI = cocoon.parameters["bindingURI"]
   var docName = cocoon.parameters["doc-name"];
   var dataURI = cocoon.parameters["dataURI"];
   var doc = loadDocument(dataURI);

   form.createBinding(bindingURI);
   form.load(doc);
   form.showForm(docName + "-display-pipeline");
   form.save(doc);

   saveDocument(doc, dataURI);
} 

[1] http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=107023534411107&w=2
[2] 
http://archives.real-time.com/pipermail/cocoon-users/2004-August/054964.html 

Timur

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


Mime
View raw message