URL Trouble

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

URL Trouble

Jim Logan-3
I just read through section 9 of the XForms Reference, and I still don't understand how to construct a URL for a service running alongside Orbeon in the same Tomcat instance. If Orbeon lives at "http://ekb.osera.gov/orbeon" and I have other REST services rooted at "http://ekb.osera.gov", how can I construct a portable URL in my form that does not specify the authority portion of the URL?

For example, let's say my form is at the URL "http://ekb.osera.gov/orbeon/asset-mgmt/new-asset.xhtml", one of my many REST services is at the URL "http://ekb.osera.gov/asset/head/sys/asserted/SC/directory", and I need to do a submission to that REST service. Specifying "../../../asset/head/sys/asserted/SC/directory" does not work, nor does "/asset/head/sys/asserted/SC/directory". How can I get this to work right?

Thanks,
-Jim



--
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: URL Trouble

Alessandro Vernet
Administrator
Jim,

On Mon, Aug 18, 2008 at 12:43 PM, Jim Logan <[hidden email]> wrote:
> For example, let's say my form is at the URL
> "http://ekb.osera.gov/orbeon/asset-mgmt/new-asset.xhtml", one of my many
> REST services is at the URL
> "http://ekb.osera.gov/asset/head/sys/asserted/SC/directory", and I need to
> do a submission to that REST service. Specifying
> "../../../asset/head/sys/asserted/SC/directory" does not work, nor does
> "/asset/head/sys/asserted/SC/directory". How can I get this to work right?

There are two ways to do this:

1) With a URI relative to the current page, with ".." in the path - If
your XForms is deployed at
http://ekb.osera.gov/orbeon/asset-mgmt/new-asset.xhtml, then to get
back to http://ekb.osera.gov/, you need to write "../..", so the
action for your submission should be
"../../asset/head/sys/asserted/SC/directory". I think you have one
additional ".." in your URI there.

2) Using a URI relative to the current host - Use
action="/asset/head/sys/asserted/SC/directory" but add
f:url-norewrite="true" on the <xforms:submission>. I think this would
be my preferred choice, as URI starting with those ".." are
error-proof and not very easy to read.

The rational behind this is that Orbeon Forms assumes that "most of
the time" you want to access services deployed as part of the same web
application, so if your URI starts with "/", it automatically adds the
context. If you want to access another web application deployed on the
same server with a URI starting with "/", then you need to use
f:url-norewrite="true". You can find more about URI rewriting on
http://www.orbeon.com/ops/doc/reference-url-rewriting.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet


--
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: URL Trouble

Jim Logan-3
Alessandro Vernet wrote:
> 2) Using a URI relative to the current host - Use
> action="/asset/head/sys/asserted/SC/directory" but add
> f:url-norewrite="true" on the <xforms:submission>.
Alex,

That did the trick! Thanks!

-Jim



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