[JBoss JIRA] Created: (RF-7399) loadstyle does not support xcss files outside the classpath
by Jacques Lemire (JIRA)
loadstyle does not support xcss files outside the classpath
-----------------------------------------------------------
Key: RF-7399
URL: https://jira.jboss.org/jira/browse/RF-7399
Project: RichFaces
Issue Type: Bug
Components: component-a4j-core
Affects Versions: 3.2.2
Environment: winxp, jboss5, seam2.1.1
Reporter: Jacques Lemire
(See the bug I reported on the JBoss Tools jira (https://jira.jboss.org/jira/browse/JBIDE-4500), as the projects they generate load an xcss from a location that is not on the classpath)
I have reported a bug to the JBoss Tools team, as their seam application generator creates a template that tries to load an XCSS from a file location outside the classloader, which does not work. There is a workaround which I guess they will include in their next version, but I have been told to report it here too as a bug. I fully understand that you may consider this bug report a non-issue, but as the documentation for xcss templates is scarce, I do not know what the intended behavior really is.
What I see is that the TemplateCSSRenderer does support to add the base64 suffix to the resource name through "getData", and that is what is being used when it is loaded from the classpath. However, when it is loaded as a StaticResource by the ResourceBuilderImpl, the StaticResource.getUri overrides the InternetResourceBase.getUri. For some reaon, StaticResource.getUri does not call InternetResourceBuilder.getUri, passing getDataToStore(context, data)), so TemplateCSSRenderer.getData never gets called.
<a:loadStyle src="resource:///stylesheet/theme.xcss"/> is rendered as:
<link class='user' rel='stylesheet' type='text/css' href='/scn/stylesheet/theme.xcss' />
If StaticResource did not override the InternetResourceBase.getUri method, it would return a properly suffixed uri which would in turn be sent to the StyleRenderer (see LocalResourceRenderer.encodeToHead), which would render the link tag properly. In turn, that link tag would be recognized by the view handler as an a4j resource and the transformed css would be returned to the browser.
<a:loadStyle src="resource:///stylesheet/theme.xcss"/> should be rendered as:
<link class='user' rel='stylesheet' type='text/css' href='/scn/a4j/s/3_2_2.SR1stylesheet/theme.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__' />
Maybe my diagnostic is wrong, as I do not have time to set my system up to compile and test it, and maybe there are good reasons why static resource do not use the resource's renderer to transform the URL, but you are in a much better position than me to answer these question. Thanks.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 6 months