You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ar...@apache.org on 2010/01/07 23:36:13 UTC
svn commit: r897038 - in
/myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin: ./
src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/
src/test/resources/META-INF/maven-faces-plugin/components/trinidad/faces/
Author: arobinson74
Date: Thu Jan 7 22:36:12 2010
New Revision: 897038
URL: http://svn.apache.org/viewvc?rev=897038&view=rev
Log:
Add support for including XML files from inside the component-metadata portion of the faces-config and added support for multiple event-name tags so that they can be imported and later merged
Modified:
myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/pom.xml
myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ComponentBean.java
myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/test/resources/META-INF/maven-faces-plugin/components/trinidad/faces/Command.xml
Modified: myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/pom.xml?rev=897038&r1=897037&r2=897038&view=diff
==============================================================================
--- myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/pom.xml (original)
+++ myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/pom.xml Thu Jan 7 22:36:12 2010
@@ -55,30 +55,23 @@
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
- <version>1.7</version>
- </dependency>
- <dependency>
- <groupId>saxon</groupId>
- <artifactId>saxon</artifactId>
- <version>6.5.3</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>2.6.2</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- <version>1.0.1</version>
- </dependency>
- <dependency>
- <groupId>stax</groupId>
- <artifactId>stax</artifactId>
- <version>1.2.0_rc2-dev</version>
+ <version>1.8.1</version>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.myfaces.trinidadbuild</groupId>
+ <artifactId>maven-jdev-plugin</artifactId>
+ <configuration>
+ <projectHasTests>true</projectHasTests>
+ <testSourceRoots>
+ <file>${project.basedir}/src/test</file>
+ </testSourceRoots>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
</project>
Modified: myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ComponentBean.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ComponentBean.java?rev=897038&r1=897037&r2=897038&view=diff
==============================================================================
--- myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ComponentBean.java (original)
+++ myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ComponentBean.java Thu Jan 7 22:36:12 2010
@@ -322,13 +322,21 @@
public void parseEventNames(String value)
{
- if (value == null)
+ if (value != null)
{
- _eventNames = null;
- }
- else
- {
- _eventNames = value.trim().split("\\s+");
+ String[] names = value.trim().split("\\s+");
+ // combine event names if given more than once (to make importing from another XML file more easy)
+ if (_eventNames == null)
+ {
+ _eventNames = names;
+ }
+ else
+ {
+ String[] currEventNames = _eventNames;
+ _eventNames = new String[_eventNames.length + names.length];
+ System.arraycopy(currEventNames, 0, _eventNames, 0, currEventNames.length);
+ System.arraycopy(names, 0, _eventNames, currEventNames.length, names.length);
+ }
}
}
Modified: myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java?rev=897038&r1=897037&r2=897038&view=diff
==============================================================================
--- myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java (original)
+++ myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java Thu Jan 7 22:36:12 2010
@@ -84,7 +84,7 @@
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setNamespaceAware(true);
// requires JAXP 1.3, in JavaSE 5.0
- // spf.setXIncludeAware(true);
+ //spf.setXIncludeAware(true);
Digester digester = new Digester(spf.newSAXParser());
digester.setNamespaceAware(true);
@@ -229,6 +229,10 @@
ComponentIncludeFactory.class);
digester.addFactoryCreate("faces-config/component/property/include",
ComponentPropertyIncludeFactory.class);
+ digester.addFactoryCreate("faces-config/component/component-extension/include",
+ ComponentIncludeFactory.class);
+ digester.addFactoryCreate("faces-config/component/component-extension/component-metadata/include",
+ ComponentIncludeFactory.class);
}
// Add component property-related digster rules
Modified: myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/test/resources/META-INF/maven-faces-plugin/components/trinidad/faces/Command.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/test/resources/META-INF/maven-faces-plugin/components/trinidad/faces/Command.xml?rev=897038&r1=897037&r2=897038&view=diff
==============================================================================
--- myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/test/resources/META-INF/maven-faces-plugin/components/trinidad/faces/Command.xml (original)
+++ myfaces/trinidad-maven/branches/2.0.x-branch/maven-faces-plugin/src/test/resources/META-INF/maven-faces-plugin/components/trinidad/faces/Command.xml Thu Jan 7 22:36:12 2010
@@ -16,35 +16,35 @@
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-
+
-->
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:af="http://myfaces.apache.org/trinidad"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:md="http://myfaces.apache.org/bali/xml/metadata"
- xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin" >
+ xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin">
+
+ <component>
- <component>
-
<component-type>org.apache.myfaces.trinidad.Command</component-type>
<component-class>org.apache.myfaces.trinidad.component.UIXCommand</component-class>
<description>
A base abstraction for components that implement ActionSource.
</description>
-
+
<xi:include href="TestInclude.xml" xpointer="/faces-config/component/*"></xi:include>
<property>
<property-name>action</property-name>
<property-class>javax.faces.el.MethodBinding</property-class>
<description><![CDATA[
-
+
The reference to the Java method that will be invoked when
an ActionEvent is broadcast by this component. The method
signature takes a single ActionEvent parameter and returns
void.
-
+
Test to make sure that markup in a pre block is escaped.
<pre>
<af:commandButton />
@@ -53,7 +53,7 @@
<af:commandButton />
</pre>
- ]]>
+ ]]>
</description>
<property-extension>
<mfp:state-holder>true</mfp:state-holder>
@@ -70,12 +70,12 @@
<property-name>actionListener</property-name>
<property-class>javax.faces.el.MethodBinding</property-class>
<description><![CDATA[
-
+
The reference to the Java method that will be invoked when
an ActionEvent is broadcast by this component. The method
signature takes a single ActionEvent parameter and returns
void.
- ]]>
+ ]]>
</description>
<property-extension>
<mfp:state-holder>true</mfp:state-holder>
@@ -110,11 +110,11 @@
<property>
<property-name>immediate</property-name>
<property-class>boolean</property-class>
- <description>a reference to an action method sent by the command component,
- or the static outcome of an action. When immediate is true, the
- default ActionListener provided by the JavaServer Faces implementation
- should be executed during Apply Request Values phase of the request
- processing lifecycle, rather than waiting until the Invoke Application
+ <description>a reference to an action method sent by the command component,
+ or the static outcome of an action. When immediate is true, the
+ default ActionListener provided by the JavaServer Faces implementation
+ should be executed during Apply Request Values phase of the request
+ processing lifecycle, rather than waiting until the Invoke Application
phase.
</description>
<property-extension>
@@ -123,11 +123,11 @@
</property>
<property>
- <description><![CDATA[the visibility of the component. If it is "false", the component will
- be hidden on the client. Unlike "rendered", this does not affect the lifecycle on the server
- - the component may have its bindings executed, etc. - and the visibility of the component can
- be toggled on and off on the client, or toggled with PPR. When "rendered" is false, the
- component will not in any way be rendered, and cannot be made visible on the client.
+ <description><![CDATA[the visibility of the component. If it is "false", the component will
+ be hidden on the client. Unlike "rendered", this does not affect the lifecycle on the server
+ - the component may have its bindings executed, etc. - and the visibility of the component can
+ be toggled on and off on the client, or toggled with PPR. When "rendered" is false, the
+ component will not in any way be rendered, and cannot be made visible on the client.
In most cases, use the "rendered" property instead of the "visible" property.]]>
</description>
<property-name>visible</property-name>
@@ -137,7 +137,7 @@
<mfp:required>false</mfp:required>
<mfp:unsupported-render-kits>org.apache.myfaces.trinidad.core</mfp:unsupported-render-kits>
<mfp:property-metadata>
- <mfp:deprecated>The "visible" attribute has been deprecated.
+ <mfp:deprecated>The "visible" attribute has been deprecated.
Use the af:showPopupBehavior tag or the show/hide methods on the popup client component.
</mfp:deprecated>
<mfp:no-op/>