portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r706843 [1/2] - in /portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade: components/jetspeed-cm/src/main/java/org/apache/jetspeed/components/factorybeans/ components/jetspeed-portal/src/main/java/org/apache/jetspeed/ components/jet...
Date Wed, 22 Oct 2008 01:34:12 GMT
Author: taylor
Date: Tue Oct 21 18:34:10 2008
New Revision: 706843

URL: http://svn.apache.org/viewvc?rev=706843&view=rev
Log:
https://issues.apache.org/jira/browse/JS2-871
This commit hooks in the majority of the new Pluto 2.0 services into Jetspeed Spring configurations and implementations
Still remaining:
* prefs, registry/factory
In the next commit all deprecated Pluto 1.0 factories will be removed

Added:
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/JetspeedPortletInvokerService.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/EventProviderImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/FilterManagerImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLListenerImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLProviderImpl.java   (contents, props changed)
      - copied, changed from r705397, portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/information/PortletURLProviderImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/RequestPropertyProviderImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/ResourceURLProviderImpl.java   (contents, props changed)
      - copied, changed from r705397, portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/information/ResourceURLProviderImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/services/JetspeedOptionalPlutoServices.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/services/JetspeedPortalCallbackServices.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/services/JetspeedRequiredPlutoServices.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/engine/servlet/
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/engine/servlet/ServletRequestFactory.java   (contents, props changed)
      - copied, changed from r706807, portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/engine/servlet/ServletRequestFactory.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/engine/servlet/ServletResponseFactory.java   (contents, props changed)
      - copied, changed from r706807, portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/engine/servlet/ServletResponseFactory.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-portal-resources/src/main/resources/assembly/pluto-services.xml
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-portal-resources/src/main/resources/assembly/servlet-api.xml
Removed:
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/engine/servlet/ServletRequestFactory.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/engine/servlet/ServletResponseFactory.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/information/PortletURLProviderImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/information/ResourceURLProviderImpl.java
Modified:
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-cm/src/main/java/org/apache/jetspeed/components/factorybeans/PlutoFactoryFactoryBean.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/JetspeedPortalContext.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/DesktopPortletContainerImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/JetspeedPortletContainerWrapper.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/JetspeedPortletInvoker.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalPortletInvoker.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalPortletInvokerFactory.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalServletRequest.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/PortletInvokerFactoryImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ServletPortletInvoker.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ServletPortletInvokerFactory.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/namespace/JetspeedNamespaceMapper.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/namespace/JetspeedNamespaceMapperImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/engine/JetspeedEngine.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/engine/servlet/ServletRequestFactoryImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/engine/servlet/ServletRequestImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/engine/servlet/ServletResponseFactoryImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/request/JetspeedRequestContext.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/request/JetspeedRequestContextComponent.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/information/DynamicInformationProviderImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/information/InformationProviderServiceImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/information/StaticInformationProviderImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/userinfo/impl/UserInfoManagerImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/PersistenceBrokerPortletRegistry.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/PortalContext.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/components/portletregistry/PortletRegistry.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/engine/Engine.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/request/RequestContext.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/request/RequestContextComponent.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/userinfo/UserInfoManager.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-commons/src/main/java/org/apache/jetspeed/container/ContainerConstants.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-portal-resources/src/main/resources/assembly/desktop.xml
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-portal-resources/src/main/resources/assembly/jetspeed-spring.xml
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-portal-resources/src/main/resources/assembly/userinfo.xml

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-cm/src/main/java/org/apache/jetspeed/components/factorybeans/PlutoFactoryFactoryBean.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-cm/src/main/java/org/apache/jetspeed/components/factorybeans/PlutoFactoryFactoryBean.java?rev=706843&r1=706842&r2=706843&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-cm/src/main/java/org/apache/jetspeed/components/factorybeans/PlutoFactoryFactoryBean.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-cm/src/main/java/org/apache/jetspeed/components/factorybeans/PlutoFactoryFactoryBean.java Tue Oct 21 18:34:10 2008
@@ -21,7 +21,6 @@
 
 import javax.servlet.ServletConfig;
 
-import org.apache.pluto.factory.Factory;
 import org.springframework.beans.factory.BeanCreationException;
 import org.springframework.beans.factory.config.AbstractFactoryBean;
 

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/JetspeedPortalContext.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/JetspeedPortalContext.java?rev=706843&r1=706842&r2=706843&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/JetspeedPortalContext.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/JetspeedPortalContext.java Tue Oct 21 18:34:10 2008
@@ -62,20 +62,17 @@
      */
     private String applicationRoot;
     
-    private final String portalInfo;
+    private String portalInfo;
 
-    public JetspeedPortalContext(Engine engine, PortalConfiguration configuration, String applicationRoot)
+    public JetspeedPortalContext()
+    {
+    }
+    
+    public JetspeedPortalContext(PortalConfiguration configuration, String applicationRoot)
     {
-        this.engine = engine;
         this.configuration = configuration;
         this.applicationRoot = applicationRoot;
-             
-        portalInfo = configuration.getString(PORTAL_NAME_ATTR) + "/" + configuration.getString(PORTAL_VERSION_ATTR);
-        
-        // Inititalize supported portlet modes and window states
-        String[] supportedModes = configuration.getStringArray(SUPPORTED_PORTLETMODE_ATTR);
-        String[] supportedStates = configuration.getStringArray(SUPPORTED_WINDOWSTATE_ATTR);
-        new JetspeedActions(supportedModes, supportedStates);
+        initialize();
     }
 
     // ------------------------------------------------------------------------
