You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mf...@apache.org on 2010/12/29 23:27:42 UTC

svn commit: r1053758 [16/16] - in /myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0: ./ api/src/main/java/javax/portlet/faces/ api/src/main/java/javax/portlet/faces/component/ examples/ examples/carstore/ examples/carstore/src/ example...

Modified: myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletFacesContextFactoryImpl.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletFacesContextFactoryImpl.java?rev=1053758&r1=1053757&r2=1053758&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletFacesContextFactoryImpl.java (original)
+++ myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletFacesContextFactoryImpl.java Wed Dec 29 22:27:33 2010
@@ -1,12 +1,19 @@
 package org.apache.myfaces.portlet.faces.context;
 
+import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import javax.el.ELContext;
+import javax.el.ELContextEvent;
+import javax.el.ELContextListener;
+
 import javax.faces.FacesException;
+import javax.faces.application.Application;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
@@ -18,6 +25,7 @@ import javax.portlet.faces.Bridge;
 import javax.portlet.faces.annotation.PortletNamingContainer;
 
 import org.apache.myfaces.portlet.faces.bridge.BridgeImpl;
+import org.apache.myfaces.portlet.faces.el.PortletELContextImpl;
 import org.apache.myfaces.shared_portlet.util.ExternalContextUtils;
 
 public class PortletFacesContextFactoryImpl
@@ -25,6 +33,7 @@ public class PortletFacesContextFactoryI
 {
   private static final Logger sLOG= Logger.getLogger(PortletFacesContextFactoryImpl.class.getName());
   private FacesContextFactory mFactory;
+  private ELContext mElContext;
   
   public PortletFacesContextFactoryImpl(FacesContextFactory factory)
   {
@@ -61,12 +70,83 @@ public class PortletFacesContextFactoryI
     public FacesContextImpl(FacesContext context)
     {
       mWrappedContext = context;
+      setCurrentInstance(this);
     }
 
     public FacesContext getWrapped()
     {
       return mWrappedContext;
     }
+    
+    /**
+     * <p>
+     * Return the <code>ELContext</code> instance for this <code>FacesContext</code> instance.
+     * This <code>ELContext</code> instance has the same lifetime and scope as the
+     * <code>FacesContext</code> instance with which it is associated, and may be created lazily the
+     * first time this method is called for a given <code>FacesContext</code> instance. Upon
+     * creation of the ELContext instance, the implementation must take the following action:
+     * </p>
+     * 
+     * <ul>
+     * 
+     * <li>
+     * <p>
+     * Call the {@link ELContext#putContext} method on the instance, passing in
+     * <code>FacesContext.class</code> and the <code>this</code> reference for the
+     * <code>FacesContext</code> instance itself.
+     * </p>
+     * </li>
+     * 
+     * <li>
+     * <p>
+     * If the <code>Collection</code> returned by {@link
+     * javax.faces.application.Application#getELContextListeners} is non-empty, create an instance of
+     * {@link javax.el.ELContextEvent} and pass it to each {@link javax.el.ELContextListener} instance
+     * in the <code>Collection</code> by calling the {@link
+     * javax.el.ELContextListener#contextCreated} method.
+     * </p>
+     * </li>
+     * 
+     * </ul>
+     * 
+     * <p>
+     * The default implementation throws <code>UnsupportedOperationException</code> and is provided
+     * for the sole purpose of not breaking existing applications that extend this class.
+     * </p>
+     * 
+     * @throws IllegalStateException
+     *           if this method is called after this instance has been released
+     * 
+     * @since 1.2
+     */
+    @Override
+    public ELContext getELContext()
+    {
+      if (mElContext == null)
+      {
+        Application app = getApplication();
+        mElContext = new PortletELContextImpl(app.getELResolver());
+        // Use one set as current instance in case we are wrapped
+        mElContext.putContext(FacesContext.class, FacesContext.getCurrentInstance());
+        UIViewRoot root = getViewRoot();
+        if (null != root)
+        {
+          mElContext.setLocale(root.getLocale());
+        }
+        
+        // Now notify any listeners that we have created this context
+        ELContextListener[] listeners = app.getELContextListeners();
+        if (listeners.length > 0)
+        {
+          ELContextEvent event = new ELContextEvent(mElContext);
+          for (ELContextListener listener:listeners)
+          {
+            listener.contextCreated(event);
+          }
+        }
+      }
+      return mElContext;
+    }
 
     @Override
     public void setViewRoot(UIViewRoot root)
@@ -94,11 +174,16 @@ public class PortletFacesContextFactoryI
     @Override
     public void release()
     {
+      mElContext = null;
+      // Reset attributes to those that existed before we were called
+      // This is done because some (local) portals run/render all portlets in the same request
       ExternalContext ec = getWrapped().getExternalContext();
       Map<String,Object> reqAttrs = ec.getRequestMap();
       
       @SuppressWarnings("unchecked")
       List<String> preExistingAttrs = (List<String>)reqAttrs.get(BridgeImpl.PREEXISTING_ATTRIBUTE_NAMES);
+      ArrayList<String> removeList = (ArrayList<String>) new ArrayList(preExistingAttrs.size());
+
 
       Set<String> keys= reqAttrs.keySet();
       
@@ -106,10 +191,17 @@ public class PortletFacesContextFactoryI
       {
         if (!preExistingAttrs.contains(key))
         {
-          reqAttrs.remove(key);
+          // Postpone the remove until after the iteration as it causes a ConcurrentModificationException on some appServers (WebSphere)
+          removeList.add(key);
         }
       }
       
+      // Postpone the remove until after the iteration as it causes a ConcurrentModificationException on some appServers (WebSphere)
+      for(Iterator<String> iter = removeList.iterator(); iter.hasNext();)
+      {
+        reqAttrs.remove(iter.next());
+      }
+      
       if(ec instanceof PortletExternalContextImpl)
       {
         ((PortletExternalContextImpl)ec).release();

Modified: myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/QueryString.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/QueryString.java?rev=1053758&r1=1053757&r2=1053758&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/QueryString.java (original)
+++ myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/QueryString.java Wed Dec 29 22:27:33 2010
@@ -45,7 +45,7 @@ public final class QueryString
   public QueryString(String queryString, String characterEncoding)
   {
     // We only work on regular QueryStrings not strictXhtml QueryStrings
-    mQueryString = queryString.replaceAll("\\&amp\\;", "&");
+    mQueryString = queryString.replace("&amp;", "&");
     mCharacterEncoding = characterEncoding;
   }
 
@@ -168,7 +168,7 @@ public final class QueryString
   
   public int numParameters()
   {
-    return mParameterMap.size();
+    return (mParameterMap != null) ? mParameterMap.size() : 0;
   }
 
   public String getParameter(String name)

Propchange: myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/QueryString.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Dec 29 22:27:33 2010
@@ -0,0 +1 @@
+/myfaces/portlet-bridge/core/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/util/QueryString.java:888894-923981,946789-982807

Modified: myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/config/FacesConfigurationProcessor.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/config/FacesConfigurationProcessor.java?rev=1053758&r1=1053757&r2=1053758&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/config/FacesConfigurationProcessor.java (original)
+++ myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/config/FacesConfigurationProcessor.java Wed Dec 29 22:27:33 2010
@@ -50,6 +50,8 @@ public class FacesConfigurationProcessor
   private static final String FACES_CONFIG_WEBINF_PATH = "/WEB-INF/faces-config.xml";
   private List<String> mExcludedAttributes = null;
   private Map<String, String> mPublicParameterMappings = null;
+  private String mWriteBehindRenderResponseWrapper = null;
+  private String mWriteBehindResourceResponseWrapper = null;
 
   /**
    * <p>
@@ -78,6 +80,16 @@ public class FacesConfigurationProcessor
   {
     return mPublicParameterMappings;
   }
+  
+  public String getWriteBehindRenderResponseWrapperClassName()
+  {
+    return mWriteBehindRenderResponseWrapper;
+  }
+  
+  public String getWriteBehindResourceResponseWrapperClassName()
+  {
+    return mWriteBehindResourceResponseWrapper;
+  }
 
   /**
    * <p>
@@ -176,6 +188,10 @@ public class FacesConfigurationProcessor
     private static final String PUBLIC_PARAMETER_MAPPING_ELEMENT  = "public-parameter-mapping";
     private static final String PARAMETER_ELEMENT  = "parameter";
     private static final String MODEL_EL_ELEMENT  = "model-el";
+    private static final String WRITE_BEHIND_RESPONSE_WRAPPERS_ELEMENT = "write-behind-response-wrappers";
+    private static final String RENDER_RESPONSE_WRAPPER_CLASS_ELEMENT = "render-response-wrapper-class";
+    private static final String RESOURCE_RESPONSE_WRAPPER_CLASS_ELEMENT = "resource-response-wrapper-class";
+
 
 
     private boolean             mInApplicationElement        = false;
@@ -185,6 +201,8 @@ public class FacesConfigurationProcessor
     private boolean             mInPublicParameterMapping = false;
     private boolean             mInParameter = false;
     private boolean             mInModelEL = false;
+    private boolean             mInWriteBehindResponseWrappers = false;
+
     
    
     private StringBuilder       mContent;
@@ -249,6 +267,19 @@ public class FacesConfigurationProcessor
           mContent = new StringBuilder();
         }
       }
+      else if (WRITE_BEHIND_RESPONSE_WRAPPERS_ELEMENT.equals(localName))
+      {
+          mInWriteBehindResponseWrappers = true;
+      }
+      else if (RENDER_RESPONSE_WRAPPER_CLASS_ELEMENT.equals(localName) || RESOURCE_RESPONSE_WRAPPER_CLASS_ELEMENT.equals(localName))
+      {
+        if (mInApplicationElement && mInApplicationExtensionElement &&
+          mInWriteBehindResponseWrappers)
+        {
+          mContent = new StringBuilder();
+        }
+      }
+      
     } // END startElement
 
     @Override
@@ -328,6 +359,22 @@ public class FacesConfigurationProcessor
         // hold mContent to add as pair later
         mContent2 = mContent.toString().trim();
       }
+      else if (WRITE_BEHIND_RESPONSE_WRAPPERS_ELEMENT.equals(localName))
+      {
+        mInWriteBehindResponseWrappers = false;
+      }
+      else if (RENDER_RESPONSE_WRAPPER_CLASS_ELEMENT.equals(localName) && mContent != null
+        && mContent.length() > 0)
+      {
+        // hold mContent to add as pair later
+        mWriteBehindRenderResponseWrapper = mContent.toString().trim();
+      }
+      else if (RESOURCE_RESPONSE_WRAPPER_CLASS_ELEMENT.equals(localName) && mContent != null
+        && mContent.length() > 0)
+      {
+        // hold mContent to add as pair later
+        mWriteBehindResourceResponseWrapper = mContent.toString().trim();
+      }
 
       mContent = null;
 

Propchange: myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/config/FacesConfigurationProcessor.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Dec 29 22:27:33 2010
@@ -0,0 +1 @@
+/myfaces/portlet-bridge/core/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/util/config/FacesConfigurationProcessor.java:888894-923981,987340

Modified: myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestHeaders.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestHeaders.java?rev=1053758&r1=1053757&r2=1053758&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestHeaders.java (original)
+++ myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestHeaders.java Wed Dec 29 22:27:33 2010
@@ -26,7 +26,7 @@ import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 
-import javax.portlet.ActionRequest;
+import javax.portlet.ClientDataRequest;
 import javax.portlet.PortletRequest;
 import javax.portlet.faces.Bridge;
 
@@ -104,24 +104,25 @@ public class PortletRequestHeaders
      // can't assume portlet container overrides these headers to reflect portlet constraints -- so do so
      ensurePortletAcceptHeader();
      ensurePortletAcceptLanguage();
-
-
-     if ((Bridge.PortletPhase) mPortletRequest.getAttribute(Bridge.PORTLET_LIFECYCLE_PHASE) ==
-         Bridge.PortletPhase.ACTION_PHASE)
-     {
-       ensurePortletContentType();
-       ensurePortletContentLength();
-     }
-     // Technically don't need this test here but I will forget to change this code when
-     // JSR 286 is supported and there are more phases.
-     else if ((Bridge.PortletPhase) mPortletRequest.getAttribute(Bridge.PORTLET_LIFECYCLE_PHASE) ==
-              Bridge.PortletPhase.RENDER_PHASE)
+     
+     switch ((Bridge.PortletPhase) mPortletRequest.getAttribute(Bridge.PORTLET_LIFECYCLE_PHASE))
      {
-       // its the RENDER_PHASE -- spec says we must remove the CONTENT_TYPE if
+     case ACTION_PHASE:
+     case RESOURCE_PHASE:
+        ensurePortletContentType();
+        ensurePortletContentLength();
+        break;
+     case RENDER_PHASE:
+     case EVENT_PHASE:
+       // its the RENDER_PHASE -- spec says we must remove the CONTENT_TYPE and CONTENT-LENGTH if
        // came in the request -- so it matches null return from
        // EC.getRequestContentType/CharacterSetEncoding
        mHeaders.remove("CONTENT-TYPE");
        mHeaderNames.remove("CONTENT-TYPE");
+       mHeaders.remove("CONTENT-LENGTH");
+       mHeaderNames.remove("CONTENT-LENGTH");
+     default:
+       // shouldn't get here
      }
 
      return true;
@@ -228,15 +229,24 @@ public class PortletRequestHeaders
      
      StringBuilder property = new StringBuilder(64);
      String contentType =
-       ((ActionRequest) mPortletRequest).getContentType();
+       ((ClientDataRequest) mPortletRequest).getContentType();
      String charset =
-       ((ActionRequest) mPortletRequest).getCharacterEncoding();
+       ((ClientDataRequest) mPortletRequest).getCharacterEncoding();
 
      if (contentType != null)
      {
-       property = property.append(contentType);
        if (charset != null)
        {
+         // remove existing charset if its there -- it might be incorrect in a wsrp world
+         int index = contentType.indexOf(";");
+         if (index < 0)
+         {
+            property = property.append(contentType);
+         }
+         else
+         {
+           property = property.append(contentType, 0, index);
+         }
          property = property.append("; charset=");
          property = property.append(charset);
        }
@@ -252,7 +262,7 @@ public class PortletRequestHeaders
      mHeaderNames.remove("CONTENT-LENGTH");
      
      int contentLength =
-       ((ActionRequest) mPortletRequest).getContentLength();
+       ((ClientDataRequest) mPortletRequest).getContentLength();
 
      if (contentLength != -1)
      {
@@ -275,7 +285,7 @@ public class PortletRequestHeaders
     {
       propertyList = new ArrayList<String>(4);
       mHeaders.put(upperName, propertyList);
-      mHeaderNames.add(name);
+      mHeaderNames.add(upperName);
     }
     propertyList.add(value);
   }

Modified: myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestParameterMap.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestParameterMap.java?rev=1053758&r1=1053757&r2=1053758&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestParameterMap.java (original)
+++ myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestParameterMap.java Wed Dec 29 22:27:33 2010
@@ -27,6 +27,9 @@ import java.util.Map;
 
 import javax.portlet.PortletRequest;
 
+import javax.portlet.faces.Bridge;
+import javax.portlet.faces.BridgeUtil;
+
 /**
  * Map of portlet request params
  */
@@ -63,7 +66,7 @@ public class PortletRequestParameterMap 
     {  
       if (mPrivateParameters == null) 
       {
-        mPrivateParameters = mPortletRequest.getPrivateParameterMap();
+        mPrivateParameters = getPrivateParameterMap();
       }
       String[] params = mPrivateParameters.get(key);
       if (params != null)
@@ -106,7 +109,7 @@ public class PortletRequestParameterMap 
 
       if (mPrivateParameters == null) 
       {
-        mPrivateParameters = mPortletRequest.getPrivateParameterMap();
+        mPrivateParameters = getPrivateParameterMap();
       }
       attrNames.addAll(mPrivateParameters.keySet());
       attrNames.addAll(mInternalAttributes.keySet());
@@ -118,4 +121,38 @@ public class PortletRequestParameterMap 
       throw new IllegalArgumentException(ILLEGAL_ARGUMENT);
     }
   }
+  
+  private Map<String,String[]> getPrivateParameterMap()
+  {
+    // Some portlet containers (WebSphere) claim submitted (form) data aren't private parameters 
+    // during an action/resource request -- instead they are all regular params -- to workaround
+    // this indicate that during an action/resource all non-public params are private params
+    
+    Map <String, String[]> privateParams = mPortletRequest.getPrivateParameterMap();;
+    if ((BridgeUtil.getPortletRequestPhase() == Bridge.PortletPhase.ACTION_PHASE || 
+         BridgeUtil.getPortletRequestPhase() == Bridge.PortletPhase.RESOURCE_PHASE))
+    {
+      Map<String, String[]> allParams = mPortletRequest.getParameterMap();
+      Map<String, String[]> publicParams = mPortletRequest.getPublicParameterMap();
+    
+      if (publicParams.size() == 0)
+      {
+        privateParams = allParams;
+      }
+      else if (allParams.size() != (privateParams.size() + publicParams.size()))
+      {
+        // Construct the non-Public param Map by excluding those which are public
+        // from the overall set.  This works around issue that some portlet
+        // containers think getPrivateParameters should return the private
+        // render parameters -- and hence its empty during an action. (WebSphere 6.1 is one case)
+        privateParams = (Map<String, String[]>) new HashMap(allParams);
+        for (Map.Entry<String, String[]> entry :  publicParams.entrySet())
+        {
+          privateParams.remove(entry.getKey());
+        }
+      }
+    }
+    
+    return privateParams;
+  }
 }

Propchange: myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestParameterMap.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Dec 29 22:27:33 2010
@@ -0,0 +1 @@
+/myfaces/portlet-bridge/core/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestParameterMap.java:888894-923981,925027-997838

Modified: myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestParameterValuesMap.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestParameterValuesMap.java?rev=1053758&r1=1053757&r2=1053758&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestParameterValuesMap.java (original)
+++ myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestParameterValuesMap.java Wed Dec 29 22:27:33 2010
@@ -29,6 +29,9 @@ import java.util.Map;
 
 import javax.portlet.PortletRequest;
 
+import javax.portlet.faces.Bridge;
+import javax.portlet.faces.BridgeUtil;
+
 /**
  * Map of portlet request param values
  */
@@ -99,7 +102,7 @@ public class PortletRequestParameterValu
     {
       if (mPrivateParametersMap == null)
       {
-         mPrivateParametersMap =  mPortletRequest.getPrivateParameterMap();
+         mPrivateParametersMap =  getPrivateParameterMap();
       }
       String[] params = mPrivateParametersMap.get(key);
       if (params != null)
@@ -140,7 +143,7 @@ public class PortletRequestParameterValu
       
       if (mPrivateParametersMap == null) 
       {
-        mPrivateParametersMap = mPortletRequest.getPrivateParameterMap();
+        mPrivateParametersMap = getPrivateParameterMap();
       }
 
       attrNames.addAll(mPrivateParametersMap.keySet());
@@ -153,4 +156,37 @@ public class PortletRequestParameterValu
       throw new IllegalArgumentException(ILLEGAL_ARGUMENT);
     }
   }
+  
+  private Map<String,String[]> getPrivateParameterMap()
+  {
+    // Some portlet containers (WebSphere) claim submitted (form) data aren't private parameters 
+    // during an action/resource request -- instead they are all regular params -- to workaround
+    // this indicate that during an action/resource all non-public params are private params
+    
+    Map <String, String[]> privateParams = mPortletRequest.getPrivateParameterMap();
+    if ((BridgeUtil.getPortletRequestPhase() == Bridge.PortletPhase.ACTION_PHASE || 
+         BridgeUtil.getPortletRequestPhase() == Bridge.PortletPhase.RESOURCE_PHASE))
+    {
+      Map<String, String[]> allParams = mPortletRequest.getParameterMap();
+      Map<String, String[]> publicParams = mPortletRequest.getPublicParameterMap();
+    
+      if (publicParams.size() == 0)
+      {
+        privateParams = allParams;
+      }
+      else if (allParams.size() != (privateParams.size() + publicParams.size()))
+      {
+        // Construct the non-Public param Map by excluding those which are public
+        // from the overall set.  This works around issue that some portlet
+        // containers think getPrivateParameters should return the private
+        // render parameters -- and hence its empty during an action. (WebSphere 6.1 is one case)
+        privateParams = (Map<String, String[]>) new HashMap(allParams);
+        for (Map.Entry<String, String[]> entry :  publicParams.entrySet())
+        {
+          privateParams.remove(entry.getKey());
+        }
+      }
+    }
+    return privateParams;
+  }
 }

Propchange: myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestParameterValuesMap.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Dec 29 22:27:33 2010
@@ -0,0 +1 @@
+/myfaces/portlet-bridge/core/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestParameterValuesMap.java:888894-923981,925027-997838

Modified: myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/pom.xml?rev=1053758&r1=1053757&r2=1053758&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/pom.xml (original)
+++ myfaces/portlet-bridge/core/branches/sobryan_portlet-bridge-3.0.0/pom.xml Wed Dec 29 22:27:33 2010
@@ -52,7 +52,7 @@
     <projectSeries>3.x</projectSeries>
     <mojarra.version>2.0.1</mojarra.version>
     <myfaces.version>2.0.1</myfaces.version>
-    <myfaces.shared.version>4.0.1</myfaces.shared.version>
+    <myfaces.shared.version>4.0.5-SNAPSHOT</myfaces.shared.version>
     <blueprints.version>5</blueprints.version>
   </properties>