portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msnickl...@apache.org
Subject [1/3] portals-pluto git commit: Added new V3 methods to the HttpServletPortletRequestWrapper and the HttpServletPortletResponseWrapper. Cleaned up the response wrapper implementation. Modified code so that query string parameters are always handled like
Date Wed, 04 May 2016 12:38:03 GMT
Repository: portals-pluto
Updated Branches:
  refs/heads/master 7f5f3003f -> 1436eafbd


Added new V3 methods to the HttpServletPortletRequestWrapper and the
HttpServletPortletResponseWrapper. Cleaned up the response wrapper
implementation. Modified code so that query string parameters are always
handled like private render parameters rather than having them be resource
parameters during resource request processing and action parameters during
action request processing.


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/8086a818
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/8086a818
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/8086a818

Branch: refs/heads/master
Commit: 8086a818c84197453ea93be97d998fc6e3893cdb
Parents: 1243122
Author: Scott Nicklous <msnicklous@apache.org>
Authored: Wed May 4 14:01:37 2016 +0200
Committer: Scott Nicklous <msnicklous@apache.org>
Committed: Wed May 4 14:01:37 2016 +0200

----------------------------------------------------------------------
 .../impl/HttpServletPortletRequestWrapper.java  |  66 ++-
 .../impl/HttpServletPortletResponseWrapper.java | 568 +++++++++----------
 .../driver/url/PortletParameterFactory.java     |  26 +-
 3 files changed, 340 insertions(+), 320 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8086a818/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletRequestWrapper.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletRequestWrapper.java
b/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletRequestWrapper.java
index 6da68bd..57797f2 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletRequestWrapper.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletRequestWrapper.java
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.security.Principal;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
@@ -30,19 +31,24 @@ import java.util.Map;
 
 import javax.portlet.ClientDataRequest;
 import javax.portlet.HeaderRequest;
+import javax.portlet.PortletException;
 import javax.portlet.PortletRequest;
 import javax.portlet.RenderRequest;
 import javax.portlet.ResourceRequest;
 import javax.servlet.AsyncContext;
 import javax.servlet.DispatcherType;
 import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
 import javax.servlet.ServletInputStream;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpUpgradeHandler;
+import javax.servlet.http.Part;
 
 import org.apache.pluto.container.NamespaceMapper;
 import org.apache.pluto.container.PortletInvokerService;
@@ -864,6 +870,15 @@ public class HttpServletPortletRequestWrapper extends HttpServletRequestWrapper
    }
 
    @Override
+   public long getContentLengthLong() {
+      if (isClosed) return 0L;
+      if (preq instanceof ClientDataRequest) {
+         return ((ClientDataRequest) preq).getContentLengthLong();
+      }
+      return 0L;
+   }
+
+   @Override
    public String getContentType() {
       if (isClosed) return null;
       if (preq instanceof ClientDataRequest) {
@@ -976,7 +991,7 @@ public class HttpServletPortletRequestWrapper extends HttpServletRequestWrapper
       } else {
          StringBuilder txt = new StringBuilder(128);
          txt.append("The async context cannot be initialized after a ");
-         txt.append("include or forward from a portlet reqource request method. ");
+         txt.append("include or forward from a portlet resource request method. ");
          txt.append("The first async context initialization must be performed within the
portlet resource method.");
          throw new IllegalStateException(txt.toString());
       }
@@ -989,7 +1004,7 @@ public class HttpServletPortletRequestWrapper extends HttpServletRequestWrapper
       } else {
          StringBuilder txt = new StringBuilder(128);
          txt.append("The async context cannot be initialized after a ");
-         txt.append("include or forward from a portlet reqource request method. ");
+         txt.append("include or forward from a portlet resource request method. ");
          txt.append("The first async context initialization must be performed within the
portlet resource method.");
          throw new IllegalStateException(txt.toString());
       }
@@ -1023,5 +1038,52 @@ public class HttpServletPortletRequestWrapper extends HttpServletRequestWrapper
    public DispatcherType getDispatcherType() {
       return super.getDispatcherType();
    }
+   
+   @Override
+   public String changeSessionId() {
+      return null;
+   }
+   
+   @Override
+   public boolean authenticate(HttpServletResponse response) throws IOException, ServletException
{
+      return false;
+   }
+   
+   @Override
+   public void login(String username, String password) throws ServletException {
+   }
+   
+   @Override
+   public void logout() throws ServletException {
+   }
 
+   @Override
+   public Part getPart(String name) throws IOException, ServletException {
+      if (preq instanceof ClientDataRequest) {
+         try {
+            return ((ClientDataRequest) preq).getPart(name);
+         } catch (PortletException e) {
+            throw new ServletException(e.getCause());
+         }
+      }
+      return null;
+   }
+   
+   @Override
+   public Collection<Part> getParts() throws IOException, ServletException {
+      if (preq instanceof ClientDataRequest) {
+         try {
+            return ((ClientDataRequest) preq).getParts();
+         } catch (PortletException e) {
+            throw new ServletException(e.getCause());
+         }
+      }
+      return null;
+   }
+   
+   @Override
+   public <T extends HttpUpgradeHandler> T upgrade(Class<T> httpUpgradeHandlerClass)
throws IOException,
+         ServletException {
+      throw new ServletException("Not Supported");
+   }
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8086a818/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletResponseWrapper.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletResponseWrapper.java
b/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletResponseWrapper.java
index c5a269e..dd941ed 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletResponseWrapper.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/HttpServletPortletResponseWrapper.java
@@ -19,6 +19,7 @@ package org.apache.pluto.container.impl;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.PrintWriter;
+import java.util.Collection;
 import java.util.Locale;
 
 import javax.portlet.ActionResponse;
@@ -39,224 +40,172 @@ import org.apache.pluto.container.util.DummyServletOutputStream;
  * @author <a href="mailto:ate@douma.nu">Ate Douma</a>
  * @version $Id$
  */
-public class HttpServletPortletResponseWrapper extends HttpServletResponseWrapper
-{
-    private final boolean forwarded;
-    private final PortletResponse portletResponse;
-    private final MimeResponse mimeResponse;
-    private final String lifecyclePhase;
-    private boolean included;
-    private OutputStream outputStream;
-    private ServletOutputStream servletOutputStream;
-    
-    public HttpServletPortletResponseWrapper(HttpServletResponse response, PortletRequest
portletRequest, PortletResponse portletResponse, boolean included)
-    {
-        super(response);
-        this.portletResponse = portletResponse;
-        this.lifecyclePhase = (String)portletRequest.getAttribute(PortletRequest.LIFECYCLE_PHASE);
-        MimeResponse mr = null;
-        if (PortletRequest.RENDER_PHASE.equals(lifecyclePhase) || 
-            PortletRequest.RESOURCE_PHASE.equals(lifecyclePhase) ||
-            PortletRequest.HEADER_PHASE.equals(lifecyclePhase)) {
-           mr = (MimeResponse)portletResponse;
-        }
-        this.mimeResponse = mr;
-        this.forwarded = !included;
-        this.included = included;
-    }
-    
-    public void setIncluded(boolean included)
-    {
-        this.included = included;
-    }
-    
-    @Override
-    public void addCookie(Cookie cookie)
-    {
-        if (forwarded && !included)
-        {
-            portletResponse.addProperty(cookie);
-        }
-    }
-
-    @Override
-    public void addDateHeader(String name, long date)
-    {
-        if (forwarded && !included && mimeResponse != null)
-        {
-            mimeResponse.addProperty(name, Long.toString(date));
-        }
-    }
-
-    @Override
-    public void addHeader(String name, String value)
-    {
-        if (forwarded && !included && mimeResponse != null)
-        {
-            mimeResponse.addProperty(name, value);
-        }
-    }
-
-    @Override
-    public void addIntHeader(String name, int value)
-    {
-        if (forwarded && !included && mimeResponse != null)
-        {
-            mimeResponse.addProperty(name, Integer.toString(value));
-        }
-    }
-
-    @Override
-    public boolean containsHeader(String name)
-    {
-        return false;
-    }
-
-    @Override
-    public String encodeRedirectUrl(String url)
-    {
-        return null;
-    }
-
-    @Override
-    public String encodeRedirectURL(String url)
-    {
-        return null;
-    }
-
-    @Override
-    public String encodeUrl(String url)
-    {
-        return encodeURL(url);
-    }
-
-    @Override
-    public String encodeURL(String url)
-    {
-        if (url != null && url.indexOf("://") == -1 && !url.startsWith("/"))
-        {
-            // The Portlet Spec only allows URL encoding for absolute or full path URIs
-            // Letting this pass through thus would lead to an IllegalArgumentException been
thrown.
-
-            // TODO: figure out how (if not impossible) this can be (pre)fixed properly
-            return url;
-        }
-        return portletResponse.encodeURL(url);
-    }
-
-    @Override
-    public void sendError(int sc, String msg) throws IOException
-    {
-    }
-
-    @Override
-    public void sendError(int sc) throws IOException
-    {
-    }
-
-    @Override
-    public void sendRedirect(String location) throws IOException
-    {
-        if (forwarded && !included && PortletRequest.ACTION_PHASE.equals(lifecyclePhase))
-        {
-            ((ActionResponse)portletResponse).sendRedirect(location);
-        }
-    }
-
-    @Override
-    public void setDateHeader(String name, long date)
-    {
-        if (forwarded && !included && mimeResponse != null)
-        {
-            mimeResponse.setProperty(name, Long.toString(date));
-        }
-    }
-
-    @Override
-    public void setHeader(String name, String value)
-    {
-        if (forwarded && !included && mimeResponse != null)
-        {
-            mimeResponse.setProperty(name, value);
-        }
-    }
-
-    @Override
-    public void setIntHeader(String name, int value)
-    {
-        if (forwarded && !included && mimeResponse != null)
-        {
-            mimeResponse.setProperty(name, Integer.toString(value));
-        }
-    }
-
-    @Override
-    public void setStatus(int sc, String sm)
-    {
-        setStatus(sc);
-    }
-
-    @Override
-    public void setStatus(int sc)
-    {
-        if (forwarded && !included && PortletRequest.RESOURCE_PHASE.equals(lifecyclePhase))
-        {
-            mimeResponse.setProperty(ResourceResponse.HTTP_STATUS_CODE, Integer.toString(sc));
-        }
-    }
-
-    @Override
-    public void flushBuffer() throws IOException
-    {
-        if (mimeResponse != null)
-        {
-            mimeResponse.flushBuffer();
-        }            
-    }
-
-    @Override
-    public int getBufferSize()
-    {
-        return mimeResponse != null ? mimeResponse.getBufferSize() : 0;
-    }
-
-    @Override
-    public String getCharacterEncoding()
-    {
-        return mimeResponse != null ? mimeResponse.getCharacterEncoding() : null;
-    }
-
-    @Override
-    public String getContentType()
-    {
-        return mimeResponse != null ? mimeResponse.getContentType() : null;
-    }
-
-    @Override
-    public Locale getLocale()
-    {
-        return mimeResponse != null ? mimeResponse.getLocale() : null;
-    }
-
-    @Override
-    public ServletOutputStream getOutputStream() throws IOException
-    {
-    	if (servletOutputStream == null)
-    	{
-        	outputStream = mimeResponse != null ? mimeResponse.getPortletOutputStream() : DummyServletOutputStream.getInstance();
-        	if (outputStream instanceof ServletOutputStream)
-        	{
-        		servletOutputStream = (ServletOutputStream)outputStream;
-        	}
-        	else
-        	{
-        		servletOutputStream = new ServletOutputStream()
-        		{
-					@Override
-					public void write(int b) throws IOException 
-					{
-						outputStream.write(b);
-					}
+public class HttpServletPortletResponseWrapper extends HttpServletResponseWrapper {
+   private final PortletResponse portletResponse;
+   private boolean               included;
+   private OutputStream          outputStream;
+   private ServletOutputStream   servletOutputStream;
+
+   public HttpServletPortletResponseWrapper(HttpServletResponse response, PortletRequest
portletRequest,
+         PortletResponse portletResponse, boolean included) {
+      super(response);
+      this.portletResponse = portletResponse;
+      this.included = included;
+   }
+
+   @Override
+   public void addCookie(Cookie cookie) {
+      if (!included) {
+         portletResponse.addProperty(cookie);
+      }
+   }
+
+   @Override
+   public void addDateHeader(String name, long date) {
+      if (!included && (portletResponse instanceof MimeResponse)) {
+         ((MimeResponse) portletResponse).addProperty(name, Long.toString(date));
+      }
+   }
+
+   @Override
+   public void addHeader(String name, String value) {
+      if (!included && (portletResponse instanceof MimeResponse)) {
+         ((MimeResponse) portletResponse).addProperty(name, value);
+      }
+   }
+
+   @Override
+   public void addIntHeader(String name, int value) {
+      if (!included && (portletResponse instanceof MimeResponse)) {
+         ((MimeResponse) portletResponse).addProperty(name, Integer.toString(value));
+      }
+   }
+
+   @Override
+   public boolean containsHeader(String name) {
+      return false;
+   }
+
+   @Override
+   public String encodeRedirectUrl(String url) {
+      return null;
+   }
+
+   @Override
+   public String encodeRedirectURL(String url) {
+      return null;
+   }
+
+   @Override
+   public String encodeUrl(String url) {
+      return encodeURL(url);
+   }
+
+   @Override
+   public String encodeURL(String url) {
+      return portletResponse.encodeURL(url);
+   }
+
+   @Override
+   public void sendError(int sc, String msg) throws IOException {
+   }
+
+   @Override
+   public void sendError(int sc) throws IOException {
+   }
+
+   @Override
+   public void sendRedirect(String location) throws IOException {
+      if (!included && (portletResponse instanceof ActionResponse)) {
+         ((ActionResponse) portletResponse).sendRedirect(location);
+      }
+   }
+
+   @Override
+   public void setDateHeader(String name, long date) {
+      if (!included && (portletResponse instanceof MimeResponse)) {
+         ((MimeResponse) portletResponse).setProperty(name, Long.toString(date));
+      }
+   }
+
+   @Override
+   public void setHeader(String name, String value) {
+      if (!included && (portletResponse instanceof MimeResponse)) {
+         ((MimeResponse) portletResponse).setProperty(name, value);
+      }
+   }
+
+   @Override
+   public void setIntHeader(String name, int value) {
+      if (!included && (portletResponse instanceof MimeResponse)) {
+         ((MimeResponse) portletResponse).setProperty(name, Integer.toString(value));
+      }
+   }
+
+   @Override
+   public void setStatus(int sc, String sm) {
+      setStatus(sc);
+   }
+
+   @Override
+   public void setStatus(int sc) {
+      if (!included && (portletResponse instanceof ResourceResponse)) {
+         ((ResourceResponse) portletResponse).setProperty(ResourceResponse.HTTP_STATUS_CODE,
Integer.toString(sc));
+      }
+   }
+
+   @Override
+   public void flushBuffer() throws IOException {
+      if ((portletResponse instanceof MimeResponse)) {
+         ((MimeResponse) portletResponse).flushBuffer();
+      }
+   }
+
+   @Override
+   public int getBufferSize() {
+      if (portletResponse instanceof MimeResponse) {
+         return ((MimeResponse) portletResponse).getBufferSize();
+      }
+      return 0;
+   }
+
+   @Override
+   public String getCharacterEncoding() {
+      if (portletResponse instanceof MimeResponse) {
+         ((MimeResponse) portletResponse).getCharacterEncoding(); 
+      }
+      return null;
+   }
+
+   @Override
+   public String getContentType() {
+      if (portletResponse instanceof MimeResponse) {
+         ((MimeResponse) portletResponse).getContentType(); 
+      }
+      return null;
+   }
+
+   @Override
+   public Locale getLocale() {
+      if (portletResponse instanceof MimeResponse) {
+         return ((MimeResponse) portletResponse).getLocale(); 
+      }
+      return null;
+   }
+
+   @Override
+   public ServletOutputStream getOutputStream() throws IOException {
+      if (servletOutputStream == null) {
+         outputStream = (portletResponse instanceof MimeResponse) ? ((MimeResponse) portletResponse)
+               .getPortletOutputStream() : DummyServletOutputStream.getInstance();
+         if (outputStream instanceof ServletOutputStream) {
+            servletOutputStream = (ServletOutputStream) outputStream;
+         } else {
+            servletOutputStream = new ServletOutputStream() {
+               @Override
+               public void write(int b) throws IOException {
+                  outputStream.write(b);
+               }
 
                @Override
                public boolean isReady() {
@@ -268,84 +217,107 @@ public class HttpServletPortletResponseWrapper extends HttpServletResponseWrappe
                public void setWriteListener(WriteListener arg0) {
                   // Servlet 3.1 API. Not implemented.
                }
-        		};
-        	}
-    	}
-    	return servletOutputStream;
-    }
-
-    @Override
-    public PrintWriter getWriter() throws IOException
-    {
-        return mimeResponse != null ? mimeResponse.getWriter() : DummyPrintWriter.getInstance();
-    }
-
-    @Override
-    public boolean isCommitted()
-    {
-        return mimeResponse != null ? mimeResponse.isCommitted() : forwarded ? false : true;
-    }
-
-    @Override
-    public void reset()
-    {
-        if (mimeResponse != null)
-        {
-            mimeResponse.reset();
-        }
-    }
-
-    @Override
-    public void resetBuffer()
-    {
-        if (mimeResponse != null)
-        {
-            mimeResponse.resetBuffer();
-        }
-    }
-
-    @Override
-    public void setBufferSize(int size)
-    {
-        if (mimeResponse != null)
-        {
-            mimeResponse.setBufferSize(size);
-        }
-    }
-
-    @Override
-    public void setCharacterEncoding(String charset)
-    {
-        if (forwarded && !included && PortletRequest.RESOURCE_PHASE.equals(lifecyclePhase))
-        {
-            ((ResourceResponse)portletResponse).setCharacterEncoding(charset);
-        }
-    }
-
-    @Override
-    public void setContentLength(int len)
-    {
-        if (forwarded && !included && PortletRequest.RESOURCE_PHASE.equals(lifecyclePhase))
-        {
-            ((ResourceResponse)portletResponse).setContentLength(len);
-        }
-    }
-
-    @Override
-    public void setContentType(String type)
-    {
-        if (forwarded && !included && mimeResponse != null)
-        {
-            mimeResponse.setContentType(type);
-        }
-    }
-
-    @Override
-    public void setLocale(Locale loc)
-    {
-        if (forwarded && !included && PortletRequest.RESOURCE_PHASE.equals(lifecyclePhase))
-        {
-            ((ResourceResponse)portletResponse).setLocale(loc);
-        }
-    }    
+            };
+         }
+      }
+      return servletOutputStream;
+   }
+
+   @Override
+   public PrintWriter getWriter() throws IOException {
+      PrintWriter writer = null;
+      if (portletResponse instanceof MimeResponse) {
+         writer =  ((MimeResponse) portletResponse).getWriter();
+      } else {
+         writer = DummyPrintWriter.getInstance();
+      }
+      return writer;
+   }
+
+   @Override
+   public boolean isCommitted() {
+      if (portletResponse instanceof MimeResponse) {
+         return ((MimeResponse) portletResponse).isCommitted();
+      }
+      return included;
+   }
+
+   @Override
+   public void reset() {
+      if ((portletResponse instanceof MimeResponse)) {
+         ((MimeResponse) portletResponse).reset();
+      }
+   }
+
+   @Override
+   public void resetBuffer() {
+      if ((portletResponse instanceof MimeResponse)) {
+         ((MimeResponse) portletResponse).resetBuffer();
+      }
+   }
+
+   @Override
+   public void setBufferSize(int size) {
+      if ((portletResponse instanceof MimeResponse)) {
+         ((MimeResponse) portletResponse).setBufferSize(size);
+      }
+   }
+
+   @Override
+   public void setCharacterEncoding(String charset) {
+      if (!included && (portletResponse instanceof ResourceResponse)) {
+         ((ResourceResponse) portletResponse).setCharacterEncoding(charset);
+      }
+   }
+
+   @Override
+   public void setContentLength(int len) {
+      if (!included && (portletResponse instanceof ResourceResponse)) {
+         ((ResourceResponse) portletResponse).setContentLength(len);
+      }
+   }
+
+   @Override
+   public void setContentType(String type) {
+      if (!included && (portletResponse instanceof MimeResponse)) {
+         ((MimeResponse) portletResponse).setContentType(type);
+      }
+   }
+
+   @Override
+   public void setLocale(Locale loc) {
+      if (!included && (portletResponse instanceof ResourceResponse)) {
+         ((ResourceResponse) portletResponse).setLocale(loc);
+      }
+   }
+   
+   @Override
+   public void setContentLengthLong(long length) {
+      if (portletResponse instanceof ResourceResponse) {
+         ((ResourceResponse) portletResponse).setContentLengthLong(length);
+      }
+   }
+   
+   @Override
+   public int getStatus() {
+      if (portletResponse instanceof ResourceResponse) {
+         return ((ResourceResponse) portletResponse).getStatus();
+      }
+      return SC_OK;
+   }
+   
+   @Override
+   public String getHeader(String name) {
+      return portletResponse.getProperty(name);
+   }
+   
+   @Override
+   public Collection<String> getHeaderNames() {
+      return portletResponse.getPropertyNames();
+   }
+   
+   @Override
+   public Collection<String> getHeaders(String name) {
+      return portletResponse.getPropertyValues(name);
+   }
 }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8086a818/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortletParameterFactory.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortletParameterFactory.java
b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortletParameterFactory.java
index 95f13d1..cf9ec61 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortletParameterFactory.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortletParameterFactory.java
@@ -18,6 +18,10 @@
 
 package org.apache.pluto.driver.url;
 
+import static org.apache.pluto.driver.url.PortalURLParameter.PARAM_TYPE_ACTION;
+import static org.apache.pluto.driver.url.PortalURLParameter.PARAM_TYPE_RENDER;
+import static org.apache.pluto.driver.url.PortalURLParameter.PARAM_TYPE_RESOURCE;
+
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -29,10 +33,6 @@ import java.util.Set;
 import org.apache.pluto.container.PortletRequestContext;
 import org.apache.pluto.driver.services.portal.PublicRenderParameterMapper;
 import org.apache.pluto.driver.url.PortalURL.URLType;
-
-import static org.apache.pluto.driver.url.PortalURLParameter.*;
-import static javax.portlet.PortletRequest.*;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -508,22 +508,8 @@ public class PortletParameterFactory {
             LOGGER.debug(txt.toString());
          }
 
-         switch (phase) {
-            case ACTION_PHASE:
-               if (type.equals(PARAM_TYPE_ACTION)) {
-                  params.putAll(qp);
-               }
-               break;
-            case RESOURCE_PHASE:
-               if (type.equals(PARAM_TYPE_RESOURCE)) {
-                  params.putAll(qp);
-               }
-               break;
-            case RENDER_PHASE:
-            case EVENT_PHASE:
-            case HEADER_PHASE:
-               params.putAll(qp);
-               break;
+         if (type.equals(PARAM_TYPE_RENDER)) {
+            params.putAll(qp);
          }
       }
 


Mime
View raw message