Author: cziegeler
Date: Tue Oct  5 06:36:38 2004
New Revision: 53792

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/DynamicTitleServiceImpl.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
Log:
Use temporary attributes for portlets

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/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
   Tue Oct  5 06:36:38 2004
@@ -76,7 +76,7 @@
  * 
  * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
  * 
- * @version CVS $Id: PortletWindowAspect.java,v 1.8 2004/04/25 20:09:34 haul 
Exp $
+ * @version CVS $Id$
  */
 public final class PortletWindowAspect 
 extends AbstractAspect 
@@ -118,7 +118,7 @@
         if ( config.rootTag ) {
             XMLUtils.startElement(contenthandler, config.tagName);
         }
-        final PortletWindow window = 
(PortletWindow)copletInstanceData.getAttribute("window");
+        final PortletWindow window = 
(PortletWindow)copletInstanceData.getTemporaryAttribute("window");
         if ( window == null ) {
             // no portlet window, so use a default behaviour
             XMLUtils.createElement(contenthandler, "title", 
copletInstanceData.getCopletData().getTitle());
@@ -127,7 +127,7 @@
                 ((PortletWindowImpl)window).setLayout((CopletLayout)layout);
             }
             
-            String title = (String) 
copletInstanceData.getAttribute("dynamic-title");
+            String title = (String) 
copletInstanceData.getTemporaryAttribute("dynamic-title");
             if ( title == null ) {
                 final PortletDefinition def = 
window.getPortletEntity().getPortletDefinition();
                 try {
@@ -144,7 +144,7 @@
                 DynamicInformationProvider dip = 
ips.getDynamicProvider((HttpServletRequest) 
context.getObjectModel().get("portlet-request"));
                 
                 // Sizing
-                WindowState ws = 
(WindowState)copletInstanceData.getAttribute("window-state"); 
+                WindowState ws = 
(WindowState)copletInstanceData.getTemporaryAttribute("window-state"); 
                 if ( ws == null ) {
                     ws = WindowState.NORMAL;
                 }
@@ -172,7 +172,7 @@
                 }
 
                 // portlet modes
-                PortletMode pm = 
(PortletMode)copletInstanceData.getAttribute("portlet-mode"); 
+                PortletMode pm = 
(PortletMode)copletInstanceData.getTemporaryAttribute("portlet-mode"); 
                 if ( pm == null ) {
                     pm = PortletMode.VIEW;
                 }

Modified: 
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/DynamicInformationProviderImpl.java
      (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/DynamicInformationProviderImpl.java
      Tue Oct  5 06:36:38 2004
@@ -35,7 +35,7 @@
  *
  * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
  * 
- * @version CVS $Id: DynamicInformationProviderImpl.java,v 1.2 2004/03/05 
13:02:14 bdelacretaz Exp $
+ * @version CVS $Id$
  */
 public class DynamicInformationProviderImpl 
 implements DynamicInformationProvider {
@@ -81,7 +81,7 @@
      */
     public PortletMode getPortletMode(PortletWindow portletWindow) {
         final CopletInstanceData cid = 
((PortletEntityImpl)portletWindow.getPortletEntity()).getCopletInstanceData();
-        PortletMode pm = (PortletMode) cid.getAttribute("portlet-mode");
+        PortletMode pm = (PortletMode) 
cid.getTemporaryAttribute("portlet-mode");
         if ( pm == null ) {
             pm = PortletMode.VIEW;
         }
@@ -93,7 +93,7 @@
      */
     public PortletMode getPreviousPortletMode(PortletWindow portletWindow) {
         final CopletInstanceData cid = 
((PortletEntityImpl)portletWindow.getPortletEntity()).getCopletInstanceData();
-        PortletMode pm = (PortletMode) 
cid.getAttribute("previous-portlet-mode");
+        PortletMode pm = (PortletMode) 
cid.getTemporaryAttribute("previous-portlet-mode");
         return pm;
     }
 
@@ -102,7 +102,7 @@
      */
     public WindowState getWindowState(PortletWindow portletWindow) {
         final CopletInstanceData cid = 
((PortletEntityImpl)portletWindow.getPortletEntity()).getCopletInstanceData();
-        WindowState ws = (WindowState) cid.getAttribute("window-state");
+        WindowState ws = (WindowState) 
cid.getTemporaryAttribute("window-state");
         if ( ws == null ) {
             ws = WindowState.NORMAL;
         }
@@ -114,7 +114,7 @@
      */
     public WindowState getPreviousWindowState(PortletWindow portletWindow) {
         final CopletInstanceData cid = 
((PortletEntityImpl)portletWindow.getPortletEntity()).getCopletInstanceData();
-        WindowState ws = (WindowState) 
cid.getAttribute("previous-window-state");        
+        WindowState ws = (WindowState) 
cid.getTemporaryAttribute("previous-window-state");        
         return ws;
     }
 

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/DynamicTitleServiceImpl.java
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/DynamicTitleServiceImpl.java
     (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/DynamicTitleServiceImpl.java
     Tue Oct  5 06:36:38 2004
@@ -26,7 +26,7 @@
  *
  * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
  * 
- * @version CVS $Id: DynamicTitleServiceImpl.java,v 1.2 2004/03/05 13:02:14 
bdelacretaz Exp $
+ * @version CVS $Id$
  */
 public class DynamicTitleServiceImpl 
 implements DynamicTitleService {    
@@ -37,7 +37,7 @@
     public void setDynamicTitle(PortletWindow window,
                                 HttpServletRequest request,
                                 String dynamicTitle) {
-        
((PortletEntityImpl)window.getPortletEntity()).getCopletInstanceData().setAttribute("dynamic-title",
 dynamicTitle);
+        
((PortletEntityImpl)window.getPortletEntity()).getCopletInstanceData().setTemporaryAttribute("dynamic-title",
 dynamicTitle);
     }
                                 
 }

Modified: 
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/PortletActionProviderImpl.java
   (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java
   Tue Oct  5 06:36:38 2004
@@ -28,7 +28,7 @@
  *
  * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
  * 
- * @version CVS $Id: PortletActionProviderImpl.java,v 1.2 2004/03/05 13:02:14 
bdelacretaz Exp $
+ * @version CVS $Id$
  */
 public class PortletActionProviderImpl implements PortletActionProvider {
 
@@ -45,13 +45,13 @@
     public void changePortletMode(PortletMode mode) {
         if ( mode != null ) {
             final CopletInstanceData cid = 
((PortletEntityImpl)portletWindow.getPortletEntity()).getCopletInstanceData();
-            PortletMode pm = (PortletMode) cid.getAttribute("portlet-mode");
+            PortletMode pm = (PortletMode) 
cid.getTemporaryAttribute("portlet-mode");
             if ( (pm == null && !mode.equals(PortletMode.VIEW)) 
                 || (pm != null && !pm.equals(mode)) ) {
                 if ( pm != null ) {
-                    cid.setAttribute("previous-portlet-mode", pm);
+                    cid.setTemporaryAttribute("previous-portlet-mode", pm);
                 }
-                cid.setAttribute("portlet-mode", mode);
+                cid.setTemporaryAttribute("portlet-mode", mode);
             }
         }
     }
@@ -62,13 +62,13 @@
     public void changePortletWindowState(WindowState state) {
         if ( state != null ) {
             final CopletInstanceData cid = 
((PortletEntityImpl)portletWindow.getPortletEntity()).getCopletInstanceData();
-            WindowState ws = (WindowState) cid.getAttribute("window-state");
+            WindowState ws = (WindowState) 
cid.getTemporaryAttribute("window-state");
             if ( (ws == null && !state.equals(PortletMode.VIEW)) 
                 || (ws != null && !ws.equals(state)) ) {
                 if ( ws != null ) {
-                    cid.setAttribute("previous-window-state", ws);
+                    cid.setTemporaryAttribute("previous-window-state", ws);
                 }
-                cid.setAttribute("window-state", state);
+                cid.setTemporaryAttribute("window-state", state);
             }
         }
     }

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java
==============================================================================
--- 
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
      Tue Oct  5 06:36:38 2004
@@ -43,7 +43,7 @@
  *
  * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
  * 
- * @version CVS $Id: PortletURLProviderImpl.java,v 1.6 2004/03/19 07:24:12 
cziegeler Exp $
+ * @version CVS $Id$
  */
 public class PortletURLProviderImpl 
        implements PortletURLProvider, CopletInstanceEvent {
@@ -174,7 +174,7 @@
             Event sizingEvent = null;
             if ( cl != null ) {
                 final CopletInstanceData cid = cl.getCopletInstanceData();
-                WindowState oldState = 
(WindowState)cid.getAttribute("window-state"); 
+                WindowState oldState = 
(WindowState)cid.getTemporaryAttribute("window-state"); 
                 if ( oldState == null ) {
                     oldState = WindowState.NORMAL;
                 }

Reply via email to