Contributed patch for XForms filter and URL rewriting

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

Contributed patch for XForms filter and URL rewriting

Erik Bruchez
Administrator
All,

We still haven't managed to get to this annoying rewriting bug in  
separate deployment:

http://forge.ow2.org/tracker/index.php?func=detail&aid=310890&group_id=168&atid=350207

However Marwoto has contributed a patch which works around this by  
performing some custom URL rewriting in the filter. If this is of  
interest to anyone, this patched version of the filter is attached to  
this message.

-Erik

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.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

OrbeonXFormsFilter.java (17K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Contributed patch for XForms filter and URL rewriting

Markku Laine

> We still haven't managed to get to this annoying rewriting bug in  
> separate deployment:
>
> http://forge.ow2.org/tracker/index.php?func=detail&aid=310890&group_id=168&atid=350207
>
> However Marwoto has contributed a patch which works around this by  
> performing some custom URL rewriting in the filter. If this is of  
> interest to anyone, this patched version of the filter is attached  
> to this message.

If the patch works, could it be then applied, temporarily, to the  
source code of Orbeon Forms. Then it would be really easy for everyone  
to take that feature in use just by downloading nightly build versions  
of Orbeon Forms (orbeon.war).

Regards


-Markku


--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Contributed patch for XForms filter and URL rewriting

Markku Laine
>> We still haven't managed to get to this annoying rewriting bug in  

>> separate deployment:
>>
>> http://forge.ow2.org/tracker/index.php?func=detail&aid=310890&group_id=168&atid=350207
>>
>> However Marwoto has contributed a patch which works around this by  
>> performing some custom URL rewriting in the filter. If this is of  
>> interest to anyone, this patched version of the filter is attached  
>> to this message.
>
> If the patch works, could it be then applied, temporarily, to the  
> source code of Orbeon Forms. Then it would be really easy for  
> everyone to take that feature in use just by downloading nightly  
> build versions of Orbeon Forms (orbeon.war).
Decided to try out the patch as well. Unfortunately, it didn't fix the  
rewriting bug in separate deployment--at least I wasn't able to run my  
test web page successfully :( All I did was retrieved the source code,  
replaced the Java file and built and web application.

Anyway, got the following error message on the first time trying to  
access my web page:
"Fatal error: The prefix "f" for attribute "f:url-norewrite"  
associated with an element type "link" is not bound."

After adding the needed XML Namespace declaration (xmlns:f="http://orbeon.org/oxf/xml/formatting 
") to my web page I run into the same old error message as before:
"Got invalid return code while loading URI: http://localhost:8080/ 
<mycontext>/orbeon/xml/my-external-instance.xml, 404"

This occurs when I am trying to use an external XML instance on my web  
page:
<xforms:instance id="my-external-instance" src="xml/my-external-
instance.xml" />


While trying out to fix/test the rewriting bug I ALMOST found a  
working solution. The only thing that doesn't work with my work around  
is session handling with cookies (works with URL rewriting). The  
session is lost/wrong after invalidating the session in my own Web  
application code. If I remember correctly, this was the issue back in  
the days before getting it fixed on Dec 18, 2007 or so (the version,  
3.6.0.200712181809, of Orbeon Forms I am using at the moment works).

Anyway, here is what I did (basically followed the XForms for Java  
Apps instructions):
1) Put the latest nightly build version of Orbeon Forms (orbeon.war)  
to Tomcat.
2) Used the OLD (instead of the current one) XForms Filter  
configurations in my Web applications' web.xml:
-------- 8< ---------
  <filter>
                <filter-name>ops-xforms-filter</filter-name>
                <filter-class>org.orbeon.oxf.servlet.OPSXFormsFilter</filter-class>
                <init-param>
                        <param-name>oxf.xforms.renderer.context</param-name>
                        <param-value>/orbeon</param-value>
                </init-param>
        </filter>
        <filter-mapping>
                <filter-name>ops-xforms-filter</filter-name>
                <url-pattern>*.xforms</url-pattern>
        </filter-mapping>
  <filter-mapping>
                <filter-name>ops-xforms-filter</filter-name>
                <url-pattern>/orbeon/*</url-pattern>
        </filter-mapping>
-------- 8< ---------
3) Added the context.xml file under the META-INF folder
4) Put the OLD (instead of the current one) orbeon-xforms-filter.jar  
file under the WEB-INF/lib folder of my web application.

The fix was to use the OLD web.xml configurations and orbeon-xforms-
filter.jar file. I know this ain't a bullet proof solution but  
nevertheless I was now able to use all the latest features Orbeon  
Forms has to offer in separate deployment!!!

I tested my Web applications a bit with this newer Orbeon Forms and  
found a couple of problems:
1) Session lost/wrong (related to cookies) after invalidating session  
in my Web application's code. Works in the older version of OF I am  
using.
2) The digest function used to return alphabets in upper case, now it  
returns them in lower case.


I guess this work around works 100% if the session handling with  
cookies bug will get fixed. I attached the orbeon-xforms-filter.jar  
file to this email if somebody wants to use it as well. Or,  
preferably, take a closer look at the source code and try to see what  
is the difference between the code in this JAR (needs to be  
decompiled) and the current code in CVS, which does not work properly.

Hope this helps somebody and hoping to see a fix to the rewriting bug  
soon.

Kind regards


-Markku





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

orbeon-xforms-filter.jar (19K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Contributed patch for XForms filter and URL rewriting

Erik Bruchez
Administrator
Markku,

Thanks for trying, and sorry to hear that this did not work for you.
This bug will need proper fixing anyway.

-Erik

On Thu, Jul 9, 2009 at 6:08 AM, Markku Laine<[hidden email]> wrote:

>>> We still haven't managed to get to this annoying rewriting bug in
>>> separate deployment:
>>>
>>>
>>> http://forge.ow2.org/tracker/index.php?func=detail&aid=310890&group_id=168&atid=350207
>>>
>>> However Marwoto has contributed a patch which works around this by
>>> performing some custom URL rewriting in the filter. If this is of interest
>>> to anyone, this patched version of the filter is attached to this message.
>>
>> If the patch works, could it be then applied, temporarily, to the source
>> code of Orbeon Forms. Then it would be really easy for everyone to take that
>> feature in use just by downloading nightly build versions of Orbeon Forms
>> (orbeon.war).
>
> Decided to try out the patch as well. Unfortunately, it didn't fix the
> rewriting bug in separate deployment--at least I wasn't able to run my test
> web page successfully :( All I did was retrieved the source code, replaced
> the Java file and built and web application.
>
> Anyway, got the following error message on the first time trying to access
> my web page:
> "Fatal error: The prefix "f" for attribute "f:url-norewrite" associated with
> an element type "link" is not bound."
>
> After adding the needed XML Namespace declaration
> (xmlns:f="http://orbeon.org/oxf/xml/formatting") to my web page I run into
> the same old error message as before:
> "Got invalid return code while loading URI:
> http://localhost:8080/<mycontext>/orbeon/xml/my-external-instance.xml, 404"
>
> This occurs when I am trying to use an external XML instance on my web page:
> <xforms:instance id="my-external-instance"
> src="xml/my-external-instance.xml" />
>
>
> While trying out to fix/test the rewriting bug I ALMOST found a working
> solution. The only thing that doesn't work with my work around is session
> handling with cookies (works with URL rewriting). The session is lost/wrong
> after invalidating the session in my own Web application code. If I remember
> correctly, this was the issue back in the days before getting it fixed on
> Dec 18, 2007 or so (the version, 3.6.0.200712181809, of Orbeon Forms I am
> using at the moment works).
>
> Anyway, here is what I did (basically followed the XForms for Java Apps
> instructions):
> 1) Put the latest nightly build version of Orbeon Forms (orbeon.war) to
> Tomcat.
> 2) Used the OLD (instead of the current one) XForms Filter configurations in
> my Web applications' web.xml:
> -------- 8< ---------
>        <filter>
>                <filter-name>ops-xforms-filter</filter-name>
>
>  <filter-class>org.orbeon.oxf.servlet.OPSXFormsFilter</filter-class>
>                <init-param>
>                        <param-name>oxf.xforms.renderer.context</param-name>
>                        <param-value>/orbeon</param-value>
>                </init-param>
>        </filter>
>        <filter-mapping>
>                <filter-name>ops-xforms-filter</filter-name>
>                <url-pattern>*.xforms</url-pattern>
>        </filter-mapping>
>        <filter-mapping>
>                <filter-name>ops-xforms-filter</filter-name>
>                <url-pattern>/orbeon/*</url-pattern>
>        </filter-mapping>
> -------- 8< ---------
> 3) Added the context.xml file under the META-INF folder
> 4) Put the OLD (instead of the current one) orbeon-xforms-filter.jar file
> under the WEB-INF/lib folder of my web application.
>
> The fix was to use the OLD web.xml configurations and
> orbeon-xforms-filter.jar file. I know this ain't a bullet proof solution but
> nevertheless I was now able to use all the latest features Orbeon Forms has
> to offer in separate deployment!!!
>
> I tested my Web applications a bit with this newer Orbeon Forms and found a
> couple of problems:
> 1) Session lost/wrong (related to cookies) after invalidating session in my
> Web application's code. Works in the older version of OF I am using.
> 2) The digest function used to return alphabets in upper case, now it
> returns them in lower case.
>
>
> I guess this work around works 100% if the session handling with cookies bug
> will get fixed. I attached the orbeon-xforms-filter.jar file to this email
> if somebody wants to use it as well. Or, preferably, take a closer look at
> the source code and try to see what is the difference between the code in
> this JAR (needs to be decompiled) and the current code in CVS, which does
> not work properly.
>
> Hope this helps somebody and hoping to see a fix to the rewriting bug soon.
>
> Kind regards
>
>
> -Markku
>
>
>
>
>
> --
> 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