You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2009/12/09 01:44:33 UTC
svn commit: r888664 [1/5] - in /myfaces/tomahawk/trunk: ./ core/
core/src/main/resources-filtered/ core/src/main/resources-filtered/org/
core/src/main/resources-filtered/org/apache/
core/src/main/resources-filtered/org/apache/myfaces/ core/src/main/res...
Author: lu4242
Date: Wed Dec 9 00:44:27 2009
New Revision: 888664
URL: http://svn.apache.org/viewvc?rev=888664&view=rev
Log:
TOMAHAWK-1470 Setup tomahawk core and sandbox code module for JSF 2.0
Added:
myfaces/tomahawk/trunk/core/src/main/resources-filtered/
myfaces/tomahawk/trunk/core/src/main/resources-filtered/org/
myfaces/tomahawk/trunk/core/src/main/resources-filtered/org/apache/
myfaces/tomahawk/trunk/core/src/main/resources-filtered/org/apache/myfaces/
myfaces/tomahawk/trunk/core/src/main/resources-filtered/org/apache/myfaces/renderkit/
myfaces/tomahawk/trunk/core/src/main/resources-filtered/org/apache/myfaces/renderkit/html/
myfaces/tomahawk/trunk/core/src/main/resources-filtered/org/apache/myfaces/renderkit/html/util/
myfaces/tomahawk/trunk/core/src/main/resources-filtered/org/apache/myfaces/renderkit/html/util/AddResource.properties
myfaces/tomahawk/trunk/core20/ (with props)
myfaces/tomahawk/trunk/core20/pom.xml
myfaces/tomahawk/trunk/core20/src/
myfaces/tomahawk/trunk/core20/src/main/
myfaces/tomahawk/trunk/core20/src/main/conf/
myfaces/tomahawk/trunk/core20/src/main/conf/META-INF/
myfaces/tomahawk/trunk/core20/src/main/conf/META-INF/facelets-taglib-base.xml
myfaces/tomahawk/trunk/core20/src/main/conf/META-INF/faces-config-base.xml
myfaces/tomahawk/trunk/core20/src/main/conf/META-INF/tomahawk-base.tld
myfaces/tomahawk/trunk/core20/src/main/java/
myfaces/tomahawk/trunk/core20/src/main/java/org/
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/aliasbean/
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeanTagHandler.java
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeansScopeTagHandler.java
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/facelets/
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/facelets/tag/
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/facelets/tag/MethodRule.java
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/schedule/
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/schedule/ScheduleTagHandler.java
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tabbedpane/
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tabbedpane/HtmlPanelTabbedPaneTagHandler.java
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tabbedpane/TabChangeListenerTagHandler.java
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree/
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree/taglib/
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree/taglib/IconProviderTagHandler.java
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree/taglib/TreeSelectionListenerTagHandler.java
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree/taglib/TreeTagHandler.java
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/updateactionlistener/
myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/updateactionlistener/UpdateActionListenerTagHandler.java
myfaces/tomahawk/trunk/core20/src/main/resources/
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/LICENSE.txt
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/NOTICE.txt
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/componentClass12.vm
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/facelets-taglib.vm
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/faces-config12.vm
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/licenses/
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/licenses/dojo-LICENSE.TXT
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/licenses/i18n-LICENSE.txt
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/licenses/jscookmenu-LICENSE.txt
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/licenses/kupu-LICENSE.txt
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/licenses/prototype-LICENSE.txt
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/licenses/scriptaculous-LICENSE.txt
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/tagClass12.vm
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/tagConverterClass12.vm
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/tagValidatorClass12.vm
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/tomahawk12.vm
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/validatorClass12.vm
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/xdoc-component.vm
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/xdoc-converter.vm
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/xdoc-tag.vm
myfaces/tomahawk/trunk/core20/src/main/resources/META-INF/xdoc-validator.vm
myfaces/tomahawk/trunk/core20/src/test/
myfaces/tomahawk/trunk/core20/src/test/java/
myfaces/tomahawk/trunk/core20/src/test/resources/
myfaces/tomahawk/trunk/sandbox/core20/ (with props)
myfaces/tomahawk/trunk/sandbox/core20/pom.xml
myfaces/tomahawk/trunk/sandbox/core20/src/
myfaces/tomahawk/trunk/sandbox/core20/src/main/
myfaces/tomahawk/trunk/sandbox/core20/src/main/conf/
myfaces/tomahawk/trunk/sandbox/core20/src/main/conf/META-INF/
myfaces/tomahawk/trunk/sandbox/core20/src/main/conf/META-INF/facelets-taglib-base.xml
myfaces/tomahawk/trunk/sandbox/core20/src/main/conf/META-INF/faces-config-base.xml
myfaces/tomahawk/trunk/sandbox/core20/src/main/conf/META-INF/myfaces_sandbox-base.tld
myfaces/tomahawk/trunk/sandbox/core20/src/main/java/
myfaces/tomahawk/trunk/sandbox/core20/src/main/java/org/
myfaces/tomahawk/trunk/sandbox/core20/src/main/java/org/apache/
myfaces/tomahawk/trunk/sandbox/core20/src/main/java/org/apache/myfaces/
myfaces/tomahawk/trunk/sandbox/core20/src/main/java/org/apache/myfaces/custom/
myfaces/tomahawk/trunk/sandbox/core20/src/main/java/org/apache/myfaces/custom/ajaxchildcombobox/
myfaces/tomahawk/trunk/sandbox/core20/src/main/java/org/apache/myfaces/custom/ajaxchildcombobox/AjaxChildComboBoxTagHandler.java
myfaces/tomahawk/trunk/sandbox/core20/src/main/java/org/apache/myfaces/custom/suggestajax/
myfaces/tomahawk/trunk/sandbox/core20/src/main/java/org/apache/myfaces/custom/suggestajax/inputsuggestajax/
myfaces/tomahawk/trunk/sandbox/core20/src/main/java/org/apache/myfaces/custom/suggestajax/inputsuggestajax/InputSuggestAjaxTagHandler.java
myfaces/tomahawk/trunk/sandbox/core20/src/main/java/org/apache/myfaces/custom/suggestajax/tablesuggestajax/
myfaces/tomahawk/trunk/sandbox/core20/src/main/java/org/apache/myfaces/custom/suggestajax/tablesuggestajax/TableSuggestAjaxTagHandler.java
myfaces/tomahawk/trunk/sandbox/core20/src/main/resources/
myfaces/tomahawk/trunk/sandbox/core20/src/main/resources/META-INF/
myfaces/tomahawk/trunk/sandbox/core20/src/main/resources/META-INF/LICENSE.txt
myfaces/tomahawk/trunk/sandbox/core20/src/main/resources/META-INF/NOTICE.txt
myfaces/tomahawk/trunk/sandbox/core20/src/main/resources/META-INF/componentClass12.vm
myfaces/tomahawk/trunk/sandbox/core20/src/main/resources/META-INF/facelets-taglib.vm
myfaces/tomahawk/trunk/sandbox/core20/src/main/resources/META-INF/faces-config12.vm
myfaces/tomahawk/trunk/sandbox/core20/src/main/resources/META-INF/licenses/
myfaces/tomahawk/trunk/sandbox/core20/src/main/resources/META-INF/licenses/i18n-LICENSE.txt
myfaces/tomahawk/trunk/sandbox/core20/src/main/resources/META-INF/licenses/iText-LICENSE.txt
myfaces/tomahawk/trunk/sandbox/core20/src/main/resources/META-INF/licenses/jscookmenu-LICENSE.txt
myfaces/tomahawk/trunk/sandbox/core20/src/main/resources/META-INF/licenses/kupu-LICENSE.txt
myfaces/tomahawk/trunk/sandbox/core20/src/main/resources/META-INF/licenses/prototype-LICENSE.txt
myfaces/tomahawk/trunk/sandbox/core20/src/main/resources/META-INF/licenses/scriptaculous-LICENSE.txt
myfaces/tomahawk/trunk/sandbox/core20/src/main/resources/META-INF/tagClass12.vm
myfaces/tomahawk/trunk/sandbox/core20/src/main/resources/META-INF/tagConverterClass12.vm
myfaces/tomahawk/trunk/sandbox/core20/src/main/resources/META-INF/tagValidatorClass12.vm
myfaces/tomahawk/trunk/sandbox/core20/src/main/resources/META-INF/tomahawk12.vm
myfaces/tomahawk/trunk/sandbox/core20/src/main/resources/META-INF/validatorClass12.vm
Removed:
myfaces/tomahawk/trunk/core/src/main/resources/org/apache/myfaces/renderkit/html/util/
Modified:
myfaces/tomahawk/trunk/core/pom.xml
myfaces/tomahawk/trunk/core12/pom.xml
myfaces/tomahawk/trunk/examples/pom.xml
myfaces/tomahawk/trunk/pom.xml
myfaces/tomahawk/trunk/sandbox/core/pom.xml
myfaces/tomahawk/trunk/sandbox/core12/pom.xml
myfaces/tomahawk/trunk/sandbox/pom.xml
Modified: myfaces/tomahawk/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/pom.xml?rev=888664&r1=888663&r2=888664&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/pom.xml (original)
+++ myfaces/tomahawk/trunk/core/pom.xml Wed Dec 9 00:44:27 2009
@@ -126,12 +126,6 @@
<version>1.6-1</version>
</dependency>
- <dependency>
- <groupId>com.lowagie</groupId>
- <artifactId>itext</artifactId>
- <version>1.4.8</version>
- </dependency>
-
<!-- provided dependencies -->
<dependency>
@@ -299,18 +293,27 @@
</excludes>
</resource>
<resource>
+ <directory>src/main/resources-filtered</directory>
+ <filtering>true</filtering>
+ </resource>
+
+ <!--
+ <resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
+ -->
<!-- Used in the resources URL, to enable caching the
resources on the client.
See MyfacesResourceLoader.getLastModified() -->
+ <!--
<include>**/AddResource.properties</include>
</includes>
<excludes>
<exclude>**/*.vm</exclude>
</excludes>
</resource>
+ -->
<!--
<resource>
<directory>src/main/resources-facesconfig</directory>
@@ -489,7 +492,7 @@
<artifactItem>
<groupId>org.apache.myfaces.shared</groupId>
<artifactId>myfaces-shared-tomahawk</artifactId>
- <version>${myfaces-shared.version}</version>
+ <version>${myfaces-shared11-version}</version>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
@@ -508,7 +511,7 @@
<artifactItem>
<groupId>org.apache.myfaces.shared</groupId>
<artifactId>myfaces-shared-tomahawk</artifactId>
- <version>${myfaces-shared.version}</version>
+ <version>${myfaces-shared11-version}</version>
<classifier>sources</classifier>
</artifactItem>
</artifactItems>
@@ -551,6 +554,14 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.4</source>
+ <target>1.4</target>
+ </configuration>
+ </plugin>
</plugins>
</build>
Added: myfaces/tomahawk/trunk/core/src/main/resources-filtered/org/apache/myfaces/renderkit/html/util/AddResource.properties
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/resources-filtered/org/apache/myfaces/renderkit/html/util/AddResource.properties?rev=888664&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/resources-filtered/org/apache/myfaces/renderkit/html/util/AddResource.properties (added)
+++ myfaces/tomahawk/trunk/core/src/main/resources-filtered/org/apache/myfaces/renderkit/html/util/AddResource.properties Wed Dec 9 00:44:27 2009
@@ -0,0 +1,3 @@
+# Used in the resources URL, to enable caching the resources on the client.
+# See MyfacesResourceLoader.getLastModified()
+lastModified=${tomahawk.lastModified}
Modified: myfaces/tomahawk/trunk/core12/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core12/pom.xml?rev=888664&r1=888663&r2=888664&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core12/pom.xml (original)
+++ myfaces/tomahawk/trunk/core12/pom.xml Wed Dec 9 00:44:27 2009
@@ -118,12 +118,6 @@
<artifactId>batik-awt-util</artifactId>
<version>1.6-1</version>
</dependency>
-
- <dependency>
- <groupId>com.lowagie</groupId>
- <artifactId>itext</artifactId>
- <version>1.4.8</version>
- </dependency>
<!--
<dependency>
Propchange: myfaces/tomahawk/trunk/core20/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Dec 9 00:44:27 2009
@@ -0,0 +1,10 @@
+*.iml
+*.ipr
+*.iws
+*.jdbc
+.classpath
+.externalToolBuilders
+.project
+.settings
+maven-eclipse.xml
+target
Added: myfaces/tomahawk/trunk/core20/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/pom.xml?rev=888664&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/pom.xml (added)
+++ myfaces/tomahawk/trunk/core20/pom.xml Wed Dec 9 00:44:27 2009
@@ -0,0 +1,785 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.myfaces.tomahawk</groupId>
+ <artifactId>tomahawk20</artifactId>
+ <packaging>jar</packaging>
+ <name>Tomahawk 2.0 Core</name>
+ <description>
+ JSF components and utilities that can be used with any JSF implementation.
+ This library is based on the JSF1.1 version of Tomahawk, but with minor source code and build
+ changes to take advantage of JSF2.0 features. A JSF2.0 implementation is required to use this
+ version of the Tomahawk library.
+ </description>
+
+ <parent>
+ <groupId>org.apache.myfaces.tomahawk</groupId>
+ <artifactId>tomahawk-project</artifactId>
+ <version>1.1.10-SNAPSHOT</version>
+ </parent>
+
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/myfaces/tomahawk/trunk/core20</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/myfaces/tomahawk/trunk/core20</developerConnection>
+ <url>http://svn.apache.org/viewcvs.cgi/myfaces/tomahawk/trunk/core20</url>
+ </scm>
+
+ <dependencies>
+
+ <!-- compile dependencies -->
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
+ <scope>compile</scope>
+ </dependency>
+
+
+ <dependency>
+ <groupId>commons-validator</groupId>
+ <artifactId>commons-validator</artifactId>
+ <version>1.3.1</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>1.2.1</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- Transitive dependency from commons-fileupload.
+ in 2.0 it was declared optional, but t:inputFileUpload
+ uses it indirectly, so it is necessary to include it
+ in our pom as runtime dependency -->
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.3.2</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2.1</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>struts</groupId>
+ <artifactId>struts</artifactId>
+ <version>1.2.9</version>
+ <scope>compile</scope>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tiles</groupId>
+ <artifactId>tiles-core</artifactId>
+ <version>2.0.6</version>
+ <scope>compile</scope>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.3</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>oro</groupId>
+ <artifactId>oro</artifactId>
+ <version>2.0.8</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.4</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.2</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>batik</groupId>
+ <artifactId>batik-awt-util</artifactId>
+ <version>1.6-1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.lowagie</groupId>
+ <artifactId>itext</artifactId>
+ <version>1.4.8</version>
+ </dependency>
+
+ <!--
+ <dependency>
+ <groupId>org.apache.myfaces.commons</groupId>
+ <artifactId>myfaces-validators</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+ -->
+ <!-- provided dependencies -->
+
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>${myfaces-core20-version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.shared</groupId>
+ <artifactId>myfaces-shared-tomahawk</artifactId>
+ <version>${myfaces-shared20-version}</version>
+ <scope>provided</scope> <!-- because we add all classes to the jar directly -->
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>portlet-api</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.buildtools</groupId>
+ <artifactId>myfaces-builder-annotations</artifactId>
+ <version>1.0.4</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!--
+ <dependency>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ -->
+
+ <!-- test dependencies -->
+
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <version>${myfaces-core20-version}</version>
+ <!--
+ Since Tomahawk must stay compatible to other JSF implementations we
+ must not have any (compile time) dependency on myfaces-impl other than
+ test classes.
+ -->
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
+ <version>1.5.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>cactus</groupId>
+ <artifactId>cactus</artifactId>
+ <version>13-1.7.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>1.5.4</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>easymock</groupId>
+ <artifactId>easymock</artifactId>
+ <version>1.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>easymock</groupId>
+ <artifactId>easymockclassextension</artifactId>
+ <version>1.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.shale</groupId>
+ <artifactId>shale-test</artifactId>
+ <version>1.0.4</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.myfaces</groupId>
+ <artifactId>myfaces-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.myfaces</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>myfaces</groupId>
+ <artifactId>myfaces-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>myfaces</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>jmock</groupId>
+ <artifactId>jmock</artifactId>
+ <version>1.0.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>jmock</groupId>
+ <artifactId>jmock-cglib</artifactId>
+ <version>1.0.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>maven-taglib</groupId>
+ <artifactId>maven-taglib-plugin</artifactId>
+ <version>1.4.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <excludes>
+ <exclude>**/*.vm</exclude>
+ </excludes>
+ </resource>
+ <!--
+ <resource>
+ <directory>src/main/resources-facesconfig</directory>
+ </resource>
+ -->
+ <resource>
+ <directory>target/tomahawk12_resources</directory>
+ </resource>
+ </resources>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <X-Compile-Source-JDK>1.5</X-Compile-Source-JDK>
+ <X-Compile-Target-JDK>1.5</X-Compile-Target-JDK>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <!--
+ - Add two new source directories to the compile path. Other plugins will write files into
+ - those directories. Note that when building the source jars, these directories are
+ - automatically used too.
+ -
+ - * shared_sources: contains code from the 2.0.x branch of the myfaces-shared project
+ - * tomahawk12_sources: contains all the source code from the "main" branch of tomahawk,
+ - which is written to be JSF1.1-compatible.
+ -->
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <!-- <phase>process-sources</phase> -->
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>
+ ${project.build.directory}/shared_sources
+ </source>
+ <source>
+ ${project.build.directory}/tomahawk12_sources
+ </source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.myfaces.buildtools</groupId>
+ <artifactId>myfaces-builder-plugin</artifactId>
+ <version>1.0.4</version>
+ <executions>
+ <execution>
+ <id>unpack-tomahawk</id>
+ <phase>generate-sources</phase>
+ <!-- <phase>process-resources</phase> -->
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <scanModel>true</scanModel>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.myfaces.tomahawk</groupId>
+ <artifactId>tomahawk12</artifactId>
+ <version>${pom.version}</version>
+ <classifier>sources</classifier>
+ <!-- <outputDirectory>${project.build.directory}/unpacktomahawksources</outputDirectory> -->
+ <outputDirectory>${project.build.directory}/tomahawk12_sources</outputDirectory>
+ <includes>**/*.java</includes>
+ <excludes>**/*.class,**/META-INF/**,org/apache/myfaces/shared_tomahawk/**/*.java</excludes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ <execution>
+ <id>unpack-tomahawk-resources</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <baseDirectory1>${basedir}/src/main/resources</baseDirectory1>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.myfaces.tomahawk</groupId>
+ <artifactId>tomahawk12</artifactId>
+ <version>${pom.version}</version>
+ <outputDirectory>${project.build.directory}/tomahawk12_resources</outputDirectory>
+ <excludes>**/*.class,**/META-INF/**</excludes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ <execution>
+ <!-- A hierarchy of different tag classes must be created,
+ because this classes are not part of the public api. The
+ generation of all html package is the same. Please note that
+ we need only a subset -->
+ <configuration>
+ <replacePackagePrefixTagFrom>org.apache.myfaces.taglib</replacePackagePrefixTagFrom>
+ <replacePackagePrefixTagTo>org.apache.myfaces.shared_tomahawk.taglib</replacePackagePrefixTagTo>
+ </configuration>
+ <goals>
+ <goal>build-metadata</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>makefacesconfig</id>
+ <configuration>
+ <templateFile>faces-config12.vm</templateFile>
+ <xmlFile>META-INF/faces-config.xml</xmlFile>
+ </configuration>
+ <goals>
+ <goal>make-config</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>makecomp</id>
+ <goals>
+ <goal>make-components</goal>
+ </goals>
+ <configuration>
+ <jsfVersion>12</jsfVersion>
+ <templateComponentName>componentClass12.vm</templateComponentName>
+ <mainSourceDirectory2>${project.build.directory}/tomahawk12_sources</mainSourceDirectory2>
+ </configuration>
+ </execution>
+ <execution>
+ <id>makeval</id>
+ <goals>
+ <goal>make-validators</goal>
+ </goals>
+ <configuration>
+ <jsfVersion>12</jsfVersion>
+ <templateValidatorName>validatorClass12.vm</templateValidatorName>
+ <mainSourceDirectory2>${project.build.directory}/tomahawk12_sources</mainSourceDirectory2>
+ </configuration>
+ </execution>
+ <execution>
+ <id>make_tags_myfaces_core</id>
+ <configuration>
+ <packageContains>org.apache.myfaces.shared_tomahawk.taglib</packageContains>
+ <typePrefix>javax.faces</typePrefix>
+ <modelIds>
+ <!-- All the info needed is on myfaces-api package -->
+ <modelId>myfaces-api</modelId>
+ </modelIds>
+ <jsfVersion>12</jsfVersion>
+ <templateTagName>tagClass12.vm</templateTagName>
+ </configuration>
+ <goals>
+ <goal>make-tags</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>make_tags_tomahawk</id>
+ <configuration>
+ <jsfVersion>12</jsfVersion>
+ <templateTagName>tagClass12.vm</templateTagName>
+ <mainSourceDirectory2>${project.build.directory}/tomahawk12_sources</mainSourceDirectory2>
+ </configuration>
+ <goals>
+ <goal>make-tags</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>make_validator_tags_tomahawk</id>
+ <configuration>
+ <jsfVersion>12</jsfVersion>
+ <mainSourceDirectory2>${project.build.directory}/tomahawk12_sources</mainSourceDirectory2>
+ </configuration>
+ <goals>
+ <goal>make-validator-tags</goal>
+ <goal>make-converter-tags</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>maketomahawktld</id>
+ <configuration>
+ <xmlFile>META-INF/tomahawk.tld</xmlFile>
+ <xmlBaseFile>src/main/conf/META-INF/tomahawk-base.tld</xmlBaseFile>
+ <templateFile>tomahawk12.vm</templateFile>
+ <params>
+ <shortname>t</shortname>
+ <uri>http://myfaces.apache.org/tomahawk</uri>
+ <displayname>Tomahawk tag library 2.0.</displayname>
+ <description> MyFaces subproject that contains components and other goodies to be used with any JSF implementation.</description>
+ </params>
+ <modelIds>
+ <modelId>tomahawk20</modelId>
+ </modelIds>
+ </configuration>
+ <goals>
+ <goal>make-config</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>maketomahawktaglib</id>
+ <configuration>
+ <xmlFile>META-INF/tomahawk.taglib.xml</xmlFile>
+ <xmlBaseFile>src/main/conf/META-INF/facelets-taglib-base.xml</xmlBaseFile>
+ <templateFile>facelets-taglib.vm</templateFile>
+ <params>
+ <shortname>t</shortname>
+ <uri>http://myfaces.apache.org/tomahawk</uri>
+ </params>
+ <modelIds>
+ <modelId>tomahawk20</modelId>
+ </modelIds>
+ </configuration>
+ <goals>
+ <goal>make-config</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.2</version>
+ <configuration>
+ <excludes>
+ <exclude>**/Abstract*.java</exclude>
+ <exclude>**/*HtmlDateRendererTest*</exclude>
+ <exclude>**/TestUtils.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.0</version>
+ <executions>
+ <execution>
+ <id>unpack-shared-tomahawk</id>
+ <phase>process-classes</phase>
+ <goals><goal>unpack</goal></goals>
+ <configuration>
+ <excludes>META-INF/*.*</excludes>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.myfaces.shared</groupId>
+ <artifactId>myfaces-shared-tomahawk</artifactId>
+ <version>${myfaces-shared20-version}</version>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>${project.build.directory}/classes</outputDirectory>
+ </configuration>
+ </execution>
+ <!-- unpack the shared sources into target/shared_sources-->
+ <execution>
+ <id>unpack-shared-impl-sources</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <excludes>META-INF/*.*</excludes>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.myfaces.shared</groupId>
+ <artifactId>myfaces-shared-tomahawk</artifactId>
+ <version>${myfaces-shared20-version}</version>
+ <classifier>sources</classifier>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>${project.build.directory}/shared_sources</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- the following will add the unpacked shared sources directory as source directory into the pom,
+ so also the shared sources are automaticaly included by the attach source plugin -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${project.build.directory}/shared_sources</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-source</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+
+ </plugins>
+
+ </build>
+
+ <reporting>
+
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-changelog-plugin</artifactId>
+ <version>2.1</version>
+ <reportSets>
+ <reportSet>
+ <id>dual-report</id>
+ <configuration>
+ <type>range</type>
+ <range>30</range>
+ </configuration>
+ <reports>
+ <report>changelog</report>
+ <report>file-activity</report>
+ <report>dev-activity</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-jxr-plugin</artifactId>
+ <version>2.1</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>taglist-maven-plugin</artifactId>
+ <version>2.0</version>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ <!-- This plugin is reffered on myfaces master pom, but
+ this is needed to set targetJdk to 1.5 -->
+ <plugin>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <rulesets>
+ <ruleset>/rulesets/basic.xml</ruleset>
+ <ruleset>/rulesets/unusedcode.xml</ruleset>
+ </rulesets>
+ <linkXref>true</linkXref>
+ <minimumTokens>100</minimumTokens>
+ <targetJdk>1.5</targetJdk>
+ </configuration>
+ </plugin>
+ </plugins>
+
+ </reporting>
+
+ <profiles>
+ <profile>
+ <id>generate-site</id>
+ <build>
+ <plugins>
+ <plugin>
+ <!-- Generate content for custom tagdoc report -->
+ <groupId>org.apache.myfaces.buildtools</groupId>
+ <artifactId>myfaces-builder-plugin</artifactId>
+ <version>1.0.4</version>
+ <configuration>
+ <taglibs>
+ <t>http://myfaces.apache.org/tomahawk</t>
+ </taglibs>
+ </configuration>
+ <executions>
+ <execution>
+ <goals><goal>tagdoc-content</goal></goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>net.sourceforge.maven-taglib</groupId>
+ <artifactId>maven-taglib-plugin</artifactId>
+ <configuration>
+ <taglib.src.dir>${basedir}/target/classes/META-INF</taglib.src.dir>
+ <tldDocDir>${basedir}/target/site/tlddoc</tldDocDir>
+ </configuration>
+ </plugin>
+ <plugin>
+ <!-- which goal is run here? -->
+ <groupId>org.apache.myfaces.buildtools</groupId>
+ <artifactId>myfaces-builder-plugin</artifactId>
+ <version>1.0.4</version>
+ <configuration>
+ <taglibs>
+ <t>http://myfaces.apache.org/tomahawk</t>
+ </taglibs>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+ </profile>
+
+ <profile>
+ <!--
+ - Build and install into the repository some additional artifacts that we don't
+ - want to build during normal development because they take too long.
+ -->
+ <id>generate-assembly</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <!-- Install in the repository a "-javadoc.jar" file -->
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.4</version>
+ <executions>
+ <execution>
+ <id>attach-javadoc</id>
+ <goals><goal>jar</goal></goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <!-- Install in the repository a "-tlddoc.jar" file -->
+ <groupId>net.sourceforge.maven-taglib</groupId>
+ <artifactId>maven-taglib-plugin</artifactId>
+ <configuration>
+ <taglib.src.dir>${basedir}/target/classes/META-INF</taglib.src.dir>
+ <tldDocDir>${basedir}/target/tlddoc</tldDocDir>
+ </configuration>
+ <executions>
+ <execution>
+ <id>attach-javadoc</id>
+ <goals><goal>taglibdocjar</goal></goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <!-- Install in the repository a "-sources.jar" file -->
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-source</id>
+ <goals><goal>jar</goal></goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
Added: myfaces/tomahawk/trunk/core20/src/main/conf/META-INF/facelets-taglib-base.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/conf/META-INF/facelets-taglib-base.xml?rev=888664&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/conf/META-INF/facelets-taglib-base.xml (added)
+++ myfaces/tomahawk/trunk/core20/src/main/conf/META-INF/facelets-taglib-base.xml Wed Dec 9 00:44:27 2009
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!DOCTYPE facelet-taglib
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
+<facelet-taglib xmlns="http://java.sun.com/JSF/Facelet">
+
+</facelet-taglib>
\ No newline at end of file
Added: myfaces/tomahawk/trunk/core20/src/main/conf/META-INF/faces-config-base.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/conf/META-INF/faces-config-base.xml?rev=888664&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/conf/META-INF/faces-config-base.xml (added)
+++ myfaces/tomahawk/trunk/core20/src/main/conf/META-INF/faces-config-base.xml Wed Dec 9 00:44:27 2009
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
+ version="1.2">
+
+ <lifecycle>
+
+ <phase-listener>org.apache.myfaces.webapp.filter.ServeResourcePhaseListener</phase-listener>
+
+ <phase-listener>org.apache.myfaces.renderkit.html.util.ExtensionsPhaseListener</phase-listener>
+ <!-- This PhaseListener is only necessary if the autoscroll feature is used -->
+ <phase-listener>org.apache.myfaces.renderkit.html.util.AutoScrollPhaseListener</phase-listener>
+ </lifecycle>
+
+ <factory>
+ <faces-context-factory>org.apache.myfaces.webapp.filter.TomahawkFacesContextFactory</faces-context-factory>
+ </factory>
+
+ <!-- additional "by type" converters -->
+
+ <converter>
+ <converter-for-class>java.util.Date</converter-for-class>
+ <converter-class>javax.faces.convert.DateTimeConverter</converter-class>
+ </converter>
+
+
+ <!-- non standard converters -->
+
+ <converter>
+ <converter-for-class>[Ljava.lang.String;</converter-for-class>
+ <converter-class>org.apache.myfaces.convert.StringArrayConverter</converter-class>
+ </converter>
+
+ <converter>
+ <converter-for-class>org.apache.myfaces.custom.fileupload.UploadedFile</converter-for-class>
+ <converter-class>org.apache.myfaces.custom.fileupload.UploadedFileConverter</converter-class>
+ </converter>
+
+</faces-config>
Added: myfaces/tomahawk/trunk/core20/src/main/conf/META-INF/tomahawk-base.tld
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/conf/META-INF/tomahawk-base.tld?rev=888664&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/conf/META-INF/tomahawk-base.tld (added)
+++ myfaces/tomahawk/trunk/core20/src/main/conf/META-INF/tomahawk-base.tld Wed Dec 9 00:44:27 2009
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<taglib xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
+ version="2.1">
+
+</taglib>
\ No newline at end of file
Added: myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeanTagHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeanTagHandler.java?rev=888664&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeanTagHandler.java (added)
+++ myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeanTagHandler.java Wed Dec 9 00:44:27 2009
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.aliasbean;
+
+import java.io.IOException;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.application.Application;
+import javax.faces.component.UIComponent;
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.webapp.UIComponentTag;
+
+/**
+ * Tag handler used in facelets
+ *
+ * @since 1.1.7
+ * @author Leonardo Uribe (latest modification by $Author: lu4242 $)
+ * @version $Revision: 691856 $ $Date: 2008-09-03 21:40:30 -0500 (mié, 03 sep 2008) $
+ *
+ */
+public class AliasBeanTagHandler extends ComponentHandler
+{
+ private TagAttribute valueAttr;
+ private TagAttribute aliasAttr;
+
+ public AliasBeanTagHandler(ComponentConfig tagConfig)
+ {
+ super(tagConfig);
+
+ valueAttr = getRequiredAttribute("value");
+ aliasAttr = getRequiredAttribute("alias");
+ }
+
+ public void setAttributes(FaceletContext ctx, Object instance)
+ {
+ super.setAttributes(ctx, instance);
+
+ Application app = ctx.getFacesContext().getApplication();
+
+ AliasBean aliasBean = (AliasBean) instance;
+
+ String value = valueAttr.getValue();
+ if (UIComponentTag.isValueReference(value))
+ {
+ aliasBean.setValueBinding("value", app.createValueBinding(valueAttr
+ .getValue()));
+ }
+ else
+ {
+ aliasBean.setValue(value);
+ }
+
+ String alias = aliasAttr.getValue();
+ if (UIComponentTag.isValueReference(alias))
+ {
+ aliasBean.setValueBinding("alias", app.createValueBinding(aliasAttr
+ .getValue()));
+ }
+ else
+ {
+ aliasBean.setAlias(alias);
+ }
+ }
+
+ public void applyNextHandler(FaceletContext ctx, UIComponent component)
+ throws IOException, FacesException, ELException
+ {
+ AliasBean aliasBean = (AliasBean) component;
+ aliasBean.makeAlias(ctx.getFacesContext());
+ super.applyNextHandler(ctx, component);
+ aliasBean.removeAlias(ctx.getFacesContext());
+ }
+
+ /**
+ * We have to add the children to the parent, for ensure proper
+ * behavior between aliasBean and aliasBeansScope.
+ *
+ */
+ public void onComponentCreated(FaceletContext faceletcontext,
+ UIComponent component, UIComponent parent)
+ {
+ parent.getChildren().add(component);
+ }
+
+}
Added: myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeansScopeTagHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeansScopeTagHandler.java?rev=888664&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeansScopeTagHandler.java (added)
+++ myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeansScopeTagHandler.java Wed Dec 9 00:44:27 2009
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.aliasbean;
+
+import java.io.IOException;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+
+/**
+ * Tag handler used in facelets
+ *
+ * @since 1.1.7
+ * @author Leonardo Uribe (latest modification by $Author: lu4242 $)
+ * @version $Revision: 691856 $ $Date: 2008-09-03 21:40:30 -0500 (mié, 03 sep 2008) $
+ *
+ */
+public class AliasBeansScopeTagHandler extends ComponentHandler
+{
+
+ public AliasBeansScopeTagHandler(ComponentConfig tagConfig)
+ {
+ super(tagConfig);
+ }
+
+ public void applyNextHandler(FaceletContext ctx, UIComponent c)
+ throws IOException, FacesException, ELException
+ {
+ AliasBeansScope aliasBean = (AliasBeansScope) c;
+ aliasBean.makeAliases(ctx.getFacesContext());
+ super.applyNextHandler(ctx, c);
+ aliasBean.removeAliases(ctx.getFacesContext());
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/facelets/tag/MethodRule.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/facelets/tag/MethodRule.java?rev=888664&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/facelets/tag/MethodRule.java (added)
+++ myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/facelets/tag/MethodRule.java Wed Dec 9 00:44:27 2009
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.facelets.tag;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import javax.el.MethodExpression;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagAttributeException;
+
+/**
+ * Optional Rule for binding Method[Binding|Expression] properties
+ *
+ * @author Mike Kienenberger
+ * @author Jacob Hookom
+ */
+public final class MethodRule extends MetaRule
+{
+
+ private final String methodName;
+
+ private final Class<?> returnTypeClass;
+
+ private final Class<?>[] params;
+
+ public MethodRule(String methodName, Class<?> returnTypeClass, Class<?>[] params)
+ {
+ this.methodName = methodName;
+ this.returnTypeClass = returnTypeClass;
+ this.params = params;
+ }
+
+ public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta)
+ {
+ if (false == name.equals(this.methodName))
+ return null;
+
+ if (MethodExpression.class.equals(meta.getPropertyType(name)))
+ {
+ Method method = meta.getWriteMethod(name);
+ if (method != null)
+ {
+ return new MethodExpressionMetadata(method, attribute, this.returnTypeClass, this.params);
+ }
+ }
+
+ return null;
+ }
+
+ private class MethodExpressionMetadata extends Metadata
+ {
+ private final Method _method;
+
+ private final TagAttribute _attribute;
+
+ private Class<?>[] _paramList;
+
+ private Class<?> _returnType;
+
+ public MethodExpressionMetadata(Method method, TagAttribute attribute, Class<?> returnType,
+ Class<?>[] paramList)
+ {
+ _method = method;
+ _attribute = attribute;
+ _paramList = paramList;
+ _returnType = returnType;
+ }
+
+ public void applyMetadata(FaceletContext ctx, Object instance)
+ {
+ MethodExpression expr = _attribute.getMethodExpression(ctx, _returnType, _paramList);
+
+ try
+ {
+ _method.invoke(instance, new Object[] { expr });
+ }
+ catch (InvocationTargetException e)
+ {
+ throw new TagAttributeException(_attribute, e.getCause());
+ }
+ catch (Exception e)
+ {
+ throw new TagAttributeException(_attribute, e);
+ }
+ }
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/schedule/ScheduleTagHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/schedule/ScheduleTagHandler.java?rev=888664&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/schedule/ScheduleTagHandler.java (added)
+++ myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/schedule/ScheduleTagHandler.java Wed Dec 9 00:44:27 2009
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.schedule;
+
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.MetaRuleset;
+
+import org.apache.myfaces.custom.facelets.tag.MethodRule;
+
+/**
+ *
+ * @since 1.1.7
+ */
+public class ScheduleTagHandler extends ComponentHandler {
+
+ private static final String MOUSE_LISTENER = "mouseListener";
+
+ private static final Class [] mouseListenerParamList = new Class[]{ScheduleMouseEvent.class};
+
+ public ScheduleTagHandler(ComponentConfig tagConfig) {
+ super(tagConfig);
+ }
+
+ protected MetaRuleset createMetaRuleset(Class type)
+ {
+ return super.createMetaRuleset(type).alias("class", "styleClass")
+ .addRule(
+ new MethodRule(MOUSE_LISTENER,
+ String.class, mouseListenerParamList));
+ }
+
+ }
\ No newline at end of file
Added: myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tabbedpane/HtmlPanelTabbedPaneTagHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tabbedpane/HtmlPanelTabbedPaneTagHandler.java?rev=888664&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tabbedpane/HtmlPanelTabbedPaneTagHandler.java (added)
+++ myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tabbedpane/HtmlPanelTabbedPaneTagHandler.java Wed Dec 9 00:44:27 2009
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.tabbedpane;
+
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.MetaRuleset;
+
+import org.apache.myfaces.custom.facelets.tag.MethodRule;
+
+/**
+ *
+ * @since 1.1.7
+ *
+ */
+public class HtmlPanelTabbedPaneTagHandler extends ComponentHandler
+{
+ static final String METHOD_BINDING_ATTR_NAME = "tabChangeListener";
+ static final Class[] METHOD_BINDING_SIGNATURE = { TabChangeEvent.class };
+
+ protected final static MethodRule actionListenerTagRule = new MethodRule(
+ METHOD_BINDING_ATTR_NAME, void.class, METHOD_BINDING_SIGNATURE);
+
+ public HtmlPanelTabbedPaneTagHandler(ComponentConfig config)
+ {
+ super(config);
+ }
+
+ protected MetaRuleset createMetaRuleset(Class type)
+ {
+ return super.createMetaRuleset(type).alias("class", "styleClass")
+ .addRule(actionListenerTagRule);
+ }
+
+}
\ No newline at end of file
Added: myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tabbedpane/TabChangeListenerTagHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tabbedpane/TabChangeListenerTagHandler.java?rev=888664&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tabbedpane/TabChangeListenerTagHandler.java (added)
+++ myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tabbedpane/TabChangeListenerTagHandler.java Wed Dec 9 00:44:27 2009
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.tabbedpane;
+
+import java.io.IOException;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.FaceletException;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagConfig;
+import javax.faces.view.facelets.TagHandler;
+
+import org.apache.myfaces.shared_tomahawk.util.ClassUtils;
+
+/**
+ * Custom Facelets taghandler for the TabChangeListener class.
+ *
+ * @since 1.1.7
+ */
+public class TabChangeListenerTagHandler extends TagHandler
+{
+ private final TagAttribute typeAttr;
+
+ public TabChangeListenerTagHandler(TagConfig config)
+ {
+ super(config);
+ typeAttr = getRequiredAttribute("type");
+ }
+
+ public void apply(FaceletContext faceletContext, UIComponent parent)
+ throws IOException, FacesException, FaceletException, ELException
+ {
+ // only process this tag if the parent has just been created..
+ if (parent.getParent() == null)
+ {
+ if (parent instanceof HtmlPanelTabbedPane)
+ {
+ Object listenerRef;
+ if (typeAttr.isLiteral())
+ {
+ listenerRef = typeAttr.getValue();
+ }
+ else
+ {
+ listenerRef = typeAttr.getObject(faceletContext);
+ }
+
+ if (listenerRef instanceof String)
+ {
+ String className = (String) listenerRef;
+ TabChangeListener listener = (TabChangeListener) ClassUtils.newInstance(className);
+ ((HtmlPanelTabbedPane) parent).addTabChangeListener(listener);
+ }
+ else if (listenerRef instanceof TabChangeListener)
+ {
+ TabChangeListener listener = (TabChangeListener) listenerRef;
+ ((HtmlPanelTabbedPane) parent).addTabChangeListener(listener);
+ }
+ else if (listenerRef == null)
+ {
+ throw new FaceletException("Property 'type' must not be null.");
+ }
+ else
+ {
+ throw new FaceletException(
+ "Property 'type' must be either a string (containing a class name) " +
+ "or a TabChangeListener instance.");
+ }
+ }
+ else
+ {
+ throw new FaceletException(
+ "Component " + parent.getId() + " is not of type HtmlPanelTabbedPane");
+ }
+ }
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree/taglib/IconProviderTagHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree/taglib/IconProviderTagHandler.java?rev=888664&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree/taglib/IconProviderTagHandler.java (added)
+++ myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree/taglib/IconProviderTagHandler.java Wed Dec 9 00:44:27 2009
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.tree.taglib;
+
+import java.io.IOException;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.FaceletException;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagConfig;
+import javax.faces.view.facelets.TagHandler;
+
+import org.apache.myfaces.custom.tree.HtmlTree;
+import org.apache.myfaces.custom.tree.IconProvider;
+import org.apache.myfaces.shared_tomahawk.util.ClassUtils;
+
+/**
+ *
+ * @since 1.1.7
+ */
+public class IconProviderTagHandler extends TagHandler
+{
+
+ private final TagAttribute typeAttr;
+
+ public IconProviderTagHandler(TagConfig config)
+ {
+ super(config);
+ typeAttr = getRequiredAttribute("type");
+ }
+
+ public void apply(FaceletContext faceletContext, UIComponent parent)
+ throws IOException, FacesException, FaceletException, ELException
+ {
+ if (parent.getParent() == null)
+ {
+ if (parent instanceof HtmlTree)
+ {
+ String className;
+ if (!typeAttr.isLiteral())
+ {
+ className = typeAttr.getValue();
+ }
+ else
+ {
+ className = typeAttr.getValue(faceletContext);
+ }
+ IconProvider provider = (IconProvider) ClassUtils.newInstance(className);
+ ((HtmlTree) parent).setIconProvider(provider);
+ }
+ else
+ {
+ throw new FacesException(
+ "Component is not HtmlTree children");
+ }
+ }
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree/taglib/TreeSelectionListenerTagHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree/taglib/TreeSelectionListenerTagHandler.java?rev=888664&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree/taglib/TreeSelectionListenerTagHandler.java (added)
+++ myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree/taglib/TreeSelectionListenerTagHandler.java Wed Dec 9 00:44:27 2009
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.tree.taglib;
+
+import java.io.IOException;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.FaceletException;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagConfig;
+import javax.faces.view.facelets.TagHandler;
+
+import org.apache.myfaces.custom.tree.HtmlTree;
+import org.apache.myfaces.custom.tree.event.TreeSelectionListener;
+import org.apache.myfaces.shared_tomahawk.util.ClassUtils;
+
+/**
+ *
+ * @since 1.1.7
+ */
+public class TreeSelectionListenerTagHandler extends TagHandler
+{
+
+ private final TagAttribute typeAttr;
+
+ public TreeSelectionListenerTagHandler(TagConfig config)
+ {
+ super(config);
+ typeAttr = getRequiredAttribute("type");
+ }
+
+ public void apply(FaceletContext faceletContext, UIComponent parent)
+ throws IOException, FacesException, FaceletException, ELException
+ {
+ if (parent.getParent() == null)
+ {
+ if (parent instanceof HtmlTree)
+ {
+ String className;
+ if (!typeAttr.isLiteral())
+ {
+ className = typeAttr.getValue();
+ }
+ else
+ {
+ className = typeAttr.getValue(faceletContext);
+ }
+ TreeSelectionListener listener = (TreeSelectionListener) ClassUtils.newInstance(className);
+ ((HtmlTree) parent).addTreeSelectionListener(listener);
+ }
+ else
+ {
+ throw new FacesException(
+ "Component is not HtmlTree children");
+ }
+ }
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree/taglib/TreeTagHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree/taglib/TreeTagHandler.java?rev=888664&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree/taglib/TreeTagHandler.java (added)
+++ myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/tree/taglib/TreeTagHandler.java Wed Dec 9 00:44:27 2009
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.tree.taglib;
+
+import javax.faces.application.Application;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRuleset;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.webapp.UIComponentTag;
+
+import org.apache.myfaces.custom.tree.HtmlTree;
+import org.apache.myfaces.custom.tree.model.DefaultTreeModel;
+import org.apache.myfaces.custom.tree.model.TreeModel;
+import org.apache.myfaces.custom.tree.model.TreePath;
+
+/**
+ *
+ * @since 1.1.7
+ */
+public class TreeTagHandler extends ComponentHandler
+{
+
+ private TagAttribute valueAttr;
+ private TagAttribute expandRootAttr;
+
+ private boolean expandRoot;
+
+ public TreeTagHandler(ComponentConfig config)
+ {
+ super(config);
+ valueAttr = getRequiredAttribute("value");
+ expandRootAttr = getRequiredAttribute("expandRoot");
+ expandRoot = false;
+ }
+
+ public void setAttributes(FaceletContext ctx, Object instance)
+ {
+ super.setAttributes(ctx, instance);
+
+ Application app = ctx.getFacesContext().getApplication();
+
+ HtmlTree tree = (HtmlTree) instance;
+
+ if(valueAttr != null)
+ {
+ String value = valueAttr.getValue();
+ if (value != null && UIComponentTag.isValueReference(value))
+ {
+ tree.setValueBinding("model", app.createValueBinding(valueAttr
+ .getValue()));
+ }
+ }
+ else
+ {
+ ValueBinding binding = tree.getValueBinding("model");
+ if (binding == null) {
+ binding = app.createValueBinding("#{sessionScope.tree}");
+ }
+ tree.setValueBinding("model", binding);
+ }
+
+ if (expandRootAttr != null)
+ {
+ expandRoot = expandRootAttr.getBoolean(ctx);
+ }
+ }
+
+ public void onComponentCreated(FaceletContext ctx,
+ UIComponent component, UIComponent parent)
+ {
+ FacesContext context = ctx.getFacesContext();
+ Application app = ctx.getFacesContext().getApplication();
+
+ if (valueAttr != null) {
+ String value = valueAttr.getValue();
+ if (value != null){
+ ValueBinding valueBinding = app.createValueBinding(value);
+ TreeModel treeModel = (TreeModel) (valueBinding.getValue(context));
+
+ if (treeModel == null) {
+ // create default model
+ treeModel = new DefaultTreeModel();
+ valueBinding.setValue(context, treeModel);
+ }
+ }
+ }
+
+ HtmlTree tree = (HtmlTree) component;
+
+ if (expandRoot)
+ {
+ // component was created, so expand the root node
+ TreeModel model = tree.getModel(context);
+
+ if (model != null) {
+ tree.expandPath(new TreePath(new Object[] { model.getRoot() }),
+ context);
+ }
+ }
+ tree.addToModelListeners();
+ }
+
+ protected MetaRuleset createMetaRuleset(Class type)
+ {
+ return super.createMetaRuleset(type).alias("class", "styleClass");
+ }
+}
Added: myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/updateactionlistener/UpdateActionListenerTagHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/updateactionlistener/UpdateActionListenerTagHandler.java?rev=888664&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/updateactionlistener/UpdateActionListenerTagHandler.java (added)
+++ myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/updateactionlistener/UpdateActionListenerTagHandler.java Wed Dec 9 00:44:27 2009
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.custom.updateactionlistener;
+
+import java.io.IOException;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.application.Application;
+import javax.faces.component.ActionSource;
+import javax.faces.component.UIComponent;
+import javax.faces.convert.Converter;
+import javax.faces.event.ActionListener;
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.FaceletException;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagConfig;
+import javax.faces.view.facelets.TagHandler;
+import javax.faces.webapp.UIComponentTag;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Tag handler for the Tomahawk UpdateActionListener tag
+ *
+ * @since 1.1.7
+ * @author arobinson74
+ */
+public class UpdateActionListenerTagHandler extends TagHandler
+{
+ private static Log logger = LogFactory
+ .getLog(UpdateActionListenerTagHandler.class);
+
+ private TagAttribute converterAttr;
+ private TagAttribute propertyAttr;
+ private TagAttribute valueAttr;
+
+ /**
+ * @param config
+ */
+ public UpdateActionListenerTagHandler(ComponentConfig config)
+ {
+ this((TagConfig) config);
+ }
+
+ /**
+ * @param config
+ */
+ public UpdateActionListenerTagHandler(TagConfig config)
+ {
+ super(config);
+ valueAttr = getRequiredAttribute("value");
+ propertyAttr = getRequiredAttribute("property");
+ converterAttr = getAttribute("converter");
+ }
+
+ /**
+ * @see com.sun.facelets.FaceletHandler#apply(com.sun.facelets.FaceletContext, javax.faces.component.UIComponent)
+ */
+ public void apply(FaceletContext ctx, UIComponent parent)
+ throws IOException, FacesException, FaceletException, ELException
+ {
+ logger.debug("Apply called. Component: " + parent);
+ ActionSource actionSource = (ActionSource) parent;
+
+ if (sourceHasProperty(actionSource))
+ return;
+
+ UpdateActionListener al = new UpdateActionListener();
+
+ Application app = ctx.getFacesContext().getApplication();
+ if (converterAttr != null)
+ {
+ Converter converter = app.createConverter(converterAttr
+ .getValue(ctx));
+ al.setConverter(converter);
+ }
+
+ String value = valueAttr.getValue();
+ if (UIComponentTag.isValueReference(value))
+ al.setValueBinding(app.createValueBinding(valueAttr.getValue()));
+ else
+ al.setValue(value);
+
+ al.setPropertyBinding(app.createValueBinding(propertyAttr.getValue()));
+
+ actionSource.addActionListener(al);
+ }
+
+ private boolean sourceHasProperty(ActionSource source)
+ {
+ ActionListener[] listeners = source.getActionListeners();
+ for (int i = 0; i < listeners.length; i++)
+ {
+ ActionListener listener = listeners[i];
+ if (listener instanceof UpdateActionListener == false)
+ continue;
+ UpdateActionListener al = (UpdateActionListener) listener;
+ if (al.getPropertyBinding().getExpressionString().equals(
+ this.propertyAttr.getValue()))
+ {
+ logger.debug("Action listener already has a listener for "
+ + this.propertyAttr.getValue());
+ return true;
+ }
+ }
+ logger.debug("Action listener for property is not present. Property: "
+ + this.propertyAttr.getValue());
+ return false;
+ }
+}