xforms:submission resource url re-writing

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

xforms:submission resource url re-writing

Arlo White
We have a separate webapp (/remote) with REST services that Orbeon accesses. I want my xforms:submission resource urls to point to this webapp without having to hard-code an absolute url. This is because these xforms will be transferred between different servers and I don't want to edit the XForm every time I do so.

One possibility is to pass in the remote service url prefix through a parameter or property. I couldn't get xxforms:get-request-parameter() to work for me. I'm not sure what other methods I might use. Maybe I can create my own property in properties-local.xml and inject it into the url?

I've been reading through:
http://wiki.orbeon.com/forms/doc/developer-guide/admin/url-rewriting

This seems to indicate that I can use .. in a url and Orbeon will translate it. However, ../remote/my/service didn't work. This would have been the easiest...

Portions of the documentation sound promising:
If the URL is an absolute path, the URL is rewritten
 * usually, this means that the servlet context path is prepended
 * in some cases, like separate deployment, a different context is prepended depending on the type of resources
But I'm not sure how to configure Orbeon to prepend a different context in some cases. (for xforms:submission resource attributes)

I tried setting     <property as="xs:anyURI"  name="oxf.url-rewriting.service.base-uri" value="/remote"/>
But this broke the Form Runner and Builder.

I'd appreciate any recommendations on the best way to do this.

--
Arlo White
Application Management / ITS
CalPoly, San Luis Obispo
[hidden email]


--
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: xforms:submission resource url re-writing

Erik Bruchez
Administrator
Arlo,

So which case doesn't work?

I am trying this, with /myapp being the context of a separate all, and
/orbeon the context of the Orbeon Forms WAR:

  http://localhost:8080/myapp/xforms-jsp/page1.jsp

contains the following submission:

  <xf:submission id="page1" action="/xforms-jsp/page2.jsp" method="get"/>

I correctly end up at:

  http://localhost:8080/myapp/xforms-jsp/page2.jsp

-Erik

On Thu, Dec 9, 2010 at 5:35 PM, Arlo White <[hidden email]> wrote:

> We have a separate webapp (/remote) with REST services that Orbeon accesses.
> I want my xforms:submission resource urls to point to this webapp without
> having to hard-code an absolute url. This is because these xforms will be
> transferred between different servers and I don't want to edit the XForm
> every time I do so.
>
> One possibility is to pass in the remote service url prefix through a
> parameter or property. I couldn't get xxforms:get-request-parameter() to
> work for me. I'm not sure what other methods I might use. Maybe I can create
> my own property in properties-local.xml and inject it into the url?
>
> I've been reading through:
> http://wiki.orbeon.com/forms/doc/developer-guide/admin/url-rewriting
>
> This seems to indicate that I can use .. in a url and Orbeon will translate
> it. However, ../remote/my/service didn't work. This would have been the
> easiest...
>
> Portions of the documentation sound promising:
>
> If the URL is an absolute path, the URL is rewritten
>  * usually, this means that the servlet context path is prepended
>  * in some cases, like separate deployment, a different context is prepended
> depending on the type of resources
>
> But I'm not sure how to configure Orbeon to prepend a different context in
> some cases. (for xforms:submission resource attributes)
>
> I tried setting     <property as="xs:anyURI"
> name="oxf.url-rewriting.service.base-uri" value="/remote"/>
> But this broke the Form Runner and Builder.
>
> I'd appreciate any recommendations on the best way to do this.
>
> --
> Arlo White
> Application Management / ITS
> CalPoly, San Luis Obispo
> [hidden email]
>
>
> --
> 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
Reply | Threaded
Open this post in threaded view
|

Re: xforms:submission resource url re-writing

bsteuhl
In reply to this post by Arlo White
In the REST URL within your form you can use an AVT to dynamically create the url from values stored in an instance and depending on the event within the form choosen, use xforms:setvalue to set an element used for the AVT.

There are other options but would need to understand more about the design.
 

Brian Steuhl
website: http://BTMSoftwareSolutions.com
business email: [hidden email]
cell: 908-421-0742

home office: 732-961-3187
RSS Feed To My Blog:

Business Process Modeling - BTMSoftwareSolutions.com




From: Arlo White <[hidden email]>
To: [hidden email]
Sent: Thu, December 9, 2010 8:35:32 PM
Subject: [ops-users] xforms:submission resource url re-writing

We have a separate webapp (/remote) with REST services that Orbeon accesses. I want my xforms:submission resource urls to point to this webapp without having to hard-code an absolute url. This is because these xforms will be transferred between different servers and I don't want to edit the XForm every time I do so.

One possibility is to pass in the remote service url prefix through a parameter or property. I couldn't get xxforms:get-request-parameter() to work for me. I'm not sure what other methods I might use. Maybe I can create my own property in properties-local.xml and inject it into the url?

I've been reading through:
http://wiki.orbeon.com/forms/doc/developer-guide/admin/url-rewriting

This seems to indicate that I can use .. in a url and Orbeon will translate it. However, ../remote/my/service didn't work. This would have been the easiest...

Portions of the documentation sound promising:
If the URL is an absolute path, the URL is rewritten
 * usually, this means that the servlet context path is prepended
 * in some cases, like separate deployment, a different context is prepended depending on the type of resources
But I'm not sure how to configure Orbeon to prepend a different context in some cases. (for xforms:submission resource attributes)

I tried setting     <property as="xs:anyURI"  name="oxf.url-rewriting.service.base-uri" value="/remote"/>
But this broke the Form Runner and Builder.

I'd appreciate any recommendations on the best way to do this.

--
Arlo White
Application Management / ITS
CalPoly, San Luis Obispo
[hidden email]



--
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: xforms:submission resource url re-writing

Arlo White
In reply to this post by Erik Bruchez
I'm not using the OrbeonXFormsFilter. All of our XForms are viewed in
the Form Runner. We've implemented REST services in the other webapp to
serve XForms to the Form Runner and provide REST data services.

So our webapp redirects the user to
/orbeon/fr/app/form/edit/1234
Orbeon requests the XForm through our REST persistence layer in our webapp.
xforms:submissions go to a REST service is our webapp as well. (But here
I need to specify an absolute url in the XForm, which I want to avoid as
I explained in the first post)

Should I still use the OrbeonXFormsFilter with the Form Runner?

Of course our webapp could pre-process the XForms and rewrite the
xforms:submission resource attribute, but I was hoping there was an
easier Orbeon way.


On 12/09/2010 08:19 PM, Erik Bruchez wrote:

> Arlo,
>
> So which case doesn't work?
>
> I am trying this, with /myapp being the context of a separate all, and
> /orbeon the context of the Orbeon Forms WAR:
>
>    http://localhost:8080/myapp/xforms-jsp/page1.jsp
>
> contains the following submission:
>
>    <xf:submission id="page1" action="/xforms-jsp/page2.jsp" method="get"/>
>
> I correctly end up at:
>
>    http://localhost:8080/myapp/xforms-jsp/page2.jsp
>
> -Erik
>
> On Thu, Dec 9, 2010 at 5:35 PM, Arlo White<[hidden email]>  wrote:
>> We have a separate webapp (/remote) with REST services that Orbeon accesses.
>> I want my xforms:submission resource urls to point to this webapp without
>> having to hard-code an absolute url. This is because these xforms will be
>> transferred between different servers and I don't want to edit the XForm
>> every time I do so.
>>
>> One possibility is to pass in the remote service url prefix through a
>> parameter or property. I couldn't get xxforms:get-request-parameter() to
>> work for me. I'm not sure what other methods I might use. Maybe I can create
>> my own property in properties-local.xml and inject it into the url?
>>
>> I've been reading through:
>> http://wiki.orbeon.com/forms/doc/developer-guide/admin/url-rewriting
>>
>> This seems to indicate that I can use .. in a url and Orbeon will translate
>> it. However, ../remote/my/service didn't work. This would have been the
>> easiest...
>>
>> Portions of the documentation sound promising:
>>
>> If the URL is an absolute path, the URL is rewritten
>>   * usually, this means that the servlet context path is prepended
>>   * in some cases, like separate deployment, a different context is prepended
>> depending on the type of resources
>>
>> But I'm not sure how to configure Orbeon to prepend a different context in
>> some cases. (for xforms:submission resource attributes)
>>
>> I tried setting<property as="xs:anyURI"
>> name="oxf.url-rewriting.service.base-uri" value="/remote"/>
>> But this broke the Form Runner and Builder.
>>
>> I'd appreciate any recommendations on the best way to do this.
>>
>> --
>> Arlo White
>> Application Management / ITS
>> CalPoly, San Luis Obispo
>> [hidden email]
>>
>>
>> --
>> 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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: xforms:submission resource url re-writing

Erik Bruchez
Administrator
Arlo,

In this case no, you shouldn't use OrbeonXFormsFilter.

I don't think there is a property to handle this specific case (it's
hard to remember as we have a lot of URL rewriting code ;).

In separate deployment, we already handle two servlet contexts: the
one from the user's app, and the one from Orbeon. So with some work,
it would be possible to extend this to your scenario, but it's not
there out of the box currently.

-Erik

On Fri, Dec 10, 2010 at 10:22 AM, Arlo White <[hidden email]> wrote:

> I'm not using the OrbeonXFormsFilter. All of our XForms are viewed in the
> Form Runner. We've implemented REST services in the other webapp to serve
> XForms to the Form Runner and provide REST data services.
>
> So our webapp redirects the user to
> /orbeon/fr/app/form/edit/1234
> Orbeon requests the XForm through our REST persistence layer in our webapp.
> xforms:submissions go to a REST service is our webapp as well. (But here I
> need to specify an absolute url in the XForm, which I want to avoid as I
> explained in the first post)
>
> Should I still use the OrbeonXFormsFilter with the Form Runner?
>
> Of course our webapp could pre-process the XForms and rewrite the
> xforms:submission resource attribute, but I was hoping there was an easier
> Orbeon way.
>
>
> On 12/09/2010 08:19 PM, Erik Bruchez wrote:
>>
>> Arlo,
>>
>> So which case doesn't work?
>>
>> I am trying this, with /myapp being the context of a separate all, and
>> /orbeon the context of the Orbeon Forms WAR:
>>
>>   http://localhost:8080/myapp/xforms-jsp/page1.jsp
>>
>> contains the following submission:
>>
>>   <xf:submission id="page1" action="/xforms-jsp/page2.jsp" method="get"/>
>>
>> I correctly end up at:
>>
>>   http://localhost:8080/myapp/xforms-jsp/page2.jsp
>>
>> -Erik
>>
>> On Thu, Dec 9, 2010 at 5:35 PM, Arlo White<[hidden email]>  wrote:
>>>
>>> We have a separate webapp (/remote) with REST services that Orbeon
>>> accesses.
>>> I want my xforms:submission resource urls to point to this webapp without
>>> having to hard-code an absolute url. This is because these xforms will be
>>> transferred between different servers and I don't want to edit the XForm
>>> every time I do so.
>>>
>>> One possibility is to pass in the remote service url prefix through a
>>> parameter or property. I couldn't get xxforms:get-request-parameter() to
>>> work for me. I'm not sure what other methods I might use. Maybe I can
>>> create
>>> my own property in properties-local.xml and inject it into the url?
>>>
>>> I've been reading through:
>>> http://wiki.orbeon.com/forms/doc/developer-guide/admin/url-rewriting
>>>
>>> This seems to indicate that I can use .. in a url and Orbeon will
>>> translate
>>> it. However, ../remote/my/service didn't work. This would have been the
>>> easiest...
>>>
>>> Portions of the documentation sound promising:
>>>
>>> If the URL is an absolute path, the URL is rewritten
>>>  * usually, this means that the servlet context path is prepended
>>>  * in some cases, like separate deployment, a different context is
>>> prepended
>>> depending on the type of resources
>>>
>>> But I'm not sure how to configure Orbeon to prepend a different context
>>> in
>>> some cases. (for xforms:submission resource attributes)
>>>
>>> I tried setting<property as="xs:anyURI"
>>> name="oxf.url-rewriting.service.base-uri" value="/remote"/>
>>> But this broke the Form Runner and Builder.
>>>
>>> I'd appreciate any recommendations on the best way to do this.
>>>
>>> --
>>> Arlo White
>>> Application Management / ITS
>>> CalPoly, San Luis Obispo
>>> [hidden email]
>>>
>>>
>>> --
>>> 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
>
>


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

Re: xforms:submission resource url re-writing

DL
There is a supplementary UrlRewriteFilter I have added to orbeon from here ..

  http://tuckey.org/urlrewrite/

then urlrewrite.xml rules are created in Web-Inf/urlrewrite.xml  .... at same level as web.xml

I'm not sure if it meets your requirements ...

"But here I need to specify an absolute url in the XForm, which I want to avoid as I
explained in the first post .. "


but from first tests UrlRewriteFilter seems to take precedence over other Orbeon filters.