@@ -110,6 +107,17 @@
     public void setConfiguration(PortalConfiguration configuration)
     {
         this.configuration = configuration;
+        initialize();
+    }
+    
+    protected void initialize()
+    {
+        portalInfo = configuration.getString(PORTAL_NAME_ATTR) + "/" + configuration.getString(PORTAL_VERSION_ATTR);
+        
+        // Inititalize supported portlet modes and window states
+        String[] supportedModes = configuration.getStringArray(SUPPORTED_PORTLETMODE_ATTR);
+        String[] supportedStates = configuration.getStringArray(SUPPORTED_WINDOWSTATE_ATTR);
+        new JetspeedActions(supportedModes, supportedStates);        
     }
 
     /**
@@ -141,6 +149,11 @@
     {
         return this.engine;
     }
+    
+    public void setEngine(Engine engine)
+    {
+        this.engine = engine;
+    }
 
     /**
      * Returns the engine attribute with the given name, or null if there is no attribute by that name.

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/DesktopPortletContainerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/DesktopPortletContainerImpl.java?rev=706843&r1=706842&r2=706843&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/DesktopPortletContainerImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/DesktopPortletContainerImpl.java Tue Oct 21 18:34:10 2008
@@ -17,22 +17,15 @@
 package org.apache.jetspeed.container;
 
 import java.io.IOException;
-import java.util.Map;
 
-import javax.portlet.PortletMode;
-import javax.portlet.WindowState;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.pluto.PortletContainer;
-import org.apache.pluto.PortletContainerImpl;
-import org.apache.pluto.core.InternalActionResponse;
-import org.apache.jetspeed.container.PortletWindow;
-import org.apache.pluto.services.information.DynamicInformationProvider;
-import org.apache.pluto.services.information.InformationProviderAccess;
-import org.apache.pluto.services.information.PortletURLProvider;
-
 import org.apache.jetspeed.desktop.JetspeedDesktop;
+import org.apache.pluto.OptionalContainerServices;
+import org.apache.pluto.PortletContainer;
+import org.apache.pluto.RequiredContainerServices;
+import org.apache.pluto.core.PortletContainerImpl;
 
 /**
  * Desktop Portlet Container implementation. This implementation 
@@ -49,8 +42,11 @@
     private String desktopActionPipelinePath = null;
     private String desktopRenderPipelinePath = null;
     
-    public DesktopPortletContainerImpl( String desktopPipelinePath, String desktopActionPipelinePath, String desktopRenderPipelinePath )
+    public DesktopPortletContainerImpl(String containerName,
+            RequiredContainerServices requiredServices, OptionalContainerServices optionalServices, 
+            String desktopPipelinePath, String desktopActionPipelinePath, String desktopRenderPipelinePath)
     {
+        super(containerName, requiredServices, optionalServices);
         if ( desktopPipelinePath == null || desktopPipelinePath.length() == 0 )
             desktopPipelinePath = JetspeedDesktop.DEFAULT_DESKTOP_PIPELINE_PATH;
         if ( desktopPipelinePath.charAt( 0 ) != '/' )
@@ -76,21 +72,13 @@
         this.desktopActionPipelinePath = desktopActionPipelinePath;
         this.desktopRenderPipelinePath = desktopRenderPipelinePath;
     }
-
-    /**
-     * This redirect does not redirect, instead returns the redirect URL in the response
-     */
-    protected void redirect(String location, PortletWindow portletWindow,
-            HttpServletRequest servletRequest,
-            HttpServletResponse servletResponse,
-            InternalActionResponse _actionResponse) throws IOException
+    
+    protected void redirect(HttpServletRequest servletRequest, HttpServletResponse servletResponse, String location) throws IOException    
     {
     	String encoding = servletRequest.getParameter( JetspeedDesktop.DESKTOP_ENCODER_REQUEST_PARAMETER );
-        boolean requestHasDesktopEncoding = false;
     	boolean requestIsDesktopAjax = false;
         if ( encoding != null && encoding.equals( JetspeedDesktop.DESKTOP_ENCODER_REQUEST_PARAMETER_VALUE ) )
         {   // used in cases where action request cannot be made via ajax (e.g. form has <input type=file/> element)
-        	requestHasDesktopEncoding = true;
         	requestIsDesktopAjax = true;
         	String ajaxOverride = servletRequest.getParameter( JetspeedDesktop.DESKTOP_AJAX_REQUEST_PARAMETER );
         	if ( ajaxOverride != null && ajaxOverride.equals( "false" ) )
@@ -98,66 +86,8 @@
         		requestIsDesktopAjax = false;
         	}
         }
-    	
-        if (location == null && _actionResponse != null)
-        {
-            DynamicInformationProvider provider = InformationProviderAccess
-                    .getDynamicProvider(servletRequest);
-
-            // TODO: don't send changes in case of exception -> PORTLET:SPEC:17
-
-            PortletMode portletMode = provider.getPortletMode(portletWindow);
-            WindowState windowState = provider.getWindowState(portletWindow);
-
-            // get the changings of this portlet entity that might be set during
-            // action handling
-            // change portlet mode
-            if (_actionResponse.getChangedPortletMode() != null)
-            {
-                portletMode = _actionResponse.getChangedPortletMode();
-                InformationProviderAccess.getDynamicProvider(servletRequest)
-                        .getPortletActionProvider(portletWindow)
-                        .changePortletMode(portletMode);
-            }
-            // change window state
-            if (_actionResponse.getChangedWindowState() != null)
-            {
-                windowState = _actionResponse.getChangedWindowState();
-                InformationProviderAccess.getDynamicProvider(servletRequest)
-                        .getPortletActionProvider(portletWindow)
-                        .changePortletWindowState(windowState);
-            }
-            // get render parameters
-            Map renderParameter = _actionResponse.getRenderParameters();
-
-            PortletURLProvider redirectURL = provider
-                    .getPortletURLProvider(portletWindow);
-
-            if (provider.getPortletMode(portletWindow) != null)
-            {
-                redirectURL.setPortletMode(portletMode);
-            }
-            if (provider.getWindowState(portletWindow) != null)
-            {
-                redirectURL.setWindowState(windowState);
-            }
-            if (servletRequest.isSecure())
-            {
-                redirectURL.setSecure(); // TBD
-            }
-            
-            if ( requestHasDesktopEncoding && ! requestIsDesktopAjax )
-            {   // add parameter to tell DesktopEncodingPortalURL that it should not add extra desktop parameters (e.g. entity and portlet)
-            	renderParameter.put( JetspeedDesktop.DESKTOP_REQUEST_NOT_AJAX_PARAMETER, Boolean.TRUE );
-            }
-
-            redirectURL.clearParameters();
-            redirectURL.setParameters(renderParameter);
-            
-            location = servletResponse
-                    .encodeRedirectURL(redirectURL.toString());
-        }
 
+        // TODO: 2.2 is this still necessary?
         javax.servlet.http.HttpServletResponse redirectResponse = servletResponse;
         while (redirectResponse instanceof javax.servlet.http.HttpServletResponseWrapper)
         {
@@ -176,8 +106,7 @@
             location = location.replaceAll( this.desktopRenderPipelinePath, this.desktopPipelinePath);
             redirectResponse.sendRedirect(location);
         }
-        // System.out.println("+++ >>>> location is " + location);
-        
+        System.out.println("+++ >>>> DESKTOP REDIRECT: location is " + location);        
     }
-
+    
 }

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/JetspeedPortletContainerWrapper.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/JetspeedPortletContainerWrapper.java?rev=706843&r1=706842&r2=706843&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/JetspeedPortletContainerWrapper.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/JetspeedPortletContainerWrapper.java Tue Oct 21 18:34:10 2008
@@ -17,10 +17,8 @@
 package org.apache.jetspeed.container;
 
 import java.io.IOException;
-import java.util.Properties;
 
 import javax.portlet.PortletException;
