portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddew...@apache.org
Subject svn commit: r503314 - in /portals/pluto/trunk: pluto-container/src/main/java/org/apache/pluto/core/ pluto-container/src/main/java/org/apache/pluto/internal/ pluto-container/src/main/java/org/apache/pluto/internal/impl/ pluto-container/src/main/java/org...
Date Sat, 03 Feb 2007 21:14:07 GMT
Author: ddewolf
Date: Sat Feb  3 13:14:06 2007
New Revision: 503314

URL: http://svn.apache.org/viewvc?view=rev&rev=503314
Log:
Adding version to PortletAppDD; Enabling the environment service; PLUTO-298, PLUTO-296

Added:
    portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultPortletEnvironmentService.java
  (with props)
Modified:
    portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultOptionalContainerServices.java
    portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java
    portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalActionRequest.java
    portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalActionResponse.java
    portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalRenderRequest.java
    portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalRenderResponse.java
    portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletPreferencesImpl.java
    portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletEnvironmentService.java
    portals/pluto/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet/PortletAppDD.java
    portals/pluto/trunk/pluto-descriptor-impl/src/main/resources/org/apache/pluto/descriptors/services/castor/castor-portlet-xml-mapping.xml
    portals/pluto/trunk/pluto-descriptor-impl/src/test/java/org/apache/pluto/descriptors/services/castor/PortletAppDescriptorServiceImplTest.java

Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultOptionalContainerServices.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultOptionalContainerServices.java?view=diff&rev=503314&r1=503313&r2=503314
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultOptionalContainerServices.java
(original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultOptionalContainerServices.java
Sat Feb  3 13:14:06 2007
@@ -47,7 +47,7 @@
         portletPreferencesService = new DefaultPortletPreferencesService();
         portletRegistryService = PortletContextManager.getManager();
         portletInvokerService = new DefaultPortletInvokerService();
-        portletEnvironmentService = null;
+        portletEnvironmentService = new DefaultPortletEnvironmentService();
         portletInfoService = null;
     }
     

Added: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultPortletEnvironmentService.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultPortletEnvironmentService.java?view=auto&rev=503314
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultPortletEnvironmentService.java
(added)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultPortletEnvironmentService.java
Sat Feb  3 13:14:06 2007
@@ -0,0 +1,53 @@
+package org.apache.pluto.core;
+
+import org.apache.pluto.PortletContainer;
+import org.apache.pluto.spi.optional.PortletEnvironmentService;
+import org.apache.pluto.internal.InternalActionRequest;
+import org.apache.pluto.internal.InternalActionResponse;
+import org.apache.pluto.internal.InternalPortletWindow;
+import org.apache.pluto.internal.InternalRenderRequest;
+import org.apache.pluto.internal.InternalRenderResponse;
+import org.apache.pluto.internal.impl.ActionRequestImpl;
+import org.apache.pluto.internal.impl.ActionResponseImpl;
+import org.apache.pluto.internal.impl.RenderRequestImpl;
+import org.apache.pluto.internal.impl.RenderResponseImpl;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ *
+ */
+public class DefaultPortletEnvironmentService implements PortletEnvironmentService {
+
+
+    public InternalActionRequest createActionRequest(PortletContainer container,
+                                                     HttpServletRequest request,
+                                                     HttpServletResponse response,
+                                                     InternalPortletWindow internalPortletWindow)
{
+        return new ActionRequestImpl(container, internalPortletWindow, request);
+    }
+
+    public InternalActionResponse createActionResponse(PortletContainer container,
+                                                       HttpServletRequest request,
+                                                       HttpServletResponse response,
+                                                       InternalPortletWindow internalPortletWindow)
{
+        return new ActionResponseImpl(container, internalPortletWindow, request, response);
+    }
+
+    public InternalRenderRequest createRenderRequest(PortletContainer container,
+                                                     HttpServletRequest request,
+                                                     HttpServletResponse response,
+                                                     InternalPortletWindow internalPortletWindow)
{
+        return new RenderRequestImpl(container, internalPortletWindow, request);
+    }
+
+    public InternalRenderResponse createRenderResponse(PortletContainer container,
+                                                       HttpServletRequest request,
+                                                       HttpServletResponse response,
+                                                       InternalPortletWindow internalPortletWindow)
{
+        return new RenderResponseImpl(container, internalPortletWindow, request, response);
+    }
+
+
+}

