cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r278950 - in /cocoon/branches/BRANCH_2_1_X/src/blocks/portal: java/org/apache/cocoon/portal/coplet/adapter/impl/ java/org/apache/cocoon/portal/pluto/ java/org/apache/cocoon/portal/pluto/om/ java/org/apache/cocoon/portal/pluto/servlet/ java/...
Date Tue, 06 Sep 2005 09:15:50 GMT
Author: cziegeler
Date: Tue Sep  6 02:15:36 2005
New Revision: 278950

URL: http://svn.apache.org/viewcvs?rev=278950&view=rev
Log:
Sync portal with code from 2.2 (some fixes for making Portal Bridges running)

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
    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/PortletURLConverter.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistryImpl.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/servlet/ServletRequestImpl.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/servlet/ServletResponseImpl.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/tools/copletManagement/LayoutActions.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/mocks/javax/servlet/http/HttpServletRequestWrapper.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/mocks/javax/servlet/http/HttpServletResponseWrapper.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java?rev=278950&r1=278949&r2=278950&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
Tue Sep  6 02:15:36 2005
@@ -229,6 +229,7 @@
         }
         return false;
     }
+
     /**
      * Build the key for the global cache.
      */

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=278950&r1=278949&r2=278950&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
Tue Sep  6 02:15:36 2005
@@ -395,12 +395,6 @@
                 final ServletRequestImpl req = (ServletRequestImpl) objectModel.get("portlet-request");
                 final ServletResponseImpl res= (ServletResponseImpl)objectModel.get("portlet-response");
                 this.portletContainer.processPortletAction(actionWindow, req.getRequest(actionWindow),
res);
-
-                // this redirect is only for 2.1.x, don't add it to 2.2 
-                // (see #32157 for more information)
-                final String redirectURL = res.getRedirectURL();
-                HttpServletResponse response = (HttpServletResponse) objectModel.get(HttpEnvironment.HTTP_RESPONSE_OBJECT);
-                response.sendRedirect(redirectURL);
             } catch (Exception ignore) {
                 this.getLogger().error("Error during processing of portlet action.", ignore);
             }
@@ -423,7 +417,7 @@
         final Map objectModel = aspectContext.getObjectModel();
 
         // don't generate a response, if we issued a redirect
-        if (objectModel.get("portlet-event") == null) {
+        if (objectModel.remove("portlet-event") == null) {
             aspectContext.invokeNext(ch, parameters);
         }
     }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLConverter.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLConverter.java?rev=278950&r1=278949&r2=278950&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLConverter.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLConverter.java
Tue Sep  6 02:15:36 2005
@@ -43,9 +43,9 @@
     public static final String PARAM = "pm";
     public static final String STATE = "st";
 
-    private Map urlData = new HashMap();
-    private Map parameters = new HashMap();
-    private String portletId = null;
+    private final Map urlData = new HashMap();
+    private final Map parameters = new HashMap();
+    private String portletId;
 
     /**
      * Constructor used when the URL will be marshalled.
@@ -87,14 +87,12 @@
      * Return the PortletMode
      * @return The PortletMode
      */
