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 2008/11/22 08:27:47 UTC
svn commit: r719821 - in /myfaces/commons/trunk: ./
myfaces-commons-components/ myfaces-commons-components/src/
myfaces-commons-components/src/main/
myfaces-commons-components/src/main/java/
myfaces-commons-components/src/main/java/org/ myfaces-commons...
Author: lu4242
Date: Fri Nov 21 23:27:46 2008
New Revision: 719821
URL: http://svn.apache.org/viewvc?rev=719821&view=rev
Log:
create myfaces commons components module with mc:renderOne
Added:
myfaces/commons/trunk/myfaces-commons-components/ (with props)
myfaces/commons/trunk/myfaces-commons-components/pom.xml (with props)
myfaces/commons/trunk/myfaces-commons-components/src/
myfaces/commons/trunk/myfaces-commons-components/src/main/
myfaces/commons/trunk/myfaces-commons-components/src/main/java/
myfaces/commons/trunk/myfaces-commons-components/src/main/java/org/
myfaces/commons/trunk/myfaces-commons-components/src/main/java/org/apache/
myfaces/commons/trunk/myfaces-commons-components/src/main/java/org/apache/myfaces/
myfaces/commons/trunk/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/
myfaces/commons/trunk/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/renderOne/
myfaces/commons/trunk/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/renderOne/AbstractUIRenderOne.java (with props)
myfaces/commons/trunk/myfaces-commons-components/src/main/resources/
myfaces/commons/trunk/myfaces-commons-components/src/main/resources/META-INF/
myfaces/commons/trunk/myfaces-commons-components/src/main/resources/META-INF/facelets-taglib.vm
myfaces/commons/trunk/myfaces-commons-components/src/main/resources/META-INF/faces-config12.vm
myfaces/commons/trunk/myfaces-commons-components/src/main/resources/META-INF/tomahawk12.vm
myfaces/commons/trunk/myfaces-commons-components/src/test/
myfaces/commons/trunk/myfaces-commons-components/src/test/java/
myfaces/commons/trunk/myfaces-commons-components/src/test/resources/
Modified:
myfaces/commons/trunk/pom.xml
Propchange: myfaces/commons/trunk/myfaces-commons-components/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Nov 21 23:27:46 2008
@@ -0,0 +1,10 @@
+target
+.classpath
+.project
+.wtpmodules
+*.ipr
+*.iml
+*.iws
+.settings
+maven-eclipse.xml
+.externalToolBuilders
Added: myfaces/commons/trunk/myfaces-commons-components/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-components/pom.xml?rev=719821&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-components/pom.xml (added)
+++ myfaces/commons/trunk/myfaces-commons-components/pom.xml Fri Nov 21 23:27:46 2008
@@ -0,0 +1,338 @@
+<?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.
+-->
+<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>
+ <parent>
+ <groupId>org.apache.myfaces.commons</groupId>
+ <artifactId>commons12</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>myfaces-components12</artifactId>
+ <packaging>jar</packaging>
+ <name>Apache MyFaces Commons Components</name>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <excludes>
+ <exclude>**/*.vm</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.myfaces.buildtools</groupId>
+ <artifactId>myfaces-builder-plugin</artifactId>
+ <version>1.0.2</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>build-metadata</goal>
+ <goal>make-components</goal>
+ <goal>make-tags</goal>
+ </goals>
+ <configuration>
+ <jsfVersion>1.2</jsfVersion>
+ </configuration>
+ </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>maketld</id>
+ <configuration>
+ <xmlFile>META-INF/components.tld</xmlFile>
+ <templateFile>tomahawk12.vm</templateFile>
+ <params>
+ <shortname>mc</shortname>
+ <uri>http://myfaces.apache.org/commons/components</uri>
+ <displayname>Myfaces Commons Components Tag Library 1.2.</displayname>
+ <description>MyFaces subproject that contains non rendering components to be used with any JSF implementation.</description>
+ </params>
+ </configuration>
+ <goals>
+ <goal>make-config</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>makemcctaglib</id>
+ <configuration>
+ <xmlFile>META-INF/components.taglib.xml</xmlFile>
+ <xmlBaseFile>src/main/conf/META-INF/facelets-taglib-base.xml</xmlBaseFile>
+ <templateFile>facelets-taglib.vm</templateFile>
+ <params>
+ <shortname>mc</shortname>
+ <uri>http://myfaces.apache.org/commons/components</uri>
+ </params>
+ </configuration>
+ <goals>
+ <goal>make-config</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.buildtools</groupId>
+ <artifactId>myfaces-builder-annotations</artifactId>
+ <version>1.0.2</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.commons</groupId>
+ <artifactId>myfaces-commons-utils12</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.commons</groupId>
+ <artifactId>myfaces-commons-utils12</artifactId>
+ <classifier>tests</classifier>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.shale</groupId>
+ <artifactId>shale-test</artifactId>
+ <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>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>cactus</groupId>
+ <artifactId>cactus</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>easymock</groupId>
+ <artifactId>easymock</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>easymock</groupId>
+ <artifactId>easymockclassextension</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>maven-taglib</groupId>
+ <artifactId>maven-taglib-plugin</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jxr-plugin</artifactId>
+ <version>2.1</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.4.3</version>
+ </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.2</version>
+ <configuration>
+ <taglibs>
+ <mcc>http://myfaces.apache.org/commons/components</mcc>
+ </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>${project.build.directory}/myfaces-builder-plugin/main/resources/META-INF</taglib.src.dir>
+ <tldDocDir>${project.build.directory}/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.2</version>
+ <configuration>
+ <taglibs>
+ <mcc>http://myfaces.apache.org/commons/components</mcc>
+ </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>${project.build.directory}/myfaces-builder-plugin/main/resources/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>
Propchange: myfaces/commons/trunk/myfaces-commons-components/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-commons-components/pom.xml
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/commons/trunk/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/renderOne/AbstractUIRenderOne.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/renderOne/AbstractUIRenderOne.java?rev=719821&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/renderOne/AbstractUIRenderOne.java (added)
+++ myfaces/commons/trunk/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/renderOne/AbstractUIRenderOne.java Fri Nov 21 23:27:46 2008
@@ -0,0 +1,205 @@
+/*
+ * 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.commons.renderOne;
+
+import java.io.IOException;
+import java.util.Iterator;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
+
+/**
+ * Tag that allows rendering the first child either by index or the first
+ * rendered one.
+ * <p>
+ * A component that only renders the first child either by index or the first
+ * visible one..
+ * </p>
+ *
+ * @author Andrew Robinson (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+@JSFComponent(
+ name = "mc:renderOne",
+ clazz = "org.apache.myfaces.commons.renderOne.UIRenderOne",
+ tagClass = "org.apache.myfaces.commons.renderOne.UIRenderOneTag")
+public abstract class AbstractUIRenderOne extends UIComponentBase
+{
+ public static final String COMPONENT_FAMILY = "javax.faces.Data";
+ public static final String COMPONENT_TYPE = "org.apache.myfaces.commons.UILimitRendered";
+ private static final String RENDERONE_TYPE_FIRST = "first";
+ private static final String RENDERONE_TYPE_INDEX = "index";
+ private static final Integer FIRST_ITEM_INDEX = new Integer("0");
+
+ /**
+ * The filter type: first|index. first: the first list value should evaluate to a Number
+ * or a value that can be parsed into an integer. index: A collection,
+ * array or comma-separated list of numbers. (Default: "first")
+ *
+ * @JSFProperty
+ * @return the type
+ */
+ public abstract String getType();
+
+ /**
+ * @param type the type to set
+ */
+ public abstract void setType(String type);
+
+ /**
+ * The value valid for the type. If this evaluates to null, the first child will
+ * be rendered.
+ * If the type is "first", this value will be ignored, as "first" always
+ * renders the first rendered item.
+ * If the type is "index", the value must be a number.
+ *
+ * @JSFProperty
+ * @return the value
+ */
+ public abstract Integer getValue();
+
+ /**
+ * @param value the value to set
+ */
+ public abstract void setValue(Integer value);
+
+ /**
+ * @see javax.faces.component.UIComponentBase#getRendersChildren()
+ */
+ public boolean getRendersChildren()
+ {
+ return true;
+ }
+
+ /**
+ * @see javax.faces.component.UIComponentBase#encodeChildren(javax.faces.context.FacesContext)
+ */
+ public void encodeChildren(FacesContext context) throws IOException
+ {
+ if (!isRendered())
+ {
+ return;
+ }
+
+ renderChild(context, (UIComponent) selectOneChild());
+ }
+
+ /**
+ * TODO:Copied from shared_tomahawk.renderkit.RendererUtils
+ * It could be good to move it to myfaces commons utils
+ */
+ private static void renderChild(FacesContext facesContext, UIComponent child)
+ throws IOException
+ {
+ if (!child.isRendered())
+ {
+ return;
+ }
+
+ child.encodeBegin(facesContext);
+ if (child.getRendersChildren())
+ {
+ child.encodeChildren(facesContext);
+ }
+ else
+ {
+ renderChildren(facesContext, child);
+ }
+ child.encodeEnd(facesContext);
+ }
+
+ /**
+ * TODO:Copied from shared_tomahawk.renderkit.RendererUtils
+ * It could be good to move it to myfaces commons utils
+ */
+ private static void renderChildren(FacesContext facesContext,
+ UIComponent component) throws IOException
+ {
+ if (component.getChildCount() > 0)
+ {
+ for (Iterator it = component.getChildren().iterator(); it.hasNext();)
+ {
+ UIComponent child = (UIComponent) it.next();
+ renderChild(facesContext, child);
+ }
+ }
+ }
+
+ protected Object selectOneChild()
+ {
+
+ Integer value = getValue();
+ String type = getType();
+
+ // default is render by count.
+ if (type == null)
+ {
+ type = RENDERONE_TYPE_FIRST;
+ }
+
+ // render by index case.
+ if (RENDERONE_TYPE_INDEX.equals(type))
+ {
+
+ // if value by index is not specified then the first element will be
+ // rendered only.
+ if (value == null)
+ {
+ value = FIRST_ITEM_INDEX;
+ }
+
+ // select the child by index.
+ return selectFirstChildByIndex(value);
+ }
+
+ // render by count case.
+ if (RENDERONE_TYPE_FIRST.equals(type))
+ {
+
+ // select the first child that has rendered="true".
+ return selectFirstChildOnly();
+ }
+ else
+ {
+ throw new IllegalArgumentException("type");
+ }
+ }
+
+ protected Object selectFirstChildOnly()
+ {
+ for (Iterator iter = getChildren().iterator(); iter.hasNext();)
+ {
+ UIComponent child = (UIComponent) iter.next();
+ if (child.isRendered())
+ {
+ return child;
+ }
+ }
+
+ return null;
+ }
+
+ protected Object selectFirstChildByIndex(Integer value)
+ {
+ return getChildren().get(value.intValue());
+ }
+}
Propchange: myfaces/commons/trunk/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/renderOne/AbstractUIRenderOne.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/commons/trunk/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/renderOne/AbstractUIRenderOne.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/commons/trunk/myfaces-commons-components/src/main/resources/META-INF/facelets-taglib.vm
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-components/src/main/resources/META-INF/facelets-taglib.vm?rev=719821&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-components/src/main/resources/META-INF/facelets-taglib.vm (added)
+++ myfaces/commons/trunk/myfaces-commons-components/src/main/resources/META-INF/facelets-taglib.vm Fri Nov 21 23:27:46 2008
@@ -0,0 +1,95 @@
+<?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">
+
+ <namespace>$uri</namespace>
+
+ <!-- Component Tags -->
+#set ($componentList = ${model.getComponents()})
+#foreach( $component in $componentList )
+#if ($modelIds.contains($component.modelId)
+ && ($component.name))
+#if (!$component.isConfigExcluded())
+ <tag>
+ <tag-name>$utils.getTagName($component.name)</tag-name>
+ <component>
+ <component-type>$component.type</component-type>
+#if ($component.rendererType)
+#if (!($component.rendererType == ""))
+ <renderer-type>$component.rendererType</renderer-type>
+#end
+#end
+#if ($component.tagHandler)
+ <handler-class>$component.tagHandler</handler-class>
+#end
+ </component>
+ </tag>
+#end
+#end
+#end
+
+ <!-- Converter tags -->
+#set ($componentList = ${model.getConverters()})
+#foreach( $component in $componentList )
+#if ($modelIds.contains($component.modelId)
+ && ($component.name))
+#if ($component.converterId)
+ <tag>
+ <tag-name>$utils.getTagName($component.name)</tag-name>
+ <converter>
+ <converter-id>$component.converterId</converter-id>
+ </converter>
+ </tag>
+#end
+#end
+#end
+
+ <!-- Validator tags -->
+#set ($componentList = ${model.getValidators()})
+#foreach( $component in $componentList )
+#if ($modelIds.contains($component.modelId)
+ && ($component.name))
+#if ($component.validatorId)
+ <tag>
+ <tag-name>$utils.getTagName($component.name)</tag-name>
+ <validator>
+ <validator-id>$component.validatorId</validator-id>
+ </validator>
+ </tag>
+#end
+#end
+#end
+
+ <!-- Single Tags -->
+#set ($tagList = $model.getTags())
+#foreach( $tag in $tagList )
+#if ($modelIds.contains($tag.modelId))
+#if ($tag.tagHandler)
+ <tag>
+ <tag-name>$utils.getTagName($tag.name)</tag-name>
+ <handler-class>$tag.tagHandler</handler-class>
+ </tag>
+#end
+#end
+#end
+
+</facelet-taglib>
\ No newline at end of file
Added: myfaces/commons/trunk/myfaces-commons-components/src/main/resources/META-INF/faces-config12.vm
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-components/src/main/resources/META-INF/faces-config12.vm?rev=719821&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-components/src/main/resources/META-INF/faces-config12.vm (added)
+++ myfaces/commons/trunk/myfaces-commons-components/src/main/resources/META-INF/faces-config12.vm Fri Nov 21 23:27:46 2008
@@ -0,0 +1,77 @@
+<?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">
+
+$baseContent
+
+#set ($componentList = ${model.getComponents()})
+#foreach( $component in $componentList )
+#if ($modelIds.contains($component.modelId)
+ && !($component.className.contains("UIComponent"))
+ && !($component.isConfigExcluded()))
+ <component>
+ <component-type>$component.type</component-type>
+ <component-class>$component.className</component-class>
+ </component>
+#end
+#end
+#set ($converterList = ${model.getConverters()})
+#foreach( $converter in $converterList )
+#if ($modelIds.contains($converter.modelId))
+ <converter>
+ <converter-id>$converter.converterId</converter-id>
+ <converter-class>$converter.className</converter-class>
+ </converter>
+#end
+#end
+#set ($validatorList = ${model.getValidators()})
+#foreach( $validator in $validatorList )
+#if ($modelIds.contains($validator.modelId) &&
+ !($validator.isConfigExcluded().booleanValue()) &&
+ $validator.validatorId)
+ <validator>
+ <validator-id>$validator.validatorId</validator-id>
+ <validator-class>$validator.className</validator-class>
+ </validator>
+#end
+#end
+#set ($renderKitList = ${model.getRenderKits()})
+#foreach( $renderKit in $renderKitList )
+ <render-kit>
+ <render-kit-id>$renderKit.renderKitId</render-kit-id>
+#if ($renderKit.className)
+ <render-kit-class>$renderKit.className</render-kit-class>
+#end
+#set ($rendererList = ${renderKit.getRenderers()})
+#foreach( $renderer in $rendererList )
+ <renderer>
+ <component-family>$renderer.componentFamily</component-family>
+ <renderer-type>$renderer.rendererType</renderer-type>
+ <renderer-class>$renderer.className</renderer-class>
+ </renderer>
+#end
+ </render-kit>
+#end
+</faces-config>
Added: myfaces/commons/trunk/myfaces-commons-components/src/main/resources/META-INF/tomahawk12.vm
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-components/src/main/resources/META-INF/tomahawk12.vm?rev=719821&view=auto
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-components/src/main/resources/META-INF/tomahawk12.vm (added)
+++ myfaces/commons/trunk/myfaces-commons-components/src/main/resources/META-INF/tomahawk12.vm Fri Nov 21 23:27:46 2008
@@ -0,0 +1,225 @@
+<?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.
+-->
+<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">
+ <tlib-version>1.1.7</tlib-version>
+ <short-name>$shortname</short-name>
+ <uri>$uri</uri>
+ <display-name>$displayname</display-name>
+ <description>$description</description>
+
+$baseContent
+
+ <!-- Component Tags -->
+#set ($componentList = ${model.getComponents()})
+#foreach( $component in $componentList )
+#if ($modelIds.contains($component.modelId)
+ && ($component.name))
+#if ($utils.getTagPrefix($component.name) == $shortname)
+ <tag>
+ <name>$utils.getTagName($component.name)</name>
+ <tag-class>$component.tagClass</tag-class>
+#if ($component.bodyContent)
+ <body-content>$component.bodyContent</body-content>
+#else
+ <body-content>JSP</body-content>
+#end
+ <description><![CDATA[$component.longDescription]]></description>
+
+#set ($propertyList = ${component.propertyList})
+#foreach( $property in $propertyList )
+#if (!$property.isTagExcluded())
+ <attribute>
+ <name>$property.jspName</name>
+#if ($property.isRequired())
+ <required>$property.isRequired()</required>
+#end
+#if ($property.isMethodExpression() || $property.isMethodBinding())
+#if ($property.getMethodBindingSignature())
+ <deferred-method>
+#set ($sig = $property.getMethodBindingSignature())
+ <method-signature>$sig.returnType myMethod( $sig.parameterTypesAsString )</method-signature>
+
+ </deferred-method>
+#else
+## This is a very special case. If a property is MethodBinding or MethodExpression
+## this should have a signature. If not, for allow multiple MethodBinding
+## simulate a ValueExpression and write a custom code like in
+## org.apache.myfaces.custom.suggestajax.AbstractSuggestAjaxTag
+ <deferred-value/>
+#end
+#elseif ($property.isLiteralOnly())
+ <rtexprvalue>false</rtexprvalue>
+#else
+#set ($type = $utils.getClassFromFullClass($property.className))
+#if ($type == "String")
+ <deferred-value></deferred-value>
+#else
+ <deferred-value>
+ <type>$property.className</type>
+ </deferred-value>
+#end
+#end
+#if ($property.longDescription)
+ <description><![CDATA[$property.longDescription]]></description>
+#else
+ <description><![CDATA[]]></description>
+#end
+ </attribute>
+#end
+#end
+ </tag>
+#end
+#end
+#end
+ <!-- Converter tags -->
+#set ($componentList = ${model.getConverters()})
+#foreach( $component in $componentList )
+#if ($modelIds.contains($component.modelId)
+ && ($component.name))
+#if ($utils.getTagPrefix($component.name) == $shortname)
+ <tag>
+ <name>$utils.getTagName($component.name)</name>
+ <tag-class>$component.tagClass</tag-class>
+#if ($component.bodyContent)
+ <body-content>$component.bodyContent</body-content>
+#else
+ <body-content>empty</body-content>
+#end
+ <description><![CDATA[$component.longDescription]]></description>
+
+#set ($propertyList = ${component.propertyList})
+#foreach( $property in $propertyList )
+#if (!$property.isTagExcluded())
+ <attribute>
+ <name>$property.name</name>
+#if ($property.isRequired())
+ <required>$property.isRequired()</required>
+#end
+#if ($property.isLiteralOnly())
+ <rtexprvalue>false</rtexprvalue>
+#else
+#set ($type = $utils.getClassFromFullClass($property.className))
+#if ($type == "String")
+ <deferred-value></deferred-value>
+#else
+ <deferred-value>
+ <type>$property.className</type>
+ </deferred-value>
+#end
+#end
+#if ($property.longDescription)
+ <description><![CDATA[$property.longDescription]]></description>
+#else
+ <description><![CDATA[]]></description>
+#end
+ </attribute>
+#end
+#end
+ </tag>
+#end
+#end
+#end
+ <!-- Validator tags -->
+#set ($componentList = ${model.getValidators()})
+#foreach( $component in $componentList )
+#if ($modelIds.contains($component.modelId)
+ && ($component.name))
+#if ($utils.getTagPrefix($component.name) == $shortname)
+ <tag>
+ <name>$utils.getTagName($component.name)</name>
+ <tag-class>$component.tagClass</tag-class>
+#if ($component.bodyContent)
+ <body-content>$component.bodyContent</body-content>
+#else
+ <body-content>empty</body-content>
+#end
+ <description><![CDATA[$component.longDescription]]></description>
+
+#set ($propertyList = ${component.propertyList})
+#foreach( $property in $propertyList )
+#if (!$property.isTagExcluded())
+ <attribute>
+ <name>$property.name</name>
+#if ($property.isRequired())
+ <required>$property.isRequired()</required>
+#end
+#if ($property.isLiteralOnly())
+ <rtexprvalue>false</rtexprvalue>
+#else
+#set ($type = $utils.getClassFromFullClass($property.className))
+#if ($type == "String")
+ <deferred-value></deferred-value>
+#else
+ <deferred-value>
+ <type>$property.className</type>
+ </deferred-value>
+#end
+#end
+#if ($property.longDescription)
+ <description><![CDATA[$property.longDescription]]></description>
+#else
+ <description><![CDATA[]]></description>
+#end
+ </attribute>
+#end
+#end
+ </tag>
+#end
+#end
+#end
+ <!-- Single Tags -->
+#set ($tagList = $model.getTags())
+#foreach( $tag in $tagList )
+#if ($modelIds.contains($tag.modelId))
+ <tag>
+ <name>$utils.getTagName($tag.name)</name>
+ <tag-class>$tag.className</tag-class>
+ <body-content>$tag.bodyContent</body-content>
+ <description><![CDATA[$tag.longDescription]]></description>
+#set ($attributeList = ${tag.attributeList})
+#foreach( $attribute in $attributeList )
+ <attribute>
+ <name>$attribute.name</name>
+ <required>$attribute.isRequired()</required>
+#set ($type = $utils.getClassFromFullClass($attribute.className))
+#if ($type == "ValueExpression")
+ <deferred-value></deferred-value>
+#else
+ <rtexprvalue>$attribute.isRtexprvalue()</rtexprvalue>
+#if ($attribute.className)
+ <type>$attribute.className</type>
+#else
+ <type>java.lang.String</type>
+#end
+#end
+#if ($property.longDescription)
+ <description><![CDATA[$property.longDescription]]></description>
+#else
+ <description><![CDATA[]]></description>
+#end
+ </attribute>
+#end
+ </tag>
+#end
+#end
+</taglib>
Modified: myfaces/commons/trunk/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/pom.xml?rev=719821&r1=719820&r2=719821&view=diff
==============================================================================
--- myfaces/commons/trunk/pom.xml (original)
+++ myfaces/commons/trunk/pom.xml Fri Nov 21 23:27:46 2008
@@ -242,9 +242,10 @@
</scm>
<modules>
+ <module>myfaces-commons-utils</module>
<module>myfaces-commons-validators</module>
<module>myfaces-commons-converters</module>
- <module>myfaces-commons-utils</module>
+ <module>myfaces-commons-components</module>
<module>myfaces-commons-examples</module>
</modules>