Oleg,
I'm afraid that you can't do it the way you propose. You can't get
content from the SAX stream while it's still processing the current
pipeline.
An alternative to using the sitemap approach is executing this process
from flow. That way you can call the pipeline and use it's result for
further processing.
From flow you could load the pipeline and then based on an Xpath
perform some operations:
function operations()
{
var list = loadDocument("cocoon:/all-documents");
var hrefs = list.getElementsByTagNameNS("DAV:", "href");
}
The load document comes from the cocoon examples.
I hope this helps you out a bit.
Regards,
Jeroen Reijn
Oleg Konovalov wrote:
Jeroen,
Are you saying that there is no way to capture (and manipulate) these SP
output parameters in a sitemap ?
Here is the output of SQL Transformer:
<page xmlns:sql="http://apache.org/cocoon/SQL/2.0">
<content>
<rowset name="roster"
xmlns="http://apache.org/cocoon/SQL/2.0">
<roster_id>61</roster_id>
<error_text>Error in MPS_WIP_LOAD:
ORA-0000: normal, successful completion</error_text>
</rowset>
</content>
</page>
Thank you,
Oleg.
----- Forwarded Message ----
From: Jeroen Reijn <[EMAIL PROTECTED]>
To: users@cocoon.apache.org
Sent: Thursday, October 5, 2006 9:51:14 AM
Subject: RE: Reading Output params from Stored Proc in sitemap
Hi Oleg,
i'm not completely sure, but I think the out-parameters will end up in
the SAX stream instead of them being available in the sitemap after the
transformation stage.
Regards,
Jeroen Reijn
-----Original Message-----
*From:* Oleg Konovalov [mailto:[EMAIL PROTECTED]
*Posted At:* Wednesday, October 04, 2006 10:15 PM
*Posted To:* Cocoon User List
*Conversation:* Reading Output params from Stored Proc in sitemap
*Subject:* Reading Output params from Stored Proc in sitemap
Hi,
I have 2 output parameters in stored procedure named ʽroster_idʼ and
ʽerror_textʼ (the stored procedure is executed from
create_wip_roster-query2.xml).
If the ʽerror_textʼ is populated then redirect page to
ʽupload_wip_formʼ along with the error_text value.
If the ʽerror_textʼ is not populated then redirect the page to
ʽwip_rosterʼ form along with the ʽroster_idʼ value.
For some reason I can not get obtain any parameters from stored
procedure for executing correct redirect.
sitemap entry:
<map:match
pattern="mbr/create_wip_roster">
<map:act type="request">
<map:parameter name="parameters" value="true"/>
<map:generate src="xml/create_wip_roster-query2.xml"/>
<!--
this xml doc executes a procedure and gives out two output
parameters named roster_id and error_text -->
<map:transform type="sql">
<map:parameter name="company_number" value="{company_number}"/>
<map:parameter name="use-connection" value="db_conn"/>
</map:transform>
<!--
Here I want to check if the error_text is populated then redirect to
upload_wip_form,
if not, then redirect to wip_roster does not work. -->
<map:select type="parameter">
<map:parameter name="error_text" value="{error_text}"/>
<map:when test="$error_text">
<map:redirect-to uri="upload_wip_form?error_text={error_text}"/>
</map:when>
<map:otherwise>
<map:parameter name="roster_id" value="{roster_id}"/>
<map:redirect-to uri="wip_roster"/>
</map:otherwise>
</map:select>
<map:serialize type="html"/>
</map:act>
</map:match>
<content>
<sql:execute-query>
<sql:query name="roster" isstoredprocedure="true">
begin mySP (<sql:substitute-value
sql:name="company_number"/>,?,?);end;
</sql:query>
<sql:out-parameter sql:nr="1" sql:name="roster_id"
sql:type="oracle.jdbc.driver.OracleTypes.NUMBER"/>
<sql:out-parameter sql:nr="2" sql:name="error_text"
sql:type="java.sql.Types.VARCHAR"/>
</sql:execute-query>
</content>
</page>
Sorry for the newbie question.
Thank you in advance,
Oleg.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]