Theme not being applied to submissions in nightly build

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

Theme not being applied to submissions in nightly build

ncrofts
Hi,

I've just updated to the nightly build from 2nd February 2010, but now some of the pages that I navigate to via page flow submissions have stopped getting the theme applied to them.

Previously I was using the nightly build from 10th September 2009.

I have been using the feature that allows you to specify a local theme for your application where you add a theme.xsl file to your app folder i.e. "resources/apps/APPNAME/theme.xsl".

However this does not seem to get applied any more when I perform an XML submission from a page.

Has anyone seen a similar issue, or got any ideas on where I should look to track this down?

Regards,
Neil


Reply | Threaded
Open this post in threaded view
|

Re: Theme not being applied to submissions in nightly build

ncrofts
Hello again,

I've now tracked this down to the following line in "epilogue-servlet.xpl" that decides whether or not to apply a plain or custom theme:

The latest version (2nd February 2010) has the following test condition:

  <p:when test="starts-with(/request/request-path, '/xforms-renderer')
                       or /request/attributes/attribute[name = 'javax.servlet.forward.context_path']
                       or /request/parameters/parameter[name = 'orbeon-theme']/value = 'plain'">


The version I was working with previously (10th Sept 2009) didn't have the second condition:

  <p:when test="starts-with(/request/request-path, '/xforms-renderer')
                       or /request/parameters/parameter[name = 'orbeon-theme']/value = 'plain'">


What I am finding is that if I navigate to a URL via a standard HTML anchor, the #request input contains something like:

WORKS: Accessed via an html anchor
<request>
    <container-type>servlet</container-type>
    <headers>
        <header>
            <name>accept</name>
            <value>text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</value>
        </header>
    </headers>
    <request-path>/my-app/web/search</request-path>
</request> 


However when I do a submission on my Xform page I get the following request input in the epilogue:

DOESN'T WORK: Accessed via a submission
 <request>
     <container-type>servlet</container-type>
     <attributes>
         <attribute>
             <name>javax.servlet.forward.context_path</name>
             <value>/my-context</value>
         </attribute>
     </attributes>
     <request-path>/my-app/web/search</request-path>
 </request>


My question now is, is this a bug in the epilogue or is there an issue with the way I am applying my submissions?

my-sample.xhtml:

<xforms:model>
      <xforms:submission id="search" method="post" resource="search"/>
</xforms:model>
....
<xforms:submit submission="search" appearance="minimal">
        <xforms:label>Search <xforms:label>
</xforms:submit>


page-flow.xml:

<c:page id="search" path-info="/my-app/web/search"  view="view/search.xhtml"/>


Any thoughts on the nature of this problem and the official way to resolve would be much appreciated.

Thanks,
Neil
Reply | Threaded
Open this post in threaded view
|

Re: Re: Theme not being applied to submissions in nightly build

Erik Bruchez-3
Neil,

This seems to have changed in October. Based on the comment, it may be
that this was done to handle the noscript mode better in separate
deployment.

I think this is how things are meant to work:

* In separate deployment, one idea is that can just deploy orbeon.war
without changes and things should work.
* However, by default the theme configured is theme-examples.xsl,
which you don't want in separate deployment.
* So for separate deployment, use of theme-plain.xsl was forced.
* We used to test only on the /xforms-renderer path, but that was not
enough for the noscript mode.

But if I understand your comment, you are saying that now things break
in your case, which doesn't use separate deployment. Is that right?

-Erik

On Wed, Feb 3, 2010 at 3:40 AM, ncrofts <[hidden email]> wrote:

