cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r365667 - in /cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal: pluto/adapter/PortletAdapter.java pluto/om/ServletDefinitionListImpl.java profile/impl/GroupBasedProfileManager.java
Date Tue, 03 Jan 2006 15:58:37 GMT
Author: cziegeler
Date: Tue Jan  3 07:58:30 2006
New Revision: 365667

URL: http://svn.apache.org/viewcvs?rev=365667&view=rev
Log:
Clean up and possible fix for portlet mode and window state handling

Modified:
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/pluto/adapter/PortletAdapter.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/pluto/om/ServletDefinitionListImpl.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/pluto/adapter/PortletAdapter.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/pluto/adapter/PortletAdapter.java?rev=365667&r1=365666&r2=365667&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/pluto/adapter/PortletAdapter.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/pluto/adapter/PortletAdapter.java
Tue Jan  3 07:58:30 2006
@@ -313,26 +313,24 @@
                              service.getProfileManager().getUser().getUserInfos());
         }
         objectModel.put("portlet-response",  res);
-        objectModel.put("portlet-request", req);        
+        objectModel.put("portlet-request", req);
+        // change portlet mode and window state
+        final InformationProviderService ips = (InformationProviderService)this.portletContainerEnvironment.getContainerService(InformationProviderService.class);
+        final DynamicInformationProvider dynProv = ips.getDynamicProvider(req);
+        final PortletActionProvider pap = dynProv.getPortletActionProvider(event.getPortletWindow());
+
+        final PortletMode mode = event.getPortletMode();
+        if ( mode != null ) {
+            pap.changePortletMode(mode);
+        }
+        final WindowState state = event.getWindowState();
+        if ( state != null ) {
+            pap.changePortletWindowState(state);
+        }
         if ( event.isAction() ) {
             // This means we can only have ONE portlet event per request!
             objectModel.put("portlet-event", event);
         } else {
-            DynamicInformationProvider dynProv;
-            InformationProviderService ips;
-            PortletActionProvider pap;
-
-            ips = (InformationProviderService)this.portletContainerEnvironment.getContainerService(InformationProviderService.class);
-            dynProv = ips.getDynamicProvider(req);
-            pap = dynProv.getPortletActionProvider(event.getPortletWindow());
-            final PortletMode mode = event.getPortletMode();
-            if ( mode != null ) {
-                pap.changePortletMode(mode);
-            }
-            final WindowState state = event.getWindowState();
-            if ( state != null ) {
-                pap.changePortletWindowState(state);
-            }
             ((PortletActionProviderImpl)pap).changeRenderParameters(event.getParameters());
         }
     }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/pluto/om/ServletDefinitionListImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/pluto/om/ServletDefinitionListImpl.java?rev=365667&r1=365666&r2=365667&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/pluto/om/ServletDefinitionListImpl.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/pluto/om/ServletDefinitionListImpl.java
Tue Jan  3 07:58:30 2006
@@ -24,7 +24,6 @@
 import org.apache.pluto.om.servlet.ServletDefinitionList;
 import org.apache.pluto.om.servlet.ServletDefinitionListCtrl;
 import org.apache.pluto.om.servlet.WebApplicationDefinition;
-import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.portal.pluto.om.common.AbstractSupportSet;
 import org.apache.cocoon.portal.pluto.om.common.Support;
 
