Using XForms

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

Using XForms

Adrian Baker
We're interested in utilising the XForms component of OPS directly (we have existing applications which preclude the use of the overall framework at this stage).
 
After some initial investigation, it seems the logical point of integration would be to invoke the xforms-epilogue pipeline via the pipeline API, with a XForms+XHTML document as input. Is this a feasible approach? Can pipelines be invoked directly, rather than working through the OXFServlet?
 
Adrian


--
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: Using XForms

Erik Bruchez
Administrator
Adrian,

I can see several ways to do this:

o Keep the OPS servlet, and forward an XForms page from your own
   servlet to the OPS servlet. Configure the OPS servlet to run a
   pipeline which retrieves the XForms page (likely as a DOM or
   similar) and runs the servlet epilogue.

o Use the OPS servlet filter instead. This allows you to stream the
   XForms page from your servlet to the OPS servlet filter. This is a
   sort of "proxy" mode for OPS, which works if the code producing the
   XForms page lives in the same servlet container.

o Modify OPS to work as a full XForms proxy, placed between a web
   browser and your app server, which simply serves XForms pages.

Yes, you can call pipelines directly, but here I would rather go with
a servlet filter.

We think there is a real need to make it so that OPS can be simply
configured as a proxy. See also this email in ops-user:

   http://mail-archive.objectweb.org/ops-users/2005-09/msg00259.html

-Erik

Adrian Baker wrote:
 > We're interested in utilising the XForms component of OPS directly (we
 > have existing applications which preclude the use of the overall
 > framework at this stage).
 >
 > After some initial investigation, it seems the logical point of
 > integration would be to invoke the xforms-epilogue pipeline via the
 > pipeline API, with a XForms+XHTML document as input. Is this a
 > feasible approach? Can pipelines be invoked directly, rather than
 > working through the OXFServlet?
 >
 > Adrian



--
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: Using XForms

Adrian Baker
In reply to this post by Adrian Baker
Re: [ops-users] Using XForms
Ok, this is encouraging, thanks.
 
Can you give any hints as to how the OXFServletFilter should be configured (I have it set up to run after a servlet which outputs a XForms+XHTML document)? I tried pointing it directly to the epilogue.xpl, but this errored out because the pipeline input "xforms-model" was not connected:
 
 <filter>
        <filter-name>ops-filter</filter-name>
        <filter-class>org.orbeon.oxf.servlet.OXFServletFilter</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/epilogue.xpl</param-value>
        </init-param>
 
Am I correct in thinking the filter should point to a pageflow which just extracts these basic inputs from the request body (the XForms+XHTML doc) somehow before handing off to the epilogue? Apologies for my very weak understanding of the framework!
 
Adrian


From: Erik Bruchez on behalf of Erik Bruchez
Sent: Thu 27/10/2005 12:48 p.m.
To: [hidden email]
Subject: Re: [ops-users] Using XForms

Adrian,

I can see several ways to do this:

o Keep the OPS servlet, and forward an XForms page from your own
   servlet to the OPS servlet. Configure the OPS servlet to run a
   pipeline which retrieves the XForms page (likely as a DOM or
   similar) and runs the servlet epilogue.

o Use the OPS servlet filter instead. This allows you to stream the
   XForms page from your servlet to the OPS servlet filter. This is a
   sort of "proxy" mode for OPS, which works if the code producing the
   XForms page lives in the same servlet container.

o Modify OPS to work as a full XForms proxy, placed between a web
   browser and your app server, which simply serves XForms pages.

Yes, you can call pipelines directly, but here I would rather go with
a servlet filter.

We think there is a real need to make it so that OPS can be simply
configured as a proxy. See also this email in ops-user:

   http://mail-archive.objectweb.org/ops-users/2005-09/msg00259.html

-Erik

Adrian Baker wrote:
 > We're interested in utilising the XForms component of OPS directly (we
 > have existing applications which preclude the use of the overall
 > framework at this stage).
 >
 > After some initial investigation, it seems the logical point of
 > integration would be to invoke the xforms-epilogue pipeline via the
 > pipeline API, with a XForms+XHTML document as input. Is this a
 > feasible approach? Can pipelines be invoked directly, rather than
 > working through the OXFServlet?
 >
 > Adrian



--
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: Using XForms

Erik Bruchez
Administrator
You are correct. Do do this, you need to configure the
OXFServletFilter to run a pipeline which will first use the Servlet
Filter generator (oxf:servlet-filter-generator) processor.

I realize that there is no documentation for this processor, but it
simply has a "data" output which produces the input of the filter as
XML.

You then feed the data produced by the Servlet Filter generator to one
of the existing epilogue pipelines.

-Erik

The filter therefore runs a pipeline,

Adrian Baker wrote:
 > Ok, this is encouraging, thanks.
 >
 > Can you give any hints as to how the OXFServletFilter should be
 > configured (I have it set up to run after a servlet which outputs a
 > XForms+XHTML document)? I tried pointing it directly to the
 > epilogue.xpl, but this errored out because the pipeline
 > input "xforms-model" was not connected:
 >
 >  <filter>
 >         <filter-name>ops-filter</filter-name>
 >
<filter-class>org.orbeon.oxf.servlet.OXFServletFilter</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/epilogue.xpl</param-value>
 >         </init-param>
 >
 > Am I correct in thinking the filter should point to a pageflow which
 > just extracts these basic inputs from the request body (the XForms+XHTML
 > doc) somehow before handing off to the epilogue? Apologies for my very
 > weak understanding of the framework!
 >
 > Adrian




--
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: Using XForms

Adrian Baker-2
Thanks for the pointers - I now have this up and running. For the record, since I couldn't find this written down anywhere, my web.xml looks like:

    <filter>
        <filter-name>ops-main-servlet</filter-name>
        <filter-class>org.orbeon.oxf.servlet.OXFServletFilter</filter-class>
       
        <!-- Set main processor -->
        <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:/filter.xpl</param-value>
        </init-param>
        <!-- Set error processor -->
        <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:/ops/xforms/xforms-server-error.xpl</param-value>
        </init-param>
    </filter>

(This is in addition to the ops-xforms-server-servlet which handles form interactions). The contents of filter.xpl is pretty minimal:

<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
    xmlns:oxf="http://www.orbeon.com/oxf/processors"
    xmlns:xforms="http://www.w3.org/2002/xforms"
    xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
    xmlns="http://www.orbeon.com/oxf/controller">
   
    <!-- Extract request body -->
    <p:processor name="oxf:servlet-filter-generator">
        <p:output name="data" id="request-body"/>
    </p:processor>
   
    <p:processor name="oxf:pipeline">
        <p:input name="config" href="config/epilogue.xpl"/>
        <p:input name="data" href="#request-body"/>
        <p:input name="xforms-model" href="#request-body"/>
    </p:processor>
   
</p:config>

Although I don't believe it's used (?), I had to specify the xforms-model input otherwise the epilogue pipeline would error out.

Adrian

Erik Bruchez wrote:
You are correct. Do do this, you need to configure the
OXFServletFilter to run a pipeline which will first use the Servlet
Filter generator (oxf:servlet-filter-generator) processor.

I realize that there is no documentation for this processor, but it
simply has a "data" output which produces the input of the filter as
XML.

You then feed the data produced by the Servlet Filter generator to one
of the existing epilogue pipelines.

-Erik

The filter therefore runs a pipeline,

Adrian Baker wrote:
> Ok, this is encouraging, thanks.
>
> Can you give any hints as to how the OXFServletFilter should be
> configured (I have it set up to run after a servlet which outputs a
> XForms+XHTML document)? I tried pointing it directly to the
> epilogue.xpl, but this errored out because the pipeline
> input "xforms-model" was not connected:
>
>  <filter>
>         <filter-name>ops-filter</filter-name>
> <filter-class>org.orbeon.oxf.servlet.OXFServletFilter</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/epilogue.xpl</param-value>
>         </init-param>
>
> Am I correct in thinking the filter should point to a pageflow which
> just extracts these basic inputs from the request body (the XForms+XHTML
> doc) somehow before handing off to the epilogue? Apologies for my very
> weak understanding of the framework!
>
> Adrian



-- 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: Using XForms

Erik Bruchez
Administrator
Adrian,

Beautiful work, and very helpful!

To answer your last question, you should be able to replace this:

   <p:input name="xforms-model" href="#request-body"/>

with:

   <p:input name="xforms-model"><dummy/></p:input>

The "xforms-model" input is used only for the legacy XForms engine. You
could even tweak xforms-epilogue.xpl by removing the test on
"xforms-model" input and keeping only the XForms NG branch. In that
case, the "xforms-model" input won't even be necessary.

Feel free to report on your progress in the mailing-list!

-Erik

Adrian Baker wrote:

> Thanks for the pointers - I now have this up and running. For the
> record, since I couldn't find this written down anywhere, my web.xml
> looks like:
>
>     <filter>
>         <filter-name>ops-main-servlet</filter-name>
>         <filter-class>org.orbeon.oxf.servlet.OXFServletFilter</filter-class>
>        
>         <!-- Set main processor -->
>         <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:/filter.xpl</param-value>
>         </init-param>
>         <!-- Set error processor -->
>         <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:/ops/xforms/xforms-server-error.xpl</param-value>
>         </init-param>
>     </filter>
>
> (This is in addition to the ops-xforms-server-servlet which handles form
> interactions). The contents of filter.xpl is pretty minimal:
>
> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
>     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>     xmlns:fo="http://www.w3.org/1999/XSL/Format"
>     xmlns:xhtml="http://www.w3.org/1999/xhtml"
>     xmlns:oxf="http://www.orbeon.com/oxf/processors"
>     xmlns:xforms="http://www.w3.org/2002/xforms"
>     xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
>     xmlns="http://www.orbeon.com/oxf/controller">
>    
>     <!-- Extract request body -->
>     <p:processor name="oxf:servlet-filter-generator">
>         <p:output name="data" id="request-body"/>
>     </p:processor>
>    
>     <p:processor name="oxf:pipeline">
>         <p:input name="config" href="config/epilogue.xpl"/>
>         <p:input name="data" href="#request-body"/>
>         <p:input name="xforms-model" href="#request-body"/>
>     </p:processor>
>    
> </p:config>
>
> Although I don't believe it's used (?), I had to specify the
> xforms-model input otherwise the epilogue pipeline would error out.
>
> Adrian
>
> Erik Bruchez wrote:
>
>> You are correct. Do do this, you need to configure the
>> OXFServletFilter to run a pipeline which will first use the Servlet
>> Filter generator (oxf:servlet-filter-generator) processor.
>>
>> I realize that there is no documentation for this processor, but it
>> simply has a "data" output which produces the input of the filter as
>> XML.
>>
>> You then feed the data produced by the Servlet Filter generator to one
>> of the existing epilogue pipelines.
>>
>> -Erik
>>
>> The filter therefore runs a pipeline,
>>
>> Adrian Baker wrote:
>> > Ok, this is encouraging, thanks.
>> >
>> > Can you give any hints as to how the OXFServletFilter should be
>> > configured (I have it set up to run after a servlet which outputs a
>> > XForms+XHTML document)? I tried pointing it directly to the
>> > epilogue.xpl, but this errored out because the pipeline
>> > input "xforms-model" was not connected:
>> >
>> >  <filter>
>> >         <filter-name>ops-filter</filter-name>
>> > <filter-class>org.orbeon.oxf.servlet.OXFServletFilter</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/epilogue.xpl</param-value>
>> >         </init-param>
>> >
>> > Am I correct in thinking the filter should point to a pageflow which
>> > just extracts these basic inputs from the request body (the
>> XForms+XHTML
>> > doc) somehow before handing off to the epilogue? Apologies for my very
>> > weak understanding of the framework!
>> >
>> > Adrian
>>
>>
>>------------------------------------------------------------------------
>>
>>
>>--
>>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
>>  
>>
>
>
> ------------------------------------------------------------------------
>
>
> --
> 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



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