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 [5/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-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/GlobalConfiguratorImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/GlobalConfiguratorImpl.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/config/GlobalConfiguratorImpl.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/GlobalConfiguratorImpl.java Tue Jan  5 11:48:54 2010
@@ -22,15 +22,12 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
 import java.util.concurrent.atomic.AtomicReference;
 
 import javax.faces.context.ExternalContext;
 
 import javax.servlet.ServletRequest;
-
 import javax.servlet.ServletRequestWrapper;
-
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.myfaces.trinidad.config.Configurator;
@@ -40,6 +37,9 @@
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 import org.apache.myfaces.trinidad.skin.SkinFactory;
 import org.apache.myfaces.trinidad.util.ClassLoaderUtils;
+import org.apache.myfaces.trinidad.util.ExternalContextUtils;
+import org.apache.myfaces.trinidad.util.RequestStateMap;
+import org.apache.myfaces.trinidad.util.RequestType;
 import org.apache.myfaces.trinidadinternal.context.RequestContextFactoryImpl;
 import org.apache.myfaces.trinidadinternal.context.external.ServletCookieMap;
 import org.apache.myfaces.trinidadinternal.context.external.ServletRequestHeaderMap;
@@ -49,9 +49,7 @@
 import org.apache.myfaces.trinidadinternal.context.external.ServletRequestParameterValuesMap;
 import org.apache.myfaces.trinidadinternal.skin.SkinFactoryImpl;
 import org.apache.myfaces.trinidadinternal.skin.SkinUtils;
-import org.apache.myfaces.trinidad.util.ExternalContextUtils;
-import org.apache.myfaces.trinidad.util.RequestStateMap;
-import org.apache.myfaces.trinidad.util.RequestType;
+
 
 /**
  * This is the implementation of the Trinidad's Global configurator. It provides the entry point for
@@ -410,7 +408,7 @@
       finally
       {
 
-        //Do cleanup of anything which may have use the thread local manager durring
+        //Do cleanup of anything which may have use the thread local manager during
         //init.
         _releaseManagedThreadLocals();
       }

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/LazyValueExpression.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/LazyValueExpression.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/config/LazyValueExpression.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/LazyValueExpression.java Tue Jan  5 11:48:54 2010
@@ -20,25 +20,26 @@
 
 import javax.el.ELContext;
 import javax.el.ELResolver;
+import javax.el.ExpressionFactory;
 import javax.el.FunctionMapper;
+import javax.el.ValueExpression;
+import javax.el.VariableMapper;
 
 import javax.faces.FactoryFinder;
 import javax.faces.application.Application;
 import javax.faces.application.ApplicationFactory;
 import javax.faces.context.FacesContext;
-import javax.el.ValueExpression;
-
-import javax.el.VariableMapper;
 
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 
- /**
-  * A ValueExpression class that lazily parses the underlying EL expression
-  * (in case the Application object is not yet available).  Unfortunately,
-  * this implementation means that errors in the syntax of the EL
-  * expression won't get detected until use.
-  *
-  */
+
+/**
+ * A ValueExpression class that lazily parses the underlying EL expression
+ * (in case the Application object is not yet available).  Unfortunately,
+ * this implementation means that errors in the syntax of the EL
+ * expression won't get detected until use.
+ *
+ */
 public class LazyValueExpression extends ValueExpression
 {
 
@@ -175,10 +176,11 @@
       {
         ELContext elContext = _getELContext(application);
 
-        return
-          application.getExpressionFactory().
-            createValueExpression(elContext, expression, expectedType);
-
+        ExpressionFactory expressionFactory = application.getExpressionFactory();
+        if (expressionFactory != null)
+        {
+          return expressionFactory.createValueExpression(elContext, expression, expectedType);
+        }
       }
     }
 

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/FacesContextFactoryImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/FacesContextFactoryImpl.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/context/FacesContextFactoryImpl.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/FacesContextFactoryImpl.java Tue Jan  5 11:48:54 2010
@@ -19,6 +19,10 @@
 package org.apache.myfaces.trinidadinternal.context;
 
 import java.io.IOException;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
 import java.util.Iterator;
 import java.util.Map;
 
@@ -266,6 +270,18 @@
 
       super.dispatch(path);
     }
+    
+    @Override
+    public URL getResource(String path)
+                             throws MalformedURLException
+    {
+      RequestContext afc = RequestContext.getCurrentInstance();
+      if (afc != null)
+      {
+        path = afc.getPageResolver().getPhysicalURI(path);
+      }
+      return super.getResource(path);
+    }
 
 
     @Override

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.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/context/RequestContextImpl.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java Tue Jan  5 11:48:54 2010
@@ -33,6 +33,7 @@
 import java.util.Set;
 import java.util.TimeZone;
 
+import javax.faces.application.ProjectStage;
 import javax.faces.component.NamingContainer;
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIViewRoot;
@@ -223,8 +224,29 @@
   @Override
   public boolean isDebugOutput()
   {
-    return Boolean.TRUE.equals(
-       _bean.getProperty(RequestContextBean.DEBUG_OUTPUT_KEY));
+    // FALSE is the default value...
+    boolean debugOutput = Boolean.TRUE.equals(
+      _bean.getProperty(RequestContextBean.DEBUG_OUTPUT_KEY));
+
+    FacesContext fc = FacesContext.getCurrentInstance();
+    
+    if (fc.isProjectStage(ProjectStage.Production))
+    {
+      // on production we always want FALSE, unless the 
+      // user explicitly set the config to TRUE, but 
+      // generate a WARNING message for that.
+      if (debugOutput)
+      {
+         _LOG.warning("DEBUG_OUTPUT_TRUE_IN_PRODUCTION_STAGE");
+        return true;
+      }
+
+      return false;
+    }
+    else
+    {
+      return debugOutput;
+    }
   }
 
   @Override

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/NumberConverter.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/NumberConverter.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/convert/NumberConverter.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/NumberConverter.java Tue Jan  5 11:48:54 2010
@@ -147,7 +147,7 @@
     else
       params = new Object[4];
 
