<xforms:output mediatype="image/*" ... /> does not work in the separate deployment mode

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

<xforms:output mediatype="image/*" ... /> does not work in the separate deployment mode

Markku Laine
Erik,


The XForms markup below does not work in the separate deployment mode  
(works in the integrated deployment mode).
<xforms:output mediatype="image/*" value="'http://www.google.com/ig/images/weather/mostly_cloudy.gif' 
" />

Here is the markup transformed by Orbeon Forms:
<span id="xf-54" class="xforms-control xforms-output xforms-mediatype-
image">
   <img src="/weather/orbeon/xforms-server/dynamic/
67c170744e473f8cf2ee581902c8311c"/>
</span>


I guess the "/weather" part, which my web application's context name,  
in the src attribute should not be there?

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

Re: <xforms:output mediatype="image/*" ... /> does not work in the separate deployment mode

Alessandro  Vernet
Administrator
Markku,

On Wed, Nov 11, 2009 at 7:02 AM, Markku Laine <[hidden email]> wrote:

> The XForms markup below does not work in the separate deployment mode (works
> in the integrated deployment mode).
> <xforms:output mediatype="image/*"
> value="'http://www.google.com/ig/images/weather/mostly_cloudy.gif'" />
>
> Here is the markup transformed by Orbeon Forms:
> <span id="xf-54" class="xforms-control xforms-output
> xforms-mediatype-image">
>  <img
> src="/weather/orbeon/xforms-server/dynamic/67c170744e473f8cf2ee581902c8311c"/>
> </span>
This is strange, as it works for me, and I have the same markup generated:

<img src="/myapp/orbeon/xforms-server/dynamic/67c170744e473f8cf2ee581902c8311c"
class="xforms-output-output" id="xf-5$$c"/>

Do you see an exception in orbeon.log?

> I guess the "/weather" part, which my web application's context name, in the
> src attribute should not be there?

Yes, it should be there: the URLs seen by the browser all point to
your web app, so you can in essence block any access to the Orbeon
Forms web app (usually deployed on /orbeon) from the outside.

Alex
--
Orbeon Forms - Web forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
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: <xforms:output mediatype="image/*" ... /> does not work in the separate deployment mode

Markku Laine
Alex,


On 12.11.2009, at 0.44, Alessandro Vernet wrote:

> Markku,
>
> On Wed, Nov 11, 2009 at 7:02 AM, Markku Laine <[hidden email]>  
> wrote:
>> The XForms markup below does not work in the separate deployment  
>> mode (works
>> in the integrated deployment mode).
>> <xforms:output mediatype="image/*"
>> value="'http://www.google.com/ig/images/weather/ 
>> mostly_cloudy.gif'" />
>>
>> Here is the markup transformed by Orbeon Forms:
>> <span id="xf-54" class="xforms-control xforms-output
>> xforms-mediatype-image">
>>  <img
>> src="/weather/orbeon/xforms-server/dynamic/
>> 67c170744e473f8cf2ee581902c8311c"/>
>> </span>
>
> This is strange, as it works for me, and I have the same markup  
> generated:
>
> <img src="/myapp/orbeon/xforms-server/dynamic/
> 67c170744e473f8cf2ee581902c8311c"
> class="xforms-output-output" id="xf-5$$c"/>
Hmm... that's strange indeed. I did more tests and found out that the  
problem occurs when you have disabled cookies in your browser (or done  
that in the application level by using <Context crossContext="true"  
cookies="false" /> in your META-INF/context.xml file). By disabling  
cookies, the <xforms:output mediatype="image/*" ... /> does not work  
anymore neither in the integrated deployment mode nor in the separate  
deployment mode.

Does the same happen for you when you disable cookies? Can you think  
of any other Orbeon Forms/XForms features that might behave the same  
way i.e. needs to be fixed as well?

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

Re: Re: Re: <xforms:output mediatype="image/*" ... /> does not work in the separate deployment mode

Alessandro  Vernet
Administrator
Markku,

On Wed, Nov 11, 2009 at 11:11 PM, Markku Laine <[hidden email]> wrote:
> Does the same happen for you when you disable cookies? Can you think of any
> other Orbeon Forms/XForms features that might behave the same way i.e. needs
> to be fixed as well?

Yes, it is normal that this doesn't work if you disable cookies, as
Orbeon Forms won't be able to keep track of your session in that case.
Do you get anything else to work with cookies disabled? Maybe you are
using the client mode?

Alex
--
Orbeon Forms - Web forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
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: Re: Re: <xforms:output mediatype="image/*" ... /> does not work in the separate deployment mode

Markku Laine
Alex,


> Yes, it is normal that this doesn't work if you disable cookies, as
> Orbeon Forms won't be able to keep track of your session in that case.
> Do you get anything else to work with cookies disabled? Maybe you are
> using the client mode?

Just a quick reply... Actually, everything else (at least all my test
applications) is working perfectly if cookies are disabled. This might be
due to URL encoding (URL rewriting to include the session ID) that I am
applying to all links (e.g., <xforms:submission action="..."/>,
<xforms:load resource="..." /> and <a href="..." />) in my own XFormsDB
transformation (an XForms-based framework I am working on), though. I have
to try without the transformation to confirm this.

I use Orbeon Forms as such i.e. I have not made any modifications to the
configurations etc. Just downloaded the *.war file and deployed it.

As a work around for the <xforms:output mediatype="image/*" ... />
issue I am currently using AVTs in the <img src="..." /> attribute. Works
fine.

We need to support cookieless user agents as well because some mobile
phones might not support cookies. In addition, if you embed an
XForms-based widget two or more times to a Web page/site using iframe
etc., the same cookie is being used by all widget instances --> things
start to get mixed up.

I also have to try to apply URL encoding to the <xforms:output
mediatype="image/*" ref/value="..." /> attribute. Maybe that works.

Regards


-Markku

Ps. I will let you know how things work without the XFormsDB
transformation.


--
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: Re: Re: <xforms:output mediatype="image/*" ... /> does not work in the separate deployment mode

Markku Laine

On 13.11.2009, at 7.07, .::: Markku :::. wrote:

> Alex,
>
>
>> Yes, it is normal that this doesn't work if you disable cookies, as
>> Orbeon Forms won't be able to keep track of your session in that  
>> case.
>> Do you get anything else to work with cookies disabled? Maybe you are
>> using the client mode?
>
> I also have to try to apply URL encoding to the <xforms:output  
> mediatype="image/*" ref/value="..." /> attribute. Maybe that works.
That did not work because the value of the "ref" and "value"  
attributes cannot be URL encoded in my transformation (the value is  
not a valid URL). Maybe URL encoding could be applied in the Orbeon  
Forms transformation?

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: Re: Re: Re: <xforms:output mediatype="image/*" ... /> does not work in the separate deployment mode

Alessandro  Vernet
Administrator
In reply to this post by Markku Laine
Markku,

On Thu, Nov 12, 2009 at 9:07 PM, .::: Markku :::. <[hidden email]> wrote:
> Just a quick reply... Actually, everything else (at least all my test
> applications) is working perfectly if cookies are disabled. This might be
> due to URL encoding (URL rewriting to include the session ID) that I am
> applying to all links (e.g., <xforms:submission action="..."/>, <xforms:load
> resource="..." /> and <a href="..." />) in my own XFormsDB transformation
> (an XForms-based framework I am working on), though. I have to try without
> the transformation to confirm this.

I see. This is interesting, I have never tried to do this, and have
always relied on cookies for session handling.

> We need to support cookieless user agents as well because some mobile phones
> might not support cookies. In addition, if you embed an XForms-based widget
> two or more times to a Web page/site using iframe etc., the same cookie is
> being used by all widget instances --> things start to get mixed up.

Your point on mobile browsers that don't support cookies is well
taken. However, things should not get mixed up in Orbeon Forms if you
open multiple forms (even the same form multiple times) in different
iframes, or different windows/tabs of the same browser. We have paid
especially attention this (and if it happens, it is a bug!).

> I also have to try to apply URL encoding to the <xforms:output
> mediatype="image/*" ref/value="..." /> attribute. Maybe that works.

Like you said in a latter message, you can't, since the value here is
not the URL. We would need to provide some facility for this. What are
you changing in the URL? Are you adding a jsessionid request
parameter?

Alex
--
Orbeon Forms - Web forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
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: Re: Re: Re: Re: <xforms:output mediatype="image/*" ... /> does not work in the separate deployment mode

Markku Laine
Alex,


