Hi,
I'm using Cocoon 2.1.5-dev (snapshot 2004-04-16)
I have a sitemap like this:
----------------- snip ---------------------------------------------------------
[...]
<map:match pattern="content">
<map:act type="auth-protect">
<map:parameter name="handler" value="portalhandler"/>
<map:generate type="file" src="" label="content" />
<map:transform type="session" label="transform-session"/>
<map:select type="request-parameter">
<map:parameter name="attribute-name" value="content"/>
[...]
<map:when test="_messages">
<!-- put in the select statement -->
<map:transform src="">
<map:transform type="sql">
<map:parameter name="use-connection" value="myPortalStructure"/>
<map:parameter name="show-nr-of-rows" value="true"/>
<map:parameter name="clob-encoding" value="UTF-8"/>
<map:parameter name="column-case" value="preserve"/>
<map:parameter name="userid" value="{session-context:authentication/authentication/data/userid}"/>
</map:transform>
<!-- put the row-state in the rows tag -->
<map:transform src="">
<!-- write the result to the session for use in the flowscript -->
<map:transform type="writeDOMsession">
<map:parameter name="dom-name" value="DBResult"/>
<map:parameter name="dom-root-element" value="document"/>
</map:transform>
<map:select type="request-method">
<map:when test="GET">
<map:call function="handleForm">
<map:parameter name="function" value="updnachrichten"/>
<map:parameter name="form-definition" value="forms/messagelist.xml"/>
<map:parameter name="bindingURI" value="forms/messageliste_bind.xml"/>
</map:call>
</map:when>
<map:when test="POST">
<map:call continuation="{request-param:continuation-id}"/>
</map:when>
</map:select>
</map:when>
[...]
----------------- /snip ---------------------------------------------------------
and a flow script like this:
----------------- snip ---------------------------------------------------------
cocoon.load("resource://org/apache/cocoon/forms/flow/_javascript_/Form.js");
function updnachrichten(form) {
// get the document from the session
var document = cocoon.session.getAttribute("DBResult");
// TODO: this is only, because the first time the function
// is called, the document is null.
if (null == document) {
form.showForm("nachrichtenliste-display-pipeline");
}
// bind the document data to the form
form.load(document);
// show the form to the user until it is validated successfully
form.showForm("nachrichtenliste-display-pipeline");
// bind the form's data back to the document
form.save(document);
// write document back to the session for next pipeline
cocoon.session.setAttribute("nachrichtenlisteDocument", document);
// send to pipeline, which saves data in db
cocoon.sendPage("nachrichten-save-pipeline");
}
----------------- /snip ---------------------------------------------------------
I wanted to use the result from the SQLTransformer (set in the Session with the WriteDOMSession) in my flow script, but realized, that first the flow script is executed and then the rest of the <map:when test="_messages">-part of the pipeline.
(If I make the request a second time, the result from the query of the request before is then in the session.)
Does anyone know why this is or how I can force cocoon to process my pipeline sequentially?
many thanks in advance,
Nicole
- Re: Order of processing in sitemap with call of flow Hochleiter
- Re: Order of processing in sitemap with call of flo... Joerg Heinicke
- Re: Order of processing in sitemap with call of... Nicole Hochleiter