-    public PortletMode getMode()
-    {
+    public PortletMode getMode() {
         String mode = (String)urlData.get(getModeKey());
         if (mode!=null) {
             return new PortletMode(mode);
-        } else {
-            return PortletMode.VIEW;
         }
+        return PortletMode.VIEW;
     }
 
     /**
@@ -106,9 +104,7 @@
         if (state != null) {
             return new WindowState(state);
         }
-        else {
-            return WindowState.NORMAL;
-        }
+        return WindowState.NORMAL;
     }
 
     /**
@@ -122,8 +118,7 @@
     /**
      * Indicates that the URL is an action.
      */
-    public void setAction()
-    {
+    public void setAction() {
         urlData.put(getActionKey(),ACTION.toUpperCase());
     }
 
@@ -131,8 +126,7 @@
      * Sets the PortletMode.
      * @param mode The PortletMode
      */
-    public void setMode(PortletMode mode)
-    {
+    public void setMode(PortletMode mode) {
         urlData.put(getModeKey(), mode.toString());
     }
 
@@ -173,8 +167,7 @@
      * @param name The parameter name
      * @param values An array of Strings.
      */
-    public void setParam(String name, String[] values)
-    {
+    public void setParam(String name, String[] values) {
         this.parameters.put(encodeParameterName(name), encodeParameterValues(values));
     }
 
@@ -292,4 +285,4 @@
         value = StringUtils.replace(value, " ", "0x8");
         return value;
     }
-}
\ No newline at end of file
+}

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java?rev=278950&r1=278949&r2=278950&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java
Tue Sep  6 02:15:36 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004,2004 The Apache Software Foundation.
+ * Copyright 2004-2005 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -42,7 +42,7 @@
 import org.apache.pluto.services.information.PortletURLProvider;
 
 /**
- * Creste the URL for a portlet
+ * Create the URL for a portlet.
  *
  * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  * 
@@ -64,7 +64,7 @@
     protected boolean action;
     
     /** Secure link? */
-    protected Boolean secure = null;
+    protected Boolean secure;
     
     /** Clear parameters */
     protected boolean clearParameters;
@@ -74,7 +74,7 @@
     
     /** The generated url */
     protected String generatedURL;
-    private LinkService linkService;
+    private final LinkService linkService;
     private static final String DEFAULT_PORTLET_URL_REQUEST_PARAM = "url";
 
     /**
@@ -139,7 +139,7 @@
         return this.portletWindow;
     }
     
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.services.information.PortletURLProvider#setPortletMode(javax.portlet.PortletMode)
      */
     public void setPortletMode(PortletMode mode) {
@@ -153,7 +153,7 @@
         return this.mode;
     }
     
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.services.information.PortletURLProvider#setWindowState(javax.portlet.WindowState)
      */
     public void setWindowState(WindowState state) {
@@ -167,7 +167,7 @@
         return this.state;
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.services.information.PortletURLProvider#setAction()
      */
     public void setAction() {
@@ -181,21 +181,21 @@
         return this.action;
     }
         
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.services.information.PortletURLProvider#setSecure()
      */
     public void setSecure() {
         this.secure =  new Boolean(true);
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.services.information.PortletURLProvider#clearParameters()
      */
     public void clearParameters() {
         this.clearParameters = true;
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.services.information.PortletURLProvider#setParameters(java.util.Map)
      */
     public void setParameters(Map parameters) {
@@ -212,11 +212,14 @@
         return this.parameters;
     }
 
+    /**
+     * @see java.lang.Object#toString()
+     */
     public String toString() {
         return new PortletURLProviderImpl(this).getURL();
     }
 
-    /* (non-Javadoc)
+    /**
      * @see java.lang.Object#toString()
      */
     private String getURL() {
@@ -252,11 +255,10 @@
                 this.generatedURL = this.linkService.getLinkURI(l, secure);
             }
         }
-
         return linkService.encodeURL(this.generatedURL);
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.cocoon.portal.event.ActionEvent#getTarget()
      */
     public Object getTarget() {        

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistryImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistryImpl.java?rev=278950&r1=278949&r2=278950&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistryImpl.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistryImpl.java
Tue Sep  6 02:15:36 2005
@@ -93,14 +93,14 @@
     /** The entity resolver */
     protected EntityResolver resolver;
     
-    /* (non-Javadoc)
+    /**
      * @see org.apache.avalon.framework.context.Contextualizable#contextualize(org.apache.avalon.framework.context.Context)
      */
     public void contextualize(Context context) throws ContextException {
         this.context = context;
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
      */
     public void service(ServiceManager manager) 
@@ -109,7 +109,7 @@
         this.resolver = (EntityResolver) this.manager.lookup(EntityResolver.ROLE);
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.avalon.framework.activity.Disposable#dispose()
      */
     public void dispose() {
@@ -121,12 +121,14 @@
         this.context = null;
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.avalon.framework.activity.Initializable#initialize()
      */
     public void initialize() throws Exception {
-        this.getLogger().debug("Initializing PortletDefinitionRegistry");
-        ServletConfig servletConfig = (ServletConfig) context.get(CocoonServlet.CONTEXT_SERVLET_CONFIG);
+        if ( this.getLogger().isDebugEnabled() ) {
+            this.getLogger().debug("Initializing PortletDefinitionRegistry");
+        }
+        ServletConfig servletConfig = (ServletConfig) this.context.get(CocoonServlet.CONTEXT_SERVLET_CONFIG);
         
         ServletContext servletContext = servletConfig.getServletContext();
 
@@ -178,7 +180,7 @@
             }
 
         } catch (Exception e) {
-            e.printStackTrace();
+            this.getLogger().error("Error during initialization of registry.", e);
         } finally {
             this.manager.release(resolver);
         } 
@@ -186,10 +188,16 @@
         ((PortletApplicationEntityListCtrl)this.portletApplicationEntities).add("cocoon");
     }
 
+    /**
+     * @see org.apache.cocoon.portal.pluto.om.PortletDefinitionRegistry#getPortletApplicationDefinitionList()
+     */
     public PortletApplicationDefinitionList getPortletApplicationDefinitionList() {
         return registry;
     }
 
+    /**
+     * @see org.apache.cocoon.portal.pluto.om.PortletDefinitionRegistry#getPortletDefinition(org.apache.pluto.om.common.ObjectID)
+     */
     public PortletDefinition getPortletDefinition(ObjectID id) {
         return (PortletDefinition)portletsKeyObjectId.get(id);
     }
@@ -383,10 +391,10 @@
         }
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.cocoon.portal.pluto.om.PortletDefinitionRegistry#getPortletApplicationEntityList()
      */
     public PortletApplicationEntityList getPortletApplicationEntityList() {
         return this.portletApplicationEntities;
     }
-}
\ No newline at end of file
+}

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=278950&r1=278949&r2=278950&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
Tue Sep  6 02:15:36 2005
@@ -15,22 +15,15 @@
  */
 package org.apache.cocoon.portal.pluto.servlet;
 
-import java.io.BufferedReader;
-import java.io.IOException;
 import java.io.UnsupportedEncodingException;
-import java.security.Principal;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Iterator;
-import java.util.Locale;
 import java.util.Map;
 
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletInputStream;
-import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpServletRequestWrapper;
 
 import org.apache.cocoon.portal.pluto.PortletURLProviderImpl;
 import org.apache.pluto.om.window.PortletWindow;
@@ -41,9 +34,7 @@
  * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  * @version CVS $Id$
  */
-public class ServletRequestImpl implements HttpServletRequest {
-
-    final protected HttpServletRequest request;
+public class ServletRequestImpl extends HttpServletRequestWrapper {
 
     /** Cache the parameter map */
     protected Map portletParameterMap;
@@ -54,97 +45,20 @@
 
     public ServletRequestImpl(HttpServletRequest request,
                               PortletURLProviderImpl provider) {
-        this.request = request;
+        super(request);
         this.provider = provider;
     }
 
     public ServletRequestImpl(HttpServletRequest request,
                               PortletURLProviderImpl provider,
                               PortletWindow window) {
-        this.request = request;
+        super(request);
         this.provider = provider;
         this.window = window;
     }
 
     public ServletRequestImpl getRequest(PortletWindow window) {
-        return new ServletRequestImpl(request, provider, window);
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#getAuthType()
-     */
-    public String getAuthType() {
-        return this.request.getAuthType();
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#getContextPath()
-     */
-    public String getContextPath() {
-        return this.request.getContextPath();
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#getCookies()
-     */
-    public Cookie[] getCookies() {
-        return this.request.getCookies();
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#getDateHeader(java.lang.String)
-     */
-    public long getDateHeader(String arg0) {
-        return this.request.getDateHeader(arg0);
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#getHeader(java.lang.String)
-     */
-    public String getHeader(String arg0) {
-        return this.request.getHeader(arg0);
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#getHeaderNames()
-     */
-    public Enumeration getHeaderNames() {
-        return this.request.getHeaderNames();
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#getHeaders(java.lang.String)
-     */
-    public Enumeration getHeaders(String arg0) {
-        return this.request.getHeaders(arg0);
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#getIntHeader(java.lang.String)
-     */
-    public int getIntHeader(String arg0) {
-        return this.request.getIntHeader(arg0);
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#getMethod()
-     */
-    public String getMethod() {
-        return this.request.getMethod();
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#getPathInfo()
-     */
-    public String getPathInfo() {
-        return this.request.getPathInfo();
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#getPathTranslated()
-     */
-    public String getPathTranslated() {
-        return this.request.getPathTranslated();
+        return new ServletRequestImpl((HttpServletRequest)this.getRequest(), provider, window);
     }
 
     /**
@@ -155,232 +69,13 @@
     }
 
     /**
-     * @see javax.servlet.http.HttpServletRequest#getRemoteUser()
-     */
-    public String getRemoteUser() {
-        return this.request.getRemoteUser();
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#getRequestedSessionId()
-     */
-    public String getRequestedSessionId() {
-        return this.request.getRequestedSessionId();
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#getRequestURI()
-     */
-    public String getRequestURI() {
-        return this.request.getRequestURI();
-    }
-
-    /**
      * @see javax.servlet.http.HttpServletRequest#getRequestURL()
      */
     public StringBuffer getRequestURL() {
-        //return this.request.getRequestURL();
         return null;
     }
 
     /**
-     * @see javax.servlet.http.HttpServletRequest#getServletPath()
-     */
-    public String getServletPath() {
-        return this.request.getServletPath();
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#getSession()
-     */
-    public HttpSession getSession() {
-        return this.request.getSession();
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#getSession(boolean)
-     */
-    public HttpSession getSession(boolean arg0) {
-        return this.request.getSession(arg0);
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#getUserPrincipal()
-     */
-    public Principal getUserPrincipal() {
-        return this.request.getUserPrincipal();
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdFromCookie()
-     */
-    public boolean isRequestedSessionIdFromCookie() {
-        return this.request.isRequestedSessionIdFromCookie();
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdFromUrl()
-     */
-    public boolean isRequestedSessionIdFromUrl() {
-        return this.request.isRequestedSessionIdFromURL();
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdFromURL()
-     */
-    public boolean isRequestedSessionIdFromURL() {
-        return this.request.isRequestedSessionIdFromURL();
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdValid()
-     */
-    public boolean isRequestedSessionIdValid() {
-        return this.request.isRequestedSessionIdValid();
-    }
-
-    /**
-     * @see javax.servlet.http.HttpServletRequest#isUserInRole(java.lang.String)
-     */
-    public boolean isUserInRole(String arg0) {
-        return this.request.isUserInRole(arg0);
-    }
-
-    /**
-     * @see javax.servlet.ServletRequest#getAttribute(java.lang.String)
-     */
-    public Object getAttribute(String arg0) {
-        return this.request.getAttribute(arg0);
-    }
-
-    /**
-     * @see javax.servlet.ServletRequest#getAttributeNames()
-     */
-    public Enumeration getAttributeNames() {
-        return this.request.getAttributeNames();
-    }
-
-    /**
-     * @see javax.servlet.ServletRequest#getCharacterEncoding()
-     */
-    public String getCharacterEncoding() {
-        return this.request.getCharacterEncoding();
-    }
-
-    /**
-     * @see javax.servlet.ServletRequest#getContentLength()
-     */
-    public int getContentLength() {
-        return this.request.getContentLength();
-    }
-
-    /**
-     * @see javax.servlet.ServletRequest#getInputStream()
-     */
-    public ServletInputStream getInputStream() throws IOException {
-        return this.request.getInputStream();
-    }
-
-    /**
-     * @see javax.servlet.ServletRequest#getLocale()
-     */
-    public Locale getLocale() {
-        return this.request.getLocale();
-    }
-
-    /**
-     * @see javax.servlet.ServletRequest#getLocales()
-     */
-    public Enumeration getLocales() {
-        return this.request.getLocales();
-    }
-
-    /**
-     * @see javax.servlet.ServletRequest#getProtocol()
-     */
-    public String getProtocol() {
-        return this.request.getProtocol();
-    }
-
-    /**
-     * @see javax.servlet.ServletRequest#getReader()
-     */
-    public BufferedReader getReader() throws IOException {
-        return this.request.getReader();
-    }
-
-    /**
-     * @see javax.servlet.ServletRequest#getRealPath(java.lang.String)
-     */
-    public String getRealPath(String arg0) {
-        return this.request.getRealPath(arg0);
-    }
-
-    /**
-     * @see javax.servlet.ServletRequest#getRemoteAddr()
-     */
-    public String getRemoteAddr() {
-        return this.request.getRemoteAddr();
-    }
-
-    /**
-     * @see javax.servlet.ServletRequest#getRemoteHost()
-     */
-    public String getRemoteHost() {
-        return this.request.getRemoteHost();
-    }
-
-    /**
-     * @see javax.servlet.ServletRequest#getRequestDispatcher(java.lang.String)
-     */
-    public RequestDispatcher getRequestDispatcher(String arg0) {
-        return this.request.getRequestDispatcher(arg0);
-    }
-
-    /**
-     * @see javax.servlet.ServletRequest#getScheme()
-     */
-    public String getScheme() {
-        return this.request.getScheme();
-    }
-
-    /**
-     * @see javax.servlet.ServletRequest#getServerName()
-     */
-    public String getServerName() {
-        return this.request.getServerName();
-    }
-
-    /**
-     * @see javax.servlet.ServletRequest#getServerPort()
-     */
-    public int getServerPort() {
-        return this.request.getServerPort();
-    }
-
-    /**
-     * @see javax.servlet.ServletRequest#isSecure()
-     */
-    public boolean isSecure() {
-        return this.request.isSecure();
-    }
-
-    /**
-     * @see javax.servlet.ServletRequest#removeAttribute(java.lang.String)
-     */
-    public void removeAttribute(String arg0) {
-        this.request.removeAttribute(arg0);
-    }
-
-    /**
-     * @see javax.servlet.ServletRequest#setAttribute(java.lang.String,
-     *      java.lang.Object)
-     */
-    public void setAttribute(String arg0, Object arg1) {
-        this.request.setAttribute(arg0, arg1);
-    }
-
-    /**
      * @see javax.servlet.ServletRequest#setCharacterEncoding(java.lang.String)
      */
     public void setCharacterEncoding(String arg0)
@@ -415,7 +110,7 @@
      * @see javax.servlet.ServletRequest#getParameterMap()
      */
     public Map getParameterMap() {
-        if (this.portletParameterMap == null) {
+        // TODO - readd caching
             //get control params
             this.portletParameterMap = new HashMap();
 
@@ -438,14 +133,13 @@
                 }
 
                 //get request params
-                Enumeration parameters = this.request.getParameterNames();
+            Enumeration parameters = this.getRequest().getParameterNames();
                 while (parameters.hasMoreElements()) {
                     String paramName = (String) parameters.nextElement();
-                    String[] paramValues =
-                        this.request.getParameterValues(paramName);
-                    String[] values =
-                        (String[]) this.portletParameterMap.get(paramName);
+                String[] paramValues = this.getRequest().getParameterValues(paramName);
+                String[] values = (String[]) this.portletParameterMap.get(paramName);
 
+                if ( !paramName.startsWith("cocoon-") ) {
                     if (values != null) {
                         String[] temp =
                             new String[paramValues.length + values.length];

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/servlet/ServletResponseImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/servlet/ServletResponseImpl.java?rev=278950&r1=278949&r2=278950&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/servlet/ServletResponseImpl.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/servlet/ServletResponseImpl.java
Tue Sep  6 02:15:36 2005
@@ -21,8 +21,8 @@
 import java.util.Locale;
 
 import javax.servlet.ServletOutputStream;
-import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletResponseWrapper;
 
 /**
  * Our response wrapper
@@ -30,9 +30,8 @@
  * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  * @version CVS $Id$
  */
-public class ServletResponseImpl implements HttpServletResponse {
+public class ServletResponseImpl extends HttpServletResponseWrapper {
 
-    protected final HttpServletResponse response;
     protected MyOutputStream stream;
     protected PrintWriter writer;
 
@@ -42,7 +41,7 @@
     protected String redirectURL;
 
     public ServletResponseImpl(HttpServletResponse response) {
-        this.response = response;
+        super(response);
         this.stream = new MyOutputStream();
         this.writer = new PrintWriter(this.stream);
     }
@@ -80,94 +79,6 @@
     /*
      * (non-Javadoc)
      *
-     * @see javax.servlet.http.HttpServletResponse#addCookie(javax.servlet.http.Cookie)
-     */
-    public void addCookie(Cookie arg0) {
-        this.response.addCookie(null);
-
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see javax.servlet.http.HttpServletResponse#addDateHeader(java.lang.String,
-     *      long)
-     */
-    public void addDateHeader(String arg0, long arg1) {
-        this.response.addDateHeader(arg0, arg1);
-
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see javax.servlet.http.HttpServletResponse#addHeader(java.lang.String,
-     *      java.lang.String)
-     */
-    public void addHeader(String arg0, String arg1) {
-        this.response.addHeader(arg0, arg1);
-
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see javax.servlet.http.HttpServletResponse#addIntHeader(java.lang.String,
-     *      int)
-     */
-    public void addIntHeader(String arg0, int arg1) {
-        this.response.addIntHeader(arg0, arg1);
-
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see javax.servlet.http.HttpServletResponse#containsHeader(java.lang.String)
-     */
-    public boolean containsHeader(String arg0) {
-        return this.response.containsHeader(arg0);
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see javax.servlet.http.HttpServletResponse#encodeRedirectUrl(java.lang.String)
-     */
-    public String encodeRedirectUrl(String arg0) {
-        return this.response.encodeRedirectURL(arg0);
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see javax.servlet.http.HttpServletResponse#encodeRedirectURL(java.lang.String)
-     */
-    public String encodeRedirectURL(String arg0) {
-        return this.response.encodeRedirectURL(arg0);
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see javax.servlet.http.HttpServletResponse#encodeUrl(java.lang.String)
-     */
-    public String encodeUrl(String arg0) {
-        return this.response.encodeURL(arg0);
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see javax.servlet.http.HttpServletResponse#encodeURL(java.lang.String)
-     */
-    public String encodeURL(String arg0) {
-        return this.response.encodeURL(arg0);
-    }
-
-    /*
-     * (non-Javadoc)
-     *
      * @see javax.servlet.http.HttpServletResponse#sendError(int,
      *      java.lang.String)
      */
@@ -196,36 +107,6 @@
     /*
      * (non-Javadoc)
      *
-     * @see javax.servlet.http.HttpServletResponse#setDateHeader(java.lang.String,
-     *      long)
-     */
-    public void setDateHeader(String arg0, long arg1) {
-        this.response.setDateHeader(arg0, arg1);
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see javax.servlet.http.HttpServletResponse#setHeader(java.lang.String,
-     *      java.lang.String)
-     */
-    public void setHeader(String arg0, String arg1) {
-        this.response.setHeader(arg0, arg1);
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see javax.servlet.http.HttpServletResponse#setIntHeader(java.lang.String,
-     *      int)
-     */
-    public void setIntHeader(String arg0, int arg1) {
-        this.response.setIntHeader(arg0, arg1);
-    }
-
-    /*
-     * (non-Javadoc)
-     *
      * @see javax.servlet.http.HttpServletResponse#setStatus(int,
      *      java.lang.String)
      */
@@ -258,24 +139,6 @@
      */
     public int getBufferSize() {
         return this.bufferSize = 1024;
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see javax.servlet.ServletResponse#getCharacterEncoding()
-     */
-    public String getCharacterEncoding() {
-        return this.response.getCharacterEncoding();
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see javax.servlet.ServletResponse#getLocale()
-     */
-    public Locale getLocale() {
-        return this.response.getLocale();
     }
 
     /*

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/tools/copletManagement/LayoutActions.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/tools/copletManagement/LayoutActions.java?rev=278950&r1=278949&r2=278950&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/tools/copletManagement/LayoutActions.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/tools/copletManagement/LayoutActions.java
Tue Sep  6 02:15:36 2005
@@ -60,7 +60,7 @@
     /**
      * Delets the Object with the id in the layout
      * @param id 
-     * @return
+     * @return true if the object could be deleted.
      */
 	public boolean del(String id) {
 		
@@ -108,7 +108,7 @@
 	 * Moves the object one position up or down
 	 * @param id id of the element
 	 * @param moveUp set 'true', to move the element up ('false' to move it down)
-	 * @return 
+	 * @return true if the object could be moved.
 	 */
 	public boolean move(String id, boolean moveUp) {
 		
@@ -299,7 +299,9 @@
 				   cl.addItem(item);
 			   }
 			   
-			} catch (ProcessingException e) {}
+			} catch (ProcessingException e) {
+                // ignore it
+            }
 		}
 		return copletDatas;
     }
@@ -308,9 +310,8 @@
         Object obj = getLayoutElement(layout, id, "", 1);
         if(obj instanceof CopletLayout) {
             return ((CopletLayout) obj).getCopletInstanceData();
-        } else {
-            return null;    
         }
+        return null;    
     }
     
     /**
@@ -345,4 +346,4 @@
 		}
 		return null;
 	}
-}
\ No newline at end of file
+}

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/mocks/javax/servlet/http/HttpServletRequestWrapper.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/mocks/javax/servlet/http/HttpServletRequestWrapper.java?rev=278950&r1=278949&r2=278950&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/mocks/javax/servlet/http/HttpServletRequestWrapper.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/mocks/javax/servlet/http/HttpServletRequestWrapper.java
Tue Sep  6 02:15:36 2005
@@ -15,6 +15,14 @@
  */
 package javax.servlet.http;
 
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.security.Principal;
+import java.util.Enumeration;
+import java.util.Locale;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletInputStream;
 import javax.servlet.ServletRequest;
 
 /**
@@ -23,7 +31,199 @@
  * 
  * @version $Id$
  */
-public class HttpServletRequestWrapper {
+public class HttpServletRequestWrapper implements HttpServletRequest {
+
+    public HttpServletRequestWrapper(HttpServletRequest request) {
+        
+    }
+
+    public String getAuthType() {
+        return null;
+    }
+
+    public String getContextPath() {
+        return null;
+    }
+
+    public Cookie[] getCookies() {
+        return null;
+    }
+
+    public long getDateHeader(String arg0) {
+        return 0;
+    }
+
+    public String getHeader(String arg0) {
+        return null;
+    }
+
+    public Enumeration getHeaderNames() {
+        return null;
+    }
+
+    public Enumeration getHeaders(String arg0) {
+        return null;
+    }
+
+    public int getIntHeader(String arg0) {
+        return 0;
+    }
+
+    public String getMethod() {
+        return null;
+    }
+
+    public String getPathInfo() {
+        return null;
+    }
+
+    public String getPathTranslated() {
+        return null;
+    }
+
+    public String getQueryString() {
+        return null;
+    }
+
+    public String getRemoteUser() {
+        return null;
+    }
+
+    public String getRequestedSessionId() {
+        return null;
+    }
+
+    public String getRequestURI() {
+        return null;
+    }
+
+    public String getServletPath() {
+        return null;
+    }
+
+    public HttpSession getSession() {
+        return null;
+    }
+
+    public HttpSession getSession(boolean arg0) {
+        return null;
+    }
+
+    public Principal getUserPrincipal() {
+        return null;
+    }
+
+    public boolean isRequestedSessionIdFromCookie() {
+        return false;
+    }
+
+    public boolean isRequestedSessionIdFromUrl() {
+        return false;
+    }
+
+    public boolean isRequestedSessionIdFromURL() {
+        return false;
+    }
+
+    public boolean isRequestedSessionIdValid() {
+        return false;
+    }
+
+    public boolean isUserInRole(String arg0) {
+        return false;
+    }
+
+    public Object getAttribute(String arg0) {
+        return null;
+    }
+
+    public Enumeration getAttributeNames() {
+        return null;
+    }
+
+    public String getCharacterEncoding() {
+        return null;
+    }
+
+    public int getContentLength() {
+        return 0;
+    }
+
+    public String getContentType() {
+        return null;
+    }
+
+    public ServletInputStream getInputStream() throws IOException {
+        return null;
+    }
+
+    public Locale getLocale() {
+        return null;
+    }
+
+    public Enumeration getLocales() {
+        return null;
+    }
+
+    public String getParameter(String arg0) {
+        return null;
+    }
+
+    public Enumeration getParameterNames() {
+        return null;
+    }
+
+    public String[] getParameterValues(String arg0) {
+        return null;
+    }
+
+    public String getProtocol() {
+        return null;
+    }
+
+    public BufferedReader getReader() throws IOException {
+        return null;
+    }
+
+    public String getRealPath(String arg0) {
+        return null;
+    }
+
+    public String getRemoteAddr() {
+        return null;
+    }
+
+    public String getRemoteHost() {
+        return null;
+    }
+
+    public RequestDispatcher getRequestDispatcher(String arg0) {
+        return null;
+    }
+
+    public String getScheme() {
+        return null;
+    }
+
+    public String getServerName() {
+        return null;
+    }
+
+    public int getServerPort() {
+        return 0;
+    }
+
+    public boolean isSecure() {
+        return false;
+    }
+
+    public void removeAttribute(String arg0) {
+        
+    }
+
+    public void setAttribute(String arg0, Object arg1) {
+        
+    }
 
     public ServletRequest getRequest() {
         return null;

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/mocks/javax/servlet/http/HttpServletResponseWrapper.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/mocks/javax/servlet/http/HttpServletResponseWrapper.java?rev=278950&r1=278949&r2=278950&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/mocks/javax/servlet/http/HttpServletResponseWrapper.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/mocks/javax/servlet/http/HttpServletResponseWrapper.java
Tue Sep  6 02:15:36 2005
@@ -15,6 +15,11 @@
  */
 package javax.servlet.http;
 
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Locale;
+
+import javax.servlet.ServletOutputStream;
 import javax.servlet.ServletResponse;
 
 /**
@@ -23,9 +28,111 @@
  * 
  * @version $Id$
  */
-public class HttpServletResponseWrapper {
+public class HttpServletResponseWrapper implements HttpServletResponse {
+
+    public HttpServletResponseWrapper(HttpServletResponse response) {
+        
+    }
 
     public ServletResponse getResponse() {
         return null;
+    }
+
+    public void addCookie(Cookie arg0) {
+    }
+
+    public void addDateHeader(String arg0, long arg1) {
+    }
+
+    public void addHeader(String arg0, String arg1) {
+    }
+
+    public void addIntHeader(String arg0, int arg1) {
+    }
+
+    public boolean containsHeader(String arg0) {
+        return false;
+    }
+
+    public String encodeRedirectUrl(String arg0) {
+        return null;
+    }
+
+    public String encodeRedirectURL(String arg0) {
+        return null;
+    }
+
+    public String encodeUrl(String arg0) {
+        return null;
+    }
+
+    public String encodeURL(String arg0) {
+        return null;
+    }
+
+    public void sendError(int arg0, String arg1) throws IOException {
+    }
+
+    public void sendError(int arg0) throws IOException {
+    }
+
+    public void sendRedirect(String arg0) throws IOException {
+    }
+
+    public void setDateHeader(String arg0, long arg1) {
+    }
+
+    public void setHeader(String arg0, String arg1) {
+    }
+
+    public void setIntHeader(String arg0, int arg1) {
+    }
+
+    public void setStatus(int arg0, String arg1) {
+    }
+
+    public void setStatus(int arg0) {
+    }
+
+    public void flushBuffer() throws IOException {
+    }
+
+    public int getBufferSize() {
+        return 0;
+    }
+
+    public String getCharacterEncoding() {
+        return null;
+    }
+
+    public Locale getLocale() {
+        return null;
+    }
+
+    public ServletOutputStream getOutputStream() throws IOException {
+        return null;
+    }
+
+    public PrintWriter getWriter() throws IOException {
+        return null;
+    }
+
+    public boolean isCommitted() {
+        return false;
+    }
+
+    public void reset() {
+    }
+
+    public void setBufferSize(int arg0) {
+    }
+
+    public void setContentLength(int arg0) {
+    }
+
+    public void setContentType(String arg0) {
+    }
+
+    public void setLocale(Locale arg0) {
     }
 }



Mime
View raw message