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 2011/04/09 20:28:55 UTC
svn commit: r1090646 [2/3] - in
/myfaces/myfaces-build-tools/trunk/maven2-archetypes: ./
myfaces-archetype-jsfcomponents20/ myfaces-archetype-jsfcomponents20/src/
myfaces-archetype-jsfcomponents20/src/main/
myfaces-archetype-jsfcomponents20/src/main/re...
Added: myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/facelets-taglib20.vm
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/facelets-taglib20.vm?rev=1090646&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/facelets-taglib20.vm (added)
+++ myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/facelets-taglib20.vm Sat Apr 9 18:28:53 2011
@@ -0,0 +1,300 @@
+<?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.
+-->
+<facelet-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 http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
+ version="2.0">
+
+ <namespace>$uri</namespace>
+#if ($compositeLibrary)
+ <composite-library-name>$compositeLibrary</composite-library-name>
+#end
+
+$baseContent
+
+## ----------------------------- START MACROS -----------------------------
+##
+## -------------------------------
+## writeJSFProperty
+## -------------------------------
+##
+#macro (writeJSFProperty $property)
+#if (!$property.isTagExcluded())
+ <attribute>
+#if ($property.longDescription)
+ <description><![CDATA[$property.longDescription]]></description>
+#else
+ <description><![CDATA[]]></description>
+#end
+ <name>$property.jspName</name>
+#if ($property.isRequired())
+ <required>$property.isRequired()</required>
+#end
+#if ($property.isMethodExpression() || $property.isMethodBinding())
+#if ($property.getMethodBindingSignature())
+#set ($sig = $property.getMethodBindingSignature())
+ <method-signature>$sig.returnType myMethod( $sig.parameterTypesAsString )</method-signature>
+#end
+#elseif($property.deferredValueType)
+ <type>$property.deferredValueType</type>
+#elseif ($type == "String")
+ <type>java.lang.String</type>
+#else
+ <type>$property.className</type>
+#end
+ </attribute>
+#end
+#end
+##
+## -------------------------------
+## writeJSFAttribute
+## -------------------------------
+##
+#macro (writeJSFAttribute $attribute)
+#if (!$attribute.isTagExcluded())
+ <attribute>
+#if ($attribute.longDescription)
+ <description><![CDATA[$attribute.longDescription]]></description>
+#else
+ <description><![CDATA[]]></description>
+#end
+ <name>$attribute.jspName</name>
+#if ($attribute.isRequired())
+ <required>$attribute.isRequired()</required>
+#end
+#set ($type = $utils.getClassFromFullClass($attribute.className))
+#if ($type == "MethodExpression")
+ <method-signature>${attribute.deferredMethodSignature}</method-signature>
+#elseif ($type == "ValueExpression")
+#if($attribute.deferredValueType)
+ <type>$attribute.deferredValueType</type>
+#end
+#else
+#if ($attribute.className)
+ <type>$attribute.className</type>
+#else
+ <type>java.lang.String</type>
+#end
+#end
+ </attribute>
+#end
+#end
+## ----------------------------- END MACROS -------------------------------
+ <!-- Component Tags -->
+#set ($componentList = ${model.getComponents()})
+#foreach( $component in $componentList )
+#if ($modelIds.contains($component.modelId)
+ && ($component.name))
+#if (!$component.isConfigExcluded() && !$component.isComposite())
+## Check if we don't have a facelet tag taking precedence over this description
+#if (! ${model.findFaceletTagByName($component.name)})
+ <tag>
+#if ($component.longDescription)
+ <description><![CDATA[$component.longDescription]]></description>
+#else
+ <description><![CDATA[]]></description>
+#end
+ <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>
+#set ($attributeList = ${component.propertyList})
+#foreach( $attribute in $attributeList )
+#writeJSFProperty($attribute)
+#end
+ </tag>
+#end
+#end
+#end
+#end
+
+ <!-- Converter tags -->
+#set ($componentList = ${model.getConverters()})
+#foreach( $component in $componentList )
+#if ($modelIds.contains($component.modelId)
+ && ($component.name))
+#if ($component.converterId)
+## Check if we don't have a facelet tag taking precedence over this description
+#if (! ${model.findFaceletTagByName($component.name)})
+ <tag>
+#if ($component.longDescription)
+ <description><![CDATA[$component.longDescription]]></description>
+#else
+ <description><![CDATA[]]></description>
+#end
+ <tag-name>$utils.getTagName($component.name)</tag-name>
+ <converter>
+ <converter-id>$component.converterId</converter-id>
+#if ($component.tagHandler)
+ <handler-class>$component.tagHandler</handler-class>
+#end
+ </converter>
+#set ($propertyList = ${component.propertyList})
+#foreach( $property in $propertyList )
+#writeJSFProperty($property)
+#end
+ </tag>
+#end
+#end
+#end
+#end
+
+ <!-- Validator tags -->
+#set ($componentList = ${model.getValidators()})
+#foreach( $component in $componentList )
+#if ($modelIds.contains($component.modelId)
+ && ($component.name))
+#if ($component.validatorId)
+## Check if we don't have a facelet tag taking precedence over this description
+#if (! ${model.findFaceletTagByName($component.name)})
+ <tag>
+#if ($component.longDescription)
+ <description><![CDATA[$component.longDescription]]></description>
+#else
+ <description><![CDATA[]]></description>
+#end
+ <tag-name>$utils.getTagName($component.name)</tag-name>
+ <validator>
+ <validator-id>$component.validatorId</validator-id>
+#if ($component.tagHandler)
+ <handler-class>$component.tagHandler</handler-class>
+#end
+ </validator>
+#set ($propertyList = ${component.propertyList})
+#foreach( $property in $propertyList )
+#writeJSFProperty($property)
+#end
+ </tag>
+#end
+#end
+#end
+#end
+
+ <!-- Behavior tags -->
+#set ($behaviorList = ${model.getBehaviors()})
+#foreach( $behavior in $behaviorList )
+#if ($modelIds.contains($behavior.modelId)
+ && ($behavior.name))
+#if ($behavior.behaviorId)
+## Check if we don't have a facelet tag taking precedence over this description
+#if (! ${model.findFaceletTagByName($behavior.name)})
+ <tag>
+#if ($behavior.longDescription)
+ <description><![CDATA[$behavior.longDescription]]></description>
+#else
+ <description><![CDATA[]]></description>
+#end
+ <tag-name>$utils.getTagName($behavior.name)</tag-name>
+ <behavior>
+ <behavior-id>$behavior.behaviorId</behavior-id>
+#if ($behavior.tagHandler)
+ <handler-class>$behavior.tagHandler</handler-class>
+#end
+ </behavior>
+#set ($propertyList = ${behavior.propertyList})
+#foreach( $property in $propertyList )
+#writeJSFProperty($property)
+#end
+ </tag>
+#end
+#end
+#end
+#end
+
+ <!-- Single Tags -->
+#set ($tagList = $model.getTags())
+#foreach( $tag in $tagList )
+#if ($modelIds.contains($tag.modelId))
+#if ($tag.tagHandler)
+## Check if we don't have a facelet tag taking precedence over this description
+#if (! ${model.findFaceletTagByName($tag.name)})
+ <tag>
+#if ($tag.longDescription)
+ <description><![CDATA[$tag.longDescription]]></description>
+#else
+ <description><![CDATA[]]></description>
+#end
+ <tag-name>$utils.getTagName($tag.name)</tag-name>
+ <handler-class>$tag.tagHandler</handler-class>
+#foreach( $attribute in $attributeList )
+#writeJSFAttribute($attribute)
+#end
+ </tag>
+#end
+#end
+#end
+#end
+
+ <!-- Facelet Tags -->
+#set ($faceletTagList = $model.getFaceletTags())
+#foreach( $faceletTag in $faceletTagList )
+#if ($modelIds.contains($faceletTag.modelId) && ($faceletTag.name))
+#if ($utils.getTagPrefix($faceletTag.name) == $shortname)
+ <tag>
+#if ($faceletTag.longDescription)
+ <description><![CDATA[$faceletTag.longDescription]]></description>
+#else
+ <description><![CDATA[]]></description>
+#end
+
+ <tag-name>$utils.getTagName($faceletTag.name)</tag-name>
+#if ($faceletTag.componentClass)
+#set ($component = ${model.findComponentByClassName($faceletTag.componentClass)})
+ <component>
+ <component-type>$component.type</component-type>
+#if ($component.rendererType)
+#if (!($component.rendererType == ""))
+ <renderer-type>$component.rendererType</renderer-type>
+#end
+#end
+ <handler-class>$faceletTag.className</handler-class>
+ </component>
+#elseif ($faceletTag.converterClass)
+#set ($converter = ${model.findConverterByClassName($faceletTag.converterClass)})
+ <converter>
+ <converter-id>$converter.converterId</converter-id>
+ <handler-class>$faceletTag.className</handler-class>
+ </converter>
+#elseif ($faceletTag.behaviorClass)
+#set ($behavior = ${model.findBehaviorByClassName($faceletTag.behaviorClass)})
+ <behavior>
+ <behavior-id>$behavior.behaviorId</behavior-id>
+ <handler-class>$faceletTag.className</handler-class>
+ </behavior>
+#else
+ <handler-class>$faceletTag.className</handler-class>
+#end
+#set ($attributeList = ${tag.attributeList})
+#foreach( $attribute in $attributeList )
+#writeJSFAttribute($attribute)
+#end
+ </tag>
+#end
+#end
+#end
+</facelet-taglib>
Added: myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/faces-config20.vm
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/faces-config20.vm?rev=1090646&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/faces-config20.vm (added)
+++ myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/faces-config20.vm Sat Apr 9 18:28:53 2011
@@ -0,0 +1,93 @@
+<?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_2_0.xsd"
+ version="2.0">
+
+$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 ($behaviorList = ${model.getBehaviors()})
+#foreach( $behavior in $behaviorList )
+#if ($modelIds.contains($behavior.modelId))
+ <behavior>
+ <behavior-id>$behavior.behaviorId</behavior-id>
+ <behavior-class>$behavior.className</behavior-class>
+ </behavior>
+#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
+#set ($clientBehaviorRendererList = ${renderKit.getClientBehaviorRenderers()})
+#foreach( $clientBehaviorRenderer in $clientBehaviorRendererList )
+ <client-behavior-renderer>
+ <client-behavior-renderer-type>$clientBehaviorRenderer.rendererType</client-behavior-renderer-type>
+ <client-behavior-renderer-class>$clientBehaviorRenderer.className</client-behavior-renderer-class>
+ </client-behavior-renderer>
+#end
+ </render-kit>
+#end
+</faces-config>
Added: myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/mycomponents.tld.vm
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/mycomponents.tld.vm?rev=1090646&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/mycomponents.tld.vm (added)
+++ myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/mycomponents.tld.vm Sat Apr 9 18:28:53 2011
@@ -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>
Added: myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/tagClass12.vm
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/tagClass12.vm?rev=1090646&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/tagClass12.vm (added)
+++ myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/tagClass12.vm Sat Apr 9 18:28:53 2011
@@ -0,0 +1,170 @@
+// WARNING: This file was automatically generated. Do not edit it directly,
+// or you will lose your changes.
+/*
+ * 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 ${component.tagPackage};
+
+import javax.faces.component.UIComponent;
+import javax.el.ValueExpression;
+import javax.el.MethodExpression;
+import javax.faces.context.FacesContext;
+$utils.importTagClasses12($component)
+
+public class $utils.getClassFromFullClass($component.tagClass)
+#if (${component.tagSuperclass})
+ extends ${component.tagSuperclass}
+#else
+ extends javax.faces.webapp.UIComponentTag
+#end
+{
+ public $utils.getClassFromFullClass($component.tagClass)()
+ {
+ }
+
+ public String getComponentType()
+ {
+#if ($component.type)
+ return "$component.type";
+#else
+ return null;
+#end
+ }
+
+ public String getRendererType()
+ {
+#if ($component.rendererType && !($component.rendererType == ""))
+ return "$component.rendererType";
+#else
+ return null;
+#end
+ }
+
+#set ($propertyList = ${component.propertyTagList})
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $utils.getJspPropertyType12($property))
+
+ private $type $field;
+
+#set ($var = $utils.getVariableFromName($property.name))
+ public void $utils.getPrefixedPropertyName("set", $property.jspName)($type $var)
+ {
+ $field = $var;
+ }
+#end
+
+ protected void setProperties(UIComponent component)
+ {
+ if (!(component instanceof $component.className))
+ {
+ throw new IllegalArgumentException("Component "+
+ component.getClass().getName() +" is no $component.className");
+ }
+
+ $component.className comp = ($component.className) component;
+
+ super.setProperties(component);
+
+ FacesContext context = getFacesContext();
+
+#foreach( $property in $propertyList )## 1
+#set ($field = $property.fieldName)
+#set ($type = $utils.getJspPropertyType12($property))
+#if ($utils.isConverter($property.className))## 2
+ if ($field != null)
+ {
+ if (!${field}.isLiteralText())
+ {
+ comp.setValueExpression("$property.name", $field);
+ }
+ else
+ {
+ String s = ${field}.getExpressionString();
+ if (s != null)
+ {
+ Converter converter = getFacesContext().getApplication().createConverter(s);
+ comp.setConverter(converter);
+ }
+ }
+ }
+#elseif ($property.isMethodBinding())## 2
+ if ($field != null)
+ {
+#if ($property.jspName == "actionListener")
+ comp.addActionListener(new MethodExpressionActionListener($field));
+#elseif ($property.jspName == "valueChangeListener")
+ comp.addValueChangeListener(new MethodExpressionValueChangeListener($field));
+#elseif ($property.jspName == "validator")
+ comp.addValidator(new MethodExpressionValidator($field));
+#elseif ($utils.isStringMethodBindingReturnType($property.methodBindingSignature))##3
+ MethodBinding mb;
+ if (isValueReference($field))
+ {
+ mb = context.getApplication().createMethodBinding(
+ $field, $utils.getSignatureParams($property.methodBindingSignature));
+ }
+ else
+ {
+ throw new IllegalStateException("Invalid expression " + $field);
+ }
+ comp.${utils.getPrefixedPropertyName("set",$property.name)}(mb);
+#else## 3
+ MethodBinding mb = context.getApplication().createMethodBinding(
+ $field, $utils.getSignatureParams($property.methodBindingSignature));
+ comp.${utils.getPrefixedPropertyName("set",$property.name)}(mb);
+#end## 3
+ }
+#elseif ($property.isMethodExpression())## 2
+ if ($field != null)
+ {
+#if ($property.jspName == "action")
+ comp.setActionExpression($field);
+#elseif ($property.jspName == "actionListener")
+ comp.addActionListener(new MethodExpressionActionListener($field));
+#else
+ comp.${utils.getPrefixedPropertyName("set",$property.name)}($field);
+#end
+ }
+#else## 2
+ if ($field != null)
+ {
+#if ($property.isLiteralOnly())## 3
+ comp.getAttributes().put("$property.name", $field);
+#else## 3
+ comp.setValueExpression("$property.name", $field);
+#end## 3
+ }
+#end## 2
+#end## 1
+ }
+
+ public void release()
+ {
+ super.release();
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#if($utils.getJspPropertyType12($property) == "boolean")
+#set ($empty = "false")
+#else
+#set ($empty = "null")
+#end
+ $field = $empty;
+#end
+ }
+}
Added: myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/tagConverterClass12.vm
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/tagConverterClass12.vm?rev=1090646&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/tagConverterClass12.vm (added)
+++ myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/tagConverterClass12.vm Sat Apr 9 18:28:53 2011
@@ -0,0 +1,167 @@
+// WARNING: This file was automatically generated. Do not edit it directly,
+// or you will lose your changes.
+/*
+ * 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 $utils.getPackageFromFullClass($converter.tagClass);
+
+import javax.faces.context.FacesContext;
+import javax.el.ELContext;
+import javax.faces.convert.Converter;
+import javax.el.ValueExpression;
+import javax.faces.webapp.UIComponentTag;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.PageContext;
+$utils.importTagClasses($converter)
+
+public class $utils.getClassFromFullClass($converter.tagClass)
+#if (${converter.tagSuperclass})
+ extends ${converter.tagSuperclass}
+#else
+ extends org.apache.myfaces.commons.converter.ConverterTag
+#end
+{
+#if ($converter.serialuidtag)
+ private static final long serialVersionUID = ${converter.serialuidtag};
+#end
+
+ public $utils.getClassFromFullClass($converter.tagClass)()
+ {
+ setConverterIdString("$converter.converterId");
+ }
+#set ($propertyList = ${converter.propertyTagList})
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $utils.getJspPropertyType12($property))
+
+ private $type $field;
+
+#set ($var = $utils.getVariableFromName($property.name))
+ public void $utils.getPrefixedPropertyName("set", $property.jspName)($type $var)
+ {
+ $field = $var;
+ }
+#end
+
+ public void setPageContext(PageContext context) {
+ super.setPageContext(context);
+ setConverterIdString("$converter.converterId");
+ }
+
+ protected Converter createConverter() throws JspException {
+
+ ELContext elContext = FacesContext.getCurrentInstance().getELContext();
+ $converter.className converter = ($converter.className)super.createConverter();
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $utils.getJspPropertyType12($property))
+#set ($className = $utils.getPrimitiveType($property.className))
+ if ($field != null)
+ {
+ if (${field}.isLiteralText())
+ {
+#if ($utils.isPrimitiveClass($property.className))
+ String ${field}Value = ${field}.getExpressionString();
+ if (${field}Value != null)
+ converter.${utils.getPrefixedPropertyName("set",$property.name)}(${utils.getBoxedClass($className)}.valueOf(${field}Value).${property.className}Value());
+#elseif ($utils.isPrimitiveClass($className))
+ String ${field}Value = ${field}.getExpressionString();
+ if (${field}Value != null)
+ converter.${utils.getPrefixedPropertyName("set",$property.name)}(${utils.getBoxedClass($className)}.valueOf(${field}Value));
+ else
+ converter.${utils.getPrefixedPropertyName("set",$property.name)}(null);
+#elseif ($utils.getClassFromFullClass($property.className) == "String")
+ converter.${utils.getPrefixedPropertyName("set",$property.name)}(${field}.getExpressionString());
+#elseif ($utils.getClassFromFullClass($property.className) == "Object")
+ converter.${utils.getPrefixedPropertyName("set",$property.name)}(${field}.getExpressionString());
+#elseif ($utils.getClassFromFullClass($property.className) == "Locale")
+ converter.${utils.getPrefixedPropertyName("set",$property.name)}(
+ org.apache.myfaces.shared_tomahawk.util.LocaleUtils.converterTagLocaleFromString(${field}.getExpressionString()));
+#elseif ($utils.getClassFromFullClass($property.className) == "Class")
+ try
+ {
+ converter.${utils.getPrefixedPropertyName("set",$property.name)}(
+ org.apache.myfaces.shared_tomahawk.util.ClassUtils.classForName(${field}.getExpressionString()));
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new JspException(e);
+ }
+#elseif ($utils.getClassFromFullClass($property.className) == "TimeZone")
+ converter.${utils.getPrefixedPropertyName("set",$property.name)}(
+ java.util.TimeZone.getTimeZone(${field}.getExpressionString()));
+#else
+ converter.${utils.getPrefixedPropertyName("set",$property.name)}(($property.className) ${field}.getValue(elContext));
+#end
+ }
+ else
+ {
+#if ($utils.isPrimitiveClass($property.className))
+ Object ${field}Value = ${field}.getValue(elContext);
+ if (${field}Value != null)
+ converter.${utils.getPrefixedPropertyName("set",$property.name)}( ((${utils.getBoxedClass($className)}) ${field}Value ).${property.className}Value());
+#elseif ($utils.isPrimitiveClass($className))
+ converter.${utils.getPrefixedPropertyName("set",$property.name)}( (${utils.getBoxedClass($className)}) ${field}.getValue(elContext) );
+#elseif ($utils.getClassFromFullClass($property.className) == "Locale")
+ Object ${field}Value = ${field}.getValue(elContext);
+ if (${field}Value == null)
+ {
+ ${field}Value = FacesContext.getCurrentInstance().getViewRoot().getLocale();
+ }
+ if(!(${field}Value instanceof java.util.Locale))
+ {
+ ${field}Value = org.apache.myfaces.shared_tomahawk.util.LocaleUtils.converterTagLocaleFromString(${field}.getExpressionString());
+ }
+ converter.${utils.getPrefixedPropertyName("set",$property.name)}((java.util.Locale)${field}Value);
+#elseif ($utils.getClassFromFullClass($property.className) == "TimeZone")
+ Object ${field}Value = ${field}.getValue(elContext);
+ if(${field}Value instanceof java.util.TimeZone)
+ {
+ converter.${utils.getPrefixedPropertyName("set",$property.name)}(
+ (java.util.TimeZone) ${field}Value);
+ }
+ else
+ {
+ converter.${utils.getPrefixedPropertyName("set",$property.name)}(
+ java.util.TimeZone.getTimeZone(${field}Value.toString()));
+ }
+#elseif ($utils.getClassFromFullClass($property.className) == "String")
+ converter.${utils.getPrefixedPropertyName("set",$property.name)}( (String) ${field}.getValue(elContext));
+#else
+ converter.${utils.getPrefixedPropertyName("set",$property.name)}(($property.className) ${field}.getValue(elContext));
+#end
+ }
+ }
+#end
+ return converter;
+ }
+
+ public void release()
+ {
+ super.release();
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#if($utils.getJspPropertyType12($property) == "boolean")
+#set ($empty = "false")
+#else
+#set ($empty = "null")
+#end
+ $field = $empty;
+#end
+ }
+}
Added: myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/tagValidatorClass12.vm
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/tagValidatorClass12.vm?rev=1090646&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/tagValidatorClass12.vm (added)
+++ myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/tagValidatorClass12.vm Sat Apr 9 18:28:53 2011
@@ -0,0 +1,158 @@
+// WARNING: This file was automatically generated. Do not edit it directly,
+// or you will lose your changes.
+/*
+ * 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 $utils.getPackageFromFullClass($validator.tagClass);
+
+import javax.faces.context.FacesContext;
+import javax.el.ValueExpression;
+import javax.faces.validator.Validator;
+import javax.faces.application.Application;
+import javax.servlet.jsp.JspException;
+$utils.importTagClasses($validator)
+
+public class $utils.getClassFromFullClass($validator.tagClass)
+#if (${validator.tagSuperclass})
+ extends ${validator.tagSuperclass}
+#else
+ extends org.apache.myfaces.commons.validator.ValidatorBaseTag
+#end
+{
+#if ($validator.serialuidtag)
+ private static final long serialVersionUID = ${validator.serialuidtag};
+#end
+
+ public $utils.getClassFromFullClass($validator.tagClass)()
+ {
+ }
+#set ($propertyList = ${validator.propertyTagList})
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $utils.getJspPropertyType12($property))
+
+ private $type $field;
+
+#set ($var = $utils.getVariableFromName($property.name))
+ public void $utils.getPrefixedPropertyName("set", $property.jspName)($type $var)
+ {
+ $field = $var;
+ }
+#end
+
+ protected Validator createValidator() throws JspException {
+ String validatorId = "$validator.validatorId";
+ Application appl = FacesContext.getCurrentInstance().getApplication();
+ Validator validator = (Validator)appl.createValidator(validatorId);
+ _setProperties(validator);
+ return validator;
+ }
+
+ protected void _setProperties(Validator val) throws JspException {
+ super._setProperties(val);
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+
+ $validator.className validator = ($validator.className) val;
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $utils.getJspPropertyType12($property))
+#set ($className = $utils.getPrimitiveType($property.className))
+ if ($field != null)
+ {
+#if ($property.isLiteralOnly())
+#if ($utils.isPrimitiveClass($property.className))
+ validator.${utils.getPrefixedPropertyName("set",$property.name)}(${utils.getBoxedClass($className)}.valueOf($field).${property.className}Value());
+#elseif ($utils.isPrimitiveClass($className))
+ validator.${utils.getPrefixedPropertyName("set",$property.name)}(${utils.getBoxedClass($className)}.valueOf($field));
+#else
+ validator.${utils.getPrefixedPropertyName("set",$property.name)}($field);
+#end
+#else
+ if (!${field}.isLiteralText())
+ {
+ validator.setValueExpression("$property.name", $field);
+ }
+ else
+ {
+#if ($utils.isPrimitiveClass($property.className))
+ Object ${field}Value = ${field}.getValue(facesContext.getELContext());
+ if (${field}Value != null){
+ if (${field}Value instanceof ${utils.getBoxedClass($className)}){
+ validator.${utils.getPrefixedPropertyName("set",$property.name)}(
+ ((${utils.getBoxedClass($className)})${field}Value).${property.className}Value());
+ }
+ else
+ {
+ validator.${utils.getPrefixedPropertyName("set",$property.name)}(
+ ${utils.getBoxedClass($className)}.valueOf(${field}Value.toString()).${property.className}Value());
+ }
+ }
+#elseif ($utils.isPrimitiveClass($className))
+ Object ${field}Value = ${field}.getValue(facesContext.getELContext());
+ if (${field}Value != null){
+ if (${field}Value instanceof ${utils.getBoxedClass($className)}){
+ validator.${utils.getPrefixedPropertyName("set",$property.name)}(
+ ((${utils.getBoxedClass($className)})${field}Value));
+ }
+ else
+ {
+ validator.${utils.getPrefixedPropertyName("set",$property.name)}(
+ ${utils.getBoxedClass($className)}.valueOf(${field}Value.toString()));
+ }
+ }
+#elseif ($utils.getClassFromFullClass($property.className) == "String")
+ Object ${field}Value = ${field}.getValue(facesContext.getELContext());
+ if (${field}Value != null)
+ {
+ validator.${utils.getPrefixedPropertyName("set",$property.name)}(
+ ($property.className) ${field}Value.toString());
+ }
+#elseif ($property.className == "java.lang.String[]")
+ try
+ {
+ String[] value = org.apache.myfaces.commons.util.TagUtils.getStringArray(${field}.getValue(facesContext.getELContext()));
+ validator.${utils.getPrefixedPropertyName("set",$property.name)}(value);
+ }
+ catch (java.text.ParseException pe)
+ {
+ throw new JspException(
+ pe.getMessage() + ": " + "Position " + pe.getErrorOffset());
+ }
+#else
+ validator.${utils.getPrefixedPropertyName("set",$property.name)}(($property.className) ${field}.getValue(facesContext.getELContext()));
+#end
+ }
+#end
+ }
+#end
+ }
+
+ public void release()
+ {
+ super.release();
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#if($utils.getJspPropertyType12($property) == "boolean")
+#set ($empty = "false")
+#else
+#set ($empty = "null")
+#end
+ $field = $empty;
+#end
+ }
+}
Added: myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/validatorClass12.vm
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/validatorClass12.vm?rev=1090646&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/validatorClass12.vm (added)
+++ myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/main/resources/META-INF/validatorClass12.vm Sat Apr 9 18:28:53 2011
@@ -0,0 +1,215 @@
+## Velocity template used to generate JSF1.2-compatible validator classes
+## from validator meta-data.
+##
+## Note that there are only one type of validator generation:
+## * "subclass mode" (use annotated class as a parent class)
+##
+## Variable $validator refers to a ValidatorMeta object to process
+## Variable $utils refers to an instance of MyfacesUtils.
+##
+##
+## The java package of the generated class is always the same as
+## the package in which the annotated class exists.
+##
+/*
+ * 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 ${validator.packageName};
+
+import javax.el.ValueExpression;
+import javax.faces.context.FacesContext;
+$utils.importTagClasses($validator)
+
+#if ($validator.isTemplate())
+#set ($generatedClassParent = $validator.sourceClassParentClassName)
+#else
+#set ($generatedClassParent = $validator.sourceClassName)
+#end
+// Generated from class ${validator.sourceClassName}.
+//
+// WARNING: This file was automatically generated. Do not edit it directly,
+// or you will lose your changes.
+public class ${utils.getClassFromFullClass($validator.className)} extends $generatedClassParent
+#if ($validator.implements)
+ implements $validator.implements
+#end
+{
+
+#if ($validator.validatorId)
+ static public final String VALIDATOR_ID =
+ "$validator.validatorId";
+#end
+
+ public ${utils.getClassFromFullClass($validator.className)}()
+ {
+ }
+
+#set ($propertyList = ${validator.propertyValidatorList})
+
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $utils.getClassFromFullClass($property.className))
+#if($utils.getDefaultValueField($property))
+#set ($defaultValue = $utils.getDefaultValueField($property))
+#else
+#set ($defaultValue = false)
+#end
+ // Property: $property.name
+#if ($property.isLiteralOnly() || $property.isTagExcluded() )
+ private $type $field #if($defaultValue) = $defaultValue;#{else};#{end}
+
+
+#else
+ private $type $field;
+
+#end
+#if($utils.isPrimitiveClass($type) && !$property.isTagExcluded() )
+ private boolean ${field}Set;
+
+#if ($property.isSetMethod())
+ $property.setMethodScope boolean $utils.getPrefixedPropertyName("isSet", $property.name)()
+ {
+ return ${field}Set;
+ }
+#end
+#end
+#if($property.isLocalMethod())
+#if("boolean" == $type)
+#set ($methodName = $utils.getPrefixedPropertyName("isLocal", $property.name))
+#else
+#set ($methodName = $utils.getPrefixedPropertyName("getLocal", $property.name))
+#end
+ final $property.localMethodScope $type ${methodName}()
+ {
+ return $field;
+ }
+
+#end
+ public $type $utils.getMethodReaderFromProperty($property.name, $type)()
+ {
+#if ($property.isTagExcluded() || $property.isLiteralOnly())
+ return $field;
+#else
+#if ($utils.isPrimitiveClass($type))
+ if (${field}Set)
+#else
+ if ($field != null)
+#end
+ {
+ return $field;
+ }
+ ValueExpression vb = getValueExpression("$property.name");
+ if (vb != null)
+ {
+#if ($utils.isPrimitiveClass($type))
+ return ($utils.castIfNecessary($type) vb.getValue(getFacesContext().getELContext())).${type}Value();
+#else
+#set ($pritype = $utils.getPrimitiveType($property.className))
+#if ($utils.isPrimitiveClass($pritype))
+ Object value = vb == null ? null : vb.getValue(getFacesContext().getELContext());
+ if (!(value instanceof $type)){
+ value = ${type}.valueOf(value.toString());
+ }
+ return $utils.castIfNecessary($type) value;
+#else
+ return $utils.castIfNecessary($type) vb.getValue(getFacesContext().getELContext());
+#end
+#end
+ }
+#if ($defaultValue)
+ return $defaultValue;
+#elseif ($utils.isPrimitiveClass($type))
+ return $utils.primitiveDefaultValue($type);
+#else
+ return null;
+#end
+#end
+ }
+
+ public void $utils.getPrefixedPropertyName("set", $property.name)($type $utils.getVariableFromName($property.name))
+ {
+ this.$field = $utils.getVariableFromName($property.name);
+#if ($utils.isPrimitiveClass($type) && !$property.isTagExcluded() )
+ this.${field}Set = true;
+#end
+ }
+#end
+
+ public Object saveState(FacesContext facesContext)
+ {
+#set ($primitiveCount = $propertyList.size() + 1)
+#foreach( $property in $propertyList )
+#if($utils.isPrimitiveClass($property.className))
+#set ($primitiveCount = $primitiveCount + 1)
+#end
+#end
+ Object[] values = new Object[$primitiveCount];
+ values[0] = super.saveState(facesContext);
+#set ($arrayIndex = 0)
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $property.className)
+#set ($arrayIndex = $arrayIndex + 1)
+#if ($property.jspName == "validator" && $property.isMethodBinding() )
+ values[$arrayIndex] = saveAttachedState(facesContext,${field}List);
+#elseif ( $property.isStateHolder() )## || $utils.isConverter($type)
+ values[$arrayIndex] = saveAttachedState(facesContext,$field);
+#elseif($utils.isPrimitiveClass($type))
+ values[$arrayIndex] = ${utils.getBoxedClass($type)}.valueOf($field);
+#else
+ values[$arrayIndex] = $field;
+#end
+#if($utils.isPrimitiveClass($type) && !$property.isTagExcluded())
+#set ($arrayIndex = $arrayIndex + 1)
+ values[$arrayIndex] = Boolean.valueOf(${field}Set);
+#end
+#end
+ return values;
+ }
+
+ public void restoreState(FacesContext facesContext, Object state)
+ {
+ Object[] values = (Object[])state;
+ super.restoreState(facesContext,values[0]);
+#set ($arrayIndex = 0)
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $property.className)
+#set ($arrayIndex = $arrayIndex + 1)
+#if ( $property.isStateHolder() )
+#if ($property.jspName == "validator" && $property.isMethodBinding() )
+ ${field}List = (List<Validator>) restoreAttachedState(facesContext,values[$arrayIndex]);
+#elseif ($utils.isList($type))
+ $field = (List) restoreAttachedState(facesContext,values[$arrayIndex]);
+#else
+ $field = $utils.castIfNecessary($type) restoreAttachedState(facesContext,values[$arrayIndex]);
+#end
+#elseif ($utils.isConverter($type))
+ $field = (Converter) restoreAttachedState(facesContext,values[$arrayIndex]);
+#elseif ($utils.isPrimitiveClass($type))
+ $field = ($utils.castIfNecessary($type) values[$arrayIndex]).${type}Value();
+#else
+ $field = $utils.castIfNecessary($type) values[$arrayIndex];
+#end
+#if($utils.isPrimitiveClass($type) && !$property.isTagExcluded() )
+#set ($arrayIndex = $arrayIndex + 1)
+ ${field}Set = ((Boolean) values[$arrayIndex]).booleanValue();
+#end
+#end
+ }
+}
Added: myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/test/java/org/myorganization/component/sayhello/SayHelloRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/test/java/org/myorganization/component/sayhello/SayHelloRendererTest.java?rev=1090646&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/test/java/org/myorganization/component/sayhello/SayHelloRendererTest.java (added)
+++ myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/test/java/org/myorganization/component/sayhello/SayHelloRendererTest.java Sat Apr 9 18:28:53 2011
@@ -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.myorganization.component.sayhello;
+
+import java.io.StringWriter;
+
+import org.apache.myfaces.test.base.AbstractJsfTestCase;
+import org.apache.myfaces.test.mock.MockRenderKitFactory;
+import org.apache.myfaces.test.mock.MockResponseWriter;
+
+/**
+ * Class to test the behaviour of the SayHello renderer
+ */
+public class SayHelloRendererTest extends AbstractJsfTestCase
+{
+
+ private MockResponseWriter writer ;
+ private SayHello sayHello;
+
+ public SayHelloRendererTest(String name)
+ {
+ super(name);
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ sayHello = new SayHello();
+ sayHello.setFirstName("John");
+ sayHello.setLastName("Smith");
+
+ writer = new MockResponseWriter(new StringWriter(), null, null);
+ facesContext.setResponseWriter(writer);
+ // TODO remove these two lines once shale-test goes alpha, see MYFACES-1155
+ facesContext.getViewRoot().setRenderKitId(MockRenderKitFactory.HTML_BASIC_RENDER_KIT);
+ facesContext.getRenderKit().addRenderer(
+ sayHello.getFamily(),
+ sayHello.getRendererType(),
+ new SayHelloRenderer());
+ }
+
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ sayHello = null;
+ writer = null;
+ }
+
+ public void testEncodeEnd() throws Exception
+ {
+ sayHello.encodeEnd(facesContext);
+ facesContext.renderResponse();
+
+ String output = writer.getWriter().toString();
+
+ assertEquals("Hello John Smith!", output);
+ assertNotSame("Bye John Smith!", output);
+ }
+
+}
Added: myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/test/java/org/myorganization/converter/PhoneNumberConverterTest.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/test/java/org/myorganization/converter/PhoneNumberConverterTest.java?rev=1090646&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/test/java/org/myorganization/converter/PhoneNumberConverterTest.java (added)
+++ myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/test/java/org/myorganization/converter/PhoneNumberConverterTest.java Sat Apr 9 18:28:53 2011
@@ -0,0 +1,71 @@
+/*
+ * 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.myorganization.converter;
+
+import java.io.StringWriter;
+
+import javax.faces.component.html.HtmlInputText;
+
+import org.apache.myfaces.test.base.AbstractJsfTestCase;
+import org.apache.myfaces.test.mock.MockResponseWriter;
+
+public class PhoneNumberConverterTest extends AbstractJsfTestCase
+{
+
+ private MockResponseWriter writer ;
+ private PhoneNumberConverter phoneNumConverter;
+
+ public PhoneNumberConverterTest(String name)
+ {
+ super(name);
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ phoneNumConverter = new PhoneNumberConverter();
+ writer = new MockResponseWriter(new StringWriter(), null, null);
+ facesContext.setResponseWriter(writer);
+ }
+
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ phoneNumConverter = null;
+ writer = null;
+ }
+
+ public void testNumOnly() throws Exception
+ {
+ Object obj = phoneNumConverter.getAsObject(facesContext, new HtmlInputText(), "6373824");
+ assertNotNull(obj);
+ PhoneNumber phoneNum = (PhoneNumber) obj;
+ assertEquals(phoneNum.getNumber(), "6373824");
+ }
+
+ public void testAreaCodeNum() throws Exception
+ {
+ Object obj = phoneNumConverter.getAsObject(facesContext, new HtmlInputText(), "09-6373824");
+ assertNotNull(obj);
+ PhoneNumber phoneNum = (PhoneNumber) obj;
+ assertEquals(phoneNum.getAreaCode(), "09");
+ assertEquals(phoneNum.getNumber(), "6373824");
+ }
+}
Added: myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/test/java/org/myorganization/validator/OddNumberValidatorTest.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/test/java/org/myorganization/validator/OddNumberValidatorTest.java?rev=1090646&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/test/java/org/myorganization/validator/OddNumberValidatorTest.java (added)
+++ myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/core/src/test/java/org/myorganization/validator/OddNumberValidatorTest.java Sat Apr 9 18:28:53 2011
@@ -0,0 +1,85 @@
+/*
+ * 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.myorganization.validator;
+
+import java.io.StringWriter;
+
+import javax.faces.component.html.HtmlInputText;
+import javax.faces.validator.ValidatorException;
+
+import org.apache.myfaces.test.base.AbstractJsfTestCase;
+import org.apache.myfaces.test.mock.MockResponseWriter;
+
+public class OddNumberValidatorTest extends AbstractJsfTestCase
+{
+
+ private MockResponseWriter writer ;
+ private OddNumberValidator oddNumValidator;
+
+ public OddNumberValidatorTest(String name)
+ {
+ super(name);
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ oddNumValidator = new OddNumberValidator();
+ writer = new MockResponseWriter(new StringWriter(), null, null);
+ facesContext.setResponseWriter(writer);
+ }
+
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ oddNumValidator = null;
+ writer = null;
+ }
+
+ public void testOddNumInput() throws Exception
+ {
+ boolean noExceptionsThrown = true;
+ try
+ {
+ oddNumValidator.validate(facesContext, new HtmlInputText(), new Integer(3));
+ }
+ catch(ValidatorException ve)
+ {
+ noExceptionsThrown = false;
+ }
+ assertTrue(noExceptionsThrown);
+ }
+
+ public void testEvenNumInput() throws Exception
+ {
+ boolean noExceptionsThrown = true;
+ try
+ {
+ oddNumValidator.validate(facesContext, new HtmlInputText(), new Integer(8));
+ }
+ catch(ValidatorException ve)
+ {
+ noExceptionsThrown = false;
+ }
+ assertFalse(noExceptionsThrown);
+ }
+
+
+}
Added: myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/pom.xml?rev=1090646&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/pom.xml (added)
+++ myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/pom.xml Sat Apr 9 18:28:53 2011
@@ -0,0 +1,202 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?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.
+-->
+<!-- This is the project descriptor for the examples of my components -->
+
+<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">
+ <parent>
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}-project</artifactId>
+ <version>${version}</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>${artifactId}-examples</artifactId>
+ <packaging>war</packaging>
+ <name>My Components Examples</name>
+
+ <properties>
+ <log4j.version>1.2.13</log4j.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}-core</artifactId>
+ <version>${symbol_dollar}{project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.2</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+
+ <profiles>
+ <!-- By default the war examples use myfaces! :) -->
+ <profile>
+ <id>myfaces</id>
+ <activation>
+ <property>
+ <name>!jsf</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>${symbol_dollar}{jsf-myfaces.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <version>${symbol_dollar}{jsf-myfaces.version}</version>
+ <!-- Sandbox examples must only have runtime dependency to myfaces-impl
+ so that it will be automatically added to war. But there must not be
+ any compile dependency on impl so that is is always possible to use
+ other JSF implementations. -->
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ <jsf_implementation>MyFaces</jsf_implementation>
+ </properties>
+ </profile>
+
+ <!-- To use the examples using the Sun's JSF Reference Implementation: -Djsf=ri -->
+ <profile>
+ <id>jsfri</id>
+ <activation>
+ <property>
+ <name>jsf</name>
+ <value>ri</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>${symbol_dollar}{jsf-ri.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>${symbol_dollar}{jsf-ri.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <id>java.net</id>
+ <url>http://download.java.net/maven/1</url>
+ <layout>legacy</layout>
+ </repository>
+ </repositories>
+
+ <properties>
+ <jsf_implementation>JSF-RI</jsf_implementation>
+ </properties>
+ </profile>
+ <profile>
+ <!-- Debug profile for myfaces and jetty.
+ It allows to see debug messages using -PjettyConfig -->
+ <id>jettyConfig</id>
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>src/main/log4j</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <!--This plugin allows to run the example using mvn jetty:run -->
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>${symbol_dollar}{maven.jetty.plugin.version}</version>
+ <configuration>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ <systemProperties>
+ <systemProperty>
+ <name>org.apache.commons.logging.Log</name>
+ <value>org.apache.commons.logging.impl.Log4JLogger</value>
+ </systemProperty>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${symbol_dollar}{log4j.version}</version>
+ <type>jar</type>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <!--This plugin allows to run the example using mvn jetty:run -->
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>${symbol_dollar}{maven.jetty.plugin.version}</version>
+ <configuration>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ </configuration>
+ </plugin>
+ </plugins>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </build>
+</project>
Added: myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/src/main/java/org/myorganization/component/example/SayHelloBean.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/src/main/java/org/myorganization/component/example/SayHelloBean.java?rev=1090646&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/src/main/java/org/myorganization/component/example/SayHelloBean.java (added)
+++ myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/src/main/java/org/myorganization/component/example/SayHelloBean.java Sat Apr 9 18:28:53 2011
@@ -0,0 +1,117 @@
+/*
+ * 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.myorganization.component.example;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+import javax.faces.event.ActionEvent;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.myorganization.converter.PhoneNumber;
+
+/**
+ * Managed bean for the sayHello page example
+ */
+public class SayHelloBean
+{
+
+ private static final Log log = LogFactory.getLog(SayHelloBean.class);
+
+ private String firstName;
+ private String lastName;
+ private boolean renderGreeting;
+ private Integer oddNumber;
+ private PhoneNumber phoneNumber;
+
+ public SayHelloBean()
+ {
+ this.renderGreeting = false;
+ }
+
+ public void sayIt(ActionEvent evt)
+ {
+ renderGreeting = true;
+
+ if (log.isInfoEnabled())
+ {
+ log.info("The name to say hello is '"+firstName+"' and the last name is '"+lastName+"'.");
+ }
+ }
+
+
+ public String getFirstName()
+ {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName)
+ {
+ this.firstName = firstName;
+ }
+
+ public String getLastName()
+ {
+ return lastName;
+ }
+
+ public void setLastName(String lastName)
+ {
+ this.lastName = lastName;
+ }
+
+
+ public boolean isRenderGreeting()
+ {
+ return renderGreeting;
+ }
+
+ public void setRenderGreeting(boolean renderGreeting)
+ {
+ this.renderGreeting = renderGreeting;
+ }
+
+ public Integer getOddNumber()
+ {
+ return oddNumber;
+ }
+
+ public void setOddNumber(Integer oddNumber)
+ {
+ this.oddNumber = oddNumber;
+ }
+
+ public String submitOddNumber() {
+ return "display_number";
+ }
+
+ public String submitPhoneNumber() {
+ return "display_phone";
+ }
+
+ public PhoneNumber getPhoneNumber()
+ {
+ return phoneNumber;
+ }
+
+ public void setPhoneNumber(PhoneNumber phoneNumber)
+ {
+ this.phoneNumber = phoneNumber;
+ }
+}
Added: myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/src/main/log4j/log4j.properties
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/src/main/log4j/log4j.properties?rev=1090646&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/src/main/log4j/log4j.properties (added)
+++ myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/src/main/log4j/log4j.properties Sat Apr 9 18:28:53 2011
@@ -0,0 +1,35 @@
+# 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.
+
+log4j.rootLogger=INFO, A1, A2
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+
+#log on a file on target too, to make easier check it
+log4j.appender.A2=org.apache.log4j.RollingFileAppender
+log4j.appender.A2.File=target/log4j.log
+log4j.appender.A2.MaxFileSize=1000KB
+# Keep one backup file
+log4j.appender.A2.MaxBackupIndex=1
+log4j.appender.A2.layout=org.apache.log4j.PatternLayout
+log4j.appender.A2.layout.ConversionPattern=%p %t %c - %m%n
+
+# Log level for myfaces libraries
+log4j.logger.org.apache.commons=INFO
+log4j.logger.org.apache.myfaces=TRACE
+log4j.logger.javax.faces=TRACE
+
+# Print the date in ISO 8601 format
+log4j.appender.A1.layout.ConversionPattern=%5p [%t] (%F\:%L) - %m%n
\ No newline at end of file
Added: myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/src/main/resources/org/myorganization/component/example/build.properties
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/src/main/resources/org/myorganization/component/example/build.properties?rev=1090646&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/src/main/resources/org/myorganization/component/example/build.properties (added)
+++ myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/src/main/resources/org/myorganization/component/example/build.properties Sat Apr 9 18:28:53 2011
@@ -0,0 +1,21 @@
+# 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.
+#
+# Do not edit this file, as it will be completed automatically
+# by maven during the build process
+mycomponents_version=${pom.version}
+jsf_implementation=${jsf_implementation}
\ No newline at end of file
Added: myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/src/main/resources/org/myorganization/component/example/messages.properties
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/src/main/resources/org/myorganization/component/example/messages.properties?rev=1090646&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/src/main/resources/org/myorganization/component/example/messages.properties (added)
+++ myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/src/main/resources/org/myorganization/component/example/messages.properties Sat Apr 9 18:28:53 2011
@@ -0,0 +1,25 @@
+title=My JSF Component Examples for JSF 2.0
+
+demo_component=sayHello - custom component demo
+demo_converter=phoneNumberConverter - custom converter demo
+demo_validator=oddNumberValidator - custom validator demo
+demo_composite_component=sayHelloCC - custom composite component demo
+
+home=[HOME]
+
+phone_number=Enter your phone number (Area Code-Number)
+
+show_area_code=Your area code is:
+show_number=Your number is:
+show_value_entered=Value entered is:
+
+say_hello=Say Hello!
+input_first_name=First name
+input_last_name=Last name
+
+input_odd_number=Enter an odd number
+submit=Submit
+
+probably_not_you_i_know=(probably not you, I know)
+
+hello=Hello
Added: myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/src/main/resources/org/myorganization/component/example/messages_en.properties
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-archetypes/myfaces-archetype-jsfcomponents20/src/main/resources/archetype-resources/examples/src/main/resources/org/myorganization/component/example/messages_en.properties?rev=1090646&view=auto
==============================================================================
(empty)