>> We need to support cookieless user agents as well because some  
>> mobile phones
>> might not support cookies. In addition, if you embed an XForms-
>> based widget
>> two or more times to a Web page/site using iframe etc., the same  
>> cookie is
>> being used by all widget instances --> things start to get mixed up.
>
> Your point on mobile browsers that don't support cookies is well
> taken. However, things should not get mixed up in Orbeon Forms if you
> open multiple forms (even the same form multiple times) in different
> iframes, or different windows/tabs of the same browser. We have paid
> especially attention this (and if it happens, it is a bug!).
Well, sessions do get mixed up in my browser so this maybe it is a  
bug. I attached a sample Web application so that you can try it out  
yourself.

Instructions:
1) Deploy both WAR files
2) Go to URL: http://localhost:8080/session/
3) Input text and click the "Store text in the session" link
4) Open a new tab and go to the URL: http://localhost:8080/session/
5) It initialized the input text field with the value you stored in  
the session using a different instance of the application --> bug?

The same thing happens when you embed the application two or more  
times to another Web page/application
1) Go to URL: http://localhost:8080/sessionembedded/
2) Input text (use different values in both input fields) and click  
the "Store text in the session" link in both embedded views
3) Reload the Web page
4) Both embedded views initialize the input text field with the same  
value --> bug?


Another bug related to sessions: Set/get session attribute functions  
do not work as they should when you try to store text in the session  
for the second time on the URL http://localhost:8080/session/. It  
always overrides your new value with the one you stored in the first  
time.


>> I also have to try to apply URL encoding to the <xforms:output
>> mediatype="image/*" ref/value="..." /> attribute. Maybe that works.
>
> Like you said in a latter message, you can't, since the value here is
> not the URL. We would need to provide some facility for this. What are
> you changing in the URL? Are you adding a jsessionid request
> parameter?

Here is a short description of what I am doing:
  * Parse the XHTML+XForms document
  * Extract all URIs i.e. link values (e.g., xforms:submission  
resource="...", xhtml:a href="...", etc.)
  * Before encoding URLs, the URIs need to be transformed into ASCII  
strings etc. AVTs in the URIs may cause problems here...
  * Encode the URIs with the following method:  
response.encodeURL( uriString );
  * Pass the modified URIs to the XSLT transformation, which replaces  
the original URIs with the modified ones (containing the JSESSIONID if  
needed)

Hope this helps!

Kind regards


-Markku

Ps. I am using Orbeon Forms dev-post-3.7.1.200910160000-development in  
the separate deployment mode.




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

session.war (12K) Download Attachment
sessionembedded.war (11K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Re: Re: <xforms:output mediatype="image/*" ... /> does not work in the separate deployment mode

Alessandro  Vernet
Administrator
Markku,

On Mon, Nov 16, 2009 at 3:55 AM, Markku Laine <[hidden email]> wrote:

> Well, sessions do get mixed up in my browser so this maybe it is a bug. I
> attached a sample Web application so that you can try it out yourself.
>
> Instructions:
> 1) Deploy both WAR files
> 2) Go to URL: http://localhost:8080/session/
> 3) Input text and click the "Store text in the session" link
> 4) Open a new tab and go to the URL: http://localhost:8080/session/
> 5) It initialized the input text field with the value you stored in the
> session using a different instance of the application --> bug?
Yes, I see that. And this is how it should behave. The session is
maintained through cookies, and if a window sets a cookie in your
browser, when you open a connection to the server through another
browser window, the browser will send the cookie that was set earlier.
If this is not the behavior you expect, I'd say you shouldn't use the
session. And indeed, many developers store date in the session just
because it is a convenient thing to do, and "well, who opens multiple
browser windows/tabs anyway?". As XForms developers, I think we should
store information in instances, and pass those instances to other
pages when they need that data.

> Here is a short description of what I am doing:
>  * Parse the XHTML+XForms document
>  * Extract all URIs i.e. link values (e.g., xforms:submission
> resource="...", xhtml:a href="...", etc.)
>  * Before encoding URLs, the URIs need to be transformed into ASCII strings
> etc. AVTs in the URIs may cause problems here...
>  * Encode the URIs with the following method: response.encodeURL( uriString
> );
>  * Pass the modified URIs to the XSLT transformation, which replaces the
> original URIs with the modified ones (containing the JSESSIONID if needed)
For the <xforms:output mediatype="image/*">, you'll need to do the
rewrite after the XForms engine has run, in the epilogue. In essence,
some URLs can only be rewritten before the XForms engine runs (e.g.
submissions's resource="...") and other can only be handled after the
engine runs (e.g. <xforms:output mediatype="image/*"> or
<xforms:output mediatype="text/thml">). Maybe this rewriting would be
better handled by the XForms engine itself.

Alex
--
Orbeon Forms - Web forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
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: Re: Re: Re: Re: Re: Re: <xforms:output mediatype="image/*" ... /> does not work in the separate deployment mode

Markku Laine
Alex,


On 17.11.2009, at 9.55, Alessandro Vernet wrote:

> On Mon, Nov 16, 2009 at 3:55 AM, Markku Laine <[hidden email]>  
> wrote:
>> Well, sessions do get mixed up in my browser so this maybe it is a  
>> bug. I
>> attached a sample Web application so that you can try it out  
>> yourself.
>>
>> Instructions:
>> 1) Deploy both WAR files
>> 2) Go to URL: http://localhost:8080/session/
>> 3) Input text and click the "Store text in the session" link
>> 4) Open a new tab and go to the URL: http://localhost:8080/session/
>> 5) It initialized the input text field with the value you stored in  
>> the
>> session using a different instance of the application --> bug?
>
> Yes, I see that. And this is how it should behave. The session is
> maintained through cookies, and if a window sets a cookie in your
> browser, when you open a connection to the server through another
> browser window, the browser will send the cookie that was set earlier.
> If this is not the behavior you expect, I'd say you shouldn't use the
> session. And indeed, many developers store date in the session just
> because it is a convenient thing to do, and "well, who opens multiple
> browser windows/tabs anyway?". As XForms developers, I think we should
> store information in instances, and pass those instances to other
> pages when they need that data.
Yes, that's what I initially thought, too. I just got a bit confused  
about your comment below:
------------ 8< ---------
> We need to support cookieless user agents as well because some  
> mobile phones
> might not support cookies. In addition, if you embed an XForms-based  
> widget
> two or more times to a Web page/site using iframe etc., the same  
> cookie is
> being used by all widget instances --> things start to get mixed up.

Your point on mobile browsers that don't support cookies is well
taken. However, things should not get mixed up in Orbeon Forms if you
open multiple forms (even the same form multiple times) in different
iframes, or different windows/tabs of the same browser. We have paid
especially attention this (and if it happens, it is a bug!).
------------ 8< ---------

However, I still think Orbeon Forms should work when cookies are  
disabled. For instance, we have a portal service, which enables adding  
widgets from the library to your personal view. Now, let's say that a  
user wants to add TWO weather widgets to his/her personal view  
(embedded using the iframe/object element), one showing the weather in  
Helsinki and the other showing the weather in Berlin. Due to cookie-
based session maintenance, the sessions get mixed up. URL rewriting  
would solve this problem.

I know that this is rather unusual use case but it's something we have  
to deal with at the moment. The URL rewriting approach I described in  
the previous post solves this problem and using <Context  
cookies="false" /> in the context.xml forces the Web application to  
rely on URL rewriting even if user agent would support cookies.


>> Here is a short description of what I am doing:
>>  * Parse the XHTML+XForms document
>>  * Extract all URIs i.e. link values (e.g., xforms:submission
>> resource="...", xhtml:a href="...", etc.)
>>  * Before encoding URLs, the URIs need to be transformed into ASCII  
>> strings
>> etc. AVTs in the URIs may cause problems here...
>>  * Encode the URIs with the following method:  
>> response.encodeURL( uriString
>> );
>>  * Pass the modified URIs to the XSLT transformation, which  
>> replaces the
>> original URIs with the modified ones (containing the JSESSIONID if  
>> needed)
>
> For the <xforms:output mediatype="image/*">, you'll need to do the
> rewrite after the XForms engine has run, in the epilogue. In essence,
> some URLs can only be rewritten before the XForms engine runs (e.g.
> submissions's resource="...") and other can only be handled after the
> engine runs (e.g. <xforms:output mediatype="image/*"> or
> <xforms:output mediatype="text/thml">). Maybe this rewriting would be
> better handled by the XForms engine itself.
Yes, I agree. Then Orbeon Forms would also work with user agents ,  
which do not support cookies. And if you need any help with the  
design, do not hesitate to contact me.

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