Embedding the XForms Engine seperately?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Embedding the XForms Engine seperately?

Arnout Engelen
Hi,

Is it possible to embed the OPS XForms engine without going "all the
way" basing the entire application on the PresentationServer?

A picture says more than a thousand words: it the following possible?

  http://bzzt.net/~arnouten/xforms.png


Kind regards,

Arnout



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Embedding the XForms Engine seperately?

Adrian Baker-2
Hi Arount,

Yes it is - we do something similar. In our case we generate an XHTML+XForms document, then set this as an attribute on the request which is then forwarded to Orbeon. A simple xpl file then reads the document from the request and proceeds directly to rendering the HTML+Javascript page:

<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
    xmlns:oxf="http://www.orbeon.com/oxf/processors">
    <!-- Extract request body -->
    <p:processor name="oxf:scope-generator">
        <p:input name="config">
            <config>
                <key>form</key>
                <scope>request</scope>
            </config>
        </p:input>
        <p:output name="data" id="form"/>
    </p:processor>
    <p:processor name="oxf:pipeline">
        <p:input name="config" href="config/epilogue.xpl"/>
        <p:input name="data" href="#form"/>
    </p:processor>
</p:config>

An alternative to forwarding the http request using the servlet api is to directly invoke Orbeon using it's processor API - I managed to make this work but found it involved a little more code and decided using a forward was simpler.

Looking at your diagram the only reservation I'd have is around your 'possibly embeds into template' comment. The HTML+Javascript page generated by Orbeon isn't totally self contained - it relies on Orbeon servlets being available to handle & process interactions with the form. So you'd have to ensure these are available when the page is actually used.

Adrian

Arnout Engelen wrote:
Hi,

Is it possible to embed the OPS XForms engine without going "all the way" basing the entire application on the PresentationServer?

A picture says more than a thousand words: it the following possible?

 http://bzzt.net/~arnouten/xforms.png


Kind regards,

Arnout


-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] ObjectWeb mailing lists service home page: http://www.objectweb.org/wws



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Embedding the XForms Engine seperately?

Larry T. Chen
Hi Adrian and Arount,

Another method we've employed successfully is to use your own main servlet and use the OPS XForms Engine via the Tomcat filter mechanism if you want to replace the XPL engine with something else.

Thus every request will go through your own servlet, but you can configure the OPSServletFilter in web.xml to filter only *.xhtml files, as follows:

<filter>
        <filter-name>ops-main-filter</filter-name>
        <filter-class>org.orbeon.oxf.servlet.OPSServletFilter</filter-class>
        <init-param>
            <param-name>oxf.main-processor.name</param-name>
            <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value>
        </init-param>
        <init-param>
            <param-name>oxf.main-processor.input.config</param-name>
            <param-value>oxf:/config/filter.xpl</param-value>
        </init-param>
        <init-param>
            <param-name>oxf.error-processor.name</param-name>
            <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value>
        </init-param>
        <init-param>
            <param-name>oxf.error-processor.input.config</param-name>
            <param-value>oxf:/config/error.xpl</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>ops-main-filter</filter-name>
        <url-pattern>*.xhtml</url-pattern>
    </filter-mapping>

Larry T. Chen
Software Engineer
Intelenet Communications

Adrian Baker wrote:
Hi Arount,

Yes it is - we do something similar. In our case we generate an XHTML+XForms document, then set this as an attribute on the request which is then forwarded to Orbeon. A simple xpl file then reads the document from the request and proceeds directly to rendering the HTML+Javascript page:

<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
    xmlns:oxf="http://www.orbeon.com/oxf/processors">
    <!-- Extract request body -->
    <p:processor name="oxf:scope-generator">
        <p:input name="config">
            <config>
                <key>form</key>
                <scope>request</scope>
            </config>
        </p:input>
        <p:output name="data" id="form"/>
    </p:processor>
    <p:processor name="oxf:pipeline">
        <p:input name="config" href="config/epilogue.xpl"/>
        <p:input name="data" href="#form"/>
    </p:processor>
</p:config>

An alternative to forwarding the http request using the servlet api is to directly invoke Orbeon using it's processor API - I managed to make this work but found it involved a little more code and decided using a forward was simpler.

Looking at your diagram the only reservation I'd have is around your 'possibly embeds into template' comment. The HTML+Javascript page generated by Orbeon isn't totally self contained - it relies on Orbeon servlets being available to handle & process interactions with the form. So you'd have to ensure these are available when the page is actually used.

Adrian

Arnout Engelen wrote:
Hi,

Is it possible to embed the OPS XForms engine without going "all the way" basing the entire application on the PresentationServer?

A picture says more than a thousand words: it the following possible?

 http://bzzt.net/~arnouten/xforms.png


Kind regards,

Arnout


-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] ObjectWeb mailing lists service home page: http://www.objectweb.org/wws


-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] ObjectWeb mailing lists service home page: http://www.objectweb.org/wws



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws