[
https://issues.jboss.org/browse/RF-11909?page=com.atlassian.jira.plugin.s...
]
Lukáš Fryč edited comment on RF-11909 at 1/26/12 1:09 PM:
----------------------------------------------------------
Following *configuration names was renamed* (with backward compatible option to use old
param names):
{{org.richfaces.*resourceMapping*.enabled}} ->
{{org.richfaces.*resourceOptimization*.enabled}}
{{org.richfaces.resourceMapping.compressedStages}} ->
{{org.richfaces.resourceOptimization.compressionStages}}
{{org.richfaces.resourceMapping.packedStages}} ->
{{org.richfaces.resourceOptimization.packagingStages}}
Following *configuration params stay same*:
{{org.richfaces.resourceMapping.mappingFile}}
{{org.richfaces.resourceMapping.location}}
However it is not necessary to set {{org.richfaces.resourceMapping.enabled}} in order to
define custom mappings files.
For defining *custom mapping files*, user needs just to either:
* create {{META-INF/richfaces/static-resource-mappings.properties}} mapping file on
classpath
* create custom file on classpath and configure it's name in
{{org.richfaces.resourceMapping.mappingFile}} (comma separated list of files)
Configurations from mapping files will be applied in *following order* (the last one will
take precedence), it gives user chance to redefine mappings:
* resource loading optimization ({{org.richfaces.resourceMapping.enabled}})
* {{META-INF/richfaces/static-resource-mappings.properties}}
* custom files in {{org.richfaces.resourceMapping.mappingFile}}
was (Author: lfryc):
Following **configuration names was renamed** (with backward compatible option to use
old param names):
{{org.richfaces.*resourceMapping*.enabled}} ->
{{org.richfaces.*resourceLoading.optimization*.enabled}}
{{org.richfaces.resourceMapping.compressedStages}} ->
{{org.richfaces.resourceLoading.optimization.compression.stages}}
{{org.richfaces.resourceMapping.packedStages}} ->
{{org.richfaces.resourceLoading.optimization.packaging.stages}}
Following *configuration params stay same*:
{{org.richfaces.resourceMapping.mappingFile}}
{{org.richfaces.resourceMapping.location}}
However it is not necessary to set {{org.richfaces.resourceMapping.enabled}} in order to
define custom mappings files.
For defining *custom mapping files*, user needs just to either:
* create {{META-INF/richfaces/static-resource-mappings.properties}} mapping file on
classpath
* create custom file on classpath and configure it's name in
{{org.richfaces.resourceMapping.mappingFile}} (comma separated list of files)
Configurations from mapping files will be applied in *following order* (the last one will
take precedence), it gives user chance to redefine mappings:
* resource loading optimization ({{org.richfaces.resourceMapping.enabled}})
* {{META-INF/richfaces/static-resource-mappings.properties}}
* custom files in {{org.richfaces.resourceMapping.mappingFile}}
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