cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r358547 - in /cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal: coplet/adapter/impl/PortletAdapter.java pluto/PortletActionProviderImpl.java pluto/servlet/ServletRequestImpl.java
Date Thu, 22 Dec 2005 10:09:30 GMT
Author: cziegeler
Date: Thu Dec 22 02:09:23 2005
New Revision: 358547

URL: http://svn.apache.org/viewcvs?rev=358547&view=rev
Log:
Fix render parameter handling

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/servlet/ServletRequestImpl.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java?rev=358547&r1=358546&r2=358547&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java
Thu Dec 22 02:09:23 2005
@@ -43,6 +43,7 @@
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
 import org.apache.cocoon.portal.event.EventManager;
 import org.apache.cocoon.portal.event.Receiver;
+import org.apache.cocoon.portal.pluto.PortletActionProviderImpl;
 import org.apache.cocoon.portal.pluto.PortletContainerEnvironmentImpl;
 import org.apache.cocoon.portal.pluto.PortletURLProviderImpl;
 import org.apache.cocoon.portal.pluto.om.PortletDefinitionRegistry;
@@ -359,6 +360,7 @@
             if ( state != null ) {
                 pap.changePortletWindowState(state);
             }
+            ((PortletActionProviderImpl)pap).changeRenderParameters(event.getParameters());
         }
     }
 

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java?rev=358547&r1=358546&r2=358547&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java
Thu Dec 22 02:09:23 2005
@@ -15,6 +15,9 @@
  */
 package org.apache.cocoon.portal.pluto;
 
+import java.util.HashMap;
+import java.util.Map;
+
 import javax.portlet.PortletMode;
 import javax.portlet.WindowState;
 
@@ -73,4 +76,12 @@
         }
     }
 
+    public void changeRenderParameters(Map parameters) {
+        final CopletInstanceData cid = ((PortletEntityImpl)portletWindow.getPortletEntity()).getCopletInstanceData();
+        if ( parameters == null ) {
+            cid.removeTemporaryAttribute("render-parameters");
+        } else {
+            cid.setTemporaryAttribute("render-parameters", new HashMap(parameters));
+        }
+    }
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/servlet/ServletRequestImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/servlet/ServletRequestImpl.java?rev=358547&r1=358546&r2=358547&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/servlet/ServletRequestImpl.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/servlet/ServletRequestImpl.java
Thu Dec 22 02:09:23 2005
@@ -25,11 +25,13 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequestWrapper;
 
+import org.apache.cocoon.portal.coplet.CopletInstanceData;
 import org.apache.cocoon.portal.pluto.PortletURLProviderImpl;
+import org.apache.cocoon.portal.pluto.om.PortletWindowImpl;
 import org.apache.pluto.om.window.PortletWindow;
 
 /**
- * Our request wrapper
+ * Our request wrapper.
  *
  * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  * @version CVS $Id$
@@ -109,11 +111,13 @@
              || currentRequest != this.cachedRequest ) {
             this.cachedRequest = currentRequest;
 
-            //get control params
-            this.portletParameterMap = new HashMap();
+            // get control params
 
             if (this.provider != null
                 && this.provider.getPortletWindow().equals(this.window)) {
+
+                this.portletParameterMap = new HashMap();
+
                 // get render parameters
                 Iterator i = this.provider.getParameters().entrySet().iterator();
                 while (i.hasNext()) {
@@ -148,6 +152,13 @@
                         this.portletParameterMap.put(paramName, paramValues);
                     }
                 }
+            } else {
+                // provider is null or different window, use stored render parameters
+                final CopletInstanceData cid = ((PortletWindowImpl)this.window).getLayout().getCopletInstanceData();
+                this.portletParameterMap = (Map)cid.getTemporaryAttribute("render-parameters");
+            }
+            if ( this.portletParameterMap == null ) {
+                this.portletParameterMap = Collections.EMPTY_MAP;
             }
         }
 



Mime
View raw message