-import javax.servlet.ServletConfig;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
@@ -28,10 +26,11 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.engine.servlet.ServletRequestFactory;
 import org.apache.jetspeed.engine.servlet.ServletResponseFactory;
+import org.apache.pluto.OptionalContainerServices;
 import org.apache.pluto.PortletContainer;
 import org.apache.pluto.PortletContainerException;
-import org.apache.jetspeed.container.PortletWindow;
-import org.apache.pluto.services.PortletContainerEnvironment;
+import org.apache.pluto.PortletWindow;
+import org.apache.pluto.RequiredContainerServices;
 
 /**
  * Portlet Container Wrapper to secure access to portlet container.
@@ -43,70 +42,36 @@
 {
     private boolean initialized = false;
     private static final Log log = LogFactory.getLog(JetspeedPortletContainerWrapper.class);
+    private final String INVALID_WINDOW_TYPE = "Window is not of valid type: ";    
     private final PortletContainer pluto;
     private final String containerId;
-    private final Properties properties;
-    private final PortletContainerEnvironment environment;
-    private final ServletConfig servletConfig;
     
     private ServletRequestFactory requestFactory;
     private ServletResponseFactory responseFactory;
 
-    public JetspeedPortletContainerWrapper(PortletContainer pluto, String containerId, 
-            ServletConfig servletConfig, PortletContainerEnvironment env, Properties properties)
+    public JetspeedPortletContainerWrapper(PortletContainer pluto, String containerId)
     {
         this.pluto = pluto;
         this.containerId = containerId;
-        this.environment = env;
-        this.properties = properties;
-        this.servletConfig = servletConfig;
     }
     
-    public JetspeedPortletContainerWrapper(PortletContainer pluto, String containerId, 
-            ServletConfig servletConfig, PortletContainerEnvironment env)
-    {
-        this(pluto, containerId, servletConfig, env, new Properties());
-    }
-    
-    /**
-     * Allows starting of the container without providing calling the 
-     * <code>init()</code> method without all of the arguments as the
-     * arguments have already been provided in the constructor.
-     * 
-     * @throws PortletContainerException
-     */
-    public void start() throws PortletContainerException
+    public void init() throws PortletContainerException
     {
         log.info("Attmepting to start Pluto portal container...");
-        this.init(containerId, servletConfig, environment, properties);
-        log.info("Pluto portlet container successfully started.");
-    }
-  
-    /**
-     * initialization is still handled outside component architecture, since Pluto is not a component
-     */
-    public synchronized void init(
-        String uniqueContainerId,
-        ServletConfig servletConfig,
-        PortletContainerEnvironment environment,
-        Properties props)
-        throws PortletContainerException
-    {
-
-        pluto.init(uniqueContainerId, servletConfig, environment, props);
-        initialized = true;
+        pluto.init();
+        initialized = true;        
+        log.info("Pluto portlet container successfully started.");        
     }
-
-    public synchronized void shutdown() throws PortletContainerException
+    
+    public synchronized void destroy() throws PortletContainerException
     {
         initialized = false;
-        pluto.shutdown();
+        pluto.destroy();
     }
-
-    public void renderPortlet(PortletWindow portletWindow, HttpServletRequest servletRequest, HttpServletResponse servletResponse)
+    
+    public void doRender(PortletWindow portletWindow, HttpServletRequest servletRequest, HttpServletResponse servletResponse)
         throws PortletException, IOException, PortletContainerException
