portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r587487 - /portals/jetspeed-2/branches/JETSPEED-2.1.3/commons/src/java/org/apache/jetspeed/portlet/PortletObjectProxy.java
Date Tue, 23 Oct 2007 12:53:30 GMT
Author: woonsan
Date: Tue Oct 23 05:53:30 2007
New Revision: 587487

URL: http://svn.apache.org/viewvc?rev=587487&view=rev
Log:
[JS2-784] Adding portlet doesn't work in 2.1.3 trunk!
Fixed.

I reproduced this problem as follows:
 - Set the first constructor-arg of portletFactory bean in registry.xml to create proxy instances
for actual portlet instances. (See JS2-634.)
 - If you restart Tomcat, then portlets using DOJO (implementing SupportsHeaderPhase interface)
do not work.
   e.g) demo::GroovyDojoCustomerList in groovy.psml and j2-admin::CategoryPortletSelector
in selector.psml.

The portlet proxy did not implement SupportsHeaderPhase interface.

Modified:
    portals/jetspeed-2/branches/JETSPEED-2.1.3/commons/src/java/org/apache/jetspeed/portlet/PortletObjectProxy.java

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/commons/src/java/org/apache/jetspeed/portlet/PortletObjectProxy.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/commons/src/java/org/apache/jetspeed/portlet/PortletObjectProxy.java?rev=587487&r1=587486&r2=587487&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/commons/src/java/org/apache/jetspeed/portlet/PortletObjectProxy.java
(original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/commons/src/java/org/apache/jetspeed/portlet/PortletObjectProxy.java
Tue Oct 23 05:53:30 2007
@@ -39,6 +39,7 @@
 import org.apache.pluto.om.portlet.ContentTypeSet;
 
 import org.apache.jetspeed.JetspeedActions;
+import org.apache.jetspeed.portlet.SupportsHeaderPhase;
 import org.apache.jetspeed.util.BaseObjectProxy;
 import org.apache.jetspeed.container.JetspeedPortletConfig;
 
@@ -74,7 +75,17 @@
     {
         Class proxiedClass = proxiedObject.getClass();
         ClassLoader classLoader = proxiedClass.getClassLoader();
-        Class [] proxyInterfaces = new Class [] { Portlet.class };
+        Class [] proxyInterfaces = null;
+        
+        if (proxiedObject instanceof SupportsHeaderPhase)
+        {
+            proxyInterfaces = new Class [] { Portlet.class, SupportsHeaderPhase.class };
+        }
+        else
+        {
+            proxyInterfaces = new Class [] { Portlet.class };
+        }
+        
         InvocationHandler handler = new PortletObjectProxy(proxiedObject);
         return Proxy.newProxyInstance(classLoader, proxyInterfaces, handler);
     }
@@ -117,6 +128,10 @@
             {
                 result = method.invoke(this.portletObject, args);
             }
+        }
+        else if (declaringClass == SupportsHeaderPhase.class)
+        {
+            result = method.invoke(this.portletObject, args);
         }
         else
         {



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