Cannot change the theme on an app

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

Cannot change the theme on an app

Rod Glover
I hope this does not turn out to be my second "duh" moment in 24 hours. According to the this FAQ documentation, and echoed by the configuration properties documentation, I should be able to apply a different theme to my forms by changing the oxf.epilogue.theme property. Following the suggestion in the first link above, I added this tag to WEB-INF/resources/config/properties-local.xml:
<property as="xs:anyURI" name="oxf.epilogue.theme" value="oxf:/config/theme-plain.xsl"/>
Nothing changed. Not on any hand coded forms, and not on a form created with Form Builder. Question 1: What am I missing here? From reading this community discussion thread, and in the comments in WEB-INF/resources/config/theme-plain.xsl, I understood that I could define my own theme per app by dropping a theme.xsl file into the app root directory, e.g., into WEB-INF/resources/apps/my-app/. I copied the file theme-plain.xsl into my app directory and renamed it theme.xsl. This also produced no effect. I assume that if this had worked, I would see a very plain page without the automatically inserted Orbeon-themed navigation area at the top of the page. Question 2: see Question 1.
Rod Glover
Senior Consultant
Vivid Solutions, Inc.
Reply | Threaded
Open this post in threaded view
|

Re: Cannot change the theme on an app

Alessandro  Vernet
Administrator
Hi Rod,

I am trying this here, and it seems to work for me. When accessing http://localhost:8080/orbeon/xforms-hello/, I see (cropped screenshot):



But after adding <property as="xs:anyURI" name="oxf.epilogue.theme" value="oxf:/config/theme-plain.xsl"/> to my properties-local.xml, I see:



Note that HTML that should be hidden still shows because of a missing "orbeon" class on the body element. See issue https://github.com/orbeon/orbeon-forms/issues/877. For now, you need to add that class yourself, either in your XForms document, or in your style.

Could you try this again and see if this couldn't be a caching issue with the browser? Or with Orbeon (i.e. does it work after restarting Tomcat? here I could just change the property and didn't have to restart).

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Cannot change the theme on an app

Rod Glover
Hi Alex,

Your timing could not have been better. I just reinstalled Orbeon 4.0.1 (in Apache Tomcat) and walked through the installation procedure as documented.

After installing, ran the Hello World app. Worked fine.

Created properties-local.xml and added the oxf.epilogue.theme property as described (set to "oxf:/config/theme-plain.xs").

Refreshed Hello World in my browser (Chrome). No change (still on example theme).

Restarted Tomcat. Now I see the plain theme, with the errant HTML.

Changed property to "oxf:/config/theme-example.xs". Open Hello World in IE9. In IE9 see the expected example theme.

Try refreshing in Chrome again, still on plain theme! Try manually clearing the cache in Chrome and refreshing, still on plain theme.

Change property back to plain theme. Refresh in IE. Still on example theme! Clear IE cache manually and refresh. Still on example theme. Interesting ... in one browser I am stuck on one theme, in the other on a different one.

Restart Tomcat. Refresh both browsers. On plain theme as expected in both browsers. Change to example theme, restart Tomcat, refresh browsers. On example theme in both browsers.

Conclusion: Symptoms suggest the browsers are at fault (but both Chrome and IE9??). They seem to load the xforms transformation only once. But I could be wrong about this.

Restarting Tomcat is a drag but not a show-stopper, thank goodness. I'd be interested to hear (read) any thoughts on this problem.

Alessandro Vernet wrote
Hi Rod,

I am trying this here, and it seems to work for me. When accessing http://localhost:8080/orbeon/xforms-hello/, I see (cropped screenshot):



But after adding <property as="xs:anyURI" name="oxf.epilogue.theme" value="oxf:/config/theme-plain.xsl"/> to my properties-local.xml, I see:



Note that HTML that should be hidden still shows because of a missing "orbeon" class on the body element. See issue https://github.com/orbeon/orbeon-forms/issues/877. For now, you need to add that class yourself, either in your XForms document, or in your style.