-    {
-                
+    {                
         if(portletWindow.getPortletEntity() == null)
         {
             log.warn("Could not render PortletWindow "+ portletWindow.getId() + " as it has no PortletEntity defined.");
@@ -118,32 +83,58 @@
             log.warn("Could not render PortletWindow"+ portletWindow.getId() + " as it has no PortletDefintion defined.");
             return;
         }
-        pluto.renderPortlet(portletWindow, servletRequest, servletResponse);
-        // TODO: figure out how to access pluto-services before container kicks in
-        //                              ServletObjectAccess.getServletRequest(servletRequest),
-        //                              ServletObjectAccess.getServletResponse(servletResponse));
+        pluto.doRender(portletWindow, servletRequest, servletResponse);
     }
 
-    public void processPortletAction(
+    public void doAction(
         PortletWindow portletWindow,
         HttpServletRequest servletRequest,
         HttpServletResponse servletResponse)
         throws PortletException, IOException, PortletContainerException
     {
-        pluto.processPortletAction(portletWindow, servletRequest, servletResponse);
-        //                                     ServletObjectAccess.getServletRequest(servletRequest),
-        //                                     ServletObjectAccess.getServletResponse(servletResponse));
+        pluto.doAction(portletWindow, servletRequest, servletResponse);
     }
 
-    public void portletLoad(PortletWindow portletWindow, HttpServletRequest servletRequest, HttpServletResponse servletResponse)
-        throws PortletException, PortletContainerException
+    
+    public void doLoad(PortletWindow portletWindow, HttpServletRequest servletRequest, HttpServletResponse servletResponse)
+        throws PortletException, IOException, PortletContainerException
     {
-        pluto.portletLoad(
-            portletWindow,
-            requestFactory.getServletRequest(servletRequest, portletWindow),
+        if (portletWindow instanceof org.apache.jetspeed.container.PortletWindow)
+            throw new PortletException(INVALID_WINDOW_TYPE + org.apache.jetspeed.container.PortletWindow.class);
+        org.apache.jetspeed.container.PortletWindow jpw = (org.apache.jetspeed.container.PortletWindow)portletWindow;
+        pluto.doLoad(portletWindow, 
+            requestFactory.getServletRequest(servletRequest, jpw),
             responseFactory.getServletResponse(servletResponse));
     }
 
+    public void doAdmin(PortletWindow portletWindow, HttpServletRequest servletRequest, HttpServletResponse servletResponse)
+        throws PortletException, IOException, PortletContainerException
+    {
+        pluto.doAdmin(portletWindow, servletRequest, servletResponse);
+    }
+
+    public void doServeResource(PortletWindow portletWindow, HttpServletRequest servletRequest, HttpServletResponse servletResponse)
+    throws PortletException, IOException, PortletContainerException
+    {
+        pluto.doServeResource(portletWindow, servletRequest, servletResponse);
+    }
+
+    public String getName()
+    {
+        return this.containerId;
+    }
+
+    public OptionalContainerServices getOptionalContainerServices()
+    {
+        return pluto.getOptionalContainerServices();
+    }
+
+    public RequiredContainerServices getRequiredContainerServices()
+    {
+        return pluto.getRequiredContainerServices();
+    }
+
+    
     /**
      * <p>
      * isInitialized
@@ -166,5 +157,6 @@
     {
         this.responseFactory = responseFactory;
     }
+    
 
 }

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/JetspeedPortletInvoker.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/JetspeedPortletInvoker.java?rev=706843&r1=706842&r2=706843&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/JetspeedPortletInvoker.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/JetspeedPortletInvoker.java Tue Oct 21 18:34:10 2008
@@ -16,21 +16,25 @@
  */
 package org.apache.jetspeed.container.invoker;
 
+import java.io.IOException;
+
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletResponse;
 import javax.servlet.ServletConfig;
 
 import org.apache.jetspeed.factory.PortletFactory;
-import org.apache.pluto.invoker.PortletInvoker;
 import org.apache.pluto.om.portlet.PortletDefinition;
+import org.apache.pluto.spi.FilterManager;
 
 /**
- * JetspeedPortletInvoker extends Pluto's portlet invoker and extends it
- * with lifecycle management. Portlet Invokers can be pooled, and activated
- * and passivated per request cycle.
+ * JetspeedPortletInvoker extends Pluto's portlet invoker model and extends it
+ * with lifecycle management. 
  *
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  * @version $Id$
  */
-public interface JetspeedPortletInvoker extends PortletInvoker
+public interface JetspeedPortletInvoker 
 {
     /**
      * Activating an invoker makes it ready to invoke portlets.
@@ -42,20 +46,7 @@
      * @param containerServlet
      */
     void activate(PortletFactory portletFactory, PortletDefinition portletDefinition, ServletConfig servletConfig);
-
-    /**
-     * Activating an invoker makes it ready to invoke portlets.
-     * If an invoker's state is not activated, it can not invoke.
-     * This second signature allows for activating with an extra property.
-     * 
-     * @param portletFactory The factory to get access to the portlet being invoked.
-     * @param portletDefinition The portlet's definition that is being invoked.
-     * @param servletConfig The servlet configuration of the portal. 
-     * @param property Implementation specific property
-     * @param containerServlet
-     */
-    void activate(PortletFactory portletFactory, PortletDefinition portletDefinition, ServletConfig servletConfig, String property);
-    
+   
     /**
      * Passivates an invoker, freeing it back to the invoker pool.
      * If an invoker's state is passivated, it cannot be used to invoke portlets.
@@ -67,4 +58,17 @@
      * @return True if the current state of the invoker is 'activated' otherwise false.
      */
     boolean isActivated();
+
+    /**
+     * Invoke a method
+     * @param portletRequest
+     * @param portletResponse
+     * @param method
+     * @param filter
+     * @throws PortletException
+     * @throws IOException
+     */
+    void invoke(PortletRequest portletRequest, PortletResponse portletResponse, Integer method, FilterManager filter)
+        throws PortletException, IOException;
+    
 }

Added: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/JetspeedPortletInvokerService.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/JetspeedPortletInvokerService.java?rev=706843&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/JetspeedPortletInvokerService.java (added)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/JetspeedPortletInvokerService.java Tue Oct 21 18:34:10 2008
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.container.invoker;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletResponse;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+
+import org.apache.jetspeed.PortalContext;
+import org.apache.jetspeed.container.ContainerConstants;
+import org.apache.jetspeed.factory.PortletFactory;
+import org.apache.jetspeed.om.portlet.PortletApplication;
+import org.apache.jetspeed.om.portlet.PortletDefinition;
+import org.apache.pluto.PortletWindow;
+import org.apache.pluto.spi.FilterManager;
+import org.apache.pluto.spi.optional.PortletInvokerService;
+
+/**
+ * Implements Pluto's portlet invoker service interface.
+ *
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class JetspeedPortletInvokerService implements PortletInvokerService
+{
+    public final static String INVOKER_SERVLET_MAPPING_NAME = "factory.invoker.servlet.mapping.name";
+    public final static String DEFAULT_MAPPING_NAME = "/container";
+    
+    private ServletConfig servletConfig;
+    private PortletFactory portletFactory;
+    private PortletRequestResponseUnwrapper unwrapper;
+    private String servletMappingName;
+    
+    public JetspeedPortletInvokerService(ServletConfig servletConfig, PortalContext portalContext, 
+            PortletFactory portletFactory, PortletRequestResponseUnwrapper unwrapper)
+    {
+        this.servletConfig = servletConfig;
+        this.portletFactory = portletFactory;
+        this.unwrapper = unwrapper;
+        this.servletMappingName = portalContext.getConfigurationProperty(INVOKER_SERVLET_MAPPING_NAME, DEFAULT_MAPPING_NAME);                                
+    }
+   
+    public void action(ServletContext context, ActionRequest request,
+            ActionResponse response, PortletWindow window, FilterManager filter)
+            throws IOException, PortletException
+    {
+        JetspeedPortletInvoker invoker = getInvoker(window);
+        invoker.invoke(request, response, ContainerConstants.METHOD_ACTION, filter);
+    }
+
+    public void admin(ServletContext context, PortletRequest request,
+            PortletResponse response, PortletWindow window) throws IOException,
+            PortletException
+    {
+        JetspeedPortletInvoker invoker = getInvoker(window);
+        invoker.invoke(request, response, ContainerConstants.METHOD_ADMIN, null);        
+    }
+
+    public void event(ServletContext context, EventRequest request,
+            EventResponse response, PortletWindow window, FilterManager filter)
+            throws IOException, PortletException
+    {
+        JetspeedPortletInvoker invoker = getInvoker(window);
+        invoker.invoke(request, response, ContainerConstants.METHOD_EVENT, filter);
+    }
+
+    public void load(ServletContext context, PortletRequest request,
+            PortletResponse response, PortletWindow window) throws IOException,
+            PortletException
+    {
+        JetspeedPortletInvoker invoker = getInvoker(window);
+        invoker.invoke(request, response, ContainerConstants.METHOD_NOOP, null);
+    }   
+    
+    public void render(ServletContext context, RenderRequest request,
+            RenderResponse response, PortletWindow window, FilterManager filter)
+            throws IOException, PortletException
+    {
+        JetspeedPortletInvoker invoker = getInvoker(window);
+        invoker.invoke(request, response, ContainerConstants.METHOD_RENDER, filter);
+    }
+
+    public void serveResource(ServletContext context, ResourceRequest request,
+            ResourceResponse response, PortletWindow window, FilterManager filter)
+            throws IOException, PortletException
+    {
+        JetspeedPortletInvoker invoker = getInvoker(window);
+        invoker.invoke(request, response, ContainerConstants.METHOD_RESOURCE, filter);
+    }
+    
+    protected JetspeedPortletInvoker getInvoker(PortletWindow window)
+    {
+        PortletDefinition portletDefinition = (PortletDefinition)window.getPortletEntity().getPortletDefinition();
+        PortletApplication app = (PortletApplication)portletDefinition.getApplication();
+        JetspeedPortletInvoker invoker;
+        if (app.getApplicationType() == PortletApplication.LOCAL)
+        {
+            invoker = new LocalPortletInvoker();
+        }
+        else
+        {
+            invoker =  new ServletPortletInvoker(this.unwrapper, servletMappingName);
+
+        }
+        invoker.activate(portletFactory, portletDefinition, servletConfig);
+        return invoker;        
+    }
+    
+}

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalPortletInvoker.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalPortletInvoker.java?rev=706843&r1=706842&r2=706843&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalPortletInvoker.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalPortletInvoker.java Tue Oct 21 18:34:10 2008
@@ -30,8 +30,6 @@
 import javax.servlet.ServletContext;
 import javax.servlet.ServletRequest;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.container.ContainerConstants;
 import org.apache.jetspeed.container.PortletRequestContext;
@@ -40,6 +38,7 @@
 import org.apache.jetspeed.om.portlet.PortletApplication;
 import org.apache.jetspeed.request.RequestContext;
 import org.apache.pluto.om.portlet.PortletDefinition;
+import org.apache.pluto.spi.FilterManager;
 
 /**
  * LocalPortletInvoker invokes local (internal) portlet applications.
@@ -58,8 +57,6 @@
  */
 public class LocalPortletInvoker implements JetspeedPortletInvoker
 {
-    private final static Log log = LogFactory.getLog(LocalPortletInvoker.class);
-
     protected PortletFactory portletFactory;
     protected ServletContext jetspeedContext;
     protected ServletConfig jetspeedConfig;
@@ -99,42 +96,6 @@
         activated = false;
     }
     
-    /* (non-Javadoc)
-     * @see org.apache.pluto.invoker.PortletInvoker#action(javax.portlet.ActionRequest, javax.portlet.ActionResponse)
-     */
-    public void action(ActionRequest request, ActionResponse response)
-        throws PortletException, IOException
-    {
-        invoke(request, response, ContainerConstants.METHOD_ACTION);
-    }
-    
-    /* (non-Javadoc)
-     * @see org.apache.pluto.invoker.PortletInvoker#render(javax.portlet.RenderRequest, javax.portlet.RenderResponse)
-     */
-    public void render(RenderRequest request, RenderResponse response)
-        throws PortletException, IOException
-    {
-        invoke(request, response, ContainerConstants.METHOD_RENDER);
-    }
-    
-    /* (non-Javadoc)
-     * @see org.apache.pluto.invoker.PortletInvoker#load(javax.portlet.PortletRequest, javax.portlet.RenderResponse)
-     */
-    public void load(PortletRequest request, RenderResponse response)
-        throws PortletException
-    {
-        try
-        {
-            invoke(request, response, ContainerConstants.METHOD_NOOP);
-        }
-        catch (IOException e)
-        {
-            log.error("LocalPortletInvokerImpl.load() - Error while dispatching portlet.", e);
-            throw new PortletException(e);
-        }
-    }
-    
-    
     /**
      * Invokes the specific request denoted by the <code>method</code> parameter on a portlet.
      * The portlet is invoked with a direct method call on the portlet. It is not invoked in another web application.
@@ -146,22 +107,17 @@
      * @throws PortletException
      * @throws IOException
      */
-    protected void invoke(PortletRequest portletRequest, PortletResponse portletResponse, Integer method)
+    public void invoke(PortletRequest portletRequest, PortletResponse portletResponse, Integer method, FilterManager filter)
             throws PortletException, IOException
     {
         ClassLoader paClassLoader = portletFactory
-                .getPortletApplicationClassLoader((PortletApplication) portletDefinition
-                        .getPortletApplicationDefinition());
+                .getPortletApplicationClassLoader((PortletApplication) portletDefinition.getApplication());
         PortletInstance portletInstance = portletFactory.getPortletInstance(jetspeedContext, portletDefinition);
-
         if (method == ContainerConstants.METHOD_NOOP)
         {
             return;
         }
-
-        // gather all required data from request and response
         ServletRequest servletRequest = ((javax.servlet.http.HttpServletRequestWrapper) portletRequest).getRequest();
-
         ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
         try
         {

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalPortletInvokerFactory.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalPortletInvokerFactory.java?rev=706843&r1=706842&r2=706843&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalPortletInvokerFactory.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalPortletInvokerFactory.java Tue Oct 21 18:34:10 2008
@@ -19,7 +19,7 @@
 /**
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  * @version $Id: $
- *
+ * @deprecated delete me
  */
 public class LocalPortletInvokerFactory 
 {

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalServletRequest.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalServletRequest.java?rev=706843&r1=706842&r2=706843&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalServletRequest.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalServletRequest.java Tue Oct 21 18:34:10 2008
@@ -35,6 +35,7 @@
  * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
  * @author <a href="">David Gurney</a>
  * @version $Id: $
+ * @deprecated delete me
  */
 public class LocalServletRequest extends HttpServletRequestWrapper
 {

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/PortletInvokerFactoryImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/PortletInvokerFactoryImpl.java?rev=706843&r1=706842&r2=706843&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/PortletInvokerFactoryImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/PortletInvokerFactoryImpl.java Tue Oct 21 18:34:10 2008
@@ -23,8 +23,6 @@
 import org.apache.jetspeed.PortalContext;
 import org.apache.jetspeed.factory.PortletFactory;
 import org.apache.jetspeed.om.portlet.PortletApplication;
-import org.apache.pluto.factory.PortletInvokerFactory;
-import org.apache.pluto.invoker.PortletInvoker;
 import org.apache.pluto.om.portlet.PortletDefinition;
 
 /**
@@ -51,6 +49,7 @@
  * With servlet invokers, the servlet request dispatcher is used to call methods on the portlet. 
  * </p>
  * 
+ * @deprecated delete me
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  * @version $Id$
  */

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ServletPortletInvoker.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ServletPortletInvoker.java?rev=706843&r1=706842&r2=706843&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ServletPortletInvoker.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ServletPortletInvoker.java Tue Oct 21 18:34:10 2008
@@ -18,13 +18,9 @@
 
 import java.io.IOException;
 
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequest;
 import javax.portlet.PortletResponse;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
 import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
@@ -35,15 +31,16 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.PortalReservedParameters;
+import org.apache.jetspeed.aggregator.CurrentWorkerContext;
 import org.apache.jetspeed.container.ContainerConstants;
 import org.apache.jetspeed.container.PortletRequestContext;
 import org.apache.jetspeed.factory.PortletFactory;
 import org.apache.jetspeed.factory.PortletInstance;
-import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.aggregator.CurrentWorkerContext;
-import org.apache.pluto.om.portlet.PortletDefinition;
 import org.apache.jetspeed.om.portlet.PortletApplication;
 import org.apache.jetspeed.om.servlet.WebApplicationDefinition;
+import org.apache.jetspeed.request.RequestContext;
+import org.apache.pluto.om.portlet.PortletDefinition;
+import org.apache.pluto.spi.FilterManager;
 
 /**
  * ServletPortletInvoker invokes portlets in another web application, calling a 
@@ -81,13 +78,8 @@
      * to find the real servlet request or servlet response.
      */
     protected PortletRequestResponseUnwrapper requestResponseUnwrapper;
-
-    public ServletPortletInvoker()
-    {
-        this(new DefaultPortletRequestResponseUnwrapper());
-    }
     
-    public ServletPortletInvoker(PortletRequestResponseUnwrapper requestResponseUnwrapper)
+    public ServletPortletInvoker(PortletRequestResponseUnwrapper requestResponseUnwrapper, String servletMappingName)
     {
         this.requestResponseUnwrapper = requestResponseUnwrapper;
     }
@@ -120,50 +112,6 @@
         activated = true;
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.container.invoker.JetspeedPortletInvoker#activate(PortletFactory,org.apache.pluto.om.portlet.PortletDefinition, javax.servlet.ServletConfig, java.lang.String)
-     */
-    public void activate(PortletFactory portletFactory, PortletDefinition portletDefinition, ServletConfig servletConfig, String servletMappingName)
-    {
-        this.servletMappingName = servletMappingName;
-        activate(portletFactory, portletDefinition, servletConfig);
-    }
-
-    /**
-     *
-     * @param request
-     * @param response
-     * @throws PortletException
-     */
-    public void render(RenderRequest request, RenderResponse response) throws PortletException, IOException
-    {
-        invoke(request, response, ContainerConstants.METHOD_RENDER);
-    }
-
-    /**
-     *
-     */
-    public void action(ActionRequest request, ActionResponse response) throws PortletException, IOException
-    {
-        invoke(request, response, ContainerConstants.METHOD_ACTION);
-    }
-
-    /**
-     *
-     */
-    public void load(PortletRequest request, RenderResponse response) throws PortletException
-    {
-        try
-        {
-            invoke(request, response, ContainerConstants.METHOD_NOOP);
-        }
-        catch (IOException e)
-        {
-            log.error("ServletPortletInvokerImpl.load() - Error while dispatching portlet.", e);
-            throw new PortletException(e);
-        }
-    }
-
     /**
      * Creates a servlet request dispatcher to dispatch to another web application to render the portlet.
      * NOTE: this method requires that your container supports cross-context dispatching.
@@ -175,7 +123,7 @@
      * @throws PortletException
      * @throws IOException
      */
-    protected void invoke(PortletRequest portletRequest, PortletResponse portletResponse, Integer methodID)
+    public void invoke(PortletRequest portletRequest, PortletResponse portletResponse, Integer methodID, FilterManager filter)
         throws PortletException, IOException
     {
         // In case of parallel mode, the portletDefinition member is not thread-safe.

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ServletPortletInvokerFactory.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ServletPortletInvokerFactory.java?rev=706843&r1=706842&r2=706843&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ServletPortletInvokerFactory.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ServletPortletInvokerFactory.java Tue Oct 21 18:34:10 2008
@@ -19,7 +19,7 @@
 /**
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  * @version $Id: $
- *
+ * @deprecated delete me
  */
 public class ServletPortletInvokerFactory 
 {

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/namespace/JetspeedNamespaceMapper.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/namespace/JetspeedNamespaceMapper.java?rev=706843&r1=706842&r2=706843&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/namespace/JetspeedNamespaceMapper.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/namespace/JetspeedNamespaceMapper.java Tue Oct 21 18:34:10 2008
@@ -16,7 +16,7 @@
  */
 package org.apache.jetspeed.container.namespace;
 
-import org.apache.pluto.util.NamespaceMapper;
+import org.apache.pluto.NamespaceMapper;
 
 /**
  * Jetspeed NamespaceMapper interface extension

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/namespace/JetspeedNamespaceMapperImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/namespace/JetspeedNamespaceMapperImpl.java?rev=706843&r1=706842&r2=706843&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/namespace/JetspeedNamespaceMapperImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/namespace/JetspeedNamespaceMapperImpl.java Tue Oct 21 18:34:10 2008
@@ -16,7 +16,7 @@
  */
 package org.apache.jetspeed.container.namespace;
 
-import org.apache.pluto.om.portlet.ObjectID;
+import org.apache.pluto.PortletWindowID;
 
 
 /**
@@ -33,7 +33,7 @@
     public JetspeedNamespaceMapperImpl(String prefix)
     {
         this.prefix = prefix;
-        if ( this.prefix == null )
+        if (this.prefix == null)
         {
             this.prefix = DEFAULT_PREFIX;
         }        
@@ -44,79 +44,72 @@
         this(null);
     }
     
-    public String getPrefix()
+    /*
+     * Public Pluto APIs, encode, decode on PortletWindowID, String
+     */
+    public String encode(PortletWindowID namespace, String name)
     {
-        return prefix;
+        return encode(namespace.toString(), name);        
     }
     
-    public String encode(String ns, String name)
-    {
-        return join(prefix,ns,"_",name,null,null);
-    }
-
-    public String encode(String ns1, String ns2, String name)
+    public String decode(PortletWindowID namespace, String name)
     {
-        return join(prefix,ns1,"_",ns2,"_",name);
+        return decode(namespace.toString(), name);
     }
-
-    public String decode(String ns, String name)
-    {
-        if (!name.startsWith(prefix)) return null;
-        String tmp = join(prefix,ns,"_",null,null,null);
-        if (!name.startsWith(tmp)) return null;
-        return name.substring(tmp.length());
-    }
-
-    public String encode(long id, String name)
+    
+    /*
+     * Jetspeed API, getPrefix
+     */    
+    public String getPrefix()
     {
-        return encode(new Long(id).toString(),name);
+        return prefix;
     }
-
-    /* (non-Javadoc)
-     * @see org.apache.pluto.util.NamespaceMapper#encode(org.apache.pluto.om.common.ObjectID, java.lang.String)
+    
+    /*
+     * Implementation
      */
-    public String encode(ObjectID ns, String name)
+    protected String encode(String ns, String name)
     {
-        return encode(ns.toString(),name);
+        return join(prefix, ns, "_", name, null, null);
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.pluto.util.NamespaceMapper#encode(org.apache.pluto.om.common.ObjectID, org.apache.pluto.om.common.ObjectID, java.lang.String)
-     */
-    public String encode(ObjectID ns1, ObjectID ns2, String name)
+    public String encode(String ns1, String ns2, String name)
     {
-        return encode(ns1.toString(),ns2.toString(),name);
+        return join(prefix, ns1, "_", ns2, "_", name);
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.pluto.util.NamespaceMapper#decode(org.apache.pluto.om.common.ObjectID, java.lang.String)
-     */
-    public String decode(ObjectID ns, String name)
+    public String decode(String ns, String name)
     {
-        return decode(ns.toString(),name);
+        if (!name.startsWith(prefix))
+            return null;
+        String tmp = join(prefix, ns, "_", null, null, null);
+        if (!name.startsWith(tmp))
+            return null;
+        return name.substring(tmp.length());
     }
     
-    private static String join(String s1, String s2, String s3, String s4, String s5, String s6)
+    protected static String join(String s1, String s2, String s3, String s4,
+            String s5, String s6)
     {
         int len = 0;
         if (s1 != null)
         {
-            len+=s1.length();
+            len += s1.length();
             if (s2 != null)
             {
-                len+=s2.length();
+                len += s2.length();
                 if (s3 != null)
                 {
-                    len+=s3.length();
+                    len += s3.length();
                     if (s4 != null)
                     {
-                        len+=s4.length();
+                        len += s4.length();
                         if (s5 != null)
                         {
-                            len+=s5.length();
+                            len += s5.length();
                             if (s6 != null)
                             {
-                                len+=s6.length();
+                                len += s6.length();
                             }
                         }
                     }
@@ -125,35 +118,35 @@
         }
         char[] buffer = new char[len];
         int index = 0;
-        if (s1 != null) 
+        if (s1 != null)
         {
             len = s1.length();
-            s1.getChars(0,len,buffer,index);
-            index+= len;
-            if (s2 != null) 
+            s1.getChars(0, len, buffer, index);
+            index += len;
+            if (s2 != null)
             {
                 len = s2.length();
-                s2.getChars(0,len,buffer,index);
-                index+= len;
-                if (s3 != null) 
+                s2.getChars(0, len, buffer, index);
+                index += len;
+                if (s3 != null)
                 {
                     len = s3.length();
-                    s3.getChars(0,len,buffer,index);
-                    index+= len;
-                    if (s4 != null) 
+                    s3.getChars(0, len, buffer, index);
+                    index += len;
+                    if (s4 != null)
                     {
                         len = s4.length();
-                        s4.getChars(0,len,buffer,index);
-                        index+= len;
-                        if (s5 != null) 
+                        s4.getChars(0, len, buffer, index);
+                        index += len;
+                        if (s5 != null)
                         {
                             len = s5.length();
-                            s5.getChars(0,len,buffer,index);
-                            index+= len;
-                            if (s6 != null) 
+                            s5.getChars(0, len, buffer, index);
+                            index += len;
+                            if (s6 != null)
                             {
                                 len = s6.length();
-                                s6.getChars(0,len,buffer,index);
+                                s6.getChars(0, len, buffer, index);
                             }
                         }
                     }

Added: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/EventProviderImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/EventProviderImpl.java?rev=706843&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/EventProviderImpl.java (added)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/EventProviderImpl.java Tue Oct 21 18:34:10 2008
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.container.providers;
+
+import java.io.Serializable;
+
+import javax.xml.namespace.QName;
+
+import org.apache.pluto.EventContainer;
+import org.apache.pluto.spi.EventProvider;
+
+/**
+ * TODO: 2.2 implement 
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class EventProviderImpl implements EventProvider, Cloneable
+{
+    public EventProviderImpl()
+    {}
+    
+    public void fireEvents(EventContainer eventContainer)
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    public void registerToFireEvent(QName name, Serializable value)
+            throws IllegalArgumentException
+    {
+        throw new UnsupportedOperationException();
+    }
+}

Added: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/FilterManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/FilterManagerImpl.java?rev=706843&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/FilterManagerImpl.java (added)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/FilterManagerImpl.java Tue Oct 21 18:34:10 2008
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.container.providers;
+
+import java.io.IOException;
+
+import javax.portlet.EventPortlet;
+import javax.portlet.Portlet;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletResponse;
+import javax.portlet.ResourceServingPortlet;
+
+import org.apache.pluto.spi.FilterManager;
+
+/**
+ * TODO: 2.2 implement 
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class FilterManagerImpl implements FilterManager
+{
+    public FilterManagerImpl()
+    {}
+    
+    public void processFilter(PortletRequest req, PortletResponse res, ClassLoader loader, Portlet portlet,PortletContext portletContext)
+        throws PortletException, IOException
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    public void processFilter(PortletRequest req, PortletResponse res, ClassLoader loader, ResourceServingPortlet resourceServingPortlet,PortletContext portletContext)
+            throws PortletException, IOException
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    public void processFilter(PortletRequest req, PortletResponse res, ClassLoader loader, EventPortlet eventPortlet,PortletContext portletContext)
+            throws PortletException, IOException
+    {
+        throw new UnsupportedOperationException();
+    }
+}

Added: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLListenerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLListenerImpl.java?rev=706843&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLListenerImpl.java (added)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLListenerImpl.java Tue Oct 21 18:34:10 2008
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.container.providers;
+
+import javax.portlet.BaseURL;
+
+import org.apache.pluto.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.spi.PortletURLListener;
+
+/**
+ * TODO: 2.2 implement 
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class PortletURLListenerImpl implements PortletURLListener
+{
+    public PortletURLListenerImpl()
+    {}
+    
+    public void callListener(PortletApplicationDefinition portletApp, BaseURL baseURL, boolean isAction, boolean isResource)
+    {
+        throw new UnsupportedOperationException();        
+    }
+
+}

Copied: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLProviderImpl.java (from r705397, portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/information/PortletURLProviderImpl.java)
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLProviderImpl.java?p2=portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLProviderImpl.java&p1=portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/information/PortletURLProviderImpl.java&r1=705397&r2=706843&rev=706843&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/information/PortletURLProviderImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLProviderImpl.java Tue Oct 21 18:34:10 2008
@@ -14,21 +14,22 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jetspeed.services.information;
+package org.apache.jetspeed.container.providers;
 
 import java.util.Map;
 
 import javax.portlet.PortletMode;
 import javax.portlet.WindowState;
+import javax.servlet.http.HttpServletRequest;
 
 import org.apache.jetspeed.container.url.PortalURL;
 import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.container.PortletWindow;
-import org.apache.pluto.services.information.PortletURLProvider;
+import org.apache.pluto.PortletWindow;
+import org.apache.pluto.spi.PortletURLProvider;
 
 /**
  * Provides access to the Portal URL manipulation 
- * 
+ * TODO: 2.2 implement Portlet API 2.0 features: see methods below throwing UnsupportedOperationException
  *
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  * @version $Id$
@@ -85,4 +86,44 @@
     {
         return url.createPortletURL(portletWindow,parameters,mode,state,action,secure);
     }
+
+    public String[] getPrivateRenderParameters(String name)
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    public String[] getPublicRenderParameters(String name)
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    public boolean isResourceServing()
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    public boolean isSecureSupported()
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    public void savePortalURL(HttpServletRequest request)
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    public void setAction(boolean isAction)
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    public void setPublicRenderParameters(Map parameters)
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    public void setResourceServing(boolean isResourceServing)
+    {
+        throw new UnsupportedOperationException();
+    }
 }

Propchange: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLProviderImpl.java
------------------------------------------------------------------------------
    cvs2svn:cvs-rev = 1.10

Propchange: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLProviderImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLProviderImpl.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLProviderImpl.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Added: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/RequestPropertyProviderImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/RequestPropertyProviderImpl.java?rev=706843&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/RequestPropertyProviderImpl.java (added)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/RequestPropertyProviderImpl.java Tue Oct 21 18:34:10 2008
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.container.providers;
+
+import java.util.Collections;
+import java.util.Map;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import org.w3c.dom.Element;
+
+import org.apache.pluto.spi.RequestPropertyProvider;
+import org.apache.jetspeed.container.PortletWindow;
+
+/**
+ * TODO: 2.2 implement 
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class RequestPropertyProviderImpl implements RequestPropertyProvider
+{
+    public RequestPropertyProviderImpl(HttpServletRequest request, PortletWindow portletWindow) 
+    {}
+    
+    public Map getProperties(HttpServletRequest request,
+            PortletWindow portletWindow)
+    {
+        // TODO: currently this method returns an empty map.
+        return Collections.EMPTY_MAP;
+    }
+
+    public void setProperty(HttpServletRequest request,
+            PortletWindow portletWindow, String property, String value)
+    {
+        request.setAttribute(property + portletWindow.getId().getStringId()
+                + "__str", value);
+    }
+
+    public void addProperty(HttpServletRequest request,
+            PortletWindow portletWindow, String property, String value)
+    {
+        if (request
+                .getAttribute(property + portletWindow.getId().getStringId()) == null)
+        {
+            request.setAttribute(
+                    property + portletWindow.getId().getStringId(), value);
+        }
+        else
+        {
+            String[] tmp = (String[]) request.getAttribute(property
+                    + portletWindow.getId().getStringId() + "__str");
+            String[] values = new String[tmp.length];
+            for (int i = 0; i < tmp.length; i++)
+            {
+                values[i] = tmp[i];
+            }
+            values[tmp.length] = value;
+        }
+    }
+
+    public void addProperty(HttpServletRequest request,
+            PortletWindow portletWindow, String property, Element value)
+    {
+        if (request
+                .getAttribute(property + portletWindow.getId().getStringId()) == null)
+        {
+            request.setAttribute(
+                    property + portletWindow.getId().getStringId(), value);
+        }
+        else
+        {
+            String[] tmp = (String[]) request.getAttribute(property
+                    + portletWindow.getId().getStringId() + "__str");
+            String[] values = new String[tmp.length];
+            for (int i = 0; i < tmp.length; i++)
+            {
+                values[i] = tmp[i];
+            }
+            values[tmp.length] = value.toString();
+        }
+
+    }
+
+    public void addProperty(HttpServletRequest request,
+            PortletWindow portletWindow, Cookie cookie)
+    {
+        if (request.getAttribute(portletWindow.getId().getStringId() + "__coo") == null)
+        {
+            request.setAttribute(portletWindow.getId().getStringId() + "__coo",
+                    cookie);
+        }
+        else
+        {
+            Cookie[] tmp = (Cookie[]) request.getAttribute(portletWindow
+                    .getId().getStringId()
+                    + "__coo");
+            Cookie[] values = new Cookie[tmp.length];
+            for (int i = 0; i < tmp.length; i++)
+            {
+                values[i] = tmp[i];
+            }
+            values[tmp.length] = cookie;
+        }
+    }
+
+    public Cookie[] getPropertyCookie(HttpServletRequest request,
+            PortletWindow portletWindow)
+    {
+        return (Cookie[]) request.getAttribute(portletWindow.getId()
+                .getStringId()
+                + "__coo");
+    }
+    
+    
+}

Copied: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/ResourceURLProviderImpl.java (from r705397, portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/information/ResourceURLProviderImpl.java)
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/ResourceURLProviderImpl.java?p2=portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/ResourceURLProviderImpl.java&p1=portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/information/ResourceURLProviderImpl.java&r1=705397&r2=706843&rev=706843&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/information/ResourceURLProviderImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/ResourceURLProviderImpl.java Tue Oct 21 18:34:10 2008
@@ -14,11 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jetspeed.services.information;
+package org.apache.jetspeed.container.providers;
+
+import java.net.MalformedURLException;
+import java.net.URL;
 
 import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.container.PortletWindow;
-import org.apache.pluto.services.information.ResourceURLProvider;
+import org.apache.pluto.PortletWindow;
+import org.apache.pluto.spi.ResourceURLProvider;
 
 /**
  * <p>
@@ -26,17 +29,22 @@
  * </p>
  * 
  * 
- * @
- * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
+ * @ * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
+ * 
  * @version $ $
- *
+ * 
  */
 public class ResourceURLProviderImpl implements ResourceURLProvider
 {
+
     private String stringUrl = "";
 
-    public ResourceURLProviderImpl(RequestContext context, PortletWindow portletWindow)
+    private String base = "";
+
+    public ResourceURLProviderImpl(RequestContext context,
+            PortletWindow portletWindow)
     {
+        this.base = context.getPortalURL().getBaseURL();
     }
 
     public void setAbsoluteURL(String path)
@@ -46,12 +54,26 @@
 
     public void setFullPath(String path)
     {
-        stringUrl = path;
+        stringUrl = base + path;
     }
 
     public String toString()
     {
-        return stringUrl;
+        URL url = null;
+
+        if (!"".equals(stringUrl))
+        {
+            try
+            {
+                url = new URL(stringUrl);
+            }
+            catch (MalformedURLException e)
+            {
+                throw new java.lang.IllegalArgumentException(
+                        "A malformed URL has occured");
+            }
+        }
+        return ((url == null) ? "" : url.toString());
     }
 
 }

Propchange: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/ResourceURLProviderImpl.java
------------------------------------------------------------------------------
    cvs2svn:cvs-rev = 1.4

Propchange: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/ResourceURLProviderImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/ResourceURLProviderImpl.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/ResourceURLProviderImpl.java
------------------------------------------------------------------------------
    svn:mergeinfo = 



---------------------------------------------------------------------
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