>
> Hello again,
>
> I've now tracked this down to the following line in "epilogue-servlet.xpl"
> that decides whether or not to apply a plain or custom theme:
>
> The latest version (2nd February 2010) has the following test condition:
>
>  <p:when test="starts-with(/request/request-path, '/xforms-renderer')
>                       or /request/attributes/attribute[name =
> 'javax.servlet.forward.context_path']
>                       or /request/parameters/parameter[name =
> 'orbeon-theme']/value = 'plain'">
>
>
> The version I was working with previously (10th Sept 2009) didn't have the
> second condition:
>
>  <p:when test="starts-with(/request/request-path, '/xforms-renderer')
>                       or /request/parameters/parameter[name =
> 'orbeon-theme']/value = 'plain'">
>
>
> What I am finding is that if I navigate to a URL via a standard HTML anchor,
> the #request input contains something like:
>
> WORKS: Accessed via an html anchor
> <request>
>    <container-type>servlet</container-type>
>    <headers>
>        <header>
>            <name>accept</name>
>
> <value>text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</value>
>        </header>
>    </headers>
>    <request-path>/my-app/web/search</request-path>
> </request>
>
>
> However when I do a submission on my Xform page I get the following request
> input in the epilogue:
>
> DOESN'T WORK: Accessed via a submission
>  <request>
>     <container-type>servlet</container-type>
>     <attributes>
>         <attribute>
>             <name>javax.servlet.forward.context_path</name>
>             <value>/my-context</value>
>         </attribute>
>     </attributes>
>     <request-path>/my-app/web/search</request-path>
>  </request>
>
>
> My question now is, is this a bug in the epilogue or is there an issue with
> the way I am applying my submissions?
>
> my-sample.xhtml:
>
> <xforms:model>
>        <xforms:submission id="search" method="post" resource="search"/>
> </xforms:model>
> ....
> <xforms:submit submission="search" appearance="minimal">
>        <xforms:label>Search <xforms:label>
> </xforms:submit>
>
>
> page-flow.xml:
>
> <c:page id="search" path-info="/my-app/web/search"
> view="view/search.xhtml"/>
>
>
> Any thoughts on the nature of this problem and the official way to resolve
> would be much appreciated.
>
> Thanks,
> Neil
> --
> View this message in context: http://n4.nabble.com/Theme-not-being-applied-to-submissions-in-nightly-build-tp1460986p1461063.html
> Sent from the ObjectWeb 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
>
>


--
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: Theme not being applied to submissions in nightly build

ncrofts
Hi Erik,

That's right, we are not using a separate deployment, just a handwritten XForms application (not using Form Builder). If I comment out that new condition in the epilogue then our solution works as before when we do a submit.

Is this some how to do with the way we are performing submissions? I didn't think we were doing anything particularly non-standard there, sticking pretty closely to the examples and documentation, but of course it is possible we've inadvertently done something.

Do you know what causes the 'javax.servlet.forward.context_path' to be generated in the response?

Thanks for your help.

Neil
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Theme not being applied to submissions in nightly build

Erik Bruchez-3
Neil,

I had a look at this and I hope I fixed it. For reference, here is the bug:

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

The issue I think was that it was not clear when to apply what theme.
So now the XForms engine keeps a notion of the mode it is running in:

* "plain", e.g. like most Orbeon Forms examples
* "integrated", e.g. with servlet/JSP running within the same web app
* "separate", e.g. with servlet/JSP running outside the web app
* "embedded"

In plain mode, use apps/foobar/theme.xsl or the oxf.epilogue.theme property.

In integrated or separate mode, use the oxf.epilogue.theme.renderer property.

In embedded mode, use apps/foobar/theme-embedded.xsl or the
oxf.epilogue.theme.embedded property.

The new code in the epilogue is meant to be able to pick the mode more
reliably now.

Please let us know if you have a chance to try this.

-Erik

On Fri, Feb 5, 2010 at 1:13 AM, ncrofts <[hidden email]> wrote:

>
> Hi Erik,
>
> That's right, we are not using a separate deployment, just a handwritten
> XForms application (not using Form Builder). If I comment out that new
> condition in the epilogue then our solution works as before when we do a
> submit.
>
> Is this some how to do with the way we are performing submissions? I didn't
> think we were doing anything particularly non-standard there, sticking
> pretty closely to the examples and documentation, but of course it is
> possible we've inadvertently done something.
>
> Do you know what causes the 'javax.servlet.forward.context_path' to be
> generated in the response?
>
> Thanks for your help.
>
> Neil
> --
> View this message in context: http://n4.nabble.com/Theme-not-being-applied-to-submissions-in-nightly-build-tp1460986p1469951.html
> Sent from the ObjectWeb 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
>
>


--
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: Theme not being applied to submissions in nightly build

ncrofts
Hi Erik,

I've just tried the latest nightly build as you suggested and my initial testing indicates that the issue is resolved with the new code which is great news.

Many thanks for your help in resolving this.

Regards,
Neil
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Theme not being applied to submissions in nightly build

Erik Bruchez-3
Neil,

Good to hear! Thanks,

-Erik

On Thu, Feb 25, 2010 at 9:21 AM, ncrofts <[hidden email]> wrote:

>
> Hi Erik,
>
> I've just tried the latest nightly build as you suggested and my initial
> testing indicates that the issue is resolved with the new code which is
> great news.
>
> Many thanks for your help in resolving this.
>
> Regards,
> Neil
> --
> View this message in context: http://n4.nabble.com/Theme-not-being-applied-to-submissions-in-nightly-build-tp1460986p1569363.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
>
>


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