使用 Java 应用程序运行 Orbeon-Form-Builder-Generate-Form

发布于 2024-12-28 06:21:23 字数 8769 浏览 1 评论 0 原文

我是否应该能够使用 Java 应用程序运行 Orbeon-Form-Builder-Generate-Form,

即将表单的源复制到 simple.JSP 中(使用 http://wiki.orbeon.com/forms/doc/developer-guide/xforms-with-java-applications)?

我发现$form-resources的评估失败。 为什么

simple.jsp XML

    <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
                xmlns:xforms="http://www.w3.org/2002/xforms"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xmlns:ev="http://www.w3.org/2001/xml-events"
                xmlns:xi="http://www.w3.org/2001/XInclude"
                xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
                xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
                xmlns:exforms="http://www.exforms.org/exf/1-0"
                xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
                xmlns:saxon="http://saxon.sf.net/"
                xmlns:sql="http://orbeon.org/oxf/xml/sql"
                xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <xhtml:head>
            <xhtml:title>Simple Form</xhtml:title>
            <xforms:model id="fr-form-model">

                <!-- Main instance -->
                <xforms:instance id="fr-form-instance">
                    <form>
                        <section-1>
                            <control-2/>

                        </section-1>
                        <section-2>
                            <control-3/>
                        </section-2>
                    </form>
                </xforms:instance>

                <!-- Bindings -->
                <xforms:bind id="fr-form-binds" nodeset="instance('fr-form-instance')">
                    <xforms:bind id="section-1-bind" nodeset="section-1">
                        <xforms:bind id="control-2-bind" nodeset="control-2" name="control-2" type="xforms:date"/>

                    </xforms:bind>
                    <xforms:bind id="section-2-bind" nodeset="section-2">
                        <xforms:bind id="control-3-bind" nodeset="control-3" name="control-3"/>
                    </xforms:bind>
                </xforms:bind>

                <!-- Metadata -->
                <xforms:instance id="fr-form-metadata" xxforms:readonly="true">
                    <metadata>
                        <application-name>test</application-name>
                        <form-name>testf</form-name>
                        <title xml:lang="en">Simple Form</title>
                        <description xml:lang="en"/>
                        <author/>
                        <logo mediatype="" filename="" size=""/>
                    </metadata>
                </xforms:instance>

                <!-- Attachments -->
                <xforms:instance id="fr-form-attachments">
                    <attachments>
                        <css mediatype="text/css" filename="" size=""/>
                        <pdf mediatype="application/pdf" filename="" size=""/>
                    </attachments>
                </xforms:instance>

                <!-- All form resources -->
                <!-- Don't make readonly by default in case a service modifies the resources -->
                <xforms:instance id="fr-form-resources" xxforms:readonly="false">
                    <resources>
                        <resource xml:lang="en">
                            <control-3>
                                <label>input 2</label>
                                <hint/>
                                <help/>
                                <alert/>
                            </control-3>
                            <control-2>
                                <label>dATE</label>
                                <hint/>
                                <help/>
                                <alert/>
                            </control-2>
                            <section-1>
                                <label>sec1</label>
                                <help/>
                            </section-1>
                            <section-2>
                                <label>sec2</label>
                                <help/>
                            </section-2>

                        </resource>
                    </resources>
                </xforms:instance>

                <!-- Utility instances for services -->
                <xforms:instance id="fr-service-request-instance" xxforms:exclude-result-prefixes="#all">
                    <request/>
                </xforms:instance>

                <xforms:instance id="fr-service-response-instance" xxforms:exclude-result-prefixes="#all">
                    <response/>
                </xforms:instance>

            </xforms:model>
        </xhtml:head>
        <xhtml:body>
            <fr:view>
                <xforms:label ref="instance('fr-form-metadata')/title"/>
                <fr:body>
                    <fr:section id="section-1-section" bind="section-1-bind">
                        <xforms:label ref="$form-resources/section-1/label"/>
                        <xforms:help ref="$form-resources/section-1/help"/>
                        <fr:grid columns="1">
                            <xhtml:tr>

                                <xhtml:td>
                                    <xforms:input xmlns:xbl="http://www.w3.org/ns/xbl"
                                                  xmlns:fb="http://orbeon.org/oxf/xml/form-builder"
                                                  xmlns:pipeline="java:org.orbeon.oxf.processor.pipeline.PipelineFunctionLibrary"
                                                  id="control-2-control"
                                                  bind="control-2-bind">
                                        <xforms:label ref="$form-resources/control-2/label"/>
                                        <xforms:hint ref="$form-resources/control-2/hint"/>
                                        <xforms:help ref="$form-resources/control-2/help"/>
                                        <xforms:alert ref="$fr-resources/detail/labels/alert"/>
                                    </xforms:input>
                                </xhtml:td>
                            </xhtml:tr>
                        </fr:grid>
                    </fr:section>
                    <fr:section id="section-2-section" bind="section-2-bind">
                        <xforms:label ref="$form-resources/section-2/label"/>
                        <xforms:help ref="$form-resources/section-2/help"/>
                        <fr:grid columns="1">
                            <xhtml:tr>
                                <xhtml:td>
                                    <xforms:input xmlns:xbl="http://www.w3.org/ns/xbl"
                                                  xmlns:fb="http://orbeon.org/oxf/xml/form-builder"
                                                  xmlns:pipeline="java:org.orbeon.oxf.processor.pipeline.PipelineFunctionLibrary"
                                                  id="control-3-control"
                                                  bind="control-3-bind">
                                        <xforms:label ref="$form-resources/control-3/label"/>
                                        <xforms:hint ref="$form-resources/control-3/hint"/>
                                        <xforms:help ref="$form-resources/control-3/help"/>
                                        <xforms:alert ref="$fr-resources/detail/labels/alert"/>
                                    </xforms:input>
                                </xhtml:td>
                            </xhtml:tr>
                        </fr:grid>
                    </fr:section>
                </fr:body>
            </fr:view>
        </xhtml:body>
    </xhtml:html>

Should I be able to run Orbeon-Form-Builder-Generated-Form with Java Application,

i.e. Copy the source of the Form into a simple.JSP (using separate deployment as mentioned in http://wiki.orbeon.com/forms/doc/developer-guide/xforms-with-java-applications) ?

I found that the evaluation of $form-resources fails. Why ?

simple.jsp XML

    <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
                xmlns:xforms="http://www.w3.org/2002/xforms"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xmlns:ev="http://www.w3.org/2001/xml-events"
                xmlns:xi="http://www.w3.org/2001/XInclude"
                xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
                xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
                xmlns:exforms="http://www.exforms.org/exf/1-0"
                xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
                xmlns:saxon="http://saxon.sf.net/"
                xmlns:sql="http://orbeon.org/oxf/xml/sql"
                xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <xhtml:head>
            <xhtml:title>Simple Form</xhtml:title>
            <xforms:model id="fr-form-model">

                <!-- Main instance -->
                <xforms:instance id="fr-form-instance">
                    <form>
                        <section-1>
                            <control-2/>

                        </section-1>
                        <section-2>
                            <control-3/>
                        </section-2>
                    </form>
                </xforms:instance>

                <!-- Bindings -->
                <xforms:bind id="fr-form-binds" nodeset="instance('fr-form-instance')">
                    <xforms:bind id="section-1-bind" nodeset="section-1">
                        <xforms:bind id="control-2-bind" nodeset="control-2" name="control-2" type="xforms:date"/>

                    </xforms:bind>
                    <xforms:bind id="section-2-bind" nodeset="section-2">
                        <xforms:bind id="control-3-bind" nodeset="control-3" name="control-3"/>
                    </xforms:bind>
                </xforms:bind>

                <!-- Metadata -->
                <xforms:instance id="fr-form-metadata" xxforms:readonly="true">
                    <metadata>
                        <application-name>test</application-name>
                        <form-name>testf</form-name>
                        <title xml:lang="en">Simple Form</title>
                        <description xml:lang="en"/>
                        <author/>
                        <logo mediatype="" filename="" size=""/>
                    </metadata>
                </xforms:instance>

                <!-- Attachments -->
                <xforms:instance id="fr-form-attachments">
                    <attachments>
                        <css mediatype="text/css" filename="" size=""/>
                        <pdf mediatype="application/pdf" filename="" size=""/>
                    </attachments>
                </xforms:instance>

                <!-- All form resources -->
                <!-- Don't make readonly by default in case a service modifies the resources -->
                <xforms:instance id="fr-form-resources" xxforms:readonly="false">
                    <resources>
                        <resource xml:lang="en">
                            <control-3>
                                <label>input 2</label>
                                <hint/>
                                <help/>
                                <alert/>
                            </control-3>
                            <control-2>
                                <label>dATE</label>
                                <hint/>
                                <help/>
                                <alert/>
                            </control-2>
                            <section-1>
                                <label>sec1</label>
                                <help/>
                            </section-1>
                            <section-2>
                                <label>sec2</label>
                                <help/>
                            </section-2>

                        </resource>
                    </resources>
                </xforms:instance>

                <!-- Utility instances for services -->
                <xforms:instance id="fr-service-request-instance" xxforms:exclude-result-prefixes="#all">
                    <request/>
                </xforms:instance>

                <xforms:instance id="fr-service-response-instance" xxforms:exclude-result-prefixes="#all">
                    <response/>
                </xforms:instance>

            </xforms:model>
        </xhtml:head>
        <xhtml:body>
            <fr:view>
                <xforms:label ref="instance('fr-form-metadata')/title"/>
                <fr:body>
                    <fr:section id="section-1-section" bind="section-1-bind">
                        <xforms:label ref="$form-resources/section-1/label"/>
                        <xforms:help ref="$form-resources/section-1/help"/>
                        <fr:grid columns="1">
                            <xhtml:tr>

                                <xhtml:td>
                                    <xforms:input xmlns:xbl="http://www.w3.org/ns/xbl"
                                                  xmlns:fb="http://orbeon.org/oxf/xml/form-builder"
                                                  xmlns:pipeline="java:org.orbeon.oxf.processor.pipeline.PipelineFunctionLibrary"
                                                  id="control-2-control"
                                                  bind="control-2-bind">
                                        <xforms:label ref="$form-resources/control-2/label"/>
                                        <xforms:hint ref="$form-resources/control-2/hint"/>
                                        <xforms:help ref="$form-resources/control-2/help"/>
                                        <xforms:alert ref="$fr-resources/detail/labels/alert"/>
                                    </xforms:input>
                                </xhtml:td>
                            </xhtml:tr>
                        </fr:grid>
                    </fr:section>
                    <fr:section id="section-2-section" bind="section-2-bind">
                        <xforms:label ref="$form-resources/section-2/label"/>
                        <xforms:help ref="$form-resources/section-2/help"/>
                        <fr:grid columns="1">
                            <xhtml:tr>
                                <xhtml:td>
                                    <xforms:input xmlns:xbl="http://www.w3.org/ns/xbl"
                                                  xmlns:fb="http://orbeon.org/oxf/xml/form-builder"
                                                  xmlns:pipeline="java:org.orbeon.oxf.processor.pipeline.PipelineFunctionLibrary"
                                                  id="control-3-control"
                                                  bind="control-3-bind">
                                        <xforms:label ref="$form-resources/control-3/label"/>
                                        <xforms:hint ref="$form-resources/control-3/hint"/>
                                        <xforms:help ref="$form-resources/control-3/help"/>
                                        <xforms:alert ref="$fr-resources/detail/labels/alert"/>
                                    </xforms:input>
                                </xhtml:td>
                            </xhtml:tr>
                        </fr:grid>
                    </fr:section>
                </fr:body>
            </fr:view>
        </xhtml:body>
    </xhtml:html>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

红颜悴 2025-01-04 06:21:23

支持单独部署 Form Runner 的代码是在 3.9 版本之后推送的。截至撰写本文时,3.9 是最新版本,因此有时您需要使用每夜构建

The code to support Form Runner in separate deployment was pushed after the 3.9 release. As of this writing, 3.9 is the latest release, so at points you'll need to use a nightly build for this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文