Uploaded image for project: 'MyFaces Trinidad'
  1. MyFaces Trinidad
  2. TRINIDAD-1466

Support xinclude'd property metadata

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.2.10-plugins
    • Build
    • None

    Description

      Currently the Trinidad plugins support the use of xinclude to pull in component metadata. For example, looking at CoreCommandButton.xml, I see:

      <faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:tr="http://myfaces.apache.org/trinidad"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin"
      xmlns:xhtml="http://www.w3.org/1999/xhtml">
      <component>

      <!-- Snip -->

      <xi:include href="includes/CommonAttrs.xml" xpointer="/faces-config/component/*"/>
      <xi:include href="includes/CoreJSEvents.xml" xpointer="/faces-config/component/*"/>
      <xi:include href="includes/LaunchSource.xml" xpointer="/faces-config/component/*"/>

      <!-- Snip -->

      </faces-config.xml>

      This pulls in component properties from various external sources, making it possible to share component metadata across components.

      I have a case where I would like to include property-specific metadata, eg:

      <faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:tr="http://myfaces.apache.org/trinidad"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin"
      xmlns:xhtml="http://www.w3.org/1999/xhtml">
      <component>

      <property>
      <property-name>Foo</property-name>
      <xi:include href="includes/CommonFoo.xml" xpointer="/faces-config/component/property/*"/>
      </property>

      </faces-config.xml>

      The goal is to define property metadata once and then include this into various property definitions that share common metadata.

      However, this does not currently work. The issue is that FacesConfigParser. addComponentDigesterRules() only provides support for includes that appear within faces-config/component elements:

      // XInclude rules
      digester.setRuleNamespaceURI(XIncludeFilter.XINCLUDE_NAMESPACE);
      digester.addFactoryCreate("faces-config/component/include",
      ComponentIncludeFactory.class);

      Includes underneath faces-config/component/property elements are ignored. This prevents sharing of metadata across property definitions.

      Attachments

        1. TRINIDAD-1466.patch
          6 kB
          Andy Schwartz

        Activity

          People

            matzew Matthias Wessendorf
            andy.schwartz Andy Schwartz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: