cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r375063 - in /cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal: layout/renderer/aspect/impl/ pluto/
Date Sun, 05 Feb 2006 17:52:12 GMT
Author: cziegeler
Date: Sun Feb  5 09:52:10 2006
New Revision: 375063

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

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/PortletWindowAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/DynamicInformationProviderImpl.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/PortletWindowAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/PortletWindowAspect.java?rev=375063&r1=375062&r2=375063&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/PortletWindowAspect.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/PortletWindowAspect.java
Sun Feb  5 09:52:10 2006
@@ -143,8 +143,11 @@
                 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");
+                WindowState ws; 
+                if ( wsString != null ) {
+                    ws = new WindowState(wsString);
+                } else {
                     ws = WindowState.NORMAL;
                 }
                 
@@ -171,9 +174,12 @@
                 }
 
                 // portlet modes
-                PortletMode pm = (PortletMode)copletInstanceData.getTemporaryAttribute("portlet-mode");

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

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/DynamicInformationProviderImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/DynamicInformationProviderImpl.java?rev=375063&r1=375062&r2=375063&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/DynamicInformationProviderImpl.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/DynamicInformationProviderImpl.java
Sun Feb  5 09:52:10 2006
@@ -69,56 +69,38 @@
         return new ResourceURLProviderImpl(this.provider);
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.services.information.DynamicInformationProvider#getPortletActionProvider(org.apache.pluto.om.window.PortletWindow)
      */
     public PortletActionProvider getPortletActionProvider(PortletWindow portletWindow) {
         return new PortletActionProviderImpl(portletWindow);
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.services.information.DynamicInformationProvider#getPortletMode(org.apache.pluto.om.window.PortletWindow)
      */
     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);
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.pluto.services.information.DynamicInformationProvider#getPreviousPortletMode(org.apache.pluto.om.window.PortletWindow)
-     */
-    public PortletMode getPreviousPortletMode(PortletWindow portletWindow) {
-        final CopletInstanceData cid = ((PortletEntityImpl)portletWindow.getPortletEntity()).getCopletInstanceData();
-        PortletMode pm = (PortletMode) cid.getTemporaryAttribute("previous-portlet-mode");
-        return pm;
-    }
-
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.services.information.DynamicInformationProvider#getWindowState(org.apache.pluto.om.window.PortletWindow)
      */
     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 new WindowState(wsString);
         }
-        return ws;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.pluto.services.information.DynamicInformationProvider#getPreviousWindowState(org.apache.pluto.om.window.PortletWindow)
-     */
-    public WindowState getPreviousWindowState(PortletWindow portletWindow) {
-        final CopletInstanceData cid = ((PortletEntityImpl)portletWindow.getPortletEntity()).getCopletInstanceData();
-        WindowState ws = (WindowState) cid.getTemporaryAttribute("previous-window-state");
       
-        return ws;
+        return WindowState.NORMAL;
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.services.information.DynamicInformationProvider#getResponseContentType()
      */
     public String getResponseContentType() {

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java?rev=375063&r1=375062&r2=375063&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java
Sun Feb  5 09:52:10 2006
@@ -1,12 +1,12 @@
 /*
  * Copyright 2004,2004 The Apache Software Foundation.
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -42,37 +42,23 @@
         this.portletWindow = portletWindow;
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.services.information.PortletActionProvider#changePortletMode(PortletWindow,
PortletMode)
      */
     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)) ) {
-                if ( pm != null ) {
-                    cid.setTemporaryAttribute("previous-portlet-mode", pm);
-                }
-                cid.setTemporaryAttribute("portlet-mode", mode);
-            }
+            cid.setTemporaryAttribute("portlet-mode", mode.toString());
         }
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.pluto.services.information.PortletActionProvider#changePortletWindowState(PortletWindow,
WindowState)
      */
     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)) ) {
-                if ( ws != null ) {
-                    cid.setTemporaryAttribute("previous-window-state", ws);
-                }
-                cid.setTemporaryAttribute("window-state", state);
-            }
+            cid.setTemporaryAttribute("window-state", state.toString());
         }
     }
 

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java?rev=375063&r1=375062&r2=375063&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java
Sun Feb  5 09:52:10 2006
@@ -229,8 +229,11 @@
             Event sizingEvent = null;
             if ( cl != null ) {
                 final CopletInstanceData cid = cl.getCopletInstanceData();
-                WindowState oldState = (WindowState)cid.getTemporaryAttribute("window-state");

-                if ( oldState == null ) {
+                String oldStateString = (String)cid.getTemporaryAttribute("window-state");
+                WindowState oldState = null;
+                if ( oldStateString != null ) {
+                    oldState = new WindowState(oldStateString);
+                } else {
                     oldState = WindowState.NORMAL;
                 }
                 if ( this.state != null && !this.state.equals(oldState) ) {



Mime
View raw message