Orbeon 4.5 - How to pass request parameters?

有些话、适合烂在心里 提交于 2020-01-04 10:36:50

问题


We are upgrading from Orbeon 3.9 to 4.5.

In Orbeon 3.9, we were passing request parameters to the send success URI (oxf.fr.detail.send.success.uri) when the user clicks on a custom submit button. We have done this by modifying persistence-model.xml.

Following is the code part which we used in 3.9:

<xforms:model id="fr-persistence-model"

    <xforms:instance id="x3params">
        <data xmlns="">
            <customerid/>
        </data>
    </xforms:instance>

    <xforms:action ev:event="xforms-model-construct-done" if="$app != '*' and $form != '*'">
        <xforms:setvalue ref="instance('g3params')/customerid" value="xxforms:get-request-parameter('customerid')" />

    <xxforms:variable name="g3customerId" as="xs:string" select="instance('g3params')/customerid"/>

    <xforms:submission id="fr-workflow-send-submission"
        resource="{$workflow-success-uri}?fr-app={$app}&amp;form={$form}&amp;docid={$document}&amp;customerid={$g3customerId}"
        relevant="{xxforms:property(string-join(('oxf.fr.detail.send.success.prune', $app, $form), '.'))}"
        validate="false" method="{$workflow-success-method}"
        serialization="{if ($workflow-success-method = 'get') then 'none' else 'application/xml'}"
        ref="if (instance('fr-workflow-send-instance') != '') then instance('fr-workflow-send-instance') else xxforms:instance('fr-form-instance')"
        replace="all"/>

In Orbeon 4.5, I used the save-final process for a custom submit.

Since fr-workflow-send-submission is removed in 4.5, how can I pass the request parameters to the send success URI?

Following is my properties-local.xml:

<property as="xs:boolean" name="oxf.fr.detail.send.pdf" value="false"/>
<property as="xs:boolean" name="oxf.fr.email.attach-pdf" value="false"/>
<property as="xs:anyURI" name="oxf.fr.detail.send.success.uri.Preconstruction.*" value="http://localhost:8080/webapp/new"/>
<property as="xs:string" name="oxf.fr.detail.send.success.method.*.*" value="post"/>
<property as="xs:boolean" name="oxf.fr.detail.send.success.prune.*.*" value="false"/>

回答1:


You can use XPath value templates in the service URL:

<property
  as="xs:string"
  name="oxf.fr.detail.send.success.uri.Preconstruction.*"
  value="http://localhost:8080/webapp/new?customerid={xxf:get-request-parameter('customerid')}"/>

Orbeon Forms passes app, form and document by default now. The only thing is that I notice that in your code you use fr-app, form, and docid. It is probably better to switch to using the standard names used by Orbeon Forms now (so app, form and document).



来源:https://stackoverflow.com/questions/24175635/orbeon-4-5-how-to-pass-request-parameters

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!