cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r331279 - in /cocoon/blocks: portal-sample/trunk/samples/skins/basic/styles/ portal-sample/trunk/samples/skins/common/styles/ portal/trunk/ portal/trunk/java/org/apache/cocoon/portal/event/impl/ portal/trunk/java/org/apache/cocoon/portal/im...
Date Mon, 07 Nov 2005 15:25:57 GMT
Author: cziegeler
Date: Mon Nov  7 07:25:37 2005
New Revision: 331279

URL: http://svn.apache.org/viewcvs?rev=331279&view=rev
Log:
Add static layout objects and implement maximize functionality for layouts.

Modified:
    cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/borderless-window.xsl
    cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/window.xsl
    cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/borderless-window.xsl
    cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/window.xsl
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/impl/InternalEventReceiver.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PageLabelManager.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutFeatures.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCompositeAspect.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CompositeContentAspect.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/SizingAspect.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/wsrp/adapter/WSRPAdapter.java
    cocoon/blocks/portal/trunk/status.xml

Modified: cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/borderless-window.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/borderless-window.xsl?rev=331279&r1=331278&r2=331279&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/borderless-window.xsl (original)
+++ cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/borderless-window.xsl Mon
Nov  7 07:25:37 2005
@@ -79,7 +79,7 @@
 			</xsl:if>
 			<xsl:if test="maximize-uri">
 				<a href="{maximize-uri}">
-	  			    <img src="images/show.gif" border="0" alt="Max Page"/>
+	  			    <img src="images/show.gif" border="0" alt="Maximize"/>
 	  			</a>
 			</xsl:if>
 			<xsl:if test="normal-uri">

Modified: cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/window.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/window.xsl?rev=331279&r1=331278&r2=331279&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/window.xsl (original)
+++ cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/window.xsl Mon Nov  7 07:25:37
2005
@@ -81,7 +81,7 @@
             </xsl:if>
             <xsl:if test="maximize-uri">
                 <a href="{maximize-uri}">
-                  <img src="images/show.gif" border="0" alt="Max Page"/>
+                  <img src="images/show.gif" border="0" alt="Maximize"/>
                 </a>
             </xsl:if>
             <xsl:if test="normal-uri">

Modified: cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/borderless-window.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/borderless-window.xsl?rev=331279&r1=331278&r2=331279&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/borderless-window.xsl (original)
+++ cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/borderless-window.xsl Mon
Nov  7 07:25:37 2005
@@ -98,7 +98,7 @@
           <xsl:if test="maximize-uri">
             <td width="15">
               <a href="{maximize-uri}">
-                <img src="images/show.gif" border="0" alt="Max Page"/>
+                <img src="images/show.gif" border="0" alt="Maximize"/>
               </a>
             </td>
           </xsl:if>

Modified: cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/window.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/window.xsl?rev=331279&r1=331278&r2=331279&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/window.xsl (original)
+++ cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/window.xsl Mon Nov  7 07:25:37
2005
@@ -98,7 +98,7 @@
           <xsl:if test="maximize-uri">
             <td width="15">
               <a href="{maximize-uri}">
-                <img src="images/show.gif" border="0" alt="Max Page"/>
+                <img src="images/show.gif" border="0" alt="Maximize"/>
               </a>
             </td>
           </xsl:if>

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/impl/InternalEventReceiver.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/impl/InternalEventReceiver.java?rev=331279&r1=331278&r2=331279&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/impl/InternalEventReceiver.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/impl/InternalEventReceiver.java
Mon Nov  7 07:25:37 2005
@@ -30,14 +30,21 @@
 import org.apache.cocoon.portal.event.coplet.CopletInstanceSizingEvent;
 import org.apache.cocoon.portal.event.coplet.CopletJXPathEvent;
 import org.apache.cocoon.portal.event.layout.LayoutChangeParameterEvent;
+import org.apache.cocoon.portal.layout.Item;
 import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.layout.LayoutFeatures;
+import org.apache.cocoon.portal.layout.LayoutFeatures.RenderInfo;
 import org.apache.cocoon.portal.layout.impl.CopletLayout;
 import org.apache.cocoon.portal.profile.ProfileManager;
 import org.apache.commons.jxpath.JXPathContext;
 
 /**
- * This subscriber processes JXPath events.
+ * This receiver processes all events which change an object.
+ * All coplet instance data events, jx path events and layout events are processed
+ * and the corresponding objects are changed.
+ *
+ * The receiver is automatically added by the {@link DefaultEventManager}.
+ *
  * @version $Id$
  */
 public final class InternalEventReceiver 
@@ -82,14 +89,33 @@
             cid.setSize(event.getSize());
             if ( event.getSize() == CopletInstanceData.SIZE_FULLSCREEN ) {
                 CopletLayout layout = CopletInstanceDataFeatures.searchLayout(cid.getId(),
rootLayout);
-                LayoutFeatures.setRenderInfo(rootLayout, new LayoutFeatures.RenderInfo(layout));
+                LayoutFeatures.setFullScreenInfo(rootLayout, layout);
+            } else if ( event.getSize() == CopletInstanceData.SIZE_MAXIMIZED ) {
+                CopletLayout layout = CopletInstanceDataFeatures.searchLayout(cid.getId(),
rootLayout);
+                Item container = LayoutFeatures.searchItemForMaximizedCoplet(layout);
+                if ( container != null ) {
+                    final RenderInfo info = new RenderInfo(layout, container);
+                    LayoutFeatures.setRenderInfo(container.getParent(), info);
+                } else {
+                	// TODO - Check if this is correct
+                    LayoutFeatures.setFullScreenInfo(rootLayout, layout);               
	
+                }
             }
             if ( oldSize == CopletInstanceData.SIZE_FULLSCREEN ) {
-                LayoutFeatures.setRenderInfo(rootLayout, null);
+                LayoutFeatures.setFullScreenInfo(rootLayout, null);
+            } else if ( oldSize == CopletInstanceData.SIZE_MAXIMIZED ) {
+                CopletLayout layout = CopletInstanceDataFeatures.searchLayout(cid.getId(),
rootLayout);
+                Item container = LayoutFeatures.searchItemForMaximizedCoplet(layout);
+                if ( container != null ) {
+                	LayoutFeatures.setRenderInfo(container.getParent(), null);
+                } else {
+                	// TODO - Check if this is correct
+                	LayoutFeatures.setFullScreenInfo(rootLayout, null);
+                }
             }
         } else {
             if ( event.getSize() == CopletInstanceData.SIZE_FULLSCREEN ) {
-                LayoutFeatures.setRenderInfo(rootLayout, null);
+                LayoutFeatures.setFullScreenInfo(rootLayout, null);
             }
         }
     }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PageLabelManager.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PageLabelManager.java?rev=331279&r1=331278&r2=331279&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PageLabelManager.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PageLabelManager.java Mon
Nov  7 07:25:37 2005
@@ -40,7 +40,6 @@
 import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.layout.LayoutFeatures;
 import org.apache.cocoon.portal.layout.NamedItem;
-import org.apache.cocoon.portal.layout.LayoutFeatures.RenderInfo;
 import org.apache.cocoon.util.HashMap;
 
 /**
@@ -229,11 +228,7 @@
         Map map = new HashMap();
 
         Layout rootLayout = service.getComponentManager().getProfileManager().getPortalLayout(null,
null);
-        final RenderInfo info = LayoutFeatures.getRenderInfo(rootLayout);
-        Layout portalLayout = null;
-        if ( info != null ) {
-            portalLayout = info.layout;
-        }
+        Layout portalLayout = LayoutFeatures.getFullScreenInfo(rootLayout);
         if (portalLayout == null) {
             portalLayout = rootLayout;
         }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java?rev=331279&r1=331278&r2=331279&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java Mon
Nov  7 07:25:37 2005
@@ -43,7 +43,6 @@
 import org.apache.cocoon.portal.event.EventManager;
 import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.layout.LayoutFeatures;
-import org.apache.cocoon.portal.layout.LayoutFeatures.RenderInfo;
 import org.apache.cocoon.portal.layout.renderer.Renderer;
 import org.apache.cocoon.portal.profile.ProfileManager;
 import org.apache.cocoon.xml.AttributesImpl;
@@ -193,10 +192,7 @@
             } else {
                 // first check for a full screen layout
                 Layout rootLayout = profileManager.getPortalLayout(null, layoutId);
-                final RenderInfo info = LayoutFeatures.getRenderInfo(rootLayout);
-                if ( info != null ) {
-                    portalLayout = info.layout;
-                }
+                portalLayout = LayoutFeatures.getFullScreenInfo(rootLayout);
                 if ( portalLayout == null ) {
                     portalLayout = rootLayout;
                 }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutFeatures.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutFeatures.java?rev=331279&r1=331278&r2=331279&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutFeatures.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutFeatures.java Mon
Nov  7 07:25:37 2005
@@ -15,6 +15,8 @@
  */
 package org.apache.cocoon.portal.layout;
 
+import org.apache.cocoon.portal.layout.impl.CopletLayout;
+
 
 /**
  * This class contains constants and utility methods for the standard features
@@ -25,26 +27,56 @@
 public class LayoutFeatures {
 
     /** This is the name of the temporary layout attribute containing the information
-     * about full screen and maximized layouts. */
-    public static final String ATTRIBUTE_RENDERINFO = "render-info";
+     * about full screen layouts. */
+    protected static final String ATTRIBUTE_FULLSCREENINFO = LayoutFeatures.class.getName()
+ "/fullscreen-info";
+
+    /** This is the name of the temporary layout attribute containing the information
+     * about maximized layouts. */
+    protected static final String ATTRIBUTE_MAXMIZEDINFO = LayoutFeatures.class.getName()
+ "/maximized-info";
 
     public static final class RenderInfo {
         public final Layout layout;
+        public final Item   item;
 
-        public RenderInfo(Layout l) {
+        public RenderInfo(Layout l, Item i) {
             this.layout = l;
+            this.item = i;
+        }
+    }
+
+    public static Layout getFullScreenInfo(Layout layout) {
+        return (Layout) layout.getTemporaryAttribute(ATTRIBUTE_FULLSCREENINFO);
+    }
+
+    public static void setFullScreenInfo(Layout layout, Layout fullScreenLayout) {
+        if ( fullScreenLayout == null ) {
+            layout.removeTemporaryAttribute(ATTRIBUTE_FULLSCREENINFO);
+        } else {
+            layout.setTemporaryAttribute(ATTRIBUTE_FULLSCREENINFO, fullScreenLayout);   
        
         }
     }
 
     public static RenderInfo getRenderInfo(Layout layout) {
-        return (RenderInfo) layout.getTemporaryAttribute(ATTRIBUTE_RENDERINFO);
+        return (RenderInfo) layout.getTemporaryAttribute(ATTRIBUTE_MAXMIZEDINFO);
     }
 
     public static void setRenderInfo(Layout layout, RenderInfo info) {
         if ( info == null ) {
-            layout.removeTemporaryAttribute(ATTRIBUTE_RENDERINFO);
+            layout.removeTemporaryAttribute(ATTRIBUTE_MAXMIZEDINFO);
         } else {
-            layout.setTemporaryAttribute(ATTRIBUTE_RENDERINFO, info);            
+            layout.setTemporaryAttribute(ATTRIBUTE_MAXMIZEDINFO, info);            
         }
     }
+
+	public static Item searchItemForMaximizedCoplet(CopletLayout layout) {
+		Item item = layout.getParent();
+		while ( item != null && !item.getParent().isStatic().booleanValue() ) {
+			if ( item.getParent() == null ) {
+				item = null;
+			} else {
+			    item = item.getParent().getParent();
+			}
+		}
+		return item;
+	}
 }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java?rev=331279&r1=331278&r2=331279&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
Mon Nov  7 07:25:37 2005
@@ -39,7 +39,6 @@
 import org.apache.cocoon.portal.layout.LayoutException;
 import org.apache.cocoon.portal.layout.LayoutFactory;
 import org.apache.cocoon.portal.layout.LayoutFeatures;
-import org.apache.cocoon.portal.layout.LayoutFeatures.RenderInfo;
 import org.apache.cocoon.portal.profile.ProfileManager;
 import org.apache.cocoon.util.ClassUtils;
 
@@ -291,8 +290,8 @@
             if ( layout instanceof CopletLayout ) {
                 // full screen?
                 final Layout rootLayout = profileManager.getPortalLayout(null, null);
-                final RenderInfo info = LayoutFeatures.getRenderInfo(rootLayout);
-                if ( info != null && layout.equals(info.layout) ) {
+                final Layout fullScreenLayout = LayoutFeatures.getFullScreenInfo(rootLayout);
+                if ( fullScreenLayout != null && layout.equals(fullScreenLayout)
) {
                     Event event = new CopletInstanceSizingEvent(null, CopletInstanceData.SIZE_FULLSCREEN);
                     EventManager em = this.portalService.getComponentManager().getEventManager();
                     em.send(event);

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCompositeAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCompositeAspect.java?rev=331279&r1=331278&r2=331279&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCompositeAspect.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCompositeAspect.java
Mon Nov  7 07:25:37 2005
@@ -21,6 +21,8 @@
 import org.apache.cocoon.portal.layout.CompositeLayout;
 import org.apache.cocoon.portal.layout.Item;
 import org.apache.cocoon.portal.layout.Layout;
+import org.apache.cocoon.portal.layout.LayoutFeatures;
+import org.apache.cocoon.portal.layout.LayoutFeatures.RenderInfo;
 import org.apache.cocoon.portal.layout.renderer.Renderer;
 import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
 import org.xml.sax.ContentHandler;
@@ -51,10 +53,24 @@
 	throws SAXException {
         if ( layout instanceof CompositeLayout) {
             CompositeLayout compositeLayout = (CompositeLayout)layout;
-            // loop over all rows
-            for (Iterator iter = compositeLayout.getItems().iterator(); iter.hasNext();)
{
-                Item item = (Item) iter.next();
-                this.processItem(item, handler, service);
+        	// check for maximized information
+        	final RenderInfo maximizedInfo = LayoutFeatures.getRenderInfo(layout);
+            if ( maximizedInfo != null ) {
+	        	// loop over all rows
+	            for (Iterator iter = compositeLayout.getItems().iterator(); iter.hasNext();)
{
+	                Item item = (Item) iter.next();
+	                if ( item.equals(maximizedInfo.item) ) {
+	                    this.processMaximizedItem(item, maximizedInfo.layout, handler, service);
+	                } else if ( item.getLayout().isStatic().booleanValue() ) {
+	                    this.processItem(item, handler, service);	                	
+	                }
+	            }            	
+            } else {
+	        	// loop over all rows
+	            for (Iterator iter = compositeLayout.getItems().iterator(); iter.hasNext();)
{
+	                Item item = (Item) iter.next();
+	                this.processItem(item, handler, service);
+	            }
             }
         } else {
             throw new SAXException("CompositeLayout expected.");
@@ -62,14 +78,26 @@
 	}
 
     /**
-     * Process a single layout element. 
-     * 
+     * Process a single layout element.
+     *
      * @param item layout item to be processed
      * @param handler SAX handler taking events
      * @param service portal service providing component access
      * @throws SAXException
      */
     protected abstract void processItem(Item item, ContentHandler handler, PortalService
service)
+    throws SAXException;
+
+    /**
+     * Process an item containing a maximized layout.
+     *
+     * @param item layout item to be processed
+     * @param maximizedLayout The maximized layout.
+     * @param handler SAX handler taking events
+     * @param service portal service providing component access
+     * @throws SAXException
+     */
+    protected abstract void processMaximizedItem(Item item, Layout maximizedLayout, ContentHandler
handler, PortalService service)
     throws SAXException;
 
     /**

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CompositeContentAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CompositeContentAspect.java?rev=331279&r1=331278&r2=331279&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CompositeContentAspect.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CompositeContentAspect.java
Mon Nov  7 07:25:37 2005
@@ -114,7 +114,28 @@
         XMLUtils.endElement(handler, ITEM_STRING);
 	}
 
-    protected class PreparedConfiguration {
+	/**
+	 * @see org.apache.cocoon.portal.layout.renderer.aspect.impl.AbstractCompositeAspect#processMaximizedItem(org.apache.cocoon.portal.layout.Item,
org.apache.cocoon.portal.layout.Layout, org.xml.sax.ContentHandler, org.apache.cocoon.portal.PortalService)
+	 */
+	protected void processMaximizedItem(Item item, Layout maximizedLayout, ContentHandler handler,
PortalService service) throws SAXException {
+        Map parameters = item.getParameters();
+        if (parameters.size() == 0) {
+            XMLUtils.startElement(handler, ITEM_STRING);
+        } else {
+            AttributesImpl attributes = new AttributesImpl();
+
+			Map.Entry entry;
+			for (Iterator iter = parameters.entrySet().iterator(); iter.hasNext();) {
+				entry = (Map.Entry) iter.next();
+				attributes.addCDATAAttribute((String)entry.getKey(), (String)entry.getValue());
+			}
+            XMLUtils.startElement(handler, ITEM_STRING, attributes);
+        }
+        processLayout(maximizedLayout, service, handler);
+        XMLUtils.endElement(handler, ITEM_STRING);
+	}
+
+	protected class PreparedConfiguration {
         public String tagName;
         public boolean rootTag;
         public boolean streamSize;
@@ -137,4 +158,5 @@
         pc.streamSize = configuration.getParameterAsBoolean("stream-size", true);
         return pc;
     }
+
 }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/SizingAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/SizingAspect.java?rev=331279&r1=331278&r2=331279&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/SizingAspect.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/SizingAspect.java
Mon Nov  7 07:25:37 2005
@@ -23,7 +23,6 @@
 import org.apache.cocoon.portal.event.coplet.CopletInstanceSizingEvent;
 import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.layout.LayoutFeatures;
-import org.apache.cocoon.portal.layout.LayoutFeatures.RenderInfo;
 import org.apache.cocoon.portal.layout.impl.CopletLayout;
 import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
 import org.apache.cocoon.xml.XMLUtils;
@@ -101,8 +100,8 @@
                 boolean supportsFullScreen = CopletDataFeatures.supportsFullScreenMode(cid.getCopletData());
                 if ( supportsFullScreen ) {
                     final Layout rootLayout = service.getComponentManager().getProfileManager().getPortalLayout(null,
null);
-                    final RenderInfo info = LayoutFeatures.getRenderInfo(rootLayout);
-                    if ( info != null && info.layout.equals( layout )) {
+                    final Layout fullScreenLayout = LayoutFeatures.getFullScreenInfo(rootLayout);
+                    if ( fullScreenLayout != null && fullScreenLayout.equals( layout
)) {
                         event = new CopletInstanceSizingEvent( cid, CopletInstanceData.SIZE_NORMAL
);
                         XMLUtils.createElement(handler, "normal-uri", service.getComponentManager().getLinkService().getLinkURI(event));
                     } else {

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.java?rev=331279&r1=331278&r2=331279&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.java
Mon Nov  7 07:25:37 2005
@@ -90,7 +90,6 @@
  * <h2>Parameters</h2>
  * <table><tbody>
  *  <tr><th>store</th><td></td><td>req</td><td>String</td><td><code>null</code></td></tr>
- *  <tr><th>aspect-name</th><td>Parameter holding the current tab
state.</td><td>req</td><td>String</td><td><code>"tab"</code></td></tr>
  *  <tr><th>tag-name</th><td>Name of the tag enclosing the following
output.</td>
  *      <td></td><td>String</td><td><code>"composite"</code></td></tr>
  *  <tr><th>root-tag</th><td>Should a tag enclosing the following
output be generated?</td>
@@ -118,6 +117,9 @@
                       ContentHandler handler)
     throws SAXException {
         if (layout instanceof CompositeLayout) {
+        	// check for maximized information
+        	final RenderInfo maximizedInfo = LayoutFeatures.getRenderInfo(layout);
+
             TabPreparedConfiguration config = (TabPreparedConfiguration)context.getAspectConfiguration();
 
             if ( config.rootTag ) {
@@ -128,7 +130,7 @@
             CompositeLayout tabLayout = (CompositeLayout) layout;
 
             // selected tab
-            String data = (String)layout.getTemporaryAttribute(config.aspectName);
+            String data = (String)layout.getTemporaryAttribute("tab");
             int selected = 0;
             if ( data != null ) {
                 selected = Integer.valueOf(data).intValue();
@@ -147,7 +149,7 @@
                 if (j == selected) {
                     attributes.addCDATAAttribute("selected", "true");
                 }
-                event = new LayoutChangeParameterEvent(tabLayout, config.aspectName, String.valueOf(j),
true);
+                event = new LayoutChangeParameterEvent(tabLayout, "tab", String.valueOf(j),
true);
                 attributes.addCDATAAttribute("parameter", service.getComponentManager().getLinkService().getLinkURI(event));

 
                 // add parameters
@@ -159,8 +161,11 @@
 
                 XMLUtils.startElement(handler, "named-item", attributes);
                 if (j == selected) {
-
-                    this.processLayout(getNextLayout(service, tab), service, handler);
+                	if ( maximizedInfo != null && maximizedInfo.item.equals(tab) ) {
+                		this.processLayout(maximizedInfo.layout, service, handler);
+                	} else {
+	                    this.processLayout(tab.getLayout(), service, handler);
+                	}
                     if (config.includeSelected) {
                         List events = new ArrayList();
                         events.add(event);
@@ -184,26 +189,6 @@
         }
     }
 
-    private Layout getNextLayout(PortalService service, Item tab) {
-        Layout tabLayout = tab.getLayout();
-        if (tabLayout instanceof CompositeLayout) {
-            CompositeLayout layout = (CompositeLayout)tabLayout;
-            List list = layout.getItems();
-            int size = list.size();
-            for (int i = 0; i < size; i++) {
-                if (list.get(i) instanceof NamedItem) {
-                    return tabLayout;
-                }
-            }
-        }
-        final Layout rootLayout = service.getComponentManager().getProfileManager().getPortalLayout(null,
null);
-        final RenderInfo info = LayoutFeatures.getRenderInfo(rootLayout);
-        if (info == null) {
-            return tab.getLayout();
-        }
-        return info.layout;
-    }
-
     /*
      * Generate the sub navigation for non-selected tabs
      * @param context
@@ -243,7 +228,7 @@
                     attributes.addCDATAAttribute("name",
                         String.valueOf(((NamedItem) tab).getName()));
                     LayoutChangeParameterEvent event = new LayoutChangeParameterEvent(tabLayout,
-                        config.aspectName, String.valueOf(j), true);
+                        "tab", String.valueOf(j), true);
                     List events = new ArrayList(parentEvents);
                     events.add(event);
 
@@ -274,7 +259,6 @@
     }
 
     protected class TabPreparedConfiguration extends PreparedConfiguration {
-        public String aspectName;
         public String store;
         public boolean showAllNav = false;
         public boolean includeSelected = false;
@@ -282,7 +266,6 @@
 
         public void takeValues(TabPreparedConfiguration from) {
             super.takeValues(from);
-            this.aspectName = from.aspectName;
             this.store = from.store;
             this.showAllNav = from.showAllNav;
             this.includeSelected = from.includeSelected;
@@ -297,7 +280,6 @@
     throws ParameterException {
         TabPreparedConfiguration pc = new TabPreparedConfiguration();
         pc.takeValues((PreparedConfiguration)super.prepareConfiguration(configuration));
-        pc.aspectName = configuration.getParameter("aspect-name", "tab");
         pc.store = configuration.getParameter("store");
         pc.childTagName = configuration.getParameter("child-tag-name", "");
         if (!pc.childTagName.equals("")) {

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/wsrp/adapter/WSRPAdapter.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/wsrp/adapter/WSRPAdapter.java?rev=331279&r1=331278&r2=331279&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/wsrp/adapter/WSRPAdapter.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/wsrp/adapter/WSRPAdapter.java
Mon Nov  7 07:25:37 2005
@@ -64,7 +64,6 @@
 import org.apache.cocoon.portal.event.coplet.CopletInstanceSizingEvent;
 import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.layout.LayoutFeatures;
-import org.apache.cocoon.portal.layout.LayoutFeatures.RenderInfo;
 import org.apache.cocoon.portal.serialization.IncludingHTMLSerializer;
 import org.apache.cocoon.portal.util.HtmlSaxParser;
 import org.apache.cocoon.portal.wsrp.consumer.ConsumerEnvironmentImpl;
@@ -691,9 +690,9 @@
                 if ( !windowState.equals(windowSession.getWindowState()) ) {
                     final Layout layout = (Layout)coplet.getTemporaryAttribute(ATTRIBUTE_NAME_LAYOUT);
                     final Layout rootLayout = service.getComponentManager().getProfileManager().getPortalLayout(null,
null);
-                    final RenderInfo info = LayoutFeatures.getRenderInfo(rootLayout);
-                    if ( info != null 
-                         && info.layout.equals( layout )
+                    final Layout fullScreenLayout = LayoutFeatures.getFullScreenInfo(rootLayout);
+                    if ( fullScreenLayout != null 
+                         && fullScreenLayout.equals( layout )
                          && !windowState.equals(WindowStates._maximized) ) {
                         Event e = new CopletInstanceSizingEvent( coplet, CopletInstanceData.SIZE_FULLSCREEN
);
                         service.getComponentManager().getEventManager().send(e);

Modified: cocoon/blocks/portal/trunk/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/status.xml?rev=331279&r1=331278&r2=331279&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/status.xml (original)
+++ cocoon/blocks/portal/trunk/status.xml Mon Nov  7 07:25:37 2005
@@ -66,6 +66,9 @@
  <changes>
   <release version="@version@" date="@date@">
     <action dev="CZ" type="add">
+      Add static layout objects and implement maximize functionality for layouts.
+    </action>
+    <action dev="CZ" type="add">
       Portal Service provides access to global configuration settings which can be
       used throughout the portal.
     </action>



Mime
View raw message