cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Schmitz, Jeffrey A" <Jeffrey.A.Schm...@boeing.com>
Subject Flowscript Continuation ID parameter
Date Tue, 12 Jun 2007 13:40:48 GMT
Hello,
   I see how the continuration ID can be accessed from within a .jx file
as follows:

  <form method="post" action="${cocoon.continuation.id}.kont">

As long as the .jx file is processed by the JXTemplateGenerator, e.g.   

    <map:match pattern="*.jx">
      <map:generate type="jx" src="documents/{1}.jx"/>
      <map:serialize type="xhtml"/>
    </map:match>

However, as part of my page "flow" I want to invoke an already existing
transform that uses the file generator (not the JXTemplateGenerator),
after which I want to re-enter my flowscript.  My solution is to
manually pass the continuation ID as a parameter (parameter 4) to the
existing sitemap pipeline entry for my current transform as follows:

     var uri = inputType + "In/" + inputFile + "/" + inputType +
"In.trans/" + cocoon.continuation.id;
     cocoon.sendPageAndWait(uri);

This URI matches the following, non JXTemplateGenerator pipline, the
fourth parameter being the continuation ID, which in turn is passed into
the xsl/importResult.xsl script:

      <map:match pattern="*In/*/*.trans/*" >
         <map:generate src="inputs/{2}.xml" />
         <map:transform src="xsl/{1}InAdapter.xsl">
         </map:transform>
         <map:transform src="xsl/updateNeutralRefs.xsl"/>
         <map:transform type="PersistModelTrans">
           <map:parameter name="saveToFile" value="true"/>
           <map:parameter name="saveToDB" value="true"/>
           <map:parameter name="dataFormat" value="Neutral"/>
           <map:parameter name="passThrough" value="false"/>
         </map:transform>
         <map:transform src="xsl/importResult.xsl">
           <map:parameter name="continueID" value="{4}"/>
         </map:transform>
         <map:serialize type="xhtml"/>
      </map:match>

And then I use the continuation ID parameter in the return page xsl
(xsl/importResult.xsl) as follows to create a submit action that will
re-invoke my flowscript from the previous continuation point:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="2.0" >
 <xsl:param name="continueID"/>

   <form method="post" action="{$continueID}.kont">

Is there anything wrong with this approach (it seems to work)?  Is there
a better way?

Thanks,
Jeff


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


Mime
View raw message