Could you try this again and see if this couldn't be a caching issue with the browser? Or with Orbeon (i.e. does it work after restarting Tomcat? here I could just change the property and didn't have to restart).

Alex
Rod Glover
Senior Consultant
Vivid Solutions, Inc.
Reply | Threaded
Open this post in threaded view
|

Re: Cannot change the theme on an app

Rod Glover
On second thought, I don't know enough to diagnose the location of the problem. Over to you.

Rod Glover wrote
Hi Alex,

Your timing could not have been better. I just reinstalled Orbeon 4.0.1 (in Apache Tomcat) and walked through the installation procedure as documented.

After installing, ran the Hello World app. Worked fine.

Created properties-local.xml and added the oxf.epilogue.theme property as described (set to "oxf:/config/theme-plain.xs").

Refreshed Hello World in my browser (Chrome). No change (still on example theme).

Restarted Tomcat. Now I see the plain theme, with the errant HTML.

Changed property to "oxf:/config/theme-example.xs". Open Hello World in IE9. In IE9 see the expected example theme.

Try refreshing in Chrome again, still on plain theme! Try manually clearing the cache in Chrome and refreshing, still on plain theme.

Change property back to plain theme. Refresh in IE. Still on example theme! Clear IE cache manually and refresh. Still on example theme. Interesting ... in one browser I am stuck on one theme, in the other on a different one.

Restart Tomcat. Refresh both browsers. On plain theme as expected in both browsers. Change to example theme, restart Tomcat, refresh browsers. On example theme in both browsers.

Conclusion: Symptoms suggest the browsers are at fault (but both Chrome and IE9??). They seem to load the xforms transformation only once. But I could be wrong about this.

Restarting Tomcat is a drag but not a show-stopper, thank goodness. I'd be interested to hear (read) any thoughts on this problem.

Alessandro Vernet wrote
Hi Rod,

I am trying this here, and it seems to work for me. When accessing http://localhost:8080/orbeon/xforms-hello/, I see (cropped screenshot):



But after adding <property as="xs:anyURI" name="oxf.epilogue.theme" value="oxf:/config/theme-plain.xsl"/> to my properties-local.xml, I see:



Note that HTML that should be hidden still shows because of a missing "orbeon" class on the body element. See issue https://github.com/orbeon/orbeon-forms/issues/877. For now, you need to add that class yourself, either in your XForms document, or in your style.

Could you try this again and see if this couldn't be a caching issue with the browser? Or with Orbeon (i.e. does it work after restarting Tomcat? here I could just change the property and didn't have to restart).

Alex
Rod Glover
Senior Consultant
Vivid Solutions, Inc.
Reply | Threaded
Open this post in threaded view
|

Re: Cannot change the theme on an app

Alessandro  Vernet
Administrator
In reply to this post by Rod Glover
Hi Rod,

It's hard to say without being able to reproduce the problem. I'd really need to reproduce the issue, and look in details at the HTTP request sent by the browser and response from Orbeon Forms (with a tool like Charles, see link below), and possibly debug code Orbeon Forms if the browser request seems legit but there are cases where the server still produces an "old" page.

http://blog.orbeon.com/2013/04/let-charles-help-you-monitor-http.html

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Cannot change the theme on an app

Rod Glover
Hi Alex,

If I could squeeze out the time to do it (an open question at the moment), would you be interested in seeing logs from Charles? I suspect debugging at second hand would not be great, but if this would help you and I can find the time to set it up, I am willing to do it.
Rod Glover
Senior Consultant
Vivid Solutions, Inc.
Reply | Threaded
Open this post in threaded view
|

Re: Cannot change the theme on an app

Alessandro  Vernet
Administrator
Hi Rod,

Certainly, I'll have a look at the Charles session you saved, even if, as you said, second-hand debugging isn't always satisfying experience ;).

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet