portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r376868 - /portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/HybridNavigationalState.java
Date Fri, 10 Feb 2006 21:49:20 GMT
Author: taylor
Date: Fri Feb 10 13:49:19 2006
New Revision: 376868

URL: http://svn.apache.org/viewcvs?rev=376868&view=rev
Log:
for Garry,  only encodes render parameters that start with a given prefix

Added:
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/HybridNavigationalState.java

Added: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/HybridNavigationalState.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/HybridNavigationalState.java?rev=376868&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/HybridNavigationalState.java
(added)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/HybridNavigationalState.java
Fri Feb 10 13:49:19 2006
@@ -0,0 +1,59 @@
+package org.apache.jetspeed.container.state.impl;
+
+import java.io.UnsupportedEncodingException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.portlet.PortletMode;
+import javax.portlet.WindowState;
+
+import org.apache.pluto.om.window.PortletWindow;
+
+/**
+ * HybridNavigationalState
+ * 
+ * Only encodes render parameters that start with a given prefix
+ *
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: AbstractNavigationalState.java 333093 2005-11-13 18:42:42Z taylor $
+ */
+public class HybridNavigationalState extends SessionNavigationalState
+{
+    protected String prefix;
+    
+    public HybridNavigationalState(NavigationalStateCodec codec, String prefix)
+    {
+        super(codec);
+        this.prefix = prefix;
+    }
+    
+    public String encode(PortletWindow window, Map parameters, PortletMode mode, WindowState
state, boolean action)
+    throws UnsupportedEncodingException
+    {
+        Map subset = new HashMap();
+        Iterator params = parameters.keySet().iterator();
+        while (params.hasNext())
+        {
+            String key = (String)params.next();
+            if (key.startsWith(prefix))
+            {
+                // only encode params that start with prefix
+                subset.put(key, parameters.get(key));
+            }
+        }
+        return super.encode(window, subset, mode, state, action);
+    }
+
+    public boolean isNavigationalParameterStateFull()
+    {
+        return true;
+    }
+
+    public boolean isRenderParameterStateFull()
+    {
+        return false;
+    }
+    
+    
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message