Orbeon Formsソリューションを使用して、入力されたWebフォームからメッセージを生成しています。
パイプラインからのXForms送信に関するOrbeonのwikiでさまざまなコードスニペットを読み、さまざまな解決策を試しましたが、機能しません。パイプラインからのPOSTを使用して、PFCによってキャッチされ、XFormsビューに送信された例はありません。投稿されたデータを受け取ります(すべての例は同じページで行われます)。
彼のインスタンス入力で受信される次のパイプラインがあります。
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>
次に、アクションをキャッチするPFCがあります。
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>
次に、非常に単純な成功ビューがあります。
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>
「ViewModify」ページの「保存」ボタンをクリックして起動したこのプロセスはすべて、次のとおりです。
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>
問題は、投稿が適切に行われ、PFCがアクションを適切にキャッチし、正しいビューをロードしますが、ビューはデータなしでロードされます(ビューはインスタンス入力のデータを検出しません)。
ビューでGETを使用してPOSTデータを取得しようとしましたが、それは同じことです。データは取得されません。そのため、ダウンロードボタンは機能しません。
私は解決策を見つけるのに十分明確であることを願っています。前もって感謝します。