Hi,
I am using the Orbeon Forms solution to generate messages from filled-in web forms.
I read different code snippetse in Orbeon's wiki on XForms submission from a pipeline, and I tried different solutions but it doesn't work, and there is no example with a POST from a pipeline, caught by a PFC and sent to an XForms view that receives the posted data (all examples are done in the same page).
I have the following pipeline which is received on his instance input:
pipelineWrite.xpl
<p:config ...>
<p:param name="instance" type="input"/> <!-- instance containing the data of the form filled by user -->
<p:param name="data" type="output"/>
<p:processor name="oxf:java"> <!-- transforms the data into a file -->
<p:input name="config">
<config sourcepath="." class="ProcessorWriteCUSDECCD001B"/>
</p:input>
<p:input name="input" href="#instance"/>
<p:output name="output" id="file"/> <!-- XML containing the url of the file -->
</p:processor>
</p:config>
Then there is the PFC which catch the actions :
page-flow.xml
<config xmlns="http://www.orbeon.com/oxf/controller">
<page path-info="/CUSDECCD001B/" view="View/ViewForm.xhtml"/> <!-- load the form to be filled in by user -->
<page path-info="/CUSDECCD001B/write" model="Controller/PipelineWrite.xpl"/> <!-- send the instance of the form filled to the pipeline above -->
<page path-info="/CUSDECCD001B/success" view="View/ViewSuccess.xhtml"/> <!-- send the instance containing the url of the file to the success view -->
<epilogue url="oxf:/config/epilogue.xpl"/>
</config>
Then there is the success view, which is very simple :
ViewSuccess.xhtml
<html ... >
<head>
<title>Generation OK</title>
<xforms:model>
<xforms:instance id="FILE" src="input:instance">
<files xmlns="">
<file mediaType="" filename="" size="" />
</files>
</xforms:instance>
</xforms:model>
</head>
<body>
Click here to download :
<xforms:output ref="//file" appearance="xxforms:download">
<xforms:filename ref="@filename"/>
<xforms:mediatype ref="@mediatype"/>
<xforms:label>Download</xforms:label>
</xforms:output>
</body>
</html>
All this process I launched by clicking on the "Save" button in the "ViewModify" page :
ViewModify.xhtml
<xforms:model>
<xforms:instance id="CUSDECCD001B" src="../apps/CUSDECCD001B/Model/ModelCUSDECCD001B.xml" />
<xforms:submission id="save-submission" ref="instance('CUSDECCD001B')" action="/CUSDECCD001B/write" replace="instance" instance="CUSDECCD001BFile">
<xforms:send ev:event="xforms-submit-done" submission="send-to-success"/>
</xforms:submission>
<xforms:submission id="send-to-success" method="post" action="/CUSDECCD001B/success" ref="instance('CUSDECCD001BFile')" replace="all"/>
</xforms:model>
<!-- .... Content of XForms form -->
<xforms:submit submission="save-submission">
<xforms:label>Save</xforms:label>
</xforms:submit>
The problem is that the post is done well, the PFC catches the action well, load the correct view, but the view is loaded with no data (the view doesn't find the data on his instance input).
I tried with a GET in the view to retrieve the POST data, and that's the same thing. No data is retrieved. So the download button doesn't work.
I hope I'm clear enough to find a solution. Thanks in advance.