[
https://issues.jboss.org/browse/RF-11909?page=com.atlassian.jira.plugin.s...
]
Lukáš Fryč updated RF-11909:
----------------------------
Description:
Custom resource mapping can't simply reuse pre-generated RichFaces resources.
Use case:
* user wants to use resource mapping for several purposes
** using RichFaces pre-generated resources in
{{richfaces-components-ui.jar/META-INF/resources/org.richfaces.staticResources/<version>/...}}
** using custom mappings like {{javax.faces:jsf.js=patched-jsf.js}} using e.g.
{{my.war/resources/patched-jsf.js}}
----
With {{4.1.0.Final}}, configuration of {{org.richfaces.resourceMapping.location}} is by
default referring to root of packed resources:
{code}#{facesContext.externalContext.requestContextPath}/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/#{a4j.version.implementationVersion}/%Features%/#{resourceLocation}
{code}
and mapping file looks like:
{code}
jquery.js=jquery.js
{code}
When you want to reuse RichFaces mappings, you [need to copy mapping file from
{{richfaces-component-ui.jar}}|http://docs.jboss.org/richfaces/latest_4_X/Developer_Guide/en-US/html/chap-Developer_Guide-Advanced_features.html#d0e1692]
and extend it by custom properties.
and additionally you need to place custom resources to directory called specifically for
RF, like:
{code}
my.war/resources/org.richfaces.staticResource/4.1.0.Final/PackedCompressed/patched-jsf.js
{code}
Other options:
* change all mappings in {{custom-mappings.properties}} at own
* copy all resources from {{richfaces-component-ui.jar}} to own location
----
For simplification, I suggest default resource mapping location root be
{code}
#{facesContext.externalContext.requestContextPath}/org.richfaces.resources/javax.faces.resource/#{resourceLocation}
{code}
so it would refer to JSF resources root ({{my.war/resources}} or
{{some.jar/META-INF/resources}}) by default.
Then, we would force {{richfaces-components-ui.jar}} to define mappings which points from
JSF resources root, e.g.:
{code}
jquery.js=org.richfaces.staticResource/4.1.0.Final/PackedCompressed/jquery.js
{code}
----
Additionally, Brian suggested support for multiple {{mapping.properties}} files, so their
content will be merged.
It means user won't be forced to copy&paste RichFaces mapping configuration from
{{richfaces-components-ui.jar}}.
----
Finally, the only thing user would need to define is:
{code:XML|title=web.xml}
<context-param>
<param-name>org.richfaces.resourceMapping.mappingFile</param-name>
<param-value>META-INF/custom-mapping.properties</param-value>
</context-param>
{code}
{code:title=META-INF/custom-mapping.properties}
javax.faces:jsf.js=patched-jsf.js
{code}
was:
Following configuration of location is needed:
{code}
<context-param>
<param-name>org.richfaces.resourceMapping.location</param-name>
<param-value>#{facesContext.externalContext.requestContextPath}/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/#{a4j.version.implementationVersion}/%Features%/#{resourceLocation}</param-value>
</context-param>
{code}
But that means you need to place custom resources to directory called specifically for
RF:
{code}
${WAR}/resources/org.richfaces.staticResource/4.1.0.Final/Packed/.
{code}
Forum Reference:
https://community.jboss.org/message/647859#647859 (was:
https://community.jboss.org/message/647859#647859)
Custom resource mapping can't simply reuse pre-generated
RichFaces resources
----------------------------------------------------------------------------
Key: RF-11909
URL:
https://issues.jboss.org/browse/RF-11909
Project: RichFaces
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: core
Affects Versions: 4.1.0.Final
Reporter: Lukáš Fryč
Assignee: Lukáš Fryč
Fix For: 4.2.0.CR1
Custom resource mapping can't simply reuse pre-generated RichFaces resources.
Use case:
* user wants to use resource mapping for several purposes
** using RichFaces pre-generated resources in
{{richfaces-components-ui.jar/META-INF/resources/org.richfaces.staticResources/<version>/...}}
** using custom mappings like {{javax.faces:jsf.js=patched-jsf.js}} using e.g.
{{my.war/resources/patched-jsf.js}}
----
With {{4.1.0.Final}}, configuration of {{org.richfaces.resourceMapping.location}} is by
default referring to root of packed resources:
{code}#{facesContext.externalContext.requestContextPath}/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/#{a4j.version.implementationVersion}/%Features%/#{resourceLocation}
{code}
and mapping file looks like:
{code}
jquery.js=jquery.js
{code}
When you want to reuse RichFaces mappings, you [need to copy mapping file from
{{richfaces-component-ui.jar}}|http://docs.jboss.org/richfaces/latest_4_X/Developer_Guide/en-US/html/chap-Developer_Guide-Advanced_features.html#d0e1692]
and extend it by custom properties.
and additionally you need to place custom resources to directory called specifically for
RF, like:
{code}
my.war/resources/org.richfaces.staticResource/4.1.0.Final/PackedCompressed/patched-jsf.js
{code}
Other options:
* change all mappings in {{custom-mappings.properties}} at own
* copy all resources from {{richfaces-component-ui.jar}} to own location
----
For simplification, I suggest default resource mapping location root be
{code}
#{facesContext.externalContext.requestContextPath}/org.richfaces.resources/javax.faces.resource/#{resourceLocation}
{code}
so it would refer to JSF resources root ({{my.war/resources}} or
{{some.jar/META-INF/resources}}) by default.
Then, we would force {{richfaces-components-ui.jar}} to define mappings which points from
JSF resources root, e.g.:
{code}
jquery.js=org.richfaces.staticResource/4.1.0.Final/PackedCompressed/jquery.js
{code}
----
Additionally, Brian suggested support for multiple {{mapping.properties}} files, so their
content will be merged.
It means user won't be forced to copy&paste RichFaces mapping configuration from
{{richfaces-components-ui.jar}}.
----
Finally, the only thing user would need to define is:
{code:XML|title=web.xml}
<context-param>
<param-name>org.richfaces.resourceMapping.mappingFile</param-name>
<param-value>META-INF/custom-mapping.properties</param-value>
</context-param>
{code}
{code:title=META-INF/custom-mapping.properties}
javax.faces:jsf.js=patched-jsf.js
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira