本文介绍了使用 Java 应用程序运行 Orbeon-Form-Builder-Generated-Form的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是否可以使用 Java 应用程序运行 Orbeon-Form-Builder-Generated-Form,

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

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

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

我发现对 $form-resources 的评估失败了.为什么?

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

简单的.jsp XML

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>

推荐答案

代码支持单独部署中的 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.

这篇关于使用 Java 应用程序运行 Orbeon-Form-Builder-Generated-Form的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 07:29