[embjopr-commits] EMBJOPR SVN: r848 - in trunk/jsfunit: src/build/resources and 1 other directory.

embjopr-commits at lists.jboss.org embjopr-commits at lists.jboss.org
Sat Nov 7 00:55:38 EST 2009


Author: ozizka at redhat.com
Date: 2009-11-07 00:55:37 -0500 (Sat, 07 Nov 2009)
New Revision: 848

Added:
   trunk/jsfunit/src/build/resources/switch-web.xml-to-myfaces.xsl
Modified:
   trunk/jsfunit/pom.xml
Log:
 * POM: Created "myfaces" profile which modifies web.xml and adds MyFaces to the dependencies.


Modified: trunk/jsfunit/pom.xml
===================================================================
--- trunk/jsfunit/pom.xml	2009-11-07 05:38:06 UTC (rev 847)
+++ trunk/jsfunit/pom.xml	2009-11-07 05:55:37 UTC (rev 848)
@@ -813,6 +813,73 @@
       </profile>
 
 
+
+
+      <!-- MyFaces - workaround for AS 5.2 w/ JSF 2.0 -->
+      <profile>
+        <id>myfaces</id>
+        <dependencies>
+          <dependency>
+            <groupId>apache-myfaces</groupId>
+            <artifactId>myfaces-api</artifactId>
+            <version>1.2.7</version>
+          </dependency>
+          <dependency>
+            <groupId>apache-myfaces</groupId>
+            <artifactId>myfaces-impl</artifactId>
+            <version>1.2.7</version>
+          </dependency>
+          <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.3</version>
+          </dependency>
+          <dependency>
+            <groupId>apache-discovery</groupId>
+            <artifactId>commons-discovery</artifactId>
+            <version>0.4-brew</version>
+          </dependency>
+        </dependencies>
+
+        <build>
+          <plugins>
+            <!-- TODO: Change web.xml to set up MyFaces instead of RichFaces.
+                 http://fisheye.jboss.org/browse/EMBJOPR/branches/EmbJopr_1_3_3_MyFaces/core/src/main/webapp/WEB-INF/web.xml?r=826-->
+            <plugin>
+              <groupId>org.codehaus.mojo</groupId>
+              <artifactId>xml-maven-plugin</artifactId>
+              <executions>
+                <execution>
+                  <id>switch-web.xml-to-myfaces</id> <goals> <goal>transform</goal> </goals>
+                  <phase>process-resources</phase>
+                  <configuration>
+                    <transformationSets>
+                      <outputDir>${basedir}/testdata</outputDir>
+                      <!-- http://xerces.apache.org/xerces2-j/javadocs/api/javax/xml/transform/Transformer.html#setOutputProperty(java.lang.String,%20java.lang.String) -->
+                      <!-- javax.xml.transform.OutputKeys.INDENT -->
+                      <outputProperties>
+                        <outputProperty> <name>{http://xml.apache.org/xslt}indent-amount</name><value>4</value> </outputProperty>
+                        <outputProperty> <name>indent</name><value>yes</value> </outputProperty>
+                      </outputProperties>
+                      <transformationSet>
+                        <stylesheet>${basedir}/src/build/resources/switch-web.xml-to-myfaces.xslt</stylesheet>
+                        <dir>${project.build.directory}/war/work/org.jboss.jopr/jopr-embedded-jbas5/WEB-INF</dir>
+                        <includes>web.xml</includes>
+                      </transformationSet>
+                    </transformationSets>
+                  </configuration>
+                </execution>
+              </executions>
+            </plugin>
+
+          </plugins>
+        </build>
+      </profile>
+
+
+
+
+
       <!-- Hudson profile (commented out - hesitating to hard-code version dir to pom.xml)
       <profile>
         <id>running-in-hudson</id>
@@ -845,6 +912,10 @@
           <directory>${basedir}/testdata</directory>
           <excludes><exclude>**/*</exclude></excludes>
         </resource>
+        <resource>
+          <directory>${basedir}/src/build/resources</directory>
+          <excludes><exclude>**/*</exclude></excludes>
+        </resource>
       </resources>
 
 

Added: trunk/jsfunit/src/build/resources/switch-web.xml-to-myfaces.xsl
===================================================================
--- trunk/jsfunit/src/build/resources/switch-web.xml-to-myfaces.xsl	                        (rev 0)
+++ trunk/jsfunit/src/build/resources/switch-web.xml-to-myfaces.xsl	2009-11-07 05:55:37 UTC (rev 848)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+    Document   : switch-web.xml-to-myfaces.xsl
+    Author     : Ondra Zizka
+    Description:
+        Modifies web.xml to use MyFaces instead of RichFaces.
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+  <xsl:output method="xml"/>
+
+  <xsl:template match="@*|node()">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()"/>
+    </xsl:copy>
+  </xsl:template>
+
+  <!-- Add org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL after last context-param.  -->
+  <xsl:template match="/web-app/context-param[position()=last()]">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()"/>
+    </xsl:copy>
+    <xsl:comment>
+      This special version of web.xml allows Embedded Jopr to use MyFaces
+      instead of the built-in Mojarra JSF implementaiton.
+    </xsl:comment>
+    <context-param>
+      <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
+      <param-value>true</param-value>
+    </context-param>
+  </xsl:template>
+
+  <!-- Replace RichFaces listener with MyFaces -->
+  <!--  <listener-class>com.sun.faces.config.ConfigureListener</listener-class> -->
+  <xsl:template match="/web-app/listener/listener-class[contains( normalize-space(), 'com.sun.faces.config.ConfigureListener' )]">
+    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
+  </xsl:template>
+
+</xsl:stylesheet>



More information about the embjopr-commits mailing list