Integrating Orbeon XForms in Tapestry webapp

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

Integrating Orbeon XForms in Tapestry webapp

jean.godeyne
I want to integrate OF in a tapestry webapplication.
I followed the guide called: XForms - Using the Orbeon Forms XForms Engine with Java Applications.
My app server starts and in the log I can see that the orbeon listener is loaded.
When I try to access a page with xform it doesn't serve it correctly.


This is the content of my web.xml:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
    <display-name>ABO-BPM-Admin Tapestry 5 Application</display-name>
    <context-param>
       
        <param-name>tapestry.app-package</param-name>
        <param-value>net.atos.xa.mac.admin</param-value>
    </context-param>

        <listener>
          <listener-class>
           net.atos.xa.mac.admin.util.ProcessEnginesServletContextListener
          </listener-class>
        </listener>
    <filter>
        <filter-name>app</filter-name>
        <filter-class>org.apache.tapestry5.TapestryFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>app</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
       
       
        <filter>
            <filter-name>orbeon-xforms-filter</filter-name>
            <filter-class>org.orbeon.oxf.servlet.OrbeonXFormsFilter</filter-class>
            <init-param>
                <param-name>oxf.xforms.renderer.context</param-name>
                <param-value>/orbeon</param-value>
            </init-param>
        </filter>
       
        <filter-mapping>
            <filter-name>orbeon-xforms-filter</filter-name>
            <url-pattern>/*</url-pattern>
            <dispatcher>REQUEST</dispatcher>
            <dispatcher>FORWARD</dispatcher>
        </filter-mapping>
       
        <filter-mapping>
            <filter-name>orbeon-xforms-filter</filter-name>
            <url-pattern>/orbeon/*</url-pattern>
            <dispatcher>REQUEST</dispatcher>
            <dispatcher>FORWARD</dispatcher>
        </filter-mapping>
</web-app>

And this is the content of my tapestry template file:
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
      xmlns:ev="http://www.w3.org/2001/xml-events" 
      xmlns:xf="http://www.w3.org/2002/xforms">
  <head>
   
    <style type="text/css"> h1 {font-size: 12pt } xf|input.itemClass { width:100px } xf|input.custNumClass { width:100px } xf|input.dateClass { width:80px } </style>    <title>Enter Order</title>

    <xf:model id="model1">

      <xf:instance>
        <order xmlns="" itemNum="">
          <quantity/>
          <custNum/>
          <orderDate/>
        </order>
      </xf:instance>

      <xf:submission id="s01" method="put"
                     action="file:///temp/ex1order.xml" /> 

      <xf:submission id="s02" method="post"
                     action="http://xformstest.org/cgi-bin/showinstance.sh" /> 
    </xf:model>
  </head>

  <body>

   

Enter Order

    <p>Enter data for order below.</p>

    <xf:input model="model1" class="itemClass" ref="@itemNum">
      <xf:label>Item Number</xf:label>
    </xf:input>

    <xf:input model="model1" ref="quantity">
      <xf:label>Quantity</xf:label>
    </xf:input>

    <xf:input model="model1" ref="custNum" class="custNumClass">
      <xf:label>Customer Number</xf:label>
    </xf:input>

    <xf:input model="model1" ref="orderDate" class="dateClass">
      <xf:label>Order Date</xf:label>
    </xf:input>

    <br />

    <xf:submit submission="s01">
      <xf:label>Save</xf:label>
    </xf:submit>

    <p>Click "Save" to store entered order.</p>

  </body>
</html>

Note that I annotated my corresponding java class as ContentType("text/xml")

Somebody any ideas?

Thanks for the support
Reply | Threaded
Open this post in threaded view
|

Re: Integrating Orbeon XForms in Tapestry webapp

jean.godeyne
I resolved the issue as follows:

Invert the order of the filter declaration in the web.xml to ensure that tapestry is the last one.

This resulted into a nullpointerException in the isCompressable method of tapestry.
This was resolved by disabling the compression like this:

public class AppModule
{
  public static void contributeApplicationDefaults(MappedConfiguration<String,String> configuration)
  {
    configuration.add(SymbolConstants.GZIP_COMPRESSION_ENABLED, "false");
  }
}
Reply | Threaded
Open this post in threaded view
|

Re: Re: Integrating Orbeon XForms in Tapestry webapp

Erik Bruchez
Administrator
Jean,

Thanks for sharing.

-Erik

On Wed, Jan 25, 2012 at 7:15 AM, jean.godeyne <[hidden email]> wrote:

> I resolved the issue as follows:
>
> Invert the order of the filter declaration in the web.xml to ensure that
> tapestry is the last one.
>
> This resulted into a nullpointerException in the isCompressable method of
> tapestry.
> This was resolved by disabling the compression like this:
>
> public class AppModule
> {
>  public static void
> contributeApplicationDefaults(MappedConfiguration<String,String>
> configuration)
>  {
>    configuration.add(SymbolConstants.GZIP_COMPRESSION_ENABLED, "false");
>  }
> }
>
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Integrating-Orbeon-XForms-in-Tapestry-webapp-tp4324163p4327496.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> 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
> OW2 mailing lists service home page: http://www.ow2.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
OW2 mailing lists service home page: http://www.ow2.org/wws