-    // We call this since the pattern may contain the generic currency sign 'ยค', which we don't 
+    // We call this since the pattern may contain the generic currency sign, which we don't 
     // want to display to the user.
     params[0] = getLocalizedPattern(context, getPattern(), null);
 

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/AccessKeyPropertyTagRule.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/AccessKeyPropertyTagRule.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/facelets/AccessKeyPropertyTagRule.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/AccessKeyPropertyTagRule.java Tue Jan  5 11:48:54 2010
@@ -21,12 +21,12 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.Metadata;
-import com.sun.facelets.tag.MetadataTarget;
-import com.sun.facelets.tag.MetaRule;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.TagAttributeException;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagAttributeException;
 
 import javax.el.ValueExpression;
 

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/DatePropertyTagRule.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/DatePropertyTagRule.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/facelets/DatePropertyTagRule.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/DatePropertyTagRule.java Tue Jan  5 11:48:54 2010
@@ -18,13 +18,13 @@
  */
 package org.apache.myfaces.trinidadinternal.facelets;
 
-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;
 
-import com.sun.facelets.tag.TagAttributeException;
+import javax.faces.view.facelets.TagAttributeException;
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/FileDownloadActionListenerTag.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/FileDownloadActionListenerTag.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/facelets/FileDownloadActionListenerTag.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/FileDownloadActionListenerTag.java Tue Jan  5 11:48:54 2010
@@ -29,14 +29,15 @@
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 
+import javax.faces.view.facelets.ComponentHandler;
+
 import org.apache.myfaces.trinidadinternal.taglib.listener.FileDownloadActionListener;
 
-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.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;
 
 /**
  *
@@ -55,7 +56,7 @@
   public void apply(FaceletContext faceletContext,
           UIComponent parent) throws IOException, FacesException, FaceletException, ELException
   {
-    if(ComponentSupport.isNew(parent))
+    if(ComponentHandler.isNew(parent))
     {
       FileDownloadActionListener listener = new FileDownloadActionListener();
       if (_filename != null)

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/LocalePropertyTagRule.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/LocalePropertyTagRule.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/facelets/LocalePropertyTagRule.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/LocalePropertyTagRule.java Tue Jan  5 11:48:54 2010
@@ -18,13 +18,13 @@
  */
 package org.apache.myfaces.trinidadinternal.facelets;
 
-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;
 
-import com.sun.facelets.tag.TagAttributeException;
+import javax.faces.view.facelets.TagAttributeException;
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/ResetActionListenerTag.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/ResetActionListenerTag.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/facelets/ResetActionListenerTag.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/ResetActionListenerTag.java Tue Jan  5 11:48:54 2010
@@ -27,11 +27,12 @@
 
 import org.apache.myfaces.trinidadinternal.taglib.listener.ResetActionListener;
 
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.FaceletException;
-import com.sun.facelets.tag.TagConfig;
-import com.sun.facelets.tag.TagHandler;
-import com.sun.facelets.tag.jsf.ComponentSupport;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.FaceletException;
+import javax.faces.view.facelets.TagConfig;
+import javax.faces.view.facelets.TagHandler;
+
+import javax.faces.view.facelets.ComponentHandler;
 
 /**
  *
@@ -47,11 +48,11 @@
   public void apply(FaceletContext faceletContext,
 		  UIComponent parent) throws IOException, FacesException, FaceletException, ELException
   {
-    if(ComponentSupport.isNew(parent))
+    if(ComponentHandler.isNew(parent))
     {
       ActionSource actionSource = (ActionSource)parent;
       ResetActionListener listener = new ResetActionListener();
       actionSource.addActionListener(listener);
     }
   }
-}
\ No newline at end of file
+}

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/ReturnActionListenerTag.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/ReturnActionListenerTag.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/facelets/ReturnActionListenerTag.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/ReturnActionListenerTag.java Tue Jan  5 11:48:54 2010
@@ -26,15 +26,15 @@
 import javax.faces.component.ActionSource;
 import javax.faces.component.UIComponent;
 
+import javax.faces.view.facelets.ComponentHandler;
+
 import org.apache.myfaces.trinidadinternal.taglib.listener.ReturnActionListener;
 
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.FaceletException;
-import com.sun.facelets.el.LegacyValueBinding;
-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.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;
 
 /**
  *
@@ -52,7 +52,7 @@
   public void apply(FaceletContext faceletContext,
           UIComponent parent) throws IOException, FacesException, FaceletException, ELException
   {
-    if(ComponentSupport.isNew(parent))
+    if(ComponentHandler.isNew(parent))
     {
       ActionSource actionSource = (ActionSource)parent;
       ReturnActionListener listener = new ReturnActionListener();

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/SetActionListenerTag.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/SetActionListenerTag.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/facelets/SetActionListenerTag.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/SetActionListenerTag.java Tue Jan  5 11:48:54 2010
@@ -23,14 +23,15 @@
 import javax.faces.component.ActionSource;
 import javax.faces.component.UIComponent;
 
+import javax.faces.view.facelets.ComponentHandler;
+
 import org.apache.myfaces.trinidad.event.SetActionListener;
 
-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.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;
 
 /**
  */
@@ -47,7 +48,7 @@
   public void apply(FaceletContext faceletContext,
                     UIComponent parent) throws FaceletException, ELException
   {
-    if (ComponentSupport.isNew(parent))
+    if (ComponentHandler.isNew(parent))
     {
       // =-=AEW Couldn't this be cached?
       ValueExpression fromExpression = _from.getValueExpression(faceletContext,

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/StringArrayPropertyTagRule.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/StringArrayPropertyTagRule.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/facelets/StringArrayPropertyTagRule.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/StringArrayPropertyTagRule.java Tue Jan  5 11:48:54 2010
@@ -24,15 +24,16 @@
 import java.util.ArrayList;
 import java.util.StringTokenizer;
 
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.Metadata;
-import com.sun.facelets.tag.MetadataTarget;
-import com.sun.facelets.tag.MetaRule;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.TagAttributeException;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagAttributeException;
+
 
 /**
- * 
+ *
  * @version $Id: StringArrayPropertyTagRule.java,v 1.1 2005/08/23 05:54:54 adamwiner Exp $
  */
 final class StringArrayPropertyTagRule extends MetaRule

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/TrinidadComponentHandler.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/TrinidadComponentHandler.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/facelets/TrinidadComponentHandler.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/TrinidadComponentHandler.java Tue Jan  5 11:48:54 2010
@@ -18,12 +18,12 @@
  */
 package org.apache.myfaces.trinidadinternal.facelets;
 
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.FaceletViewHandler;
-import com.sun.facelets.tag.jsf.ComponentHandler;
-import com.sun.facelets.tag.jsf.ComponentConfig;
+import javax.faces.application.StateManager;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.ComponentConfig;
 
-import com.sun.facelets.tag.MetaRuleset;
+import javax.faces.view.facelets.MetaRuleset;
 
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIViewRoot;
@@ -50,10 +50,11 @@
       {
         ExternalContext external = context.getExternalContext();
         String restoreMode = external.getInitParameter(
-               FaceletViewHandler.PARAM_BUILD_BEFORE_RESTORE);
-        if ("true".equals(restoreMode))
+                                                     StateManager.PARTIAL_STATE_SAVING_PARAM_NAME);
+        
+        if (Boolean.valueOf(restoreMode))
           _markInitialState = Boolean.TRUE;
-        else 
+        else
           _markInitialState = Boolean.FALSE;
       }
     }
@@ -74,7 +75,7 @@
   }
 
   @Override
-  protected void onComponentPopulated(FaceletContext context,
+  public void onComponentPopulated(FaceletContext context,
                                      UIComponent component,
                                      UIComponent parent)
   {

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/TrinidadConverterHandler.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/TrinidadConverterHandler.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/facelets/TrinidadConverterHandler.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/TrinidadConverterHandler.java Tue Jan  5 11:48:54 2010
@@ -18,12 +18,14 @@
  */
 package org.apache.myfaces.trinidadinternal.facelets;
 
-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 TrinidadConverterHandler
-  extends ConvertHandler
+  extends ConverterHandler
 {
   public TrinidadConverterHandler(ConverterConfig config)
   {

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/TrinidadListenersTagRule.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/TrinidadListenersTagRule.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/facelets/TrinidadListenersTagRule.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/TrinidadListenersTagRule.java Tue Jan  5 11:48:54 2010
@@ -25,13 +25,12 @@
 import javax.el.MethodExpression;
 import javax.faces.el.MethodBinding;
 
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.el.LegacyMethodBinding;
-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 com.sun.facelets.tag.TagAttributeException;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagAttributeException;
 
 /**
  * 

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/TrinidadValidatorHandler.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/TrinidadValidatorHandler.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/facelets/TrinidadValidatorHandler.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/TrinidadValidatorHandler.java Tue Jan  5 11:48:54 2010
@@ -18,12 +18,12 @@
  */
 package org.apache.myfaces.trinidadinternal.facelets;
 
-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.ValidatorHandler;
+import javax.faces.view.facelets.ValidatorConfig;
 
 public class TrinidadValidatorHandler
-  extends ValidateHandler
+  extends ValidatorHandler
 {
   public TrinidadValidatorHandler(ValidatorConfig config)
   {

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/ValueExpressionTagRule.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/ValueExpressionTagRule.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/facelets/ValueExpressionTagRule.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/ValueExpressionTagRule.java Tue Jan  5 11:48:54 2010
@@ -18,11 +18,11 @@
  */
 package org.apache.myfaces.trinidadinternal.facelets;
 
-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;
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/HtmlResponseWriter.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/HtmlResponseWriter.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/io/HtmlResponseWriter.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/HtmlResponseWriter.java Tue Jan  5 11:48:54 2010
@@ -69,6 +69,26 @@
   {
   }
 
+  /**
+   * Writes out CDATA start.
+   * @throws IOException on any read/write error
+   */
+  public void startCDATA() throws IOException 
+  {
+    _closeStartIfNecessary();
+    _out.write("<![CDATA[");
+
+  }
+
+  /**
+   * Writes out an end CDATA element.
+   * @throws IOException on any read/write error
+   */
+  public void endCDATA() throws IOException 
+  {
+    _out.write("]]>");
+  }
+
 
   @Override
   public void endDocument() throws IOException

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/ResponseWriterDecorator.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/ResponseWriterDecorator.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/io/ResponseWriterDecorator.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/ResponseWriterDecorator.java Tue Jan  5 11:48:54 2010
@@ -18,17 +18,15 @@
  */
 package org.apache.myfaces.trinidadinternal.io;
 
-import java.io.IOException;
-import java.io.Writer;
-
-import javax.faces.component.UIComponent;
 import javax.faces.context.ResponseWriter;
+import javax.faces.context.ResponseWriterWrapper;
 
 /**
  * ResponseWriter abstract base used to decorate another ResponseWriter.
- * 
+ *
+ * @Deprecated Use ResponseWriterWrapper direcly
  */
-abstract public class ResponseWriterDecorator extends ResponseWriter
+abstract public class ResponseWriterDecorator extends ResponseWriterWrapper
 {
   /**
    * Create a ResponseWriterDecorator.
@@ -48,151 +46,18 @@
     return _decorated;
   }
 
-  @Override
-  public String getCharacterEncoding()
-  {
-    return getResponseWriter().getCharacterEncoding();
-  }
-
-  @Override
-  public String getContentType()
-  {
-    return getResponseWriter().getContentType();
-  }
-
-  @Override
-  public void startDocument() throws IOException
-  {
-    getResponseWriter().startDocument();
-  }
-
-
-  @Override
-  public void endDocument() throws IOException
-  {
-    getResponseWriter().endDocument();
-  }
-
-  @Override
-  public void flush() throws IOException
-  {
-    getResponseWriter().flush();
-  }
-
-
-  @Override
-  public void close()throws IOException
-  {
-    getResponseWriter().close();
-  }
-
-  @Override
-  public void startElement(String name,
-                           UIComponent component) throws IOException
-  {
-    getResponseWriter().startElement(name, component);
-  }
-
-  
-  @Override
-  public void endElement(String name) throws IOException
-  {
-    getResponseWriter().endElement(name);
-  }
-
-
-  @Override
-  public void writeAttribute(String name,
-                             Object value,
-                             String componentPropertyName)
-        throws IOException
-  {
-    getResponseWriter().writeAttribute(name, value, componentPropertyName);
-  }
-
-
-  @Override
-  public void writeURIAttribute(String name,
-                                Object value,
-                                String componentPropertyName)
-    throws IOException
-  {
-    getResponseWriter().writeURIAttribute(name, value, componentPropertyName);
-  }
-
-  @Override
-  public void writeComment(Object comment) throws IOException
-  {
-    getResponseWriter().writeComment(comment);
-  }
-
-
-
-  @Override
-  public void writeText(Object text, UIComponent component, 
-                        String propertyName)
-    throws IOException
-  {
-    getResponseWriter().writeText(text, component, propertyName);
-  }
-  
-  @Override
-  public void writeText(Object text, String componentPropertyName) throws IOException
-  {
-    getResponseWriter().writeText(text, componentPropertyName);
-  }
-
-
-  @Override
-  public void writeText(char text[], int off, int len)
-        throws IOException
-  {
-    getResponseWriter().writeText(text, off, len);
-  }
-
-  @Override
-  public void write(char cbuf[], int off, int len) throws IOException
-  {
-    getResponseWriter().write(cbuf, off, len);
-  }
-
-  @Override
-  public void write(String str) throws IOException
-  {
-    getResponseWriter().write(str);
-  }
-
-  @Override
-  public void write(int c) throws IOException
-  {
-    getResponseWriter().write((char) c);
-  }
-
-  @Override
-  public void write(char[] cbuf)
-    throws IOException
-  {
-    getResponseWriter().write(cbuf);
-  }
-
-  @Override
-  public void write(String str, int off, int len)
-    throws IOException
-  {
-    getResponseWriter().write(str, off, len);
-  }
-
-  @Override
-  public ResponseWriter cloneWithWriter(Writer writer)
-  {
-    return getResponseWriter().cloneWithWriter(writer);
-  }
-
   public String toString()
   {
     return super.toString() + "[" + _decorated.toString() + "]";
     
   }
+  
+  @Override
+  public ResponseWriter getWrapped()
+  {
+    return getResponseWriter();
+  }  
 
   private final ResponseWriter _decorated;
+
 }

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/XhtmlResponseWriter.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/XhtmlResponseWriter.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/io/XhtmlResponseWriter.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/io/XhtmlResponseWriter.java Tue Jan  5 11:48:54 2010
@@ -67,17 +67,36 @@
     return XHTML_CONTENT_TYPE;
   }
 
+
   @Override
   public void startDocument() throws IOException
   {
   }
 
-
   @Override
   public void endDocument() throws IOException
   {
     _out.flush();
   }
+  
+  /**
+   * Writes out CDATA start.
+   * @throws IOException on any read/write error
+   */
+  public void startCDATA() throws IOException 
+  {
+    _closeStartIfNecessary();
+    _out.write("<![CDATA[");
+  }
+
+  /**
+   * Writes out an end CDATA element.
+   * @throws IOException on any read/write error
+   */
+  public void endCDATA() throws IOException 
+  {
+    _out.write("]]>");
+  }
 
   @Override
   public void flush() throws IOException
@@ -468,4 +487,5 @@
   private static final Class<?> _INTEGER_CLASS = Integer.class;
 
   static private final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(XhtmlResponseWriter.class);
+
 }

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/RenderKitDecorator.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/RenderKitDecorator.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/renderkit/RenderKitDecorator.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/RenderKitDecorator.java Tue Jan  5 11:48:54 2010
@@ -6,9 +6,9 @@
  *  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
@@ -21,19 +21,24 @@
 import java.io.OutputStream;
 import java.io.Writer;
 
+import java.util.Iterator;
 import java.util.concurrent.ConcurrentMap;
 
 import javax.faces.FactoryFinder;
+import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
 import javax.faces.context.ResponseStream;
 import javax.faces.context.ResponseWriter;
+import javax.faces.render.ClientBehaviorRenderer;
 import javax.faces.render.RenderKit;
 import javax.faces.render.RenderKitFactory;
 import javax.faces.render.Renderer;
 import javax.faces.render.ResponseStateManager;
 
 import org.apache.myfaces.trinidad.context.RequestContext;
+import org.apache.myfaces.trinidad.context.RequestContextFactory;
 import org.apache.myfaces.trinidad.util.Service;
+import org.apache.myfaces.trinidadinternal.config.GlobalConfiguratorImpl;
 
 
 abstract public class RenderKitDecorator extends RenderKitBase
@@ -70,6 +75,21 @@
     return getRenderKit().getResponseStateManager();
   }
 
+  public void addClientBehaviorRenderer(String type, ClientBehaviorRenderer renderer)
+  {
+    getRenderKit().addClientBehaviorRenderer(type, renderer);
+  }
+
+  public ClientBehaviorRenderer getClientBehaviorRenderer(String type)
+  {
+    return getRenderKit().getClientBehaviorRenderer(type);
+  }
+
+  public Iterator<String> getClientBehaviorRendererTypes()
+  {
+    return getRenderKit().getClientBehaviorRendererTypes();
+  }
+
   protected ResponseWriter createDecoratedResponseWriter(
     ResponseWriter delegate)
   {
@@ -88,14 +108,14 @@
     if (renderer == null)
     {
       RenderKit renderKit = getRenderKit();
-            
+
       // Use findRenderer() to avoid "not found" warning messages
       if (renderKit instanceof RenderKitBase)
         renderer = ((RenderKitBase) renderKit).findRenderer(
                                         componentFamily, rendererType);
       else
         renderer = renderKit.getRenderer(componentFamily, rendererType);
-        
+
       // copy-on-read
       if (renderer != null)
         addRenderer(componentFamily, rendererType, renderer);
@@ -107,28 +127,38 @@
   protected RenderKit getRenderKit()
   {
     FacesContext context = FacesContext.getCurrentInstance();
-    
+
     // There's only one RenderKitFactory per app. The javadoc for RenderKitFactory says:
-    //      "There must be one RenderKitFactory instance per web 
+    //      "There must be one RenderKitFactory instance per web
     //       application that is utilizing JavaServer Faces"
     // The call to FactoryFinder.getFactory is doing locking, Issue 688 was filed with the RI
     // to try to remove the locking there:
     // https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=688
-    // However they were not able to remove the locking. 
+    // However they were not able to remove the locking.
     // Therefore save off the factory on the app map.
-    ConcurrentMap<String, Object> appMap = 
-                         RequestContext.getCurrentInstance().getApplicationScopedConcurrentMap();
-    
+    RequestContext requestContext = RequestContext.getCurrentInstance();
+    if (requestContext == null)
+    {
+      // In JSF 2, this method may be called be before the global configurator has been initialized and if that
+      // is the case, then the request context needs to be built
+      ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
+      GlobalConfiguratorImpl.getInstance().init(externalContext);
+      requestContext = RequestContextFactory.getFactory().createContext(externalContext);
+    }
+
+    ConcurrentMap<String, Object> appMap =
+      requestContext.getApplicationScopedConcurrentMap();
+
     RenderKitFactory factory = (RenderKitFactory)appMap.get(_RENDER_KIT_FACTORY_KEY);
-    
+
     if (factory == null)
     {
-      factory = (RenderKitFactory)FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);   
-      RenderKitFactory oldFactory = 
+      factory = (RenderKitFactory)FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
+      RenderKitFactory oldFactory =
                           (RenderKitFactory) appMap.putIfAbsent(_RENDER_KIT_FACTORY_KEY, factory);
-        
+
       if (oldFactory != null)
-        factory = oldFactory;      
+        factory = oldFactory;
     }
 
     RenderKit renderKit = factory.getRenderKit(context, getDecoratedRenderKitId());
@@ -137,6 +167,6 @@
   }
 
   abstract protected String getDecoratedRenderKitId();
-  private static final String _RENDER_KIT_FACTORY_KEY = 
+  private static final String _RENDER_KIT_FACTORY_KEY =
          "org.apache.myfaces.trinidadinternal.renderkit.RenderKitDecorator.RENDER_KIT_FACTORY_KEY";
 }

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreResponseStateManager.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreResponseStateManager.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/renderkit/core/CoreResponseStateManager.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreResponseStateManager.java Tue Jan  5 11:48:54 2010
@@ -6,9 +6,9 @@
  *  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
@@ -18,34 +18,33 @@
  */
 package org.apache.myfaces.trinidadinternal.renderkit.core;
 
-import javax.faces.application.StateManager;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import javax.faces.render.ResponseStateManager;
-
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutput;
 import java.io.ObjectOutputStream;
+import java.io.ObjectStreamClass;
 import java.io.OptionalDataException;
 import java.io.StringReader;
-import java.io.BufferedReader;
 import java.io.StringWriter;
-import java.io.BufferedWriter;
-
-
-import java.io.ObjectStreamClass;
 
-import java.util.zip.GZIPOutputStream;
+import java.util.Map;
 import java.util.zip.GZIPInputStream;
+import java.util.zip.GZIPOutputStream;
 
-import java.util.Map;
+import javax.faces.FacesException;
+import javax.faces.application.StateManager;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.render.ResponseStateManager;
 
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
-
 import org.apache.myfaces.trinidad.util.Base64InputStream;
 import org.apache.myfaces.trinidad.util.Base64OutputStream;
 import org.apache.myfaces.trinidad.util.ClassLoaderUtils;
+import org.apache.myfaces.trinidadinternal.application.StateManagerImpl;
+
 
 /**
  * ResponseStateManager implementation for the Core RenderKit.
@@ -53,6 +52,23 @@
  */
 public class CoreResponseStateManager extends ResponseStateManager
 {
+
+  @Override
+  public Object getState(FacesContext context, String viewId)
+  {
+    // TODO see doc in StateManagerImpl.restoreView
+    // (search for StateManagerImpl.RESPONSE_STATE_MANAGER_STATE_KEY) to see doc
+    // about what's going on here
+    Object state = context.getExternalContext().getRequestMap().get(
+                                              StateManagerImpl.RESPONSE_STATE_MANAGER_STATE_KEY);
+
+    if (state != null)
+      return state;
+    else
+      return super.getState(context, viewId);
+  }
+
+
   /**
    * Name of the form field that encodes the UI state.
    */
@@ -143,6 +159,56 @@
     return view[1];
   }
 
+  @Override
+  public String getViewState(FacesContext context, Object state)
+  {
+    StateManager.SerializedView serializedView = _getSerializedView(context, state);
+    try
+    {
+      return encodeSerializedViewAsString(serializedView);
+    }
+    catch (IOException e)
+    {
+      throw new FacesException();
+    }
+  }
+
+  private StateManager.SerializedView _getSerializedView(FacesContext context, Object state)
+  {
+
+    StateManager.SerializedView view;
+    if (state instanceof StateManager.SerializedView)
+    {
+      view = (StateManager.SerializedView) state;
+    }
+    else
+    {
+      if (state instanceof Object[])
+      {
+        Object[] stateArray = (Object[]) state;
+
+        // in theory the state should be a black box, but the RI makes assumptions
+        // that the state is an array of length 2
+        if (stateArray.length == 2)
+        {
+          StateManager stateManager =
+            context.getApplication().getStateManager();
+          view =
+              stateManager.new SerializedView(stateArray[0], stateArray[1]);
+        }
+        else
+        {
+          throw new IllegalArgumentException(_LOG.getMessage("UNEXPECTED_STATE"));
+        }
+      }
+      else
+      {
+        throw new IllegalArgumentException(_LOG.getMessage("UNEXPECTED_STATE"));
+      }
+    }
+
+    return view;
+  }
 
   /**
    * Restore the serialized view from the incoming request.
@@ -153,9 +219,9 @@
   private Object[] _restoreSerializedView(
      FacesContext context)
   {
-    Map<String, Object> requestMap = 
+    Map<String, Object> requestMap =
       context.getExternalContext().getRequestMap();
-    
+
     Object[] view = (Object[]) requestMap.get(_CACHED_SERIALIZED_VIEW);
     if (view == null)
     {
@@ -227,6 +293,8 @@
   }
 
 
+
+
   /* Test code for dumping out the page's state
   static private void _dump(Object o)
   {

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/StyleContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/StyleContextImpl.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/renderkit/core/StyleContextImpl.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/StyleContextImpl.java Tue Jan  5 11:48:54 2010
@@ -18,12 +18,11 @@
  */
 package org.apache.myfaces.trinidadinternal.renderkit.core;
 
-import java.beans.Beans;
-
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentMap;
 
+import javax.faces.application.ProjectStage;
 import javax.faces.context.FacesContext;
 
 import org.apache.myfaces.trinidad.context.AccessibilityProfile;
@@ -35,7 +34,6 @@
 import org.apache.myfaces.trinidad.style.Styles;
 import org.apache.myfaces.trinidadinternal.agent.TrinidadAgent;
 import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.HtmlRenderer;
-import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.StyleSheetRenderer;
 import org.apache.myfaces.trinidadinternal.share.config.Configuration;
 import org.apache.myfaces.trinidadinternal.skin.SkinStyleProvider;
 import org.apache.myfaces.trinidadinternal.style.StyleContext;
@@ -113,23 +111,16 @@
   }
   public boolean checkStylesModified()
   {
-    if (Beans.isDesignTime())
-    {
-      // In Design Time mode, if we have a skin-id on the request scope,
-      // then this means we want to check if the skin css files are modified.
-      // This is an alternative to the initParam (CHECK_TIMESTAMP_PARAM) which
-      // is set in web.xml. Design Time cannot set the web.xml file.
-      FacesContext context = FacesContext.getCurrentInstance();
-      Object requestSkinId = 
-        ((CoreRenderingContext) _arc).getRequestMapSkinId(context);
-      if (requestSkinId != null)
-        return true;
-
-    }
+    // TODO: similar code is present in the ViewHanlder;
+    // this needs to be factored out into a common util.
+    // See TRINIDAD-1662
     
     FacesContext context = FacesContext.getCurrentInstance();
     String checkTimestamp =
       context.getExternalContext().getInitParameter(Configuration.CHECK_TIMESTAMP_PARAM);
+
+    // in production stage we don't want TRUE here;
+    // a WARNING will be triggered by the ViewHandlerImpl.java
     return "true".equals(checkTimestamp);
   }
 
@@ -170,7 +161,7 @@
   /**
    *
    * @return true if we should disable style compression. e.g.,
-   * if StyleSheetRenderer.DISABLE_CONTENT_COMPRESSION is true or the skin is a portlet skin
+   * if Configuration.DISABLE_CONTENT_COMPRESSION is true or the skin is a portlet skin
    * or we are in portlet mode and not doing skin sharing.
    */
   public boolean isDisableStyleCompression()
@@ -180,14 +171,38 @@
       FacesContext context = FacesContext.getCurrentInstance();
       String disableContentCompression =
         context.getExternalContext().
-        getInitParameter(StyleSheetRenderer.DISABLE_CONTENT_COMPRESSION);
-      boolean disableContentCompressionBoolean = "true".equals(disableContentCompression);
+        getInitParameter(Configuration.DISABLE_CONTENT_COMPRESSION);
+      boolean disableContentCompressionBoolean; 
+
+      // what value has been specified for the DISABLE_CONTENT_COMPRESSION param?
+      if (disableContentCompression != null)
+      {
+        disableContentCompressionBoolean = "true".equals(disableContentCompression);
+      }
+      else 
+      {
+        // if the DISABLE_CONTENT_COMPRESSION 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
+        disableContentCompressionBoolean = !(context.isProjectStage(ProjectStage.Production));
+      }
 
       // the user wants to explicitly disable the content compression and show the full styleclass
       // names
       if (disableContentCompressionBoolean)
+      {
         _isDisableStyleCompression = Boolean.TRUE;
 
+        // if Apache MyFaces Trinidad is running in production stage and 
+        // running with content compression disabled we generate a WARNING
+        // message
+        if (context.isProjectStage(ProjectStage.Production))
+        {
+          _LOG.warning("DISABLE_CONTENT_COMPRESSION_IN_PRODUCTION_STAGE");
+        }
+      }
+
       // we still need to check if we don't want to compress even if the disable content
       // compression flag is true
       if (CoreRenderKit.OUTPUT_MODE_PORTLET.equals(_arc.getOutputMode()))
@@ -277,8 +292,6 @@
   private StyleProvider _styleProvider;
   private Styles _styles;
   private Boolean  _isDisableStyleCompression;
-  static private final String _SKIN_ID_PARAM =
-    "org.apache.myfaces.trinidad.skin.id";
 
   private static final TrinidadLogger _LOG =
     TrinidadLogger.createTrinidadLogger(StyleContextImpl.class);

Modified: myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/ChartRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/ChartRenderer.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/renderkit/core/desktop/ChartRenderer.java (original)
+++ myfaces/trinidad/branches/2.0.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/ChartRenderer.java Tue Jan  5 11:48:54 2010
@@ -80,8 +80,6 @@
     _maxPrecisionKey = type.findKey("maxPrecision");
   }
 
-
-
   /**
    * @todo Decode the chart drill down event
    *
@@ -166,7 +164,7 @@
   @Override
   protected boolean shouldRenderId(
    FacesContext context,
-   UIComponent  component)
+   UIComponent component)
   {
     return true;
   }
@@ -176,42 +174,44 @@
    */
   @Override
   protected void encodeAll(
-    FacesContext        context,
-    RenderingContext arc,
-    UIComponent         component,
-    FacesBean           bean) throws IOException
+    FacesContext     context,
+    RenderingContext rc,
+    UIComponent      component,
+    FacesBean        bean
+    ) throws IOException
   {
-    if (canSkipRendering(context, arc, component))
+    if (canSkipRendering(context, rc, component))
       return;
 
     ResponseWriter rw = context.getResponseWriter();
     rw.startElement(XhtmlConstants.DIV_ELEMENT, component);
     renderId(context, component);
-    renderStyleAttributes(context, arc, bean, SkinSelectors.AF_CHART_STYLE_CLASS);
+    renderStyleAttributes(context, rc, component, bean, SkinSelectors.AF_CHART_STYLE_CLASS);
     // We need the number convertor so that we can format numbers on the client
-    XhtmlUtils.addLib(context, arc, _NUMBER_CONVERTER_SCRIPTLET);
+    XhtmlUtils.addLib(context, rc, _NUMBER_CONVERTER_SCRIPTLET);
     // output the chart javascript library
-    chartLib.outputScriptlet(context, arc);
+    chartLib.outputScriptlet(context, rc);
 
     // We will render the chart using JavaScript
     StringWriter sw = new StringWriter(5000);
     _outputSVGDocumentCreate(context, sw, component, bean);
     _outputJSChartModel(sw, component);
-    _outputJSChartObject(context, arc, sw, component, bean);
+    _outputJSChartObject(context, rc, sw, component, bean);
     // Output the script to the response
     rw.startElement(XhtmlConstants.SCRIPT_ELEMENT, null);
-    renderScriptDeferAttribute(context, arc);
-    renderScriptTypeAttribute(context, arc);
+    renderScriptDeferAttribute(context, rc);
+    renderScriptTypeAttribute(context, rc);
     rw.write(sw.toString());
     rw.endElement(XhtmlConstants.SCRIPT_ELEMENT);
     rw.endElement(XhtmlConstants.DIV_ELEMENT);
   }
 
   protected void _outputSVGDocumentCreate(
-    FacesContext        context,
+    FacesContext context,
     StringWriter sw,
-    UIComponent         component,
-    FacesBean           bean) throws IOException
+    UIComponent  component,
+    FacesBean    bean
+    ) throws IOException
   {
     sw.append("ApacheChart.createSVG(\"");
     String clientId = component.getClientId(context);
@@ -219,7 +219,7 @@
     sw.append("\",\"svgChart");
     sw.append(clientId);
     sw.append("\",\"");
-    String templateURL = getTemplateSource(bean);
+    String templateURL = getTemplateSource(component, bean);
     templateURL = context.getExternalContext().encodeResourceURL(templateURL);
     sw.append(templateURL);
     sw.append("\",\"width:100%; height:100%;\"");
@@ -228,7 +228,8 @@
 
   protected void _outputJSChartModel(
     StringWriter sw,
-    UIComponent         component) throws IOException
+    UIComponent  component
+    ) throws IOException
   {
     CoreChart chart = (CoreChart)component;
     ChartModel model = (ChartModel)chart.getValue();
@@ -279,11 +280,12 @@
   }
 
   protected void _outputJSChartObject(
-    FacesContext        context,
-    RenderingContext    arc,
-    StringWriter sw,
-    UIComponent         component,
-    FacesBean           bean) throws IOException
+    FacesContext     context,
+    RenderingContext rc,
+    StringWriter     sw,
+    UIComponent      component,
+    FacesBean        bean
+    ) throws IOException
   {
     Integer type = _typeToJSTypeMap.get(getType(bean));
     if(type == null)
@@ -298,45 +300,45 @@
     sw.append(";\n");
 
     sw.append("var isPerspective = ");
-    _writeJSObject(sw, isPerspective(bean));
+    _writeJSObject(sw, isPerspective(component, bean));
     sw.append(";\n");
 
     sw.append("var legendPosition = ");
-    _writeJSObject(sw, getLegendPosition(bean));
+    _writeJSObject(sw, getLegendPosition(component, bean));
     sw.append(";\n");
 
     sw.append("var apacheChart = ApacheChart.createChart(type, model, chartId, isPerspective, legendPosition);");
 
     sw.append("apacheChart.setYMajorGridLineCount(");
-    _writeJSObject(sw, getYMajorGridLineCount (bean));
+    _writeJSObject(sw, getYMajorGridLineCount(component, bean));
     sw.append(");\n");
 
     sw.append("apacheChart.setYMinorGridLineCount(");
-    _writeJSObject(sw, getYMinorGridLineCount(bean));
+    _writeJSObject(sw, getYMinorGridLineCount(component, bean));
     sw.append(");\n");
 
     sw.append("apacheChart.setXMajorGridLineCount(");
-    _writeJSObject(sw, getXMajorGridLineCount(bean));
+    _writeJSObject(sw, getXMajorGridLineCount(component, bean));
     sw.append(");\n");
 
     sw.append("apacheChart.setGradientsUsed(");
-    _writeJSObject(sw, isGradientsUsed(bean));
+    _writeJSObject(sw, isGradientsUsed(component, bean));
     sw.append(");\n");
 
     sw.append("apacheChart.setAnimationDuration(");
-    _writeJSObject(sw, getAnimationDuration(bean));
+    _writeJSObject(sw, getAnimationDuration(component, bean));
     sw.append(");\n");
 
     sw.append("apacheChart.setTooltipsVisible(");
-    _writeJSObject(sw, isTooltipsVisible(bean));
+    _writeJSObject(sw, isTooltipsVisible(component, bean));
     sw.append(");\n");
 
     sw.append("apacheChart.setMaxPrecision(");
-    _writeJSObject(sw, getMaxPrecision(bean));
+    _writeJSObject(sw, getMaxPrecision(component, bean));
     sw.append(");\n");
 
     String formName;
-    FormData fData = arc.getFormData();
+    FormData fData = rc.getFormData();
     if (fData == null)
       formName =  null;
     else
@@ -356,21 +358,21 @@
       sw.append(");\n");
     }
 
-    if(TrinidadAgent.AGENT_IE.equals(arc.getAgent().getAgentName()))
+    if(TrinidadAgent.AGENT_IE.equals(rc.getAgent().getAgentName()))
     {
       sw.append("apacheChart.setErrorHtml(");
-      _writeJSObject(sw, arc.getTranslatedString("af_chart.IE_SVG_PLUGIN_ERROR_HTML"));
+      _writeJSObject(sw, rc.getTranslatedString("af_chart.IE_SVG_PLUGIN_ERROR_HTML"));
       sw.append(");\n");
     }
     else
     {
       sw.append("apacheChart.setErrorHtml(");
-      _writeJSObject(sw, arc.getTranslatedString("af_chart.SVG_ENABLED_BROWSER_ERROR_HTML"));
+      _writeJSObject(sw, rc.getTranslatedString("af_chart.SVG_ENABLED_BROWSER_ERROR_HTML"));
       sw.append(");\n");
     }
 
     sw.append("apacheChart.setStatusHtml(");
-    _writeJSObject(sw, arc.getTranslatedString("af_chart.SVG_LOADING_STATUS_HTML"));
+    _writeJSObject(sw, rc.getTranslatedString("af_chart.SVG_LOADING_STATUS_HTML"));
     sw.append(");\n");
 
     // finally draw the chart
