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 2010/11/06 03:14:24 UTC
svn commit: r1031929 - in /myfaces/commons/branches/jsf_20: ./
examples/myfaces-commons-facelets-examples/ myfaces-commons-components/
myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/
myfaces-commons-components/src/main/res...
Author: lu4242
Date: Sat Nov 6 02:14:23 2010
New Revision: 1031929
URL: http://svn.apache.org/viewvc?rev=1031929&view=rev
Log:
initial update to jsf 2.0
Added:
myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/resources/META-INF/componentClass20.vm
myfaces/commons/branches/jsf_20/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/util/AttachedDeltaWrapper.java
Modified:
myfaces/commons/branches/jsf_20/examples/myfaces-commons-facelets-examples/pom.xml
myfaces/commons/branches/jsf_20/myfaces-commons-components/pom.xml
myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/FaceletsExporterActionListenerTag.java
myfaces/commons/branches/jsf_20/myfaces-commons-converters/pom.xml
myfaces/commons/branches/jsf_20/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/ConverterBaseTagHandler.java
myfaces/commons/branches/jsf_20/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/_ConverterRule.java
myfaces/commons/branches/jsf_20/myfaces-commons-validators/pom.xml
myfaces/commons/branches/jsf_20/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/ValidatorBaseTagHandler.java
myfaces/commons/branches/jsf_20/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/_ValidatorRule.java
myfaces/commons/branches/jsf_20/pom.xml
Modified: myfaces/commons/branches/jsf_20/examples/myfaces-commons-facelets-examples/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/examples/myfaces-commons-facelets-examples/pom.xml?rev=1031929&r1=1031928&r2=1031929&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/examples/myfaces-commons-facelets-examples/pom.xml (original)
+++ myfaces/commons/branches/jsf_20/examples/myfaces-commons-facelets-examples/pom.xml Sat Nov 6 02:14:23 2010
@@ -63,12 +63,6 @@
</dependency>
<dependency>
- <groupId>com.sun.facelets</groupId>
- <artifactId>jsf-facelets</artifactId>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
<scope>compile</scope>
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-components/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-components/pom.xml?rev=1031929&r1=1031928&r2=1031929&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-components/pom.xml (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-components/pom.xml Sat Nov 6 02:14:23 2010
@@ -47,13 +47,13 @@
<goal>make-tags</goal>
</goals>
<configuration>
- <jsfVersion>1.2</jsfVersion>
+ <jsfVersion>2.0</jsfVersion>
</configuration>
</execution>
<execution>
<id>makefacesconfig</id>
<configuration>
- <templateFile>faces-config12.vm</templateFile>
+ <templateFile>faces-config20.vm</templateFile>
<xmlFile>META-INF/faces-config.xml</xmlFile>
</configuration>
<goals>
@@ -64,7 +64,7 @@
<id>maketld</id>
<configuration>
<xmlFile>META-INF/components.tld</xmlFile>
- <templateFile>tomahawk12.vm</templateFile>
+ <templateFile>tld-tomahawk20.vm</templateFile>
<params>
<shortname>mc</shortname>
<uri>http://myfaces.apache.org/commons/components</uri>
@@ -81,7 +81,7 @@
<configuration>
<xmlFile>META-INF/components.taglib.xml</xmlFile>
<xmlBaseFile>src/main/conf/META-INF/facelets-taglib-base.xml</xmlBaseFile>
- <templateFile>facelets-taglib.vm</templateFile>
+ <templateFile>facelets-taglib20.vm</templateFile>
<params>
<shortname>mc</shortname>
<uri>http://myfaces.apache.org/commons/components</uri>
@@ -152,12 +152,6 @@
</dependency>
<dependency>
- <groupId>com.sun.facelets</groupId>
- <artifactId>jsf-facelets</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
<groupId>org.apache.myfaces.commons</groupId>
<artifactId>myfaces-commons-utils20</artifactId>
<classifier>tests</classifier>
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/FaceletsExporterActionListenerTag.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/FaceletsExporterActionListenerTag.java?rev=1031929&r1=1031928&r2=1031929&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/FaceletsExporterActionListenerTag.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/FaceletsExporterActionListenerTag.java Sat Nov 6 02:14:23 2010
@@ -25,13 +25,12 @@ import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.component.ActionSource;
import javax.faces.component.UIComponent;
-
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.FaceletException;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.TagConfig;
-import com.sun.facelets.tag.TagHandler;
-import com.sun.facelets.tag.jsf.ComponentSupport;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.FaceletException;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagConfig;
+import javax.faces.view.facelets.TagHandler;
/**
* The (FaceletsExporterActionListenerTag) is responsible for handling the
@@ -57,7 +56,7 @@ public class FaceletsExporterActionListe
public void apply(FaceletContext faceletContext, UIComponent parent)
throws IOException, FacesException, FaceletException, ELException
{
- if (ComponentSupport.isNew(parent))
+ if (ComponentHandler.isNew(parent))
{
ValueExpression forVE = _for.getValueExpression(faceletContext,
Object.class);
Added: myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/resources/META-INF/componentClass20.vm
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/resources/META-INF/componentClass20.vm?rev=1031929&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/resources/META-INF/componentClass20.vm (added)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/resources/META-INF/componentClass20.vm Sat Nov 6 02:14:23 2010
@@ -0,0 +1,518 @@
+## Velocity template used to generate JSF1.2-compatible component classes
+## from component meta-data.
+##
+## Note that there are two types of component generation:
+## * "subclass mode" (use annotated class as a parent class)
+## * "template mode" (use annotated class as a template)
+## This template file is used for both.
+##
+## Variable $component refers to a ComponentMeta object to process
+## Variable $utils refers to an instance of MyfacesUtils.
+##
+## When "template mode" is being used then variable $innersource
+## holds a String containing all the non-abstract functions defined
+## in the annotated class.
+##
+## 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 ${component.packageName};
+
+import javax.el.ValueExpression;
+import javax.faces.context.FacesContext;
+import javax.faces.component.PartialStateHolder;
+import javax.faces.component.StateHolder;
+import org.apache.myfaces.commons.util.AttachedDeltaWrapper;
+$utils.importTagClasses($component)
+
+#if ($component.isTemplate())
+#set ($generatedClassParent = $component.sourceClassParentClassName)
+#else
+#set ($generatedClassParent = $component.sourceClassName)
+#end
+// Generated from class ${component.sourceClassName}.
+//
+// WARNING: This file was automatically generated. Do not edit it directly,
+// or you will lose your changes.
+public class ${utils.getClassFromFullClass($component.className)} extends $generatedClassParent
+#if ($component.implements)
+ implements $component.implements
+#end
+{
+#if ($component.serialuid)
+ private static final long serialVersionUID = ${component.serialuid};
+#end
+
+ static public final String COMPONENT_FAMILY =
+ "$component.family";
+ static public final String COMPONENT_TYPE =
+ "$component.type";
+#if ($component.rendererType)
+#if (!($component.rendererType == ""))
+ static public final String DEFAULT_RENDERER_TYPE =
+ "$component.rendererType";
+#end
+#end
+
+#if ($innersource)
+ //BEGIN CODE COPIED FROM $component.sourceClassName
+$innersource
+ //END CODE COPIED FROM $component.sourceClassName
+#end
+
+ public ${utils.getClassFromFullClass($component.className)}()
+ {
+#if ($component.rendererType)
+#if ($component.rendererType == "")
+ setRendererType(null);
+#else
+ setRendererType("$component.rendererType");
+#end
+#else
+ setRendererType(null);
+#end
+ }
+
+## On myfaces 1.1 the family is inherited, so this could be commented
+## On other this should not be commented
+ public String getFamily()
+ {
+ return COMPONENT_FAMILY;
+ }
+
+## Iterate over full component property list
+#set ($propertyList = ${component.propertyList})
+
+## TODO: this condition should be checked for parent components
+## and csv implements
+#if ($component.isClientBehaviorHolder())
+#if ($component.isOverrideEventNames())
+ static private final java.util.Collection<String> CLIENT_EVENTS_LIST =
+ java.util.Collections.unmodifiableCollection(
+ java.util.Arrays.asList(
+#set ($commavar = "")
+#foreach( $property in $propertyList )
+#if ($property.clientEvent)
+#if ($property.clientEvent != "")
+ $commavar "$property.clientEvent"
+#set ($commavar = ",")
+#end
+#end
+#end
+ ));
+
+ public java.util.Collection<String> getEventNames()
+ {
+ return CLIENT_EVENTS_LIST;
+ }
+#end
+#end
+#if ($component.defaultEventName)
+#if ($component.isOverrideDefaultEventName())
+
+ //ClientBehaviorHolder default: $component.defaultEventName
+ public String getDefaultEventName()
+ {
+ return "$component.defaultEventName";
+ }
+#end
+#end
+
+#set ($propertyList = ${component.propertyComponentList})
+
+#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.isPartialStateHolder())
+#if ($property.isLiteralOnly() || $property.isTagExcluded() )
+ private $type $field #if($defaultValue) = $defaultValue;#{else};#{end}
+
+
+#else
+ private $type $field;
+
+#end
+
+ private boolean _$utils.getPrefixedPropertyName("isSet", $property.name)()
+ {
+ Boolean value = (Boolean) getStateHelper().get(PropertyKeys.${property.name}Set);
+ return value == null ? false : value;
+ }
+
+#if($utils.isPrimitiveClass($type) && !$property.isTagExcluded()
+ && !$property.isLiteralOnly() )
+ 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 (initialStateMarked())
+ {
+ getStateHelper().put(PropertyKeys.${property.name}Set,Boolean.TRUE);
+ }
+#if ($utils.isPrimitiveClass($type) && !$property.isTagExcluded() )
+ this.${field}Set = true;
+#end
+ }
+#else
+## StateHelper aware property
+#if ($property.name == "for")
+## To keep compatibility with RI, we should call it forVal
+#set ($field = "forVal")
+#else
+#set ($field = $property.name)
+#end
+#if ($property.isSetMethod())
+ $property.setMethodScope boolean $utils.getPrefixedPropertyName("isSet", $property.name)()
+ {
+ return getStateHelper().get(PropertyKeys.$field) != null;
+ }
+#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 $utils.castIfNecessary($type) getStateHelper().get(PropertyKeys.$field);
+ }
+
+#end
+ public $type $utils.getMethodReaderFromProperty($property.name, $type)()
+ {
+#if ($property.isLiteralOnly())
+#if ($defaultValue)
+ Object value = getStateHelper().get(PropertyKeys.$field);
+ if (value != null)
+ {
+ return $utils.castIfNecessary($type) value;
+ }
+ return $defaultValue;
+#elseif ($utils.isPrimitiveClass($type))
+ Object value = getStateHelper().get(PropertyKeys.$field);
+ if (value != null)
+ {
+ return $utils.castIfNecessary($type) value;
+ }
+ return $utils.primitiveDefaultValue($type);
+#else
+ return $utils.castIfNecessary($type) getStateHelper().get(PropertyKeys.$field);
+#end
+#else
+#if ($defaultValue)
+ return $utils.castIfNecessary($type) getStateHelper().eval(PropertyKeys.$field, $defaultValue);
+#elseif ($utils.isPrimitiveClass($type))
+ Object value = $utils.castIfNecessary($type) getStateHelper().eval(PropertyKeys.$field);
+ if (value != null)
+ {
+ return $utils.castIfNecessary($type) value;
+ }
+ return $utils.primitiveDefaultValue($type);
+#else
+ return $utils.castIfNecessary($type) getStateHelper().eval(PropertyKeys.$field);
+#end
+#end
+ }
+
+ public void $utils.getPrefixedPropertyName("set", $property.name)($type $utils.getVariableFromName($property.name))
+ {
+ getStateHelper().put(PropertyKeys.$field, $utils.getVariableFromName($property.name) );
+ }
+#end
+#end
+
+ protected enum PropertyKeys
+ {
+#set ($comma = "")
+#set ($addc = "false")
+#foreach( $property in $propertyList )
+#if ($property.name == "for")
+#set ($addc = "true")
+## To keep compatibility with RI, we should call it forVal
+#set ($field = "forVal")
+#else
+#set ($field = $property.name)
+#end
+#set ($type = $utils.getClassFromFullClass($property.className))
+#if($utils.getDefaultValueField($property))
+#set ($defaultValue = $utils.getDefaultValueField($property))
+#else
+#set ($defaultValue = false)
+#end
+#if ($property.name == "for")
+ $comma $field("for")
+#else
+#if ($property.isPartialStateHolder())
+ $comma ${field}Set
+#else
+ $comma $field
+#end
+#end
+#set($comma = ",")
+#end
+#if ("true" == $addc)
+ ;
+ String c;
+
+ PropertyKeys()
+ {
+ }
+
+ //Constructor needed by "for" property
+ PropertyKeys(String c)
+ {
+ this.c = c;
+ }
+
+ public String toString()
+ {
+ return ((this.c != null) ? this.c : super.toString());
+ }
+#end
+ }
+
+#set ($primitiveCount = 1) ## $propertyList.size() + 1
+#foreach( $property in $propertyList )
+#if ($property.isPartialStateHolder())
+#set ($primitiveCount = $primitiveCount + 1)
+#if($utils.isPrimitiveClass($property.className))
+#set ($primitiveCount = $primitiveCount + 1)
+#end
+#end
+#end
+## saveState and restoreState methods only has sense if we have properties
+## that does not use StateHelper class.
+#if ($primitiveCount > 1)
+
+ public void markInitialState()
+ {
+ super.markInitialState();
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#if ($property.isPartialStateHolder())
+ if ($field != null &&
+ $field instanceof PartialStateHolder)
+ {
+ ((PartialStateHolder)$field).markInitialState();
+ }
+#end
+#end
+ }
+
+ public void clearInitialState()
+ {
+ if (initialStateMarked())
+ {
+ super.clearInitialState();
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#if ($property.isPartialStateHolder())
+## //Only has sense propagate this method if is initialStateMarked
+ if ($field != null &&
+ $field instanceof PartialStateHolder)
+ {
+ ((PartialStateHolder)$field).clearInitialState();
+ }
+#end
+#end
+ }
+ }
+
+ @Override
+ public Object saveState(FacesContext facesContext)
+ {
+ if (initialStateMarked())
+ {
+ boolean nullDelta = true;
+ Object parentSaved = super.saveState(facesContext);
+#set ($arrayIndex = 0)
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $property.className)
+#if ($property.isPartialStateHolder())
+#set ($arrayIndex = $arrayIndex + 1)
+ Object ${property.name}Saved = null;
+ if (!_$utils.getPrefixedPropertyName("isSet", $property.name)() &&
+ $field != null && $field instanceof PartialStateHolder)
+ {
+ //Delta
+ StateHolder holder = (StateHolder) $field;
+ if (!holder.isTransient())
+ {
+ Object attachedState = holder.saveState(facesContext);
+ if (attachedState != null)
+ {
+ nullDelta = false;
+ }
+ ${property.name}Saved = new AttachedDeltaWrapper(${field}.getClass(),
+ attachedState);
+ }
+ }
+ else if (_$utils.getPrefixedPropertyName("isSet", $property.name)() || $field != null )
+ {
+ //Full
+ ${property.name}Saved = saveAttachedState(facesContext,$field);
+ nullDelta = false;
+ }
+## StateHelper Properties does not need save and restore
+#end
+#end
+ if (parentSaved == null && nullDelta)
+ {
+ //No values
+ return null;
+ }
+
+ Object[] values = new Object[$primitiveCount];
+ values[0] = parentSaved;
+## Save full state
+#set ($arrayIndex = 0)
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $property.className)
+#if ($property.isPartialStateHolder())
+#set ($arrayIndex = $arrayIndex + 1)
+ values[$arrayIndex] = ${property.name}Saved;
+## StateHelper Properties does not need save and restore
+#end
+#end
+ return values;
+ }
+ else
+ {
+ Object[] values = new Object[$primitiveCount];
+ values[0] = super.saveState(facesContext);
+## Save full state
+#set ($arrayIndex = 0)
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $property.className)
+#if ($property.isPartialStateHolder())
+#set ($arrayIndex = $arrayIndex + 1)
+ values[$arrayIndex] = saveAttachedState(facesContext,$field);
+## StateHelper Properties does not need save and restore
+#end
+#end
+ return values;
+ }
+ }
+
+ @Override
+ public void restoreState(FacesContext facesContext, Object state)
+ {
+ if (state == null)
+ {
+ return;
+ }
+
+ Object[] values = (Object[])state;
+ super.restoreState(facesContext,values[0]);
+#set ($arrayIndex = 0)
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $property.className)
+#if ($property.isPartialStateHolder())
+#set ($arrayIndex = $arrayIndex + 1)
+ if (values[$arrayIndex] instanceof AttachedDeltaWrapper)
+ {
+ //Delta
+ ((StateHolder)$field).restoreState(facesContext, ((AttachedDeltaWrapper) values[$arrayIndex]).getWrappedStateObject());
+ }
+ else
+ {
+ //Full
+ $field = $utils.castIfNecessary($type) restoreAttachedState(facesContext,values[$arrayIndex]);
+ }
+#else
+## StateHelper Properties does not need save and restore
+#end
+#end
+ }
+#end
+}
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-converters/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-converters/pom.xml?rev=1031929&r1=1031928&r2=1031929&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-converters/pom.xml (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-converters/pom.xml Sat Nov 6 02:14:23 2010
@@ -48,7 +48,7 @@
<execution>
<id>makefacesconfig</id>
<configuration>
- <templateFile>faces-config12.vm</templateFile>
+ <templateFile>faces-config20.vm</templateFile>
<xmlFile>META-INF/faces-config.xml</xmlFile>
</configuration>
<goals>
@@ -61,13 +61,13 @@
<goal>make-converters</goal>
</goals>
<configuration>
- <jsfVersion>12</jsfVersion>
+ <jsfVersion>20</jsfVersion>
</configuration>
</execution>
<execution>
<id>make_converter_tags</id>
<configuration>
- <jsfVersion>12</jsfVersion>
+ <jsfVersion>20</jsfVersion>
</configuration>
<goals>
<goal>make-converter-tags</goal>
@@ -78,7 +78,7 @@
<configuration>
<xmlFile>META-INF/mcc.tld</xmlFile>
<xmlBaseFile>src/main/conf/META-INF/mcc-base.tld</xmlBaseFile>
- <templateFile>tomahawk12.vm</templateFile>
+ <templateFile>tld-tomahawk20.vm</templateFile>
<params>
<shortname>mcc</shortname>
<uri>http://myfaces.apache.org/commons/converters</uri>
@@ -88,7 +88,7 @@
</description>
</params>
<modelIds>
- <modelId>myfaces-converters12</modelId>
+ <modelId>myfaces-converters20</modelId>
</modelIds>
</configuration>
<goals>
@@ -100,13 +100,13 @@
<configuration>
<xmlFile>META-INF/mcc.taglib.xml</xmlFile>
<xmlBaseFile>src/main/conf/META-INF/facelets-taglib-base.xml</xmlBaseFile>
- <templateFile>facelets-taglib.vm</templateFile>
+ <templateFile>facelets-taglib20.vm</templateFile>
<params>
<shortname>mcc</shortname>
<uri>http://myfaces.apache.org/commons/converters</uri>
</params>
<modelIds>
- <modelId>myfaces-converters12</modelId>
+ <modelId>myfaces-converters20</modelId>
</modelIds>
</configuration>
<goals>
@@ -154,12 +154,6 @@
</dependency>
<dependency>
- <groupId>com.sun.facelets</groupId>
- <artifactId>jsf-facelets</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/ConverterBaseTagHandler.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/ConverterBaseTagHandler.java?rev=1031929&r1=1031928&r2=1031929&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/ConverterBaseTagHandler.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/ConverterBaseTagHandler.java Sat Nov 6 02:14:23 2010
@@ -18,11 +18,12 @@
*/
package org.apache.myfaces.commons.converter;
-import com.sun.facelets.tag.MetaRuleset;
-import com.sun.facelets.tag.jsf.ConvertHandler;
-import com.sun.facelets.tag.jsf.ConverterConfig;
+import javax.faces.view.facelets.ConverterConfig;
+import javax.faces.view.facelets.ConverterHandler;
+import javax.faces.view.facelets.MetaRuleset;
-public class ConverterBaseTagHandler extends ConvertHandler
+
+public class ConverterBaseTagHandler extends ConverterHandler
{
public ConverterBaseTagHandler(ConverterConfig config)
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/_ConverterRule.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/_ConverterRule.java?rev=1031929&r1=1031928&r2=1031929&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/_ConverterRule.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/_ConverterRule.java Sat Nov 6 02:14:23 2010
@@ -18,11 +18,11 @@
*/
package org.apache.myfaces.commons.converter;
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.MetaRule;
-import com.sun.facelets.tag.Metadata;
-import com.sun.facelets.tag.MetadataTarget;
-import com.sun.facelets.tag.TagAttribute;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
final class _ConverterRule extends MetaRule {
Added: myfaces/commons/branches/jsf_20/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/util/AttachedDeltaWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/util/AttachedDeltaWrapper.java?rev=1031929&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/util/AttachedDeltaWrapper.java (added)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-utils/src/main/java/org/apache/myfaces/commons/util/AttachedDeltaWrapper.java Sat Nov 6 02:14:23 2010
@@ -0,0 +1,52 @@
+/*
+ * 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.util;
+
+import java.io.Serializable;
+
+/**
+ * @author Leonardo Uribe (latest modification by $Author: lu4242 $)
+ * @version $Revision: 788877 $ $Date: 2009-06-26 16:30:38 -0500 (vie, 26 jun 2009) $
+ */
+public class AttachedDeltaWrapper implements Serializable
+{
+ private static final long serialVersionUID = 4732389964367986402L;
+
+ private Object _wrappedStateObject;
+
+ /**
+ * @param clazz
+ * null means wrappedStateObject is a List of state objects
+ * @param wrappedStateObject
+ */
+ public AttachedDeltaWrapper(Class<?> clazz, Object wrappedStateObject)
+ {
+ if (wrappedStateObject != null && !(wrappedStateObject instanceof Serializable))
+ {
+ throw new IllegalArgumentException("Attached state for Object of type " + clazz + " (Class "
+ + wrappedStateObject.getClass().getName() + ") is not serializable");
+ }
+ _wrappedStateObject = wrappedStateObject;
+ }
+
+ public Object getWrappedStateObject()
+ {
+ return _wrappedStateObject;
+ }
+}
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-validators/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-validators/pom.xml?rev=1031929&r1=1031928&r2=1031929&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-validators/pom.xml (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-validators/pom.xml Sat Nov 6 02:14:23 2010
@@ -48,7 +48,7 @@
<execution>
<id>makefacesconfig</id>
<configuration>
- <templateFile>faces-config12.vm</templateFile>
+ <templateFile>faces-config20.vm</templateFile>
<xmlFile>META-INF/faces-config.xml</xmlFile>
</configuration>
<goals>
@@ -61,13 +61,13 @@
<goal>make-validators</goal>
</goals>
<configuration>
- <jsfVersion>12</jsfVersion>
+ <jsfVersion>20</jsfVersion>
</configuration>
</execution>
<execution>
<id>make_validator_tags</id>
<configuration>
- <jsfVersion>12</jsfVersion>
+ <jsfVersion>20</jsfVersion>
</configuration>
<goals>
<goal>make-validator-tags</goal>
@@ -78,7 +78,7 @@
<configuration>
<xmlFile>META-INF/mcv.tld</xmlFile>
<xmlBaseFile>src/main/conf/META-INF/mcv-base.tld</xmlBaseFile>
- <templateFile>tomahawk12.vm</templateFile>
+ <templateFile>tld-tomahawk20.vm</templateFile>
<params>
<shortname>mcv</shortname>
<uri>http://myfaces.apache.org/commons/validators</uri>
@@ -101,7 +101,7 @@
<configuration>
<xmlFile>META-INF/mcc.taglib.xml</xmlFile>
<xmlBaseFile>src/main/conf/META-INF/facelets-taglib-base.xml</xmlBaseFile>
- <templateFile>facelets-taglib.vm</templateFile>
+ <templateFile>facelets-taglib20.vm</templateFile>
<params>
<shortname>mcv</shortname>
<uri>http://myfaces.apache.org/commons/validators</uri>
@@ -156,12 +156,6 @@
</dependency>
<dependency>
- <groupId>com.sun.facelets</groupId>
- <artifactId>jsf-facelets</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/ValidatorBaseTagHandler.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/ValidatorBaseTagHandler.java?rev=1031929&r1=1031928&r2=1031929&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/ValidatorBaseTagHandler.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/ValidatorBaseTagHandler.java Sat Nov 6 02:14:23 2010
@@ -18,17 +18,17 @@
*/
package org.apache.myfaces.commons.validator;
-import com.sun.facelets.tag.MetaRuleset;
-import com.sun.facelets.tag.jsf.ValidateHandler;
-import com.sun.facelets.tag.jsf.ValidatorConfig;
+import javax.faces.view.facelets.MetaRuleset;
+import javax.faces.view.facelets.ValidatorConfig;
+import javax.faces.view.facelets.ValidatorHandler;
-public class ValidatorBaseTagHandler extends ValidateHandler
+
+public class ValidatorBaseTagHandler extends ValidatorHandler
{
public ValidatorBaseTagHandler(ValidatorConfig config)
{
super(config);
- // TODO Auto-generated constructor stub
}
@Override
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/_ValidatorRule.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/_ValidatorRule.java?rev=1031929&r1=1031928&r2=1031929&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/_ValidatorRule.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/_ValidatorRule.java Sat Nov 6 02:14:23 2010
@@ -18,11 +18,11 @@
*/
package org.apache.myfaces.commons.validator;
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.MetaRule;
-import com.sun.facelets.tag.Metadata;
-import com.sun.facelets.tag.MetadataTarget;
-import com.sun.facelets.tag.TagAttribute;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
final class _ValidatorRule extends MetaRule {
Modified: myfaces/commons/branches/jsf_20/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/pom.xml?rev=1031929&r1=1031928&r2=1031929&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/pom.xml (original)
+++ myfaces/commons/branches/jsf_20/pom.xml Sat Nov 6 02:14:23 2010
@@ -175,12 +175,6 @@
<version>1.0.7-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>com.sun.facelets</groupId>
- <artifactId>jsf-facelets</artifactId>
- <version>1.1.14</version>
- <scope>provided</scope>
- </dependency>
<dependency>
<groupId>org.apache.myfaces.test</groupId>