@@ -35,8 +34,9 @@
 public class ServletDefinitionListImpl extends AbstractSupportSet
 implements ServletDefinitionList, ServletDefinitionListCtrl, java.io.Serializable, Support
{
 
-    // ServletDefinitionList implementation.
-
+    /**
+     * @see org.apache.pluto.om.servlet.ServletDefinitionList#get(java.lang.String)
+     */
     public ServletDefinition get(String name) {
         Iterator iterator = this.iterator();
         while (iterator.hasNext()) {
@@ -48,8 +48,9 @@
         return null;
     }
 
-    // ServletDefinitionListCtrl implementation.
-
+    /**
+     * @see org.apache.pluto.om.servlet.ServletDefinitionListCtrl#add(java.lang.String, java.lang.String)
+     */
     public ServletDefinition add(String name, String className) {
         ServletDefinitionImpl servletDefinition = new ServletDefinitionImpl();
         servletDefinition.setServletName(name);
@@ -60,6 +61,9 @@
         return servletDefinition;
     }
 
+    /**
+     * @see org.apache.pluto.om.servlet.ServletDefinitionListCtrl#remove(java.lang.String)
+     */
     public ServletDefinition remove(String name) {
         Iterator iterator = this.iterator();
         while (iterator.hasNext()) {
@@ -72,12 +76,16 @@
         return null;
     }
 
+    /**
+     * @see org.apache.pluto.om.servlet.ServletDefinitionListCtrl#remove(org.apache.pluto.om.servlet.ServletDefinition)
+     */
     public void remove(ServletDefinition servletDefinition) {
         super.remove(servletDefinition);
     }
 
-    // Support implementation.
-
+    /**
+     * @see org.apache.cocoon.portal.pluto.om.common.AbstractSupportSet#preBuild(java.lang.Object)
+     */
     public void preBuild(Object parameter) throws Exception {
         Vector structure = (Vector)parameter;
         WebApplicationDefinition webApplicationDefinition =  (WebApplicationDefinition)structure.get(0);
@@ -105,10 +113,16 @@
         }
     }
 
+    /**
+     * @see org.apache.cocoon.portal.pluto.om.common.AbstractSupportSet#postBuild(java.lang.Object)
+     */
     public void postBuild(Object parameter) throws Exception {
         // nothing to do 
     }
 
+    /**
+     * @see org.apache.cocoon.portal.pluto.om.common.AbstractSupportSet#postLoad(java.lang.Object)
+     */
     public void postLoad(Object parameter) throws Exception {
         Iterator iterator = this.iterator();
         while (iterator.hasNext()) {
@@ -117,10 +131,16 @@
 
     }
 
+    /**
+     * @see org.apache.cocoon.portal.pluto.om.common.AbstractSupportSet#postStore(java.lang.Object)
+     */
     public void postStore(Object parameter) throws Exception {
         // nothing to do 
     }
 
+    /**
+     * @see org.apache.cocoon.portal.pluto.om.common.AbstractSupportSet#preStore(java.lang.Object)
+     */
     public void preStore(Object parameter) throws Exception {
         // nothing to do 
     }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java?rev=365667&r1=365666&r2=365667&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
Tue Jan  3 07:58:30 2006
@@ -32,9 +32,7 @@
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.avalon.framework.service.ServiceSelector;
 import org.apache.cocoon.ProcessingException;
-import org.apache.cocoon.portal.PortalRuntimeException;
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.coplet.CopletBaseData;
 import org.apache.cocoon.portal.coplet.CopletData;
@@ -182,27 +180,14 @@
     protected void logout(PortalUser user) {
         final Profile profile = this.getUserProfile(null);
         if ( profile != null ) {
-            ServiceSelector adapterSelector = null;
-            try {
-                adapterSelector = (ServiceSelector)this.manager.lookup(CopletAdapter.ROLE+"Selector");
-
-                Iterator iter = profile.getCopletInstanceDataObjects().iterator();
-                while ( iter.hasNext() ) {
-                    CopletInstanceData cid = (CopletInstanceData) iter.next();
-                    CopletAdapter adapter = null;
-                    try {
-                        adapter = (CopletAdapter)adapterSelector.select(cid.getCopletData().getCopletBaseData().getCopletAdapterName());
-                        adapter.logout( cid );
-                    } finally {
-                        adapterSelector.release( adapter );
-                    }
-                }
-
-            } catch (ServiceException e) {
-                throw new PortalRuntimeException("Unable to lookup portal service.", e);
-            } finally {
-                this.manager.release(adapterSelector);
+
+            Iterator iter = profile.getCopletInstanceDataObjects().iterator();
+            while ( iter.hasNext() ) {
+                CopletInstanceData cid = (CopletInstanceData) iter.next();
+                CopletAdapter adapter = this.portalService.getCopletAdapter(cid.getCopletData().getCopletBaseData().getCopletAdapterName());
+                adapter.logout( cid );
             }
+
             this.removeUserProfiles();
         }
         super.logout(user);



Mime
View raw message