@@ -380,7 +382,8 @@
   @SuppressWarnings("unchecked")
   static private void _writeJSObject(
     StringWriter sw,
-    Object   attrValue) throws IOException
+    Object       attrValue
+    ) throws IOException
   {
     if (attrValue == null)
     {
@@ -425,7 +428,8 @@
    */
   static private void _writeJSString(
     StringWriter sw,
-    String  value) throws IOException
+    String       value
+    ) throws IOException
   {
     if (value == null)
     {
@@ -535,7 +539,8 @@
    */
   static public void _writeJSInt(
     StringWriter sw,
-    Integer       value) throws IOException
+    Integer       value
+    ) throws IOException
   {
     sw.append(String.valueOf(value));
   }
@@ -548,7 +553,8 @@
    */
   static private void _writeJSBoolean(
     StringWriter sw,
-    Boolean      value) throws IOException
+    Boolean      value
+    ) throws IOException
   {
     sw.append(String.valueOf(value));
   }
@@ -562,7 +568,8 @@
    */
   static private void _writeJSDouble(
     StringWriter sw,
-    Double        value) throws IOException
+    Double       value
+    ) throws IOException
   {
     sw.append(String.valueOf(value));
   }
@@ -573,7 +580,10 @@
    * @param sw           the StringWriter
    * @param color        the color value
    */
-  static private void _writeJSColor(StringWriter sw, Color color) throws IOException
+  static private void _writeJSColor(
+    StringWriter sw,
+    Color        color
+    ) throws IOException
   {
     sw.append("\"RGB(");
     sw.append(String.valueOf(color.getRed()));
@@ -592,7 +602,8 @@
    */
   static private void _writeJSCollection(
     StringWriter  sw,
-    Collection<?> value) throws IOException
+    Collection<?> value
+    ) throws IOException
   {
     if (value == null)
     {
@@ -618,7 +629,9 @@
     }
   }
 
-  private static Object _getProperty(FacesBean bean, PropertyKey key)
+  private static Object _getProperty(
+    FacesBean   bean,
+    PropertyKey key)
   {
     Object ret = bean.getProperty(key);
     if (ret==null)
@@ -626,18 +639,21 @@
     return ret;
   }
 
-  protected String getType(FacesBean bean)
+  protected String getType(
+    FacesBean bean)
   {
     return toString(_getProperty(bean, _typeKey));
   }
 
-  protected String getTemplateSource(FacesBean bean)
+  protected String getTemplateSource(
+    UIComponent component,
+    FacesBean    bean)
   {
     Object ret = bean.getProperty(_templateSourceKey);
     String uri;
     if (ret==null)
     {
-      if(isGradientsUsed(bean))
+      if (isGradientsUsed(component, bean))
         uri = _TEMPLATE_DOC;
       else
         uri = _TEMPLATE_DOC_NOGRADIENT;
@@ -649,47 +665,65 @@
     return toResourceUri(FacesContext.getCurrentInstance(), uri);
   }
 
-  protected boolean isPerspective(FacesBean bean)
+  protected boolean isPerspective(
+    UIComponent component,
+    FacesBean   bean)
   {
     return Boolean.TRUE.equals(_getProperty(bean, _perspectiveKey));
   }
 
-  protected String getLegendPosition(FacesBean bean)
+  protected String getLegendPosition(
+    UIComponent component,
+    FacesBean   bean)
   {
     return toString(_getProperty(bean, _legendPositionKey));
   }
 
-  protected Integer getAnimationDuration(FacesBean bean)
+  protected Integer getAnimationDuration(
+    UIComponent component,
+    FacesBean   bean)
   {
     return (Integer)_getProperty(bean, _animationDurationKey);
   }
 
-  protected boolean isGradientsUsed(FacesBean bean)
+  protected boolean isGradientsUsed(
+    UIComponent component,
+    FacesBean   bean)
   {
     return Boolean.TRUE.equals(_getProperty(bean, _gradientsUsedKey));
   }
 
-  protected boolean isTooltipsVisible(FacesBean bean)
+  protected boolean isTooltipsVisible(
+    UIComponent component,
+    FacesBean   bean)
   {
     return Boolean.TRUE.equals(_getProperty(bean, _tooltipsVisibleKey));
   }
 
-  protected Integer getYMajorGridLineCount(FacesBean bean)
+  protected Integer getYMajorGridLineCount(
+    UIComponent component,
+    FacesBean   bean)
   {
     return (Integer)_getProperty(bean, _YMajorGridLineCountKey);
   }
 
-  protected Integer getXMajorGridLineCount(FacesBean bean)
+  protected Integer getXMajorGridLineCount(
+    UIComponent component,
+    FacesBean   bean)
   {
     return (Integer)_getProperty(bean, _XMajorGridLineCountKey);
   }
 
-  protected Integer getYMinorGridLineCount(FacesBean bean)
+  protected Integer getYMinorGridLineCount(
+    UIComponent component,
+    FacesBean   bean)
   {
     return (Integer)_getProperty(bean, _YMinorGridLineCountKey);
   }
 
-  protected Integer getMaxPrecision(FacesBean bean)
+  protected Integer getMaxPrecision(
+    UIComponent component,
+    FacesBean   bean)
   {
     return (Integer)_getProperty(bean, _maxPrecisionKey);
   }