[richfaces-issues] [JBoss JIRA] (RF-11909) Custom resource mapping can't simply reuse pre-generated RichFaces resources

Brian Leathem (JIRA) jira-events at lists.jboss.org
Mon Feb 6 13:07:48 EST 2012


    [ https://issues.jboss.org/browse/RF-11909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664569#comment-12664569 ] 

Brian Leathem commented on RF-11909:
------------------------------------

In the docs, let's include mapping jQuery as a specific example, since many will likely search on that keyword.
                
> 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

       



More information about the richfaces-issues mailing list