Versioned resources in separate deployment

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

Versioned resources in separate deployment

npujol73
Hi,

 I have turned out versioned resources. I am setup in a separate deployment. I am trying to understand what the url to my images/css should be.

My war is in context ctxA. I have a subdirectory where i have my css under $WAR_ROOT/xforms/client/main.css.

What should be the url in my xform ?

This does not work?

  <link rel="stylesheet" type="text/css" href="xforms/client/main.css"/>

To determine what the urls should be to static resources, instances served as servlets etc... in a separate deployment is still a mystery to me. Can anybody help?



Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Versioned resources in separate deployment

Alessandro  Vernet
Administrator
Versioned resources can only work for resources that are served by
Orbeon's page flow controller. If the resource is in your own war,
then it is not served by the Orbeon Forms. This means you can't use
Orbeon's versioned resources mechanism for resources that stored in
your own war.

If the resource was in the Orbeon's resources directory, and hence was
served by Orbeon Forms:

* In your HTML, you'd write:  <link rel="stylesheet" type="text/css"
href="/xforms/client/main.css"/>
* You would place the resource in RESOURCES//xforms/client/main.css
* Assuming you declared a property: <property as="xs:string"
name="oxf.resources.version-number" value="1.6.3"/>
* The link in your HTML would be rewritten
/your-app/1.6.3/xforms/client/main.css (where your-app is the Orbeon
context).
* The browser would request /your-app/1.6.3/xforms/client/main.css and
Orbeon Forms would serve RESOURCES//xforms/client/main.css.

You'll find more information about this on:

http://www.orbeon.com/orbeon/doc/reference-xforms-configuration#versioned-resources

Alex

On Mon, Mar 1, 2010 at 2:04 PM, npujol73 <[hidden email]> wrote:

>
> Hi,
>
>  I have turned out versioned resources. I am setup in a separate deployment.
> I am trying to understand what the url to my images/css should be.
>
> My war is in context ctxA. I have a subdirectory where i have my css under
> $WAR_ROOT/xforms/client/main.css.
>
> What should be the url in my xform ?
>
> This does not work?
>
>  <link rel="stylesheet" type="text/css" href="xforms/client/main.css"/>
>
> To determine what the urls should be to static resources, instances served
> as servlets etc... in a separate deployment is still a mystery to me. Can
> anybody help?
>
>
>
> Thanks
> --
> View this message in context: http://n4.nabble.com/Versioned-resources-in-separate-deployment-tp1574338p1574338.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
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My 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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Versioned resources in separate deployment

npujol73
Thanks for your reply Alex. I now realize that my question was unclear/confusing. I apologize for that. Your point about versioned resources makes sense and was my understanding.

My issue is more around determining what the urls to images/servlets/javascript/css should be in a separate deployment if I host that content in my own war along with some xml producing servlets that feed a couple of xforms:instances.

 This gets particularly confusing in a proxied environment where it appears that making urls relative is just not enough (since i presume httpclient connections to some of the resources may be opened and a fully qualified url is needed to do so). In my situation our app server servers multiple host names. For example:

http://demo1.home.com/
http://demo2.home.com/

In addition the web exposed port (80) is different than the one the server is actually running on the box itself (8080). I have  used the url-rewriting properties successfully but it is not ideal for me since the hostname really depends on the url that solicited the xform in the first place and that could be any of demo1.home.com or demo2.home.come (localhost or a generic hostname is not an option because the app server uses the hostname to drive some logic that determine what content will be served e.g http://demo1.home.com/ctx/images/mygif and http://demo2.home.com/ctx/images/mygif serve different content).

 I have seen there is also a proxy.port / proxy.host property and I was hoping to use JUST the port property with the thought that by default the hostname would be obtained from the request that solicited the xform in the first place - but that does not seem to work. Any thoughts?

Does that all make sense?
 
Reply | Threaded
Open this post in threaded view
|

Re: Versioned resources in separate deployment

npujol73
In reply to this post by Alessandro Vernet
Thanks for clarifying.
Reply | Threaded
Open this post in threaded view
|

Re: Re: Versioned resources in separate deployment

Alessandro  Vernet
Administrator
In reply to this post by npujol73
So let's assume that you're not using versioned resources (since you
can't do so for your own resources, in separate deployment).

The oxf.http.proxy.host/port properties are for something different:
they are used when Orbeon Forms needs to establish a connection back
to itself.

The main idea of rewriting is that if your app is deployed under
/my-app, and your image is accessible by the browser under
/my-app/images/logo.png, then in your HTML you write /images/logo.png,
and Orbeon Forms will rewrite it as /my-app/images/logo.png. So you
don't need to have the host/port specified, neither in your code nor
in the rewritten URL sent by Orbeon Forms to the browser.

Alex

On Tue, Mar 2, 2010 at 8:33 PM, npujol73 <[hidden email]> wrote:

>
> Thanks for your reply Alex. I now realize that my question was
> unclear/confusing. I apologize for that. Your point about versioned
> resources makes sense and was my understanding.
>
> My issue is more around determining what the urls to
> images/servlets/javascript/css should be in a separate deployment if I host
> that content in my own war along with some xml producing servlets that feed
> a couple of xforms:instances.
>
>  This gets particularly confusing in a proxied environment where it appears
> that making urls relative is just not enough (since i presume httpclient
> connections to some of the resources may be opened and a fully qualified url
> is needed to do so). In my situation our app server servers multiple host
> names. For example:
>
> http://demo1.home.com/
> http://demo2.home.com/
>
> In addition the web exposed port (80) is different than the one the server
> is actually running on the box itself (8080). I have  used the url-rewriting
> properties successfully but it is not ideal for me since the hostname really
> depends on the url that solicited the xform in the first place and that
> could be any of demo1.home.com or demo2.home.come (localhost or a generic
> hostname is not an option because the app server uses the hostname to drive
> some logic that determine what content will be served e.g
> http://demo1.home.com/ctx/images/mygif and
> http://demo2.home.com/ctx/images/mygif serve different content).
>
>  I have seen there is also a proxy.port / proxy.host property and I was
> hoping to use JUST the port property with the thought that by default the
> hostname would be obtained from the request that solicited the xform in the
> first place - but that does not seem to work. Any thoughts?
>
> Does that all make sense?
>
> --
> View this message in context: http://n4.nabble.com/Versioned-resources-in-separate-deployment-tp1574338p1576044.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
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My 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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: Versioned resources in separate deployment

npujol73
right this makes sense for links of xhtml elements (link,javascript,img etc...) but how about for xforms:instance src?

I have an xform who is produced by a jsp and contains a xforms:instance with a src pointing to a servlet that is hosted in the same war (separate deployment setup) like this:

<xforms:instance id="fr-url-0" xxforms:readonly="true" xxforms:cache="true" src="/LookupValues?op=mcSet&amp;id=15"/>

That definitely looks like a case of orbeon having to open a connection back to the server is it not? The only way i have been able to get this to work is to use the url-rewriting property and hard code the host and port of the server. This is particularly true in a proxied environment where the request url may not be valid on the local machine. Is there way to make this work with a relative link WITHOUT having to play around with the url-rewriting/proxy-host/proxy-port properties?

Thanks Alex for any feedback.
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Versioned resources in separate deployment

Alessandro  Vernet
Administrator
Ah, yes, indeed, in the case of an <xforms:instance src="/path">
you'll have a connection opened back to your server, and in that case
you'll need to set the oxf.http.proxy.host/port properties
appropriately. I don't think there is any way around it.

Alex

On Thu, Mar 4, 2010 at 6:46 PM, npujol73 <[hidden email]> wrote:

>
> right this makes sense for links of xhtml elements (link,javascript,img
> etc...) but how about for xforms:instance src?
>
> I have an xform who is produced by a jsp and contains a xforms:instance with
> a src pointing to a servlet that is hosted in the same war (separate
> deployment setup) like this:
>
> <xforms:instance id="fr-url-0" xxforms:readonly="true" xxforms:cache="true"
> src="/LookupValues?op=mcSet&amp;id=15"/>
>
> That definitely looks like a case of orbeon having to open a connection back
> to the server is it not? The only way i have been able to get this to work
> is to use the url-rewriting property and hard code the host and port of the
> server. This is particularly true in a proxied environment where the request
> url may not be valid on the local machine. Is there way to make this work
> with a relative link WITHOUT having to play around with the
> url-rewriting/proxy-host/proxy-port properties?
>
> Thanks Alex for any feedback.
> --
> View this message in context: http://n4.nabble.com/Versioned-resources-in-separate-deployment-tp1574338p1579118.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
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My 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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet