Maven-faces-plugin faces-config.xml generation does not allow ViewRoot 
replacement
----------------------------------------------------------------------------------

                 Key: TRINIDAD-1656
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1656
             Project: MyFaces Trinidad
          Issue Type: Bug
          Components: Plugins
    Affects Versions: 1.2.10-plugins 
            Reporter: Andy Schwartz


I am using the maven-faces-plugin (GenerateFacesConfigMojo) to generate my 
faces-config.xml.

Unfortunately, I need to make use of my own UIViewRoot implementation.  As 
such, in my base faces-config.xml file, I explicitly specify a component 
mapping for the javax.faces.ViewRoot component type, eg:

   <component>
      <component-type>javax.faces.ViewRoot</component-type>
      <component-class>org.example.component.SomeViewRoot</component-class>
   </component>

While the maven-faces-plugin passes other component mappings defined my my base 
faces-config.xml file through to the generated file, my javax.faces.ViewRoot 
mapping is ignored due to the following restriction in transform12.xsl:

       <xsl:apply-templates 
select="javaee:component[not(contains(javaee:component-extension/mfp:component-class-modifier/text(),
 'abstract')) and
                                                    
starts-with(javaee:component-type, $typePrefix)]" />

The issue is that only component mappings for component-types that match the 
$typePrefix are accepted.  Normally this is fine, but in this case I need to 
allow a mapping outside of my $typePrefix through.

A one-off fix for this problem that would meet my needs would be to also allow 
javax.faces.ViewRoot component mappings to pass through as well, eg:

       <xsl:apply-templates 
select="javaee:component[not(contains(javaee:component-extension/mfp:component-class-modifier/text(),
 'abstract')) and
          (starts-with(javaee:component-type, $typePrefix) or 
            (contains(javaee:component-type, 'javax.faces.ViewRoot')))]" />

This is a bit hokey, since it special cases a single component type, but seems 
like the least impact/risky change that meet my needs.

Can we implement this solution or something equivalent?


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to