You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ma...@apache.org on 2010/01/05 12:50:30 UTC

svn commit: r896009 [4/30] - in /myfaces/trinidad/branches/2.0.1-branch: ./ src/site/xdoc/devguide/ trinidad-api/ trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/ trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/ t...

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CoreTable.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CoreTable.xml?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CoreTable.xml (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CoreTable.xml Tue Jan  5 11:48:54 2010
@@ -248,6 +248,9 @@
       <mfp:author>Brian Albers</mfp:author>
       <mfp:component-metadata/>
       <mfp:uix2-local-name>table</mfp:uix2-local-name>
+      <fmd:default-event-name>click</fmd:default-event-name>
+      <fmd:event-names>click dblclick mousedown mouseup mouseover mousemove mouseout
+        keypress keydown keyup</fmd:event-names>
       <fmd:component-metadata>
         <fmd:default-property>id</fmd:default-property>
         <fmd:preferred-child-components>org.apache.myfaces.trinidad.CoreColumn</fmd:preferred-child-components>

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CoreTrain.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CoreTrain.xml?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CoreTrain.xml (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CoreTrain.xml Tue Jan  5 11:48:54 2010
@@ -110,6 +110,9 @@
         </mfp:source-code>
       </mfp:example>
       <mfp:author>Jeanne Waldman</mfp:author>
+      <fmd:default-event-name>click</fmd:default-event-name>
+      <fmd:event-names>click dblclick mousedown mouseup mouseover mousemove mouseout
+        keypress keydown keyup</fmd:event-names>
       <mfp:component-metadata/>
       <mfp:uix2-local-name>train</mfp:uix2-local-name>
     </component-extension>

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CoreTree.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CoreTree.xml?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CoreTree.xml (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CoreTree.xml Tue Jan  5 11:48:54 2010
@@ -76,6 +76,9 @@
       <mfp:component-metadata/>
       <mfp:uix2-local-name>tree</mfp:uix2-local-name>
       <mfp:unsupported-agents>phone voice</mfp:unsupported-agents>
+      <fmd:default-event-name>click</fmd:default-event-name>
+      <fmd:event-names>click dblclick mousedown mouseup mouseover mousemove mouseout
+        keypress keydown keyup</fmd:event-names>
       <fmd:component-metadata>
         <fmd:allowed-child-components>NONE</fmd:allowed-child-components>
         <fmd:default-property>value</fmd:default-property>

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CoreTreeTable.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CoreTreeTable.xml?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CoreTreeTable.xml (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/core/CoreTreeTable.xml Tue Jan  5 11:48:54 2010
@@ -136,6 +136,9 @@
         <mfp:unsupported-agents>pda phone voice</mfp:unsupported-agents>
       </mfp:component-metadata>
       <mfp:uix2-local-name>hGrid</mfp:uix2-local-name>
+      <fmd:default-event-name>click</fmd:default-event-name>
+      <fmd:event-names>click dblclick mousedown mouseup mouseover mousemove mouseout
+        keypress keydown keyup</fmd:event-names>
       <fmd:component-metadata>
         <fmd:default-property>id</fmd:default-property>
         <fmd:preferred-child-components>org.apache.myfaces.trinidad.CoreColumn</fmd:preferred-child-components>

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/html/HtmlBody.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/html/HtmlBody.xml?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/html/HtmlBody.xml (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/html/HtmlBody.xml Tue Jan  5 11:48:54 2010
@@ -79,7 +79,7 @@
         <mfp:property-metadata>
           <mfp:multi-scoped-id-holder>true</mfp:multi-scoped-id-holder>
         </mfp:property-metadata>
-      </property-extension>      
+      </property-extension>
     </property>
     <property>
       <description><![CDATA[an onclick Javascript handler.]]></description>
@@ -279,6 +279,9 @@
       <mfp:author>Blake Sullivan</mfp:author>
       <mfp:component-metadata/>
       <mfp:uix2-local-name>body</mfp:uix2-local-name>
+      <fmd:default-event-name>load</fmd:default-event-name>
+      <fmd:event-names>click dblclick mousedown mouseup mouseover mousemove mouseout
+        keypress keydown keyup load unload</fmd:event-names>
       <fmd:component-metadata>
         <fmd:preferred-child-components>org.apache.myfaces.trinidad.CorePanelPage org.apache.myfaces.trinidad.CoreForm</fmd:preferred-child-components>
         <fmd:required-ancestor-contracts>org-apache-myfaces-trinidad-htmlbody-holder</fmd:required-ancestor-contracts>

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/html/HtmlCellFormat.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/html/HtmlCellFormat.xml?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/html/HtmlCellFormat.xml (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/html/HtmlCellFormat.xml Tue Jan  5 11:48:54 2010
@@ -109,7 +109,7 @@
         <fmd:property-metadata>
           <fmd:required>false</fmd:required>
         </fmd:property-metadata>
-      </property-extension>      
+      </property-extension>
     </property>
     <property>
       <description><![CDATA[Indicates whether or not this table cell is a header cell or a data cell.
@@ -143,7 +143,7 @@
         <mfp:property-metadata>
           <mfp:multi-scoped-id-holder>true</mfp:multi-scoped-id-holder>
         </mfp:property-metadata>
-      </property-extension>      
+      </property-extension>
     </property>
     <property>
       <description><![CDATA[an onclick Javascript handler.]]></description>
@@ -319,6 +319,9 @@
       <mfp:java-constructor>
         <mfp:property-name>vAlign</mfp:property-name>
       </mfp:java-constructor>
+      <fmd:default-event-name>click</fmd:default-event-name>
+      <fmd:event-names>click dblclick mousedown mouseup mouseover mousemove mouseout
+        keypress keydown keyup</fmd:event-names>
       <fmd:component-metadata>
         <fmd:required-ancestor-contracts>org-apache-myfaces-trinidad-htmlcellformat-holder</fmd:required-ancestor-contracts>
       </fmd:component-metadata>

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/html/HtmlFrameBorderLayout.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/html/HtmlFrameBorderLayout.xml?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/html/HtmlFrameBorderLayout.xml (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/html/HtmlFrameBorderLayout.xml Tue Jan  5 11:48:54 2010
@@ -307,7 +307,7 @@
         <mfp:property-metadata>
           <mfp:multi-scoped-id-holder>true</mfp:multi-scoped-id-holder>
         </mfp:property-metadata>
-      </property-extension>      
+      </property-extension>
     </property>
     <property>
       <description><![CDATA[the CSS style class of the bean.]]></description>
@@ -368,6 +368,8 @@
       <mfp:component-metadata/>
       <mfp:uix2-local-name>frameBorderLayout</mfp:uix2-local-name>
       <mfp:unsupported-agents>pda phone voice</mfp:unsupported-agents>
+      <fmd:default-event-name>load</fmd:default-event-name>
+      <fmd:event-names>load unload</fmd:event-names>
       <fmd:component-metadata>
         <fmd:preferred-child-components>org.apache.myfaces.trinidad.HtmlFrame</fmd:preferred-child-components>
         <fmd:required-ancestor-contracts>org-apache-myfaces-trinidad-htmlframeborderlayout-holder</fmd:required-ancestor-contracts>

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/html/HtmlRowLayout.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/html/HtmlRowLayout.xml?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/html/HtmlRowLayout.xml (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/html/HtmlRowLayout.xml Tue Jan  5 11:48:54 2010
@@ -266,6 +266,9 @@
       <mfp:java-constructor>
         <mfp:property-name>width</mfp:property-name>
       </mfp:java-constructor>
+      <fmd:default-event-name>click</fmd:default-event-name>
+      <fmd:event-names>click dblclick mousedown mouseup mouseover mousemove mouseout
+        keypress keydown keyup</fmd:event-names>
       <fmd:component-metadata>
         <fmd:preferred-child-components>org.apache.myfaces.trinidad.HtmlCellFormat</fmd:preferred-child-components>
         <fmd:required-ancestor-contracts>org-apache-myfaces-trinidad-htmlrowlayout-holder</fmd:required-ancestor-contracts>

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/html/HtmlTableLayout.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/html/HtmlTableLayout.xml?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/html/HtmlTableLayout.xml (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/html/HtmlTableLayout.xml Tue Jan  5 11:48:54 2010
@@ -102,7 +102,7 @@
         <mfp:property-metadata>
           <mfp:multi-scoped-id-holder>true</mfp:multi-scoped-id-holder>
         </mfp:property-metadata>
-      </property-extension>      
+      </property-extension>
     </property>
     <property>
       <description><![CDATA[an onclick Javascript handler.]]></description>
@@ -277,6 +277,9 @@
       <mfp:java-constructor>
         <mfp:property-name>width</mfp:property-name>
       </mfp:java-constructor>
+      <fmd:default-event-name>click</fmd:default-event-name>
+      <fmd:event-names>click dblclick mousedown mouseup mouseover mousemove mouseout
+        keypress keydown keyup</fmd:event-names>
       <fmd:component-metadata>
         <fmd:preferred-child-components>org.apache.myfaces.trinidad.HtmlRowLayout</fmd:preferred-child-components>
         <fmd:satisfied-contracts>org-apache-myfaces-trinidad-htmlrowlayout-holder</fmd:satisfied-contracts>

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/pom.xml?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/pom.xml (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/pom.xml Tue Jan  5 11:48:54 2010
@@ -27,7 +27,7 @@
   <parent>
     <groupId>org.apache.myfaces.trinidad</groupId>
     <artifactId>trinidad</artifactId>
-    <version>1.2.12.2-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>trinidad-example</artifactId>
@@ -129,7 +129,7 @@
             <scope>runtime</scope>
           </dependency-->
 
-          <dependency>
+          <!--dependency>
             <groupId>org.apache.myfaces.core</groupId>
             <artifactId>myfaces-api</artifactId>
             <scope>compile</scope>
@@ -139,7 +139,8 @@
             <groupId>org.apache.myfaces.core</groupId>
             <artifactId>myfaces-impl</artifactId>
             <scope>runtime</scope>
-          </dependency>
+          </dependency-->
+          
          </dependencies>
        </dependencyManagement>
      </profile>
@@ -150,13 +151,16 @@
       flag.  To invoke this profile, simply do not include a -Djsf= property on your maven
       command line.  Execute this profile like this:
       
+      mstarets - The default has been temporarily changed to JSF RI
+      TODO: Restore old profile activation rules after we can build with myfaces
+      
       mvn -PjettyConfig jetty:run
     -->    
     <profile>
       <id>myfaces</id>
       <activation>
         <property>
-          <name>!jsf</name>
+          <name>myfaces</name>
         </property>
       </activation>
       <dependencies>
@@ -169,6 +173,7 @@
           <artifactId>myfaces-impl</artifactId>
         </dependency>
       </dependencies>
+      
     </profile>
 
     <!--
@@ -183,17 +188,16 @@
       <id>jsfri</id>
       <activation>
         <property>
-          <name>jsf</name>
-          <value>ri</value>
+          <name>!myfaces</name>
         </property>
       </activation>
       <dependencies>
         <dependency>
-          <groupId>javax.faces</groupId>
+          <groupId>com.sun.faces</groupId>
           <artifactId>jsf-api</artifactId>
         </dependency>
         <dependency>
-          <groupId>javax.faces</groupId>
+          <groupId>com.sun.faces</groupId>
           <artifactId>jsf-impl</artifactId>
         </dependency>
       </dependencies>      

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-blank/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-blank/pom.xml?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-blank/pom.xml (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-blank/pom.xml Tue Jan  5 11:48:54 2010
@@ -26,7 +26,7 @@
   <parent>
     <groupId>org.apache.myfaces.trinidad</groupId>
     <artifactId>trinidad-example</artifactId>
-    <version>1.2.12.2-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>trinidad-blank</artifactId>

Propchange: myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Jan  5 11:48:54 2010
@@ -6,3 +6,4 @@
 .classpath
 .project
 .settings
+*.jpr

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/pom.xml?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/pom.xml (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/pom.xml Tue Jan  5 11:48:54 2010
@@ -7,7 +7,7 @@
   <parent>
     <groupId>org.apache.myfaces.trinidad</groupId>
     <artifactId>trinidad-example</artifactId>
-    <version>1.2.12.2-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>trinidad-demo</artifactId>
@@ -23,6 +23,22 @@
       <version>${project.version}</version>
     </dependency>-->
 
+          <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-validator</artifactId>
+            <version>4.0.0.GA</version>
+          </dependency>
+          <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>1.4.2</version>
+          </dependency>
+          <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>1.4.2</version>
+          </dependency>
+
     <dependency>
       <groupId>javax.mail</groupId>
       <artifactId>mail</artifactId>
@@ -76,21 +92,22 @@
       <id>jettyConfig</id>
       <dependencyManagement>
         <dependencies>
+
           <dependency>
-            <groupId>javax.faces</groupId>
+            <groupId>com.sun.faces</groupId>
             <artifactId>jsf-api</artifactId>
             <version>${jsf-ri.version}</version>
             <scope>compile</scope>
           </dependency>
 
           <dependency>
-            <groupId>javax.faces</groupId>
+            <groupId>com.sun.faces</groupId>
             <artifactId>jsf-impl</artifactId>
             <version>${jsf-ri.version}</version>
             <scope>runtime</scope>
           </dependency>
 
-          <dependency>
+          <!--dependency>
             <groupId>org.apache.myfaces.core</groupId>
             <artifactId>myfaces-api</artifactId>
             <version>${jsf-myfaces.version}</version>
@@ -102,7 +119,7 @@
             <artifactId>myfaces-impl</artifactId>
             <version>${jsf-myfaces.version}</version>
             <scope>runtime</scope>
-          </dependency>
+          </dependency-->
         </dependencies>
       </dependencyManagement>
 

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/faces-config.xml?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/faces-config.xml Tue Jan  5 11:48:54 2010
@@ -21,7 +21,10 @@
 <!DOCTYPE faces-config PUBLIC
   "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
   "http://java.sun.com/dtd/web-facesconfig_1_1.dtd" >
-<faces-config>
+<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">
 
   <application>
     <!-- Use the Trinidad RenderKit -->
@@ -66,6 +69,16 @@
     </locale-config>
 
   </application>
+
+  <!-- behaviors -->
+
+  <behavior>
+    <behavior-id>invoke-function</behavior-id>
+    <behavior-class>org.apache.myfaces.trinidaddemo.behaviors.InvokeFunctionBehavior</behavior-class>
+  </behavior>
+
+  <!-- components -->
+
   <component>
     <component-type>org.apache.myfaces.trinidaddemo.DateField</component-type>
     <component-class>org.apache.myfaces.trinidaddemo.composite.DateField</component-class>
@@ -77,6 +90,13 @@
       <renderer-type>org.apache.myfaces.trinidaddemo.DateField</renderer-type>
       <renderer-class>org.apache.myfaces.trinidaddemo.composite.DateFieldAsRenderer</renderer-class>
     </renderer>
+
+    <client-behavior-renderer>
+      <client-behavior-renderer-type>invoke-function</client-behavior-renderer-type>
+      <client-behavior-renderer-class>
+        org.apache.myfaces.trinidaddemo.behaviors.render.InvokeFunctionBehaviorRenderer
+      </client-behavior-renderer-class>
+    </client-behavior-renderer>
   </render-kit>
 
   <converter>
@@ -184,6 +204,16 @@
   </managed-bean>
 
   <managed-bean>
+    <managed-bean-name>stateSaving</managed-bean-name>
+    <managed-bean-class>
+       org.apache.myfaces.trinidaddemo.test.stateSaving.TestStateSavingBean
+    </managed-bean-class>
+    <managed-bean-scope>
+       session
+    </managed-bean-scope>
+  </managed-bean>  
+
+  <managed-bean>
     <managed-bean-name>messages</managed-bean-name>
     <managed-bean-class>
        org.apache.myfaces.trinidaddemo.MessagesBean

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/web.xml?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/web.xml Tue Jan  5 11:48:54 2010
@@ -16,19 +16,17 @@
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
     under the License.
-	   
+     
 -->
 <web-app 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-app_2_5.xsd"
          version="2.5">
-  <!-- Use client-side state saving.  In Trinidad, it is an
-       optimized, token-based mechanism that is almost always a
-       better choice than the standard JSF server-side state saving. -->
+
+  <!-- setting the project stage to be DEVELOPMENT -->
   <context-param>
-    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
-    <param-value>client</param-value>
-    <!--param-value>server</param-value-->
+    <param-name>javax.faces.PROJECT_STAGE</param-name>   
+    <param-value>Development</param-value>
   </context-param>
 
   <context-param>
@@ -47,6 +45,17 @@
     <param-name>org.apache.myfaces.trinidadinternal.ENABLE_PPR_OPTIMIZATION</param-name>
     <param-value>false</param-value>
   </context-param>
+ 
+  <!-- In Trinidad, we use an optimized, token-based mechanism if either 
+       1] javax.faces.STATE_SAVING_METHOD = server
+       2] javax.faces.STATE_SAVING_METHOD = client and 
+          org.apache.myfaces.trinidad.CLIENT_STATE_METHOD = token
+  -->
+  <context-param>
+    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+    <param-value>client</param-value>
+    <!--param-value>server</param-value-->
+  </context-param>
 
   <!-- Parameter to set the maximum number of client view state tokens.
        Uncomment this to test low-token-count scenarios.
@@ -62,17 +71,66 @@
     <param-name>org.apache.myfaces.trinidad.CLIENT_STATE_METHOD</param-name>
     <param-value>all</param-value>
   </context-param-->
+<!-- When token client-side state saving is enabled, MyFaces Trinidad can apply an additional
+     optimization by caching an entire UIViewRoot tree with each token. 
+     (Note that this does not affect thread safety or session failover.) 
+     This is a major optimization for AJAX-intensive systems, as postbacks can be processed 
+     far more rapidly without the need to reinstantiate the UIViewRoot tree. 
+     
+     You set the org.apache.myfaces.trinidad.CACHE_VIEW_ROOT parameter to true to enable caching. 
+     True is the default. Set the parameter to false to disable caching.
+     
+     Note: This type of caching is known to interfere with some other JSF technologies. 
+     In particular, the Apache MyFaces Tomahawk saveState component does not work, 
+     and template text in Facelets may appear in duplicate.
+  -->
+  <context-param>
+    <param-name>org.apache.myfaces.trinidad.CACHE_VIEW_ROOT</param-name>
+    <param-value>true</param-value>
+  </context-param>
+  
 
-  <!-- Trinidad also supports an optimized strategy for caching some
-   view state at an application level, which significantly improves
-   scalability.  However, it makes it harder to develop (updates to
-   pages will not be noticed until the server is restarted), and in
-   some rare cases cannot be used for some pages (see Trinidad
-   documentation for more information) -->
+  <!-- Temporarily disable partial state saving default until we make it work with Trinidad -->
   <context-param>
-    <param-name>org.apache.myfaces.trinidad.USE_APPLICATION_VIEW_CACHE</param-name>
+    <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
     <param-value>false</param-value>
   </context-param>
+
+  <!-- Facelets configuration, comment to use JSP -->
+
+  <context-param>
+    <param-name>javax.faces.FACELETS_VIEW_MAPPINGS</param-name>
+    <param-value>*.xhtml</param-value>
+    <!-- to run facelets for jspx files comment the line above and uncomment line below-->
+    <!--param-value>*.xhtml;*.jspx</param-value-->
+  </context-param>
+
+  <context-param>
+    <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
+    <param-value>true</param-value>
+  </context-param>
+
+  <context-param>
+    <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
+    <param-value>/WEB-INF/tr-demo.taglib.xml</param-value>
+  </context-param>
+
+  <!-- End of facelets configuration -->
+
+  <!-- Enables Change Persistence at a session scope.  By default,
+       Change Persistence is entirely disabled. The ChangeManager is
+       an API, which can persist component modifications (like,
+       is a showDetail or tree expanded or collapsed). For providing
+       a custom Change Persistence implementation inherit from the 
+       Trinidad API's ChangeManager class. As the value you have 
+       to use the fullqualified class name. -->
+  <context-param>
+    <param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name>
+    <param-value>session</param-value>
+    <!-- to run without using the change manager comment the line above and uncomment the line below-->
+    <!--param-value>org.apache.myfaces.trinidad.change.NullChangeManager</param-value-->    
+  </context-param>
+  
 <!-- Uncomment this if you are debugging skinning and want the styleclasses to not be compressed  
 <context-param>
  <param-name>org.apache.myfaces.trinidad.DISABLE_CONTENT_COMPRESSION</param-name>
@@ -92,18 +150,6 @@
     <param-value>false</param-value>
   </context-param>
 
-  <!-- Enables Change Persistence at a session scope.  By default,
-       Change Persistence is entirely disabled. The ChangeManager is
-       an API, which can persist component modifications (like,
-       is a showDetail or tree expanded or collapsed). For providing
-       a custom Change Persistence implementation inherit from the 
-       Trinidad API's ChangeManager class. As the value you have 
-       to use the fullqualified class name. -->
-  <context-param>
-    <param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name>
-    <param-value>session</param-value>
-  </context-param>
-  
   <context-param>
     <param-name>org.apache.myfaces.trinidad.resource.DEBUG</param-name>
     <param-value>false</param-value>
@@ -121,22 +167,6 @@
     <param-value>userInputHere:</param-value>
   </context-param--> 
 
-  <!-- Uncomment the below for use with Facelets
-  <context-param>
-    <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
-    <param-value>org.apache.myfaces.trinidadinternal.facelets.TrinidadFaceletViewHandler</param-value>
-  </context-param>
-
-  <context-param>
-    <param-name>org.apache.myfaces.trinidad.FACELETS_VIEW_MAPPINGS</param-name>
-    <param-value>*.xhtml</param-value>
-  </context-param>     
-
-  <context-param>
-    <param-name>facelets.SKIP_COMMENTS</param-name>
-    <param-value>true</param-value>
-  </context-param>
-  -->
 
   <filter>
     <filter-name>trinidad</filter-name>

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/componentDemos.jspx
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/componentDemos.jspx?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/componentDemos.jspx (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/componentDemos.jspx Tue Jan  5 11:48:54 2010
@@ -37,14 +37,14 @@
           </f:facet>
           <tr:panelHeader text="Component Demos">
             <tr:panelHeader text="Core Components">
-              <tr:tree var="component" value="#{componentTree.model}"
+              <tr:tree var="node" value="#{componentTree.model}"
                 binding="#{componentTreeBean.tree}">
                 <f:facet name="nodeStamp">
                   <tr:panelGroupLayout>
-                    <tr:outputText value="Example:" rendered="#{component.example}"/>
-                    <tr:commandLink text="#{component.label}"
-                      disabled="#{empty component.filename}"
-                      action="#{component.view}"/>
+                    <tr:outputText value="Example:" rendered="#{node.example}"/>
+                    <tr:commandLink text="#{node.label}"
+                      disabled="#{empty node.filename}"
+                      action="#{node.view}"/>
                   </tr:panelGroupLayout>
                 </f:facet>
               </tr:tree>

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/demos/demos.jspx
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/demos/demos.jspx?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/demos/demos.jspx (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-demo/src/main/webapp/demos/demos.jspx Tue Jan  5 11:48:54 2010
@@ -16,7 +16,7 @@
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
     under the License.
-     
+
 -->
 <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
           xmlns:f="http://java.sun.com/jsf/core"
@@ -57,7 +57,8 @@
                 destination="showDetailDiscloseOne.jspx" />
               <tr:goLink text="FileDownloadActionListener Demo"
                 destination="tags/fileDownloadActionListener.jspx" />
-              
+              <tr:goLink text="Client behavior support Demo"
+                destination="clientBehaviorHolder.xhtml" />
             </tr:panelGroupLayout>
            </tr:panelHeader>
           </tr:panelHeader>

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-example-assembly/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-example-assembly/pom.xml?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-example-assembly/pom.xml (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-examples/trinidad-example-assembly/pom.xml Tue Jan  5 11:48:54 2010
@@ -27,7 +27,7 @@
   <parent>
     <groupId>org.apache.myfaces.trinidad</groupId>
     <artifactId>trinidad</artifactId>
-    <version>1.2.12.2-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>trinidad-example-assembly</artifactId>

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/pom.xml?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/pom.xml (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/pom.xml Tue Jan  5 11:48:54 2010
@@ -27,7 +27,7 @@
   <parent>
     <groupId>org.apache.myfaces.trinidad</groupId>
     <artifactId>trinidad</artifactId>
-    <version>1.2.12.2-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>trinidad-impl</artifactId>
@@ -60,10 +60,16 @@
       <artifactId>jstl</artifactId>
     </dependency>
 
-    <dependency>
+    <!--dependency>
       <groupId>org.apache.myfaces.core</groupId>
       <artifactId>myfaces-api</artifactId>
-      <scope>provided</scope> <!-- force provided scope here -->
+      <scope>provided</scope> 
+    </dependency-->
+    
+    <dependency>
+      <groupId>com.sun.faces</groupId>
+      <artifactId>jsf-api</artifactId>
+      <scope>provided</scope> 
     </dependency>
 
     <dependency>
@@ -76,10 +82,10 @@
       <artifactId>trinidad-api</artifactId>
     </dependency>
 
-    <dependency>
+    <!--dependency>
       <groupId>com.sun.facelets</groupId>
       <artifactId>jsf-facelets</artifactId>
-    </dependency>
+    </dependency-->
 
     <!-- "test" scope dependencies -->
     <dependency>
@@ -115,11 +121,11 @@
       <scope>test</scope>
     </dependency>
 
-    <dependency>
+    <!--dependency>
       <groupId>org.apache.myfaces.core</groupId>
       <artifactId>myfaces-impl</artifactId>
-      <scope>test</scope> <!-- getting web-facesconfig dtd from myfaces impl for unit tests -->
-    </dependency>
+      <scope>test</scope>
+    </dependency-->
 
   </dependencies>
 

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/conf/META-INF/faces-config-base.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/conf/META-INF/faces-config-base.xml?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/conf/META-INF/faces-config-base.xml (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/conf/META-INF/faces-config-base.xml Tue Jan  5 11:48:54 2010
@@ -1,119 +1,126 @@
-<?xml version="1.0" ?>
-<!--
-    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" >
-
-  <application>
-    <view-handler>org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl</view-handler>
-    <state-manager>org.apache.myfaces.trinidadinternal.application.StateManagerImpl</state-manager>
-    <navigation-handler>org.apache.myfaces.trinidadinternal.application.NavigationHandlerImpl</navigation-handler>
-    <el-resolver>org.apache.myfaces.trinidadinternal.el.TrinidadELResolver</el-resolver>
-  </application>
-
-  <factory>
-    <render-kit-factory>org.apache.myfaces.trinidadinternal.renderkit.CoreRenderKitFactory</render-kit-factory>
-    <faces-context-factory>
-      org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl
-    </faces-context-factory>
-  </factory>
-
-  <lifecycle>
-    <phase-listener>org.apache.myfaces.trinidadinternal.context.TrinidadPhaseListener</phase-listener>
-  </lifecycle>
-
-  <converter>
-    <converter-for-class>java.lang.Short</converter-for-class>
-    <converter-class>org.apache.myfaces.trinidadinternal.convert.ShortConverter</converter-class>
-  </converter>
-  
-  <converter>
-    <converter-for-class>java.lang.Byte</converter-for-class>
-    <converter-class>org.apache.myfaces.trinidadinternal.convert.ByteConverter</converter-class>
-  </converter>  
-
-  <converter>
-    <converter-for-class>java.lang.Integer</converter-for-class>
-    <converter-class>org.apache.myfaces.trinidadinternal.convert.IntegerConverter</converter-class>
-  </converter>
-  
-  <converter>
-    <converter-for-class>java.lang.Long</converter-for-class>
-    <converter-class>org.apache.myfaces.trinidadinternal.convert.LongConverter</converter-class>
-  </converter>
-  
-  <converter>
-    <converter-for-class>java.lang.Float</converter-for-class>
-    <converter-class>org.apache.myfaces.trinidadinternal.convert.FloatConverter</converter-class>
-  </converter>  
-  
-  <converter>
-    <converter-for-class>java.lang.Double</converter-for-class>
-    <converter-class>org.apache.myfaces.trinidadinternal.convert.DoubleConverter</converter-class>
-  </converter>        
-
-  <converter>
-    <description>Color Converter</description>
-    <converter-for-class>java.awt.Color</converter-for-class>
-    <converter-class>org.apache.myfaces.trinidadinternal.convert.ColorConverter</converter-class>
-  </converter>
-
-  <converter>
-    <display-name>Date Time Converter</display-name>
-    <converter-for-class>java.util.Date</converter-for-class>   
-    <converter-class>org.apache.myfaces.trinidadinternal.convert.DateTimeConverter</converter-class>
-  </converter>
-  
-  <converter>
-    <display-name>Date Time Converter</display-name>
-    <converter-for-class>java.util.Calendar</converter-for-class>   
-    <converter-class>org.apache.myfaces.trinidadinternal.convert.DateTimeConverter</converter-class>
-  </converter>
-  
-  <converter>
-    <display-name>Number Converter</display-name>
-    <converter-for-class>java.lang.Number</converter-for-class>   
-    <converter-class>org.apache.myfaces.trinidadinternal.convert.NumberConverter</converter-class>
-  </converter>
-  
-  <referenced-bean>
-    <description>implicit object provided by Trinidad</description>
-    <display-name>Request Context</display-name>
-    <referenced-bean-name>requestContext</referenced-bean-name>
-    <referenced-bean-class>org.apache.myfaces.trinidad.context.RequestContext</referenced-bean-class>
-  </referenced-bean>
-
-  <referenced-bean>
-    <description>Trinidad Page Flow Scope Map</description>
-    <display-name>Page Flow Scope</display-name>
-    <referenced-bean-name>pageFlowScope</referenced-bean-name>
-    <referenced-bean-class>java.util.Map</referenced-bean-class>
-  </referenced-bean>
-
-  <render-kit>
-    <render-kit-id>org.apache.myfaces.trinidad.core.desktop</render-kit-id>
-    <render-kit-class>org.apache.myfaces.trinidadinternal.renderkit.core.desktop.DesktopRenderKit</render-kit-class>
-  </render-kit>
-
-  <render-kit>
-    <render-kit-id>org.apache.myfaces.trinidad.core.pda</render-kit-id>
-    <render-kit-class>org.apache.myfaces.trinidadinternal.renderkit.core.pda.PdaRenderKit</render-kit-class>
-  </render-kit>
-
-</faces-config>
+<?xml version="1.0" ?>
+<!--
+    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" >
+
+  <name>trinidad</name>
+  <ordering>
+    <after>
+      <others/>
+    </after>
+  </ordering>
+
+  <application>
+    <view-handler>org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl</view-handler>
+    <state-manager>org.apache.myfaces.trinidadinternal.application.StateManagerImpl</state-manager>
+    <navigation-handler>org.apache.myfaces.trinidadinternal.application.NavigationHandlerImpl</navigation-handler>
+    <el-resolver>org.apache.myfaces.trinidadinternal.el.TrinidadELResolver</el-resolver>
+  </application>
+
+  <factory>
+    <render-kit-factory>org.apache.myfaces.trinidadinternal.renderkit.CoreRenderKitFactory</render-kit-factory>
+    <faces-context-factory>
+      org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl
+    </faces-context-factory>
+  </factory>
+
+  <lifecycle>
+    <phase-listener>org.apache.myfaces.trinidadinternal.context.TrinidadPhaseListener</phase-listener>
+  </lifecycle>
+
+  <converter>
+    <converter-for-class>java.lang.Short</converter-for-class>
+    <converter-class>org.apache.myfaces.trinidadinternal.convert.ShortConverter</converter-class>
+  </converter>
+  
+  <converter>
+    <converter-for-class>java.lang.Byte</converter-for-class>
+    <converter-class>org.apache.myfaces.trinidadinternal.convert.ByteConverter</converter-class>
+  </converter>  
+
+  <converter>
+    <converter-for-class>java.lang.Integer</converter-for-class>
+    <converter-class>org.apache.myfaces.trinidadinternal.convert.IntegerConverter</converter-class>
+  </converter>
+  
+  <converter>
+    <converter-for-class>java.lang.Long</converter-for-class>
+    <converter-class>org.apache.myfaces.trinidadinternal.convert.LongConverter</converter-class>
+  </converter>
+  
+  <converter>
+    <converter-for-class>java.lang.Float</converter-for-class>
+    <converter-class>org.apache.myfaces.trinidadinternal.convert.FloatConverter</converter-class>
+  </converter>  
+  
+  <converter>
+    <converter-for-class>java.lang.Double</converter-for-class>
+    <converter-class>org.apache.myfaces.trinidadinternal.convert.DoubleConverter</converter-class>
+  </converter>        
+
+  <converter>
+    <description>Color Converter</description>
+    <converter-for-class>java.awt.Color</converter-for-class>
+    <converter-class>org.apache.myfaces.trinidadinternal.convert.ColorConverter</converter-class>
+  </converter>
+
+  <converter>
+    <display-name>Date Time Converter</display-name>
+    <converter-for-class>java.util.Date</converter-for-class>   
+    <converter-class>org.apache.myfaces.trinidadinternal.convert.DateTimeConverter</converter-class>
+  </converter>
+  
+  <converter>
+    <display-name>Date Time Converter</display-name>
+    <converter-for-class>java.util.Calendar</converter-for-class>   
+    <converter-class>org.apache.myfaces.trinidadinternal.convert.DateTimeConverter</converter-class>
+  </converter>
+  
+  <converter>
+    <display-name>Number Converter</display-name>
+    <converter-for-class>java.lang.Number</converter-for-class>   
+    <converter-class>org.apache.myfaces.trinidadinternal.convert.NumberConverter</converter-class>
+  </converter>
+  
+  <referenced-bean>
+    <description>implicit object provided by Trinidad</description>
+    <display-name>Request Context</display-name>
+    <referenced-bean-name>requestContext</referenced-bean-name>
+    <referenced-bean-class>org.apache.myfaces.trinidad.context.RequestContext</referenced-bean-class>
+  </referenced-bean>
+
+  <referenced-bean>
+    <description>Trinidad Page Flow Scope Map</description>
+    <display-name>Page Flow Scope</display-name>
+    <referenced-bean-name>pageFlowScope</referenced-bean-name>
+    <referenced-bean-class>java.util.Map</referenced-bean-class>
+  </referenced-bean>
+
+  <render-kit>
+    <render-kit-id>org.apache.myfaces.trinidad.core.desktop</render-kit-id>
+    <render-kit-class>org.apache.myfaces.trinidadinternal.renderkit.core.desktop.DesktopRenderKit</render-kit-class>
+  </render-kit>
+
+  <render-kit>
+    <render-kit-id>org.apache.myfaces.trinidad.core.pda</render-kit-id>
+    <render-kit-class>org.apache.myfaces.trinidadinternal.renderkit.core.pda.PdaRenderKit</render-kit-class>
+  </render-kit>
+
+</faces-config>

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/conf/META-INF/tr-base.tld
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/conf/META-INF/tr-base.tld?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/conf/META-INF/tr-base.tld (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/conf/META-INF/tr-base.tld Tue Jan  5 11:48:54 2010
@@ -25,7 +25,7 @@
   version="2.1">
 
   <display-name>Apache Trinidad Core</display-name>    
-  <tlib-version>1.2.12</tlib-version>
+  <tlib-version>2.0.0</tlib-version>
   <short-name>tr</short-name>
   <uri>http://myfaces.apache.org/trinidad</uri>
   <listener>

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/conf/META-INF/trh-base.tld
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/conf/META-INF/trh-base.tld?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/conf/META-INF/trh-base.tld (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/conf/META-INF/trh-base.tld Tue Jan  5 11:48:54 2010
@@ -24,7 +24,7 @@
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
   version="2.1">
   <display-name>Apache Trinidad HTML</display-name>
-  <tlib-version>1.2.12</tlib-version>
+  <tlib-version>2.0.0</tlib-version>
   <short-name>trh</short-name>
   <uri>http://myfaces.apache.org/trinidad/html</uri>
 </taglib>

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/StateManagerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/StateManagerImpl.java?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/StateManagerImpl.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/StateManagerImpl.java Tue Jan  5 11:48:54 2010
@@ -18,13 +18,15 @@
  */
 package org.apache.myfaces.trinidadinternal.application;
 
+
+import java.io.ByteArrayOutputStream;
 import java.io.IOException;
+import java.io.ObjectOutputStream;
 import java.io.Serializable;
+
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Locale;
 import java.util.Map;
 
 import javax.faces.FactoryFinder;
@@ -37,65 +39,38 @@
 import javax.faces.render.RenderKit;
 import javax.faces.render.RenderKitFactory;
 import javax.faces.render.ResponseStateManager;
+import javax.faces.view.StateManagementStrategy;
+import javax.faces.view.ViewDeclarationLanguage;
 
+import org.apache.myfaces.trinidad.bean.util.StateUtils;
 import org.apache.myfaces.trinidad.component.UIXComponentBase;
 import org.apache.myfaces.trinidad.context.RequestContext;
+import org.apache.myfaces.trinidad.context.Window;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 import org.apache.myfaces.trinidad.util.ExternalContextUtils;
-import org.apache.myfaces.trinidadinternal.util.LRUCache;
+import org.apache.myfaces.trinidadinternal.context.RequestContextImpl;
+import org.apache.myfaces.trinidadinternal.context.TrinidadPhaseListener;
 import org.apache.myfaces.trinidadinternal.util.SubKeyMap;
 import org.apache.myfaces.trinidadinternal.util.TokenCache;
 
-import com.sun.facelets.FaceletViewHandler;
-
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectOutputStream;
-
-import org.apache.myfaces.trinidad.bean.util.StateUtils;
-import org.apache.myfaces.trinidad.context.Window;
-import org.apache.myfaces.trinidadinternal.context.RequestContextImpl;
-import org.apache.myfaces.trinidadinternal.context.TrinidadPhaseListener;
 
 /**
- * StateManager that handles a hybrid client/server strategy:  a
- * SerializedView is stored on the server, and only a small token
+ * StateManager that handles a hybrid client/server strategy:  the state
+ * is stored on the server, and only a small token
  * is stored on the client.
  * <p>
- * <h3>Application View cache</h3>
- * <p>
- * In addition, an optional Application view cache is supported.
- * This view cache will, when enabled, perform special caching
- * of all state for non-postback requests (that is, the initial
- * state of all pages).  For all pages, their SerializedView state
- * is stored in a Map at application scope, and reused across
- * all users.  This simultaneously eliminates the expense of saving
- * the state at all (except for the first request for any page),
- * and significantly reduces memory usage as long as users are
- * largely viewing initial pages only.
- * <p>
- * In addition, because the viewId is sufficient to identify the
- * page state out of the cache, the token can be completely
- * constant across requests and users.  This makes it possible
- * to cache the page content (which is not possible otherwise).
- * <p>
- * Since application scope objects do not support failover,
- * a mirror of the cache is saved at session scope.  The mirror
- * is an LRU map of the last 16 application-scoped entries, but
- * since it stores precisely the same SerializedView instances
- * as the application scope, the additional memory requirements
- * are minimal.
- * <p>
  * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/application/StateManagerImpl.java#2 $) $Date: 18-nov-2005.16:12:04 $
  */
 public class StateManagerImpl extends StateManagerWrapper
-{
-  static public final String USE_APPLICATION_VIEW_CACHE_INIT_PARAM =
-    "org.apache.myfaces.trinidad.USE_APPLICATION_VIEW_CACHE";
-
+{  
+  // TODO this should be removed, see comments in restoreView where this constant is used 
+  // on why this is needed
+  public static final String RESPONSE_STATE_MANAGER_STATE_KEY =
+    "org.apache.myfaces.trinidadinternal.application.StateManagerImp.RESPONSE_STATE_MANAGER_STATE";  
+  
   static public final String CACHE_VIEW_ROOT_INIT_PARAM =
     "org.apache.myfaces.trinidad.CACHE_VIEW_ROOT";
 
-
   /**
    * Servlet context initialization parameter used by
    * StateManagerImpl to decide what sort of state should be saved
@@ -132,37 +107,77 @@
   }
   
   @Override
-  protected StateManager getWrapped()
+  public StateManager getWrapped()
   {
     return _delegate;
   }
 
-  @SuppressWarnings("deprecation")
   @Override
-  public Object saveView(FacesContext context)
+  public String getViewState(FacesContext context)
   {
-    assert(context != null);
+    Object state = saveView(context);
     
-    if(isSavingStateInClient(context))
+    if (state != null)
     {
-      SerializedView view = _saveSerializedView(context);
-      return new Object[]{view.getStructure(), view.getState()};
+      return context.getRenderKit().getResponseStateManager().getViewState(context,state);
     }
-    
-    return super.saveView(context);
+    else
+    {
+      return null;
+    }
+
   }
 
-  @Override @SuppressWarnings("deprecation")
-  public SerializedView saveSerializedView(FacesContext context)
+  @SuppressWarnings("deprecation")
+  @Override
+  public Object saveView(FacesContext context)
   {
     assert(context != null);
     
-    if(isSavingStateInClient(context))
+    // see if a view has been saved on the request
+    Object viewState = _getCachedViewState(context);
+    
+    if (viewState != null)
+    {    
+      // TODO gcrawfor
+      //        when is this not null, meaning when is saveView being called multiple times
+      //        per request?
+      return viewState;
+    }
+    
+    // if the root is transient don't state save
+    UIViewRoot viewRoot = context.getViewRoot();
+    
+    if (viewRoot.isTransient()) 
     {
-      return _saveSerializedView(context);
+      return null;
     }
     
-    return _delegate.saveSerializedView(context);
+    String viewId = context.getViewRoot().getViewId();
+    StateManagementStrategy sms = _getStateManagementStrategy(context, viewId);
+    
+    if (sms != null) 
+    {      
+      viewState = sms.saveView(context);
+    }
+    else
+    {
+      // if there's no stateManagementStrategy handle saving the state ourselves
+      _removeTransientComponents(viewRoot);
+
+      Object structure = !_needStructure(context) ? null : new Structure(viewRoot);
+      Object state = viewRoot.processSaveState(context);
+      viewState = new Object[]{structure, state};
+
+    }
+
+    if (_saveAsToken(context))
+    {
+      viewState = _saveStateToCache(context, viewState, viewRoot);
+    }
+    
+    _saveCachedViewState(context, viewState);   
+    return viewState;
   }
 
   /**
@@ -175,7 +190,7 @@
     // Don't remove transient components...
     Object structure = new Structure(component);
     Object state = component.processSaveState(context);
-    return new PageState(context, structure, state, null);
+    return new PageState(context, new Object[]{structure, state}, null);
   }
   
   /**
@@ -196,9 +211,10 @@
         "INVALID_SAVED_STATE_OBJECT"));
 
     PageState viewState = (PageState) savedState;
-
-    Object structure = viewState.getStructure();
-    Object state = viewState.getState();
+    
+    Object[] stateArray = (Object[])viewState.getViewState();
+    Object structure = stateArray[0];
+    Object state = stateArray[1];
 
     UIComponent component =
       ((Structure) structure).createComponent();
@@ -223,7 +239,7 @@
 
     Object structure = new Structure(root);
     Object state = root.processSaveState(context);
-    return new PageState(context, structure, state, root);
+    return new PageState(context,  new Object[]{structure, state}, root);
   }
 
   static public UIViewRoot restoreViewRoot(
@@ -242,9 +258,10 @@
     {
       return root; // bug 4712492
     }
-
-    Object structure = viewState.getStructure();
-    Object state = viewState.getState();
+    
+    Object[] stateArray = (Object[])viewState.getViewState();
+    Object structure = stateArray[0];
+    Object state = stateArray[1];
 
     root = (UIViewRoot)
       ((Structure) structure).createComponent();
@@ -255,163 +272,87 @@
     return root;
   }  
 
-  @SuppressWarnings({"unchecked", "deprecation"})
-  private SerializedView _saveSerializedView(FacesContext context)
-  {
-    SerializedView view = _getCachedSerializedView(context);
-    if (view != null)
-      return view;
-
-    UIViewRoot root = context.getViewRoot();
-    boolean dontSave = false;
-
-    // See if we're going to use the application view cache for
-    // this request
-    Map<String, PageState> applicationViewCache = null;
-    Map<String, PageState> perSessionApplicationViewCache = null;
-    if (_useApplicationViewCache(context))
-    {
-      // OK, we are: so find the application cache and
-      // the per-session mirror
-      applicationViewCache = _getApplicationViewCache(context);
-      perSessionApplicationViewCache =
-        _getPerSessionApplicationViewCache(context);
-
-      synchronized (applicationViewCache)
-      {
-        // If we've already got a copy of the state stored, then
-        // we just need to make sure it's mirrored on the session
-        PageState applicationState = applicationViewCache.get(root.getViewId());
-        if (applicationState != null)
-        {
-          // Note that we've got no work to do...
-          dontSave = true;
-          perSessionApplicationViewCache.put(root.getViewId(),
-                                             applicationState);
-        }
-      }
-    }
 
-    _removeTransientComponents(root);
 
-    Object structure = (dontSave || !_needStructure(context))
-                         ? null
-                         : new Structure(root);
-    Object state = dontSave ? null : root.processSaveState(context);
-
-    if (_saveAsToken(context))
-    {
-      String token;
-      ExternalContext extContext = context.getExternalContext();
-
-
-      if (applicationViewCache == null)
-      {
-        assert(!dontSave);
-        TokenCache cache = _getViewCache(context);
-        assert(cache != null);
-
-        Map<String, Object> sessionMap = extContext.getSessionMap();
+  private Object _saveStateToCache(FacesContext context, Object viewState, UIViewRoot root)
+  {
+    String token;
+    ExternalContext extContext = context.getExternalContext();
 
-        RequestContext trinContext = RequestContext.getCurrentInstance();
-        
-        // get view cache key with "." separator suffix to separate the SubKeyMap keys
-        String subkey = _getViewCacheKey(extContext, trinContext, _SUBKEY_SEPARATOR);
-        
-        Map<String, PageState> stateMap = new SubKeyMap<PageState>(sessionMap, subkey);
 
-        // Sadly, we can't save just a SerializedView, because we should
-        // save a serialized object, and SerializedView is a *non*-static
-        // inner class of StateManager
-        PageState pageState = new PageState(
-            context,
-            structure,
-            state,
-            // Save the view root into the page state as a transient
-            // if this feature has not been disabled
-            _useViewRootCache(context) ? root : null);
-
-        // clear out all of the previous PageStates' UIViewRoots and add this page
-        // state as an active page state.  This is necessary to avoid UIViewRoots
-        // laying around if the user navigates off of a page using a GET
-        synchronized(extContext.getSession(true))
-        {
-          // get the per-window key for the active page state
-          String activePageStateKey = _getActivePageStateKey(extContext, trinContext);
-          PageState activePageState = (PageState)sessionMap.get(activePageStateKey);
+    TokenCache cache = _getViewCache(context);
+    assert(cache != null);
 
-          if (activePageState != null)
-            activePageState.clearViewRootState();
+    Map<String, Object> sessionMap = extContext.getSessionMap();
 
-          sessionMap.put(activePageStateKey, pageState);
-        }
-        
-        String requestToken = _getRequestTokenForResponse(context);
-        // If we have a cached token that we want to reuse,
-        // and that token hasn't disappeared from the cache already
-        // (unlikely, but not impossible), use the stateMap directly
-        // without asking the cache for a new token
-        if ((requestToken != null) && cache.isAvailable(requestToken))
-        {
-          // NOTE: under *really* high pressure, the cache might
-          // have been emptied between the isAvailable() call and
-          // this put().  This seems sufficiently implausible to
-          // be worth punting on
-          stateMap.put(requestToken, pageState);
-          token = requestToken;
-          // NOTE 2: we have not pinned this reused state to any old state
-          // This is OK for current uses of pinning and state reuse,
-          // as pinning stays constant within a window, and we're not
-          // erasing pinning at all.
-        }
-        else
-        {
-          // See if we should pin this new state to any old state
-          String pinnedToken = (String)extContext.getRequestMap().get(_PINNED_STATE_TOKEN_KEY);
-          token = cache.addNewEntry(pageState,
-                                    stateMap,
-                                    pinnedToken);
-        }
-      }
-      // If we got the "applicationViewCache", we're using it.
-      else
-      {
-        // use null viewRoot since this state is shared across users:
-        PageState applicationState = new PageState(context, structure, state, null);
-        
-        // If we need to, stash the state off in our cache
-        if (!dontSave)
-        {
-          synchronized (applicationViewCache)
-          {
-            applicationViewCache.put(root.getViewId(),
-                                     applicationState);
-            perSessionApplicationViewCache.put(root.getViewId(),
-                                               applicationState);
-          }
-        }
+    RequestContext trinContext = RequestContext.getCurrentInstance();
+    
+    // get per window view cache key with "." separator suffix to separate the SubKeyMap keys
+    String subkey = _getViewCacheKey(extContext, trinContext, _SUBKEY_SEPARATOR);
+    
+    Map<String, PageState> stateMap = new SubKeyMap<PageState>(sessionMap, subkey);
 
-        token = _APPLICATION_CACHE_TOKEN;
-      }
+    // Sadly, we can't save just a SerializedView, because we should
+    // save a serialized object, and SerializedView is a *non*-static
+    // inner class of StateManager
+    PageState pageState = new PageState(
+        context,
+        viewState,
+        // Save the view root into the page state as a transient
+        // if this feature has not been disabled
+        _useViewRootCache(context) ? root : null);
+
+    // clear out all of the previous PageStates' UIViewRoots and add this page
+    // state as an active page state.  This is necessary to avoid UIViewRoots
+    // laying around if the user navigates off of a page using a GET
+    synchronized(extContext.getSession(true))
+    {
+      // get the per-window key for the active page state
+      String activePageStateKey = _getActivePageStateKey(extContext, trinContext);
+      PageState activePageState = (PageState)sessionMap.get(activePageStateKey);
 
-      assert(token != null);
+      if (activePageState != null)
+        activePageState.clearViewRootState();
 
-      // Create a "tokenView" which abuses SerializedView to store
-      // our token only
-      view = new SerializedView(token, null);
-      
-      // And store the token for this request
-      extContext.getRequestMap().put(_REQUEST_STATE_TOKEN_KEY, token);
+      sessionMap.put(activePageStateKey, pageState);
+    }
+    
+    String requestToken = _getRequestTokenForResponse(context);
+    // If we have a cached token that we want to reuse,
+    // and that token hasn't disappeared from the cache already
+    // (unlikely, but not impossible), use the stateMap directly
+    // without asking the cache for a new token
+    if ((requestToken != null) && cache.isAvailable(requestToken))
+    {
+      // NOTE: under *really* high pressure, the cache might
+      // have been emptied between the isAvailable() call and
+      // this put().  This seems sufficiently implausible to
+      // be worth punting on
+      stateMap.put(requestToken, pageState);
+      token = requestToken;
+      // NOTE 2: we have not pinned this reused state to any old state
+      // This is OK for current uses of pinning and state reuse,
+      // as pinning stays constant within a window, and we're not
+      // erasing pinning at all.
     }
     else
     {
-      assert(!dontSave);
-      view = new SerializedView(structure, state);
+      // See if we should pin this new state to any old state
+      String pinnedToken = (String)extContext.getRequestMap().get(_PINNED_STATE_TOKEN_KEY);
+      token = cache.addNewEntry(pageState,
+                                stateMap,
+                                pinnedToken);
     }
+    
 
-    _saveCachedSerializedView(context, view);
+    assert(token != null);
+    
+    // And store the token for this request
+    extContext.getRequestMap().put(_REQUEST_STATE_TOKEN_KEY, token);
 
-    return view;
+    // Create a "tokenView" which abuses state to store
+    // our token only
+    return new Object[]{token, null};    
   }
 
   /**
@@ -489,14 +430,6 @@
 
     return (String) token;
   }
-    
-  
-  @Override @SuppressWarnings("deprecation")
-  public void writeState(FacesContext context,
-                         SerializedView state) throws IOException
-  {
-    _delegate.writeState(context, state);
-  }
 
   @SuppressWarnings({"unchecked", "deprecation"})
   @Override
@@ -514,17 +447,16 @@
       TrinidadPhaseListener.markPostback(context);
       return launchView;
     }
-    
-    if (!isSavingStateInClient(context))
-      return _delegate.restoreView(context, viewId, renderKitId);
-
+          
     final Object structure;
     final Object state;
-    boolean recalculateLocale = false;
 
     ResponseStateManager rsm = _getResponseStateManager(context, renderKitId);
+    
     if (_saveAsToken(context))
     {
+      // we saved the token in the structure portion of the state, so retrieve the 
+      // structure portion of the state to get the token.
       Object token = rsm.getTreeStructureToRestore(context, viewId);
       if (token == null)
       {
@@ -535,64 +467,30 @@
       assert(token instanceof String);
       _LOG.finer("Restoring saved view state for token {0}", token);
 
-      PageState viewState;
 
-      // Load from the application cache
-      if (_APPLICATION_CACHE_TOKEN.equals(token))
-      {
-        Map<String, PageState> cache = _getApplicationViewCache(context);
-        Map<String, PageState> perSessionCache =
-          _getPerSessionApplicationViewCache(context);
-
-        // Synchronize on the application-level cache.
-        // =-=AEW This may produce excessive contention
-        synchronized (cache)
-        {
-          // Look first in the per-session cache
-          viewState = perSessionCache.get(viewId);
-          if (viewState == null)
-          {
-            // Nope, it's not there.  Look in the application cache
-            viewState = cache.get(viewId);
-            // And if we find it there, then push it back into
-            // the per-session cache (it may have expired)
-            if (viewState != null)
-              perSessionCache.put(viewId, viewState);
-          }
-          
-          // If the view was found in the application cache then we
-          // know it would be unsafe to use its locale for this session.
-          // Same conclusion, however, even if found in the per-session 
-          // cache, since the latter is just a mirror of the former.
-          recalculateLocale = true;
-        }
-      }
-      else
-      {
-        // get view cache key with "." separator suffix to separate the SubKeyMap keys
-        String subkey = _getViewCacheKey(extContext,
-                                         RequestContext.getCurrentInstance(),
-                                         _SUBKEY_SEPARATOR);
-        
-        Map<String, PageState> stateMap = new SubKeyMap<PageState>(
-                         extContext.getSessionMap(),
-                         subkey);
-        viewState = stateMap.get(token);
-
-        if (viewState != null)
-          _updateRequestTokenForResponse(context, (String) token);
-
-        // Make sure that if the view state is present, the cache still
-        // has the token, and vice versa
-
-        // NOTE: it's very important that we call through to the
-        // token cache here, not just inside the assert.  If we don't,
-        // then we don't actually access the token, so it doesn't
-        // get bumped up to the front in the LRU Cache!
-        boolean isAvailable =
-          _getViewCache(context).isAvailable((String) token);
-        assert ((viewState != null) == isAvailable);
-      }
+      // get view cache key with "." separator suffix to separate the SubKeyMap keys
+      String subkey = _getViewCacheKey(extContext,
+                                       RequestContext.getCurrentInstance(),
+                                       _SUBKEY_SEPARATOR);
+      
+      Map<String, PageState> stateMap = new SubKeyMap<PageState>(
+                       extContext.getSessionMap(),
+                       subkey);
+      PageState viewState = stateMap.get(token);
+
+      if (viewState != null)
+        _updateRequestTokenForResponse(context, (String) token);
+
+      // Make sure that if the view state is present, the cache still
+      // has the token, and vice versa
+
+      // NOTE: it's very important that we call through to the
+      // token cache here, not just inside the assert.  If we don't,
+      // then we don't actually access the token, so it doesn't
+      // get bumped up to the front in the LRU Cache!
+      boolean isAvailable =
+        _getViewCache(context).isAvailable((String) token);
+      assert ((viewState != null) == isAvailable);
 
       if (viewState == null)
       {
@@ -609,15 +507,50 @@
         return root;
       }
 
-      structure = viewState.getStructure();
-      state = viewState.getState();
+      StateManagementStrategy sms = _getStateManagementStrategy(context, viewId);
+      
+      if (sms!= null) 
+      {
+        // TODO This is a hack because stateManagementStrategy doesn't take
+        // a state object as a param, instead it always asks the responseStateManager
+        // for the state, so push the state onto the request where the CoreResponseStateManager
+        // can return it. We will file a bug agains JSF 2.0 asking that the
+        // stateManagementStrategy deprecate the current restoreView method in favor of 
+        // a restoreView method that takes state
+        try
+        {
+          extContext.getRequestMap().put(RESPONSE_STATE_MANAGER_STATE_KEY, viewState.getViewState());
+          root = sms.restoreView(context, viewId, renderKitId);
+        }
+        finally
+        {
+          extContext.getRequestMap().remove(RESPONSE_STATE_MANAGER_STATE_KEY);
+        }
+        
+        return root;
+      } 
+      else
+      {        
+        Object[] stateArray = (Object[])viewState.getViewState();
+        structure = stateArray[0];
+        state = stateArray[1];
+      }
     }
     else
     {
+
+      StateManagementStrategy sms = _getStateManagementStrategy(context, viewId);
+      
+      if (sms!= null) 
+      {
+        return sms.restoreView(context, viewId, renderKitId);
+      } 
+      
       structure = rsm.getTreeStructureToRestore(context, viewId);
       state = rsm.getComponentStateToRestore(context);
     }
 
+
     if (structure == null)
     {
 
@@ -648,13 +581,7 @@
         ((Structure) structure).createComponent();
 
         if (state != null)
-          root.processRestoreState(context, state);
-        
-        if (recalculateLocale)
-        {
-          // Ensure that locale gets re-calculated when next fetched.
-          root.setLocale((Locale) null);
-        }
+          root.processRestoreState(context, state);          
 
         _LOG.finer("Restored state for view \"{0}\"", viewId);
         return root;
@@ -672,7 +599,7 @@
         _LOG.severe(iae);
       }
     }
-
+    
     return null;
   }
 
@@ -830,6 +757,15 @@
   private boolean _saveAsToken(FacesContext context)
   {
     ExternalContext external = context.getExternalContext();
+    Object stateSavingMethod =
+      external.getInitParameterMap().get(StateManager.STATE_SAVING_METHOD_PARAM_NAME);    
+    
+    if ((stateSavingMethod == null) ||
+        StateManager.STATE_SAVING_METHOD_SERVER.equalsIgnoreCase((String) stateSavingMethod))
+    {
+      return true;
+    }
+    
     Object clientMethod =
       external.getInitParameterMap().get(CLIENT_STATE_METHOD_PARAM_NAME);
     if ((clientMethod != null) &&
@@ -859,97 +795,7 @@
 
     return _DEFAULT_CACHE_SIZE;
   }
-
-  //
-  // @todo Map is a bad structure
-  // @todo a static size is bad
-  //
-  @SuppressWarnings("unchecked")
-  static private Map<String, PageState> _getApplicationViewCache(FacesContext context)
-  {
-    synchronized (_APPLICATION_VIEW_CACHE_LOCK)
-    {
-      Map<String, Object> appMap = context.getExternalContext().getApplicationMap();
-      Map<String, PageState> cache = (Map<String, PageState>)appMap.get(_APPLICATION_VIEW_CACHE_KEY);
-      if (cache == null)
-      {
-        cache = new HashMap<String, PageState>(128);
-        appMap.put(_APPLICATION_VIEW_CACHE_KEY, cache);
-      }
-
-      return cache;
-    }
-  }
   
-  @SuppressWarnings("unchecked")
-  static private Map<String, PageState> _getPerSessionApplicationViewCache(FacesContext context)
-  {
-    ExternalContext external = context.getExternalContext();
-    Object session = external.getSession(true);
-    assert(session != null);
-
-    Map<String, PageState> cache;
-    // Synchronize on the session object to ensure that
-    // we don't ever create two different caches
-    synchronized (session)
-    {
-      Map<String, Object> sessionMap = external.getSessionMap();
-      cache = (Map<String, PageState>) sessionMap.get(_APPLICATION_VIEW_CACHE_KEY);
-      if (cache == null)
-      {
-        cache = _createPerSessionApplicationViewCache();
-        sessionMap.put(_APPLICATION_VIEW_CACHE_KEY, cache);
-      }
-    }
-
-    return cache;
-  }
-
-  //
-  // For the per-session mirror of the application view cache,
-  // use an LRU LinkedHashMap to store the latest 16 pages.
-  //
-  static private Map<String, PageState> _createPerSessionApplicationViewCache()
-  {
-    return new LRUCache<String, PageState>(_MAX_PER_SESSION_APPLICATION_SIZE);
-  }
-
-  static private final int _MAX_PER_SESSION_APPLICATION_SIZE = 16;
-
-  //
-  // Use the application view cache if and only if:
-  // (1) We're saving state tokens on the client
-  // (2) This is *not* a postback request
-  // (3) The feature has been explicitly enabled
-  //
-  private boolean _useApplicationViewCache(FacesContext context)
-  {
-    if (_useApplicationViewCache == Boolean.FALSE)
-      return false;
-
-    if (_saveAsToken(context) &&
-        // Note: do not use TrinidadPhaseListener, as that
-        // will return "true" even after navigation has occured,
-        // but the Application View Cache is still fine.
-        //!TrinidadPhaseListener.isPostback(context)
-        !RequestContext.getCurrentInstance().isPostback())
-    {
-      if (_useApplicationViewCache == null)
-      {
-        String s = context.getExternalContext().getInitParameter(
-                                USE_APPLICATION_VIEW_CACHE_INIT_PARAM);
-        _useApplicationViewCache =
-          "true".equalsIgnoreCase(s) ? Boolean.TRUE : Boolean.FALSE;
-      }
-      if (Boolean.TRUE.equals(_useApplicationViewCache))
-      {
-         _LOG.severe("USE_APPLICATION_VIEW_CACHE_UNSUPPORTED");        
-      }
-      return _useApplicationViewCache.booleanValue();
-    }
-
-    return false;
-  }
 
   private boolean _useViewRootCache(FacesContext context)
   {
@@ -968,18 +814,9 @@
 
   private boolean _needStructure(FacesContext context)
   {
-    if (_structureGeneratedByTemplate == null)
-    {
-      ExternalContext external = context.getExternalContext();
-      String restoreMode = external.getInitParameter(
-        FaceletViewHandler.PARAM_BUILD_BEFORE_RESTORE);
-      if ("true".equals(restoreMode))
-        _structureGeneratedByTemplate = Boolean.TRUE;
-      else
-        _structureGeneratedByTemplate = Boolean.FALSE;
-    }
-
-    return !_structureGeneratedByTemplate.booleanValue();
+    // TODO - partial state saving is handled by facelets in JSF 2.0, 
+    //        remove this method and anything that depends on it?
+    return true;
   }
 
   static private ResponseStateManager _getResponseStateManager(
@@ -1061,21 +898,33 @@
     }
   }
 
-  @SuppressWarnings("deprecation")
-  private SerializedView _getCachedSerializedView(
+  private Object _getCachedViewState(
     FacesContext context)
   {
-    return (SerializedView) context.getExternalContext().
-                 getRequestMap().get(_CACHED_SERIALIZED_VIEW);
+    return context.getExternalContext().
+                 getRequestMap().get(_CACHED_VIEW_STATE);
   }
 
-  @SuppressWarnings({"unchecked","deprecation"})
-  private void _saveCachedSerializedView(
-    FacesContext context, SerializedView state)
+  private void _saveCachedViewState(
+    FacesContext context, Object state)
   {
-    context.getExternalContext().getRequestMap().put(_CACHED_SERIALIZED_VIEW,
+    context.getExternalContext().getRequestMap().put(_CACHED_VIEW_STATE,
                                                      state);
   }
+  
+  private StateManagementStrategy _getStateManagementStrategy(FacesContext context, String viewId)
+  {
+    ViewDeclarationLanguage vdl =  context.getApplication().getViewHandler().
+                                                    getViewDeclarationLanguage(context, viewId);
+    if (vdl != null) 
+    {
+      return vdl.getStateManagementStrategy(context, viewId);
+    }    
+    else
+    {
+      return null;
+    }
+  }
 
   private static final class ViewRootState
   {
@@ -1106,15 +955,14 @@
   {
     private static final long serialVersionUID = 1L;
 
-    private final Object _structure, _state;
+    private final Object _viewState;
     
     // use transient since UIViewRoots are not Serializable.
     private transient ViewRootState _cachedState;
 
-    public PageState(FacesContext fc, Object structure, Object state, UIViewRoot root)
+    public PageState(FacesContext fc, Object viewState, UIViewRoot root)
     {
-      _structure = structure;
-      _state = state;
+      _viewState = viewState;
       
       // if component tree serialization checking is on (in order to validate
       // fail over support, attempt to Serialize all of the component state
@@ -1123,7 +971,7 @@
       {
         try
         {
-          new ObjectOutputStream(new ByteArrayOutputStream()).writeObject(state);
+          new ObjectOutputStream(new ByteArrayOutputStream()).writeObject(viewState);
         }
         catch (IOException e)
         {          
@@ -1138,14 +986,9 @@
                        : null;
     }
 
-    public Object getStructure()
+    public Object getViewState()
     {
-      return _structure;
-    }
-
-    public Object getState()
-    {
-      return _state;
+      return _viewState;
     }
 
     public void clearViewRootState()
@@ -1221,26 +1064,21 @@
     }    
   }
 
+  // TODO - we used to delegate to the RI when the stateManagement method was server,
+  // but we no longer do that, do we really need _delegate any more?
   private final StateManager _delegate;
   private       Boolean      _useViewRootCache;
-  private       Boolean      _useApplicationViewCache;
-  private       Boolean      _structureGeneratedByTemplate;
 
   private static final Character _SUBKEY_SEPARATOR = new Character('.');
   
   private static final int _DEFAULT_CACHE_SIZE = 15;
-
-  private static final Object _APPLICATION_VIEW_CACHE_LOCK = new Object();
   
   // base key used to identify the view cache.  The window name, if any, is appended to this
   private static final String _VIEW_CACHE_KEY =
     "org.apache.myfaces.trinidadinternal.application.VIEW_CACHE";
 
-  private static final String _APPLICATION_VIEW_CACHE_KEY =
-    "org.apache.myfaces.trinidadinternal.application.APPLICATION_VIEW_CACHE";
-
-  private static final String _CACHED_SERIALIZED_VIEW =
-    "org.apache.myfaces.trinidadinternal.application.CachedSerializedView";
+  private static final String _CACHED_VIEW_STATE=
+    "org.apache.myfaces.trinidadinternal.application.CachedViewState";
 
   private static final String _REQUEST_STATE_TOKEN_KEY =
     "org.apache.myfaces.trinidadinternal.application.REQUEST_STATE_TOKEN";
@@ -1253,9 +1091,7 @@
 
   // key for saving the PageState for the last accessed view in this Session
   private static final String _ACTIVE_PAGE_STATE_SESSION_KEY =
-              "org.apache.myfaces.trinidadinternal.application.StateManagerImp.ACTIVE_PAGE_STATE";
-
-  private static final String _APPLICATION_CACHE_TOKEN = "_a_";
+              "org.apache.myfaces.trinidadinternal.application.StateManagerImp.ACTIVE_PAGE_STATE";  
 
   private static final long serialVersionUID = 1L;
 

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java?rev=896009&r1=896008&r2=896009&view=diff
==============================================================================
--- myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java Tue Jan  5 11:48:54 2010
@@ -18,7 +18,6 @@
  */
 package org.apache.myfaces.trinidadinternal.application;
 
-import java.io.File;
 import java.io.InputStream;
 import java.io.IOException;
 import java.lang.reflect.Constructor;
@@ -29,19 +28,21 @@
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
-import java.util.Locale;
 import java.util.Map;
 import java.util.Properties;
 
 import java.util.Set;
 
 import javax.faces.FacesException;
+import javax.faces.application.ProjectStage;
 import javax.faces.application.ViewHandler;
 import javax.faces.application.ViewHandlerWrapper;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
 
+import javax.faces.view.ViewDeclarationLanguage;
+
 import org.apache.myfaces.trinidad.context.RequestContext;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 import org.apache.myfaces.trinidad.render.ExtendedRenderKitService;
@@ -77,10 +78,23 @@
     _loadInternalViews();
   }
 
-  protected ViewHandler getWrapped()
+  public ViewHandler getWrapped()
   {
     return _delegate;
   }
+  
+  public ViewDeclarationLanguage getViewDeclarationLanguage(FacesContext context,
+                                                            String viewId)
+  {
+    // InternalViews will not use ViewDeclarationLanguage processors,
+    // since they do essentially the same job themselves.
+    InternalView internal = _getInternalView(context, viewId);
+    if (internal != null)
+    {
+      return null;
+    }
+    return _delegate.getViewDeclarationLanguage(context, viewId);
+  }
 
   @Override
   public UIViewRoot createView(FacesContext context, String viewId)
@@ -379,18 +393,44 @@
   {
     if (_checkTimestamp == null)
     {
+      boolean checkTimestampParam;
       String checkTimestamp =
         context.getExternalContext().getInitParameter(Configuration.CHECK_TIMESTAMP_PARAM);
-      // Detect when we're running inside of the JDeveloper embedded OC4J
-      // environment - and there, always use timestamp checking
-      // TODO: come up with a non-proprietary way of checking this?
-      boolean performCheck = "true".equals(checkTimestamp) ||
-        "development".equals(System.getProperty("oracle.application.environment"));
+      
+      if (checkTimestamp != null)
+      {
+        checkTimestampParam = "true".equals(checkTimestamp);  
+      }
+      else
+      {
+        // if the CHECK_TIMESTAMP_PARAM parameter has NOT been specified, let us
+        // apply the DEFAULT values for the certain Project Stages:
+        // -PRODUCTION we want this value to be FALSE;
+        // -other stages we use TRUE
+        checkTimestampParam = !(context.isProjectStage(ProjectStage.Production));
+      }
+
+      boolean developmentStage = context.isProjectStage(ProjectStage.Development);
+      
+      // if Apache MyFaces Trinidad is running in production stage CHECK_TIMESTAMP_PARAM should
+      // be FALSE, otherwise we generate a WARNING message
+      boolean productionStage = developmentStage || context.isProjectStage(ProjectStage.Production);
+      
+      boolean performCheck = checkTimestampParam || developmentStage;
       _checkTimestamp = Boolean.valueOf(performCheck);
-      if ("true".equals(checkTimestamp))
+      
+      if (checkTimestampParam)
       {
-        _LOG.info("TIMESTAMP_CHECKING_ENABLED_SHOULDNOT_IN_PRODUCTION",
-                  Configuration.CHECK_TIMESTAMP_PARAM);
+        if (productionStage)
+        {
+          _LOG.warning("TIMESTAMP_CHECKING_ENABLED_SHOULDNOT_IN_PRODUCTION",
+              Configuration.CHECK_TIMESTAMP_PARAM);
+        }
+        else
+        {
+          _LOG.info("TIMESTAMP_CHECKING_ENABLED_SHOULDNOT_IN_PRODUCTION",
+                    Configuration.CHECK_TIMESTAMP_PARAM);
+        }
       }
     }