本文介绍了Orbeon 4.5 - 如何传递请求参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在从 Orbeon 3.9 升级到 4.5.

We are upgrading from Orbeon 3.9 to 4.5.

在 Orbeon 3.9 中,当用户单击自定义提交按钮时,我们将请求参数传递到发送成功 URI (oxf.fr.detail.send.success.uri).我们通过修改 persistence-model.xml 来做到这一点.

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.

以下是我们在 3.9 中使用的代码部分:

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"/>

在 Orbeon 4.5 中,我使用 save-final 流程进行自定义提交.

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

既然fr-workflow-send-submission在4.5中被移除了,那么如何将请求参数传递给发送成功的URI?

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

以下是我的properties-local.xml:

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"/>

推荐答案

您可以在服务 URL 中使用 XPath 值模板:

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 现在默认通过 appformdocument.唯一的一点是我注意到在你的代码中你使用了 fr-appformdocid.现在最好改用 Orbeon Forms 使用的标准名称(例如 appformdocument).

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).

这篇关于Orbeon 4.5 - 如何传递请求参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 23:44