Propchange: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultPortletEnvironmentService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultPortletEnvironmentService.java
------------------------------------------------------------------------------
    svn:keywords = Id Author Date Rev

Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java?view=diff&rev=503314&r1=503313&r2=503314
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java
(original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java
Sat Feb  3 13:14:06 2007
@@ -29,11 +29,11 @@
 import org.apache.pluto.descriptors.portlet.PortletAppDD;
 import org.apache.pluto.internal.InternalPortletWindow;
 import org.apache.pluto.internal.PortletDescriptorRegistry;
-import org.apache.pluto.internal.impl.ActionRequestImpl;
-import org.apache.pluto.internal.impl.ActionResponseImpl;
+import org.apache.pluto.internal.InternalActionResponse;
+import org.apache.pluto.internal.InternalRenderRequest;
+import org.apache.pluto.internal.InternalRenderResponse;
+import org.apache.pluto.internal.InternalActionRequest;
 import org.apache.pluto.internal.impl.PortletWindowImpl;
-import org.apache.pluto.internal.impl.RenderRequestImpl;
-import org.apache.pluto.internal.impl.RenderResponseImpl;
 import org.apache.pluto.spi.PortletURLProvider;
 import org.apache.pluto.spi.optional.PortletInvokerService;
 import org.apache.pluto.OptionalContainerServices;
@@ -152,11 +152,12 @@
         		new PortletWindowImpl(servletContext, portletWindow);
         debugWithName("Render request received for portlet: "
         		+ portletWindow.getPortletName());
-        
-        RenderRequestImpl renderRequest = new RenderRequestImpl(
-        		this, internalPortletWindow, request);
-        RenderResponseImpl renderResponse = new RenderResponseImpl(
-        		this, internalPortletWindow, request, response);
+
+        InternalRenderRequest renderRequest = getOptionalContainerServices().getPortletEnvironmentService()
+            .createRenderRequest(this, request, response, internalPortletWindow);
+
+        InternalRenderResponse renderResponse = getOptionalContainerServices().getPortletEnvironmentService()
+            .createRenderResponse(this, request, response, internalPortletWindow);
 
         PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
 
@@ -171,6 +172,7 @@
         		+ portletWindow.getPortletName());
     }
 
+
     /**
      * Process action for the portlet associated with the given portlet window.
      * @param portletWindow  the portlet window.
@@ -193,12 +195,13 @@
             	new PortletWindowImpl(servletContext, portletWindow);
     	debugWithName("Action request received for portlet: "
     			+ portletWindow.getPortletName());
-    	
-        ActionRequestImpl actionRequest = new ActionRequestImpl(
-        		this, internalPortletWindow, request);
-        ActionResponseImpl actionResponse = new ActionResponseImpl(
-        		this, internalPortletWindow, request, response);
-        
+
+        InternalActionRequest actionRequest = getOptionalContainerServices().getPortletEnvironmentService()
+            .createActionRequest(this, request, response, internalPortletWindow);
+
+        InternalActionResponse actionResponse = getOptionalContainerServices().getPortletEnvironmentService()
+            .createActionResponse(this, request, response, internalPortletWindow); 
+
         PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
 
         try {
@@ -278,12 +281,14 @@
         		new PortletWindowImpl(servletContext, portletWindow);
         debugWithName("Load request received for portlet: "
         		+ portletWindow.getPortletName());
-        
-        RenderRequestImpl renderRequest = new RenderRequestImpl(
-        		this, internalPortletWindow, request);
-        RenderResponseImpl renderResponse = new RenderResponseImpl(
-        		this, internalPortletWindow, request, response);
-        
+
+        InternalRenderRequest renderRequest =
+            getOptionalContainerServices().getPortletEnvironmentService()
+                .createRenderRequest(this, request, response, internalPortletWindow);
+        InternalRenderResponse renderResponse =
+            getOptionalContainerServices().getPortletEnvironmentService()
+                .createRenderResponse(this, request, response, internalPortletWindow);
+
         PortletInvokerService invoker = optionalContainerServices.getPortletInvokerService();
 
         try {
@@ -398,6 +403,7 @@
             LOG.info("Portlet Container [" + name + "]: " + message);
         }
     }
-    
+
+
 }
 

Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalActionRequest.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalActionRequest.java?view=diff&rev=503314&r1=503313&r2=503314
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalActionRequest.java
(original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalActionRequest.java
Sat Feb  3 13:14:06 2007
@@ -15,13 +15,15 @@
  */
 package org.apache.pluto.internal;
 
+import javax.portlet.ActionRequest;
+
 /**
  * The internal action request extends the internal portlet request and provides
  * some action-specific methods (currently, no specific methods are declared).
  * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>
  * @since 2006-02-17
  */
-public interface InternalActionRequest extends InternalPortletRequest {
+public interface InternalActionRequest extends InternalPortletRequest, ActionRequest {
 	
 
 }

Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalActionResponse.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalActionResponse.java?view=diff&rev=503314&r1=503313&r2=503314
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalActionResponse.java
(original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalActionResponse.java
Sat Feb  3 13:14:06 2007
@@ -19,13 +19,14 @@
 
 import javax.portlet.PortletMode;
 import javax.portlet.WindowState;
+import javax.portlet.ActionResponse;
 
 /**
  * The internal action response interface extends the internal portlet response
  * interface and provides some action-specific methods.
  * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>
  */
-public interface InternalActionResponse extends InternalPortletResponse {
+public interface InternalActionResponse extends InternalPortletResponse, ActionResponse {
 
     /**
      * Retrieves the render parameters associated with this response.
@@ -51,6 +52,9 @@
      * @return the redirect location.
      */
     public String getRedirectLocation();
+
+
+    public String encodeRedirectURL(String url);
     
 }
 

Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalRenderRequest.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalRenderRequest.java?view=diff&rev=503314&r1=503313&r2=503314
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalRenderRequest.java
(original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalRenderRequest.java
Sat Feb  3 13:14:06 2007
@@ -15,13 +15,15 @@
  */
 package org.apache.pluto.internal;
 
+import javax.portlet.RenderRequest;
+
 /**
  * The internal render request interface extends the internal portlet request
  * interface and provides some render-specific methods.
  * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>
  * @since 2006-02-17
  */
-public interface InternalRenderRequest extends InternalPortletRequest {
+public interface InternalRenderRequest extends InternalPortletRequest, RenderRequest {
 	
     public void setIncluded(boolean included);
     

Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalRenderResponse.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalRenderResponse.java?view=diff&rev=503314&r1=503313&r2=503314
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalRenderResponse.java
(original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalRenderResponse.java
Sat Feb  3 13:14:06 2007
@@ -15,13 +15,15 @@
  */
 package org.apache.pluto.internal;
 
+import javax.portlet.RenderResponse;
+
 /**
  * The internal render response interface extends the internal portlet response
  * interface and provides some render-specific methods.
  * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>
  * @since 2006-02-17
  */
-public interface InternalRenderResponse extends InternalPortletResponse {
+public interface InternalRenderResponse extends InternalPortletResponse, RenderResponse {
 	
     public void setIncluded(boolean included);
 

Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletPreferencesImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletPreferencesImpl.java?view=diff&rev=503314&r1=503313&r2=503314
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletPreferencesImpl.java
(original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletPreferencesImpl.java
Sat Feb  3 13:14:06 2007
@@ -45,8 +45,8 @@
  * Implementation of the <code>javax.portlet.PortletPreferences</code>
  * interface.
  * 
- * @see org.apache.pluto.core.PortletPreference
- * @see org.apache.pluto.core.impl.PortletPreferenceImpl
+ * @see PortletPreferences
+ * @see PortletPreferenceImpl
  * 
  * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
  * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>
@@ -90,7 +90,7 @@
     /**
      * Constructs an instance.
      * @param container  the portlet container.
-     * @param portletWindow  the internal portlet window.
+     * @param window  the internal portlet window.
      * @param request  the internal portlet request.
      * @param methodId  the request method ID: render request or action request.
      */

Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletEnvironmentService.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletEnvironmentService.java?view=diff&rev=503314&r1=503313&r2=503314
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletEnvironmentService.java
(original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletEnvironmentService.java
Sat Feb  3 13:14:06 2007
@@ -15,38 +15,48 @@
  */
 package org.apache.pluto.spi.optional;
 
-import org.apache.pluto.internal.InternalPortletWindow;
+import org.apache.pluto.PortletContainer;
+import org.apache.pluto.internal.InternalActionResponse;
 import org.apache.pluto.internal.InternalPortletRequest;
 import org.apache.pluto.internal.InternalPortletResponse;
-import org.apache.pluto.internal.InternalActionResponse;
+import org.apache.pluto.internal.InternalPortletWindow;
+import org.apache.pluto.internal.InternalRenderRequest;
+import org.apache.pluto.internal.InternalActionRequest;
+import org.apache.pluto.internal.InternalRenderResponse;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 /**
  * Factory Service for creating Portlet request and responses.
- * <a href="mailto:zheng@apache.org">ZHENG Zhong</a>
+ *
+ * @author David H. DeWolf
+ * @since 1.1.0
  */
 public interface PortletEnvironmentService {
-	
-	public InternalPortletRequest createActionRequest(
-			HttpServletRequest servletRequest,
-			HttpServletResponse servletResponse,
-			InternalPortletWindow internalPortletWindow);
-	
-	public InternalActionResponse createActionRespose(
-			HttpServletRequest servletRequest,
-			HttpServletResponse servletResponse,
-			InternalPortletWindow internalPortletWindow);
-	
-	public InternalPortletRequest createRenderRequest(
-			HttpServletRequest servletRequest,
-			HttpServletResponse servletResponse,
-			InternalPortletWindow internalPortletWindow);
-	
-	public InternalPortletResponse createRenderRespose(
-			HttpServletRequest servletRequest,
-			HttpServletResponse servletResponse,
-			InternalPortletWindow internalPortletWindow);
-	
+
+    public InternalActionRequest createActionRequest(
+        PortletContainer container,
+        HttpServletRequest servletRequest,
+        HttpServletResponse servletResponse,
+        InternalPortletWindow internalPortletWindow);
+
+    public InternalActionResponse createActionResponse(
+        PortletContainer container,
+        HttpServletRequest servletRequest,
+        HttpServletResponse servletResponse,
+        InternalPortletWindow internalPortletWindow);
+
+    public InternalRenderRequest createRenderRequest(
+        PortletContainer container,
+        HttpServletRequest servletRequest,
+        HttpServletResponse servletResponse,
+        InternalPortletWindow internalPortletWindow);
+
+    public InternalRenderResponse createRenderResponse(
+        PortletContainer container,
+        HttpServletRequest servletRequest,
+        HttpServletResponse servletResponse,
+        InternalPortletWindow internalPortletWindow);
+
 }

Modified: portals/pluto/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet/PortletAppDD.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet/PortletAppDD.java?view=diff&rev=503314&r1=503313&r2=503314
==============================================================================
--- portals/pluto/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet/PortletAppDD.java
(original)
+++ portals/pluto/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet/PortletAppDD.java
Sat Feb  3 13:14:06 2007
@@ -27,6 +27,9 @@
  */
 public class PortletAppDD {
 
+    /** PortletApplication descriptor version */
+    private String version;
+
     /** The defined portlets within the system. */
     private List portlets = new ArrayList();
 
@@ -46,6 +49,15 @@
      * Default Constructor.
      */
     public PortletAppDD() {
+    }
+
+
+    public String getVersion() {
+        return version;
+    }
+
+    public void setVersion(String version) {
+        this.version = version;
     }
 
     /**

Modified: portals/pluto/trunk/pluto-descriptor-impl/src/main/resources/org/apache/pluto/descriptors/services/castor/castor-portlet-xml-mapping.xml
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-descriptor-impl/src/main/resources/org/apache/pluto/descriptors/services/castor/castor-portlet-xml-mapping.xml?view=diff&rev=503314&r1=503313&r2=503314
==============================================================================
--- portals/pluto/trunk/pluto-descriptor-impl/src/main/resources/org/apache/pluto/descriptors/services/castor/castor-portlet-xml-mapping.xml
(original)
+++ portals/pluto/trunk/pluto-descriptor-impl/src/main/resources/org/apache/pluto/descriptors/services/castor/castor-portlet-xml-mapping.xml
Sat Feb  3 13:14:06 2007
@@ -25,6 +25,11 @@
 
     <class name="org.apache.pluto.descriptors.portlet.PortletAppDD">
         <map-to xml="portlet-app"/>
+
+        <field name="Version">
+            <bind-xml name="version" node="attribute"/>
+        </field>
+
         <field name="Portlets"
                type="org.apache.pluto.descriptors.portlet.PortletDD"
                collection="arraylist">

Modified: portals/pluto/trunk/pluto-descriptor-impl/src/test/java/org/apache/pluto/descriptors/services/castor/PortletAppDescriptorServiceImplTest.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-descriptor-impl/src/test/java/org/apache/pluto/descriptors/services/castor/PortletAppDescriptorServiceImplTest.java?view=diff&rev=503314&r1=503313&r2=503314
==============================================================================
--- portals/pluto/trunk/pluto-descriptor-impl/src/test/java/org/apache/pluto/descriptors/services/castor/PortletAppDescriptorServiceImplTest.java
(original)
+++ portals/pluto/trunk/pluto-descriptor-impl/src/test/java/org/apache/pluto/descriptors/services/castor/PortletAppDescriptorServiceImplTest.java
Sat Feb  3 13:14:06 2007
@@ -42,6 +42,7 @@
         InputStream in = new ByteArrayInputStream(xml.toString().getBytes());
 
         PortletAppDD dd = service.read(in);
+        assertEquals("1.0", dd.getVersion());
         assertEquals(0, dd.getPortlets().size());
         assertEquals(2, dd.getCustomPortletModes().size());
         assertEquals(2, dd.getCustomWindowStates().size());



Mime
View raw message