portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r756727 - in /portals/jetspeed-2/portal/trunk: components/jetspeed-portlet-factory/src/main/java/org/apache/jetspeed/factory/ jetspeed-api/src/main/java/org/apache/jetspeed/factory/ jetspeed-commons/src/main/java/org/apache/jetspeed/container/
Date Fri, 20 Mar 2009 19:45:32 GMT
Author: ate
Date: Fri Mar 20 19:45:32 2009
New Revision: 756727

URL: http://svn.apache.org/viewvc?rev=756727&view=rev
Log:
JS2-871: Upgrade Pluto container
See: http://issues.apache.org/jira/browse/JS2-871
- improving on PortletInstance implementation and usage of Portlet 2.0 interfaces 

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portlet-factory/src/main/java/org/apache/jetspeed/factory/JetspeedPortletInstance.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/factory/PortletInstance.java
    portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/container/JetspeedContainerServlet.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portlet-factory/src/main/java/org/apache/jetspeed/factory/JetspeedPortletInstance.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portlet-factory/src/main/java/org/apache/jetspeed/factory/JetspeedPortletInstance.java?rev=756727&r1=756726&r2=756727&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portlet-factory/src/main/java/org/apache/jetspeed/factory/JetspeedPortletInstance.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portlet-factory/src/main/java/org/apache/jetspeed/factory/JetspeedPortletInstance.java
Fri Mar 20 19:45:32 2009
@@ -20,11 +20,17 @@
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
+import javax.portlet.EventPortlet;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
 import javax.portlet.Portlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.portlet.ResourceServingPortlet;
 import javax.portlet.UnavailableException;
 
 import org.apache.jetspeed.container.JetspeedPortletConfig;
@@ -109,12 +115,29 @@
       return portlet.toString();
   }
 
+  public void processEvent(EventRequest request, EventResponse response) throws PortletException,
IOException
+  {
+      if (portlet instanceof EventPortlet)
+      {
+          checkAvailable();
+          ((EventPortlet)portlet).processEvent(request, response);
+      }
+  }
 
-/**
- * @return Returns the portlet.
- */
-public Portlet getRealPortlet()
-{
-    return portlet;
-}
+  public void serveResource(ResourceRequest request, ResourceResponse response) throws PortletException,
IOException
+  {
+      if (portlet instanceof ResourceServingPortlet)
+      {
+          checkAvailable();
+          ((ResourceServingPortlet)portlet).serveResource(request, response);
+      }
+  }
+
+  /**
+   * @return Returns the portlet.
+   */
+  public Portlet getRealPortlet()
+  {
+      return portlet;
+  }
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/factory/PortletInstance.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/factory/PortletInstance.java?rev=756727&r1=756726&r2=756727&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/factory/PortletInstance.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/factory/PortletInstance.java
Fri Mar 20 19:45:32 2009
@@ -16,7 +16,9 @@
  */
 package org.apache.jetspeed.factory;
 
+import javax.portlet.EventPortlet;
 import javax.portlet.Portlet;
+import javax.portlet.ResourceServingPortlet;
 
 import org.apache.jetspeed.container.JetspeedPortletConfig;
 
@@ -27,7 +29,7 @@
  * @version $Id$
  *
  */
-public interface PortletInstance extends Portlet
+public interface PortletInstance extends Portlet, EventPortlet, ResourceServingPortlet
 {
     JetspeedPortletConfig getConfig();
     Portlet getRealPortlet();

Modified: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/container/JetspeedContainerServlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/container/JetspeedContainerServlet.java?rev=756727&r1=756726&r2=756727&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/container/JetspeedContainerServlet.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/container/JetspeedContainerServlet.java
Fri Mar 20 19:45:32 2009
@@ -26,14 +26,12 @@
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
-import javax.portlet.EventPortlet;
 import javax.portlet.EventRequest;
 import javax.portlet.EventResponse;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 import javax.portlet.ResourceRequest;
 import javax.portlet.ResourceResponse;
-import javax.portlet.ResourceServingPortlet;
 import javax.portlet.UnavailableException;
 import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletConfig;
@@ -254,17 +252,17 @@
                 RenderResponse renderResponse =  (RenderResponse)pwrc.getPortletResponse();
                 pwrc.getPortletInstance().render(renderRequest, renderResponse);
             }
-            else if (PortletWindowRequestContext.Action.EVENT.equals(pwrc.getAction()) &&
pwrc.getPortletInstance().getRealPortlet() instanceof EventPortlet)
+            else if (PortletWindowRequestContext.Action.EVENT.equals(pwrc.getAction()))
             {
                 EventRequest eventRequest = (EventRequest)pwrc.getPortletRequest();
                 EventResponse eventResponse =  (EventResponse)pwrc.getPortletResponse();
-                ((EventPortlet)pwrc.getPortletInstance().getRealPortlet()).processEvent(eventRequest,
eventResponse);
+                pwrc.getPortletInstance().processEvent(eventRequest, eventResponse);
             }
-            else if (PortletWindowRequestContext.Action.RESOURCE.equals(pwrc.getAction())
&& pwrc.getPortletInstance().getRealPortlet() instanceof ResourceServingPortlet)
+            else if (PortletWindowRequestContext.Action.RESOURCE.equals(pwrc.getAction()))
             {
                 ResourceRequest resourceRequest = (ResourceRequest)pwrc.getPortletRequest();
                 ResourceResponse resourceResponse = (ResourceResponse)pwrc.getPortletResponse();
-                ((ResourceServingPortlet)pwrc.getPortletInstance().getRealPortlet()).serveResource(resourceRequest,
resourceResponse);
+                pwrc.getPortletInstance().serveResource(resourceRequest, resourceResponse);
             }
 
             // if we get this far we are home free



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