cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r375068 - in /cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto: DynamicInformationProviderImpl.java PortletActionProviderImpl.java PortletURLProviderImpl.java adapter/PortletWindowAspect.java
Date Sun, 05 Feb 2006 18:08:47 GMT
Author: cziegeler
Date: Sun Feb  5 10:08:46 2006
New Revision: 375068

URL: http://svn.apache.org/viewcvs?rev=375068&view=rev
Log:
Portlet mode and window state are not serializale, so store only strings in session

Modified:
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/DynamicInformationProviderImpl.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/adapter/PortletWindowAspect.java

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/DynamicInformationProviderImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/DynamicInformationProviderImpl.java?rev=375068&r1=375067&r2=375068&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/DynamicInformationProviderImpl.java
(original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/DynamicInformationProviderImpl.java
Sun Feb  5 10:08:46 2006
@@ -91,11 +91,11 @@
      */
     public PortletMode getPortletMode(PortletWindow portletWindow) {
         final CopletInstanceData cid = ((PortletEntityImpl)portletWindow.getPortletEntity()).getCopletInstanceData();
-        PortletMode pm = (PortletMode) cid.getTemporaryAttribute("portlet-mode");
-        if ( pm == null ) {
-            pm = PortletMode.VIEW;
+        final String pmString = (String)cid.getTemporaryAttribute("portlet-mode");
+        if ( pmString == null ) {
+            return PortletMode.VIEW;
         }
-        return pm;
+        return new PortletMode(pmString);
     }
 
     /**
@@ -103,11 +103,11 @@
      */
     public WindowState getWindowState(PortletWindow portletWindow) {
         final CopletInstanceData cid = ((PortletEntityImpl)portletWindow.getPortletEntity()).getCopletInstanceData();
-        WindowState ws = (WindowState) cid.getTemporaryAttribute("window-state");
-        if ( ws == null ) {
-            ws = WindowState.NORMAL;
+        final String wsString = (String)cid.getTemporaryAttribute("window-state");
+        if ( wsString == null ) {
+            return WindowState.NORMAL;
         }
-        return ws;
+        return new WindowState(wsString);
     }
 
     /**

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java?rev=375068&r1=375067&r2=375068&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java
(original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java
Sun Feb  5 10:08:46 2006
@@ -56,11 +56,7 @@
     public void changePortletMode(PortletMode mode) {
         if ( mode != null ) {
             final CopletInstanceData cid = ((PortletEntityImpl)portletWindow.getPortletEntity()).getCopletInstanceData();
-            PortletMode pm = (PortletMode) cid.getTemporaryAttribute("portlet-mode");
-            if ( (pm == null && !mode.equals(PortletMode.VIEW)) 
-                || (pm != null && !pm.equals(mode)) ) {
-                cid.setTemporaryAttribute("portlet-mode", mode);
-            }
+            cid.setTemporaryAttribute("portlet-mode", mode.toString());
         }
     }
 
@@ -70,16 +66,14 @@
     public void changePortletWindowState(WindowState state) {
         if ( state != null ) {
             final CopletInstanceData cid = ((PortletEntityImpl)portletWindow.getPortletEntity()).getCopletInstanceData();
-            WindowState ws = (WindowState) cid.getTemporaryAttribute("window-state");
-            if ( (ws == null && !state.equals(WindowState.NORMAL))
-                || (ws != null && !ws.equals(state)) ) {
-                cid.setTemporaryAttribute("window-state", state);
-                int size = CopletInstanceData.SIZE_NORMAL;
-                if ( state.equals(WindowState.MAXIMIZED) ) {
-                    size = CopletInstanceData.SIZE_MAXIMIZED;
-                } else if ( state.equals(WindowState.MINIMIZED) ) {
-                    size = CopletInstanceData.SIZE_MINIMIZED;
-                }
+            cid.setTemporaryAttribute("window-state", state.toString());
+            int size = CopletInstanceData.SIZE_NORMAL;
+            if ( state.equals(WindowState.MAXIMIZED) ) {
+                size = CopletInstanceData.SIZE_MAXIMIZED;
+            } else if ( state.equals(WindowState.MINIMIZED) ) {
+                size = CopletInstanceData.SIZE_MINIMIZED;
+            }
+            if ( size != cid.getSize() ) {
                 final Event e = new CopletInstanceSizingEvent(cid, size);
                 this.portalService.getEventManager().send(e);
             }

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java?rev=375068&r1=375067&r2=375068&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java
(original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java
Sun Feb  5 10:08:46 2006
@@ -220,27 +220,7 @@
      */
     private String getURL() {
         if ( this.generatedURL == null ) {
-            final PortletWindowImpl impl = (PortletWindowImpl)this.portletWindow;
-            final CopletLayout cl = impl.getLayout();
-            Event sizingEvent = null;
-            if ( cl != null ) {
-                final CopletInstanceData cid = cl.getCopletInstanceData();
-                WindowState oldState = (WindowState)cid.getTemporaryAttribute("window-state");

-                if ( oldState == null ) {
-                    oldState = WindowState.NORMAL;
-                }
-            }
-
-            List l = new ArrayList();
-            if ( sizingEvent != null ) {
-                l.add(sizingEvent);
-            }
-            l.add(this);
-            if (secure == null) {
-                this.generatedURL = this.linkService.getLinkURI(l);
-            } else {
-                this.generatedURL = this.linkService.getLinkURI(l, secure);
-            }
+            this.generatedURL = this.linkService.getLinkURI(this, this.secure);
         }
         return linkService.encodeURL(this.generatedURL);
     }

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/adapter/PortletWindowAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/adapter/PortletWindowAspect.java?rev=375068&r1=375067&r2=375068&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/adapter/PortletWindowAspect.java
(original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/adapter/PortletWindowAspect.java
Sun Feb  5 10:08:46 2006
@@ -147,9 +147,12 @@
                 DynamicInformationProvider dip = ips.getDynamicProvider((HttpServletRequest)
context.getObjectModel().get("portlet-request"));
 
                 // Sizing
-                WindowState ws = (WindowState)copletInstanceData.getTemporaryAttribute("window-state");

-                if ( ws == null ) {
+                final String wsString = (String)copletInstanceData.getTemporaryAttribute("window-state");
+                final WindowState ws; 
+                if ( wsString == null ) {
                     ws = WindowState.NORMAL;
+                } else {
+                    ws = new WindowState(wsString);
                 }
 
                 if ( !ws.equals(WindowState.MINIMIZED) && !ws.equals(WindowState.MAXIMIZED))
{
@@ -175,9 +178,12 @@
                 }
 
                 // portlet modes
-                PortletMode pm = (PortletMode)copletInstanceData.getTemporaryAttribute("portlet-mode");

-                if ( pm == null ) {
+                final String pmString = (String)copletInstanceData.getTemporaryAttribute("portlet-mode");
+                final PortletMode pm; 
+                if ( pmString == null ) {
                     pm = PortletMode.VIEW;
+                } else {
+                    pm = new PortletMode(pmString);
                 }
                 if ( !pm.equals(PortletMode.EDIT) ) {
                     PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);



Mime
View raw message