cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r330865 - in /cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal: ./ impl/ layout/renderer/aspect/ layout/renderer/aspect/impl/ layout/renderer/impl/
Date Fri, 04 Nov 2005 18:54:13 GMT
Author: rgoers
Date: Fri Nov  4 10:54:05 2005
New Revision: 330865

URL: http://svn.apache.org/viewcvs?rev=330865&view=rev
Log:
Fix fullscreen mode. When fullscreenNav is true the navigation will always appear.

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/PortalService.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PageLabelLinkService.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/RendererAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/RendererAspectContext.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCompositeAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CIncludeCopletAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CompositeContentAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/DefaultCopletAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/DefaultRendererContext.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/ParameterAspect.java
    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/RendererAspectChain.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/WindowAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/XSLTAspect.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/impl/AspectRenderer.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/PortalService.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/PortalService.java?rev=330865&r1=330864&r2=330865&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/PortalService.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/PortalService.java
Fri Nov  4 10:54:05 2005
@@ -128,4 +128,16 @@
      * @since 2.1.8
      */
     Map getObjectModel();
+
+    /**
+     * Indicates whether aspects which are sensitive to rendering state should render
+     * @param renderable true if all aspects should render
+     */
+    void setRenderable(Boolean renderable);
+
+    /**
+     * Returns true if all aspects should render, false if only "static" aspects should
+     * render.
+     */
+    Boolean isRenderable();
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PageLabelLinkService.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PageLabelLinkService.java?rev=330865&r1=330864&r2=330865&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PageLabelLinkService.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PageLabelLinkService.java
Fri Nov  4 10:54:05 2005
@@ -171,7 +171,6 @@
                         getKey(item, key);
                 	    value.append(key.toString());
                     }
-
                 }
                 else {
                     value.append(Integer.toString(i));

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java?rev=330865&r1=330864&r2=330865&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java
Fri Nov  4 10:54:05 2005
@@ -162,18 +162,23 @@
         // first check for a full screen layout
 
         Layout portalLayout = null;
+        Boolean renderable = (service.getEntryLayout(null) == null) ?
+                Boolean.TRUE : Boolean.FALSE;
         if (!this.fullScreenNav) {
-            // If fullscreen mode - otherwise TabContentAspect will deal with the layout
-            portalLayout = this.portalService.getEntryLayout(null);
+            // If fullscreen mode - otherwise the aspects will deal with the layout
+            portalLayout = service.getEntryLayout(null);
+            renderable = Boolean.TRUE;
         }
         if ( portalLayout == null ) {
-            portalLayout = this.portalService.getComponentManager().getProfileManager().getPortalLayout(null,
null);
+            portalLayout = service.getComponentManager().getProfileManager().getPortalLayout(null,
null);
         }
+        service.setRenderable(renderable);
 
         Renderer portalLayoutRenderer = this.portalService.getComponentManager().getRenderer(
portalLayout.getRendererName());       
 
         ch.startDocument();
         portalLayoutRenderer.toSAX(portalLayout, this.portalService, ch);
         ch.endDocument();
-	}
+        service.setRenderable(null);
+    }
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java?rev=330865&r1=330864&r2=330865&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
Fri Nov  4 10:54:05 2005
@@ -280,6 +280,24 @@
             this.setAttribute("default-layout-key", layoutKey);
         }
     }
+
+    public void setRenderable(Boolean renderable) {
+        String key = getDefaultLayoutKey();
+        if (renderable == null) {
+            removeTemporaryAttribute("RENDER:" + key);
+        } else {
+            setTemporaryAttribute("RENDER:" + key, renderable);
+        }
+    }
+
+    public Boolean isRenderable() {
+        String key = getDefaultLayoutKey();
+        Boolean bool = (Boolean)getTemporaryAttribute("RENDER:" + key);
+        if (bool != null) {
+            return bool;
+        }
+        return Boolean.TRUE;
+    }
     
     /**
      * @see org.apache.cocoon.portal.PortalService#getDefaultLayoutKey()

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/RendererAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/RendererAspect.java?rev=330865&r1=330864&r2=330865&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/RendererAspect.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/RendererAspect.java
Fri Nov  4 10:54:05 2005
@@ -33,7 +33,7 @@
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
  * 
- * @version CVS $Id: RendererAspect.java,v 1.6 2004/04/25 20:09:34 haul Exp $
+ * @version CVS $Id$
  */
 public interface RendererAspect 
     extends Component {
@@ -68,4 +68,6 @@
      */
     Object prepareConfiguration(Parameters configuration)
     throws ParameterException;
+
+    boolean isRequired();
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/RendererAspectContext.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/RendererAspectContext.java?rev=330865&r1=330864&r2=330865&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/RendererAspectContext.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/RendererAspectContext.java
Fri Nov  4 10:54:05 2005
@@ -30,7 +30,7 @@
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
  * 
- * @version CVS $Id: RendererAspectContext.java,v 1.5 2004/03/05 13:02:13 bdelacretaz Exp
$
+ * @version CVS $Id$
  */
 public interface RendererAspectContext {
     
@@ -64,4 +64,10 @@
      * Get the object model
      */
     Map getObjectModel();
+
+    /**
+     * Return whether rendering is enabled for this chain.
+     * @return true if rendering is enabled, false otherwise.
+     */
+    boolean isRendering();
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractAspect.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/AbstractAspect.java?rev=330865&r1=330864&r2=330865&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractAspect.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractAspect.java
Fri Nov  4 10:54:05 2005
@@ -80,4 +80,8 @@
         return configuration;
     }
 
+    public boolean isRequired() {
+        return false;
+    }
+
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCompositeAspect.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/AbstractCompositeAspect.java?rev=330865&r1=330864&r2=330865&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCompositeAspect.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCompositeAspect.java
Fri Nov  4 10:54:05 2005
@@ -16,11 +16,13 @@
 package org.apache.cocoon.portal.layout.renderer.aspect.impl;
 
 import java.util.Iterator;
+import java.util.List;
 
 import org.apache.cocoon.portal.PortalService;
 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.NamedItem;
 import org.apache.cocoon.portal.layout.renderer.Renderer;
 import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
 import org.xml.sax.ContentHandler;
@@ -30,16 +32,16 @@
  * Insert a composite layout's elements into the resulting XML. Elements (items)
  * are processed in order. Concrete descendents of this class need to implement the
  * actual handling of layout elements.
- * 
+ *
  * <h2>Applicable to:</h2>
  * <ul>
  *  <li>{@link org.apache.cocoon.portal.layout.CompositeLayout}</li>
  * </ul>
- * 
+ *
  *
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
- * 
+ *
  * @version CVS $Id$
  */
 public abstract class AbstractCompositeAspect
@@ -55,10 +57,23 @@
 	throws SAXException {
         if ( layout instanceof CompositeLayout) {
             CompositeLayout compositeLayout = (CompositeLayout)layout;
+            Layout entryLayout = service.getEntryLayout(null);
             // loop over all rows
             for (Iterator iter = compositeLayout.getItems().iterator(); iter.hasNext();)
{
                 Item item = (Item) iter.next();
-                this.processItem(item, handler, service);
+                if (entryLayout != null) {
+                    Layout itemLayout = item.getLayout();
+                    if (itemLayout == entryLayout) {
+                        service.setRenderable(Boolean.TRUE);
+                        this.processLayout(itemLayout, service, handler);
+                        return;
+                    }
+                    if (itemLayout instanceof CompositeLayout) {
+                        this.processLayout(itemLayout, service, handler);
+                    }
+                } else {
+                    this.processItem(item, handler, service);
+                }
             }
         } else {
             throw new SAXException("CompositeLayout expected.");
@@ -66,8 +81,8 @@
 	}
 
     /**
-     * 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
@@ -87,5 +102,4 @@
             renderer.toSAX(layout, service, handler);
         }
     }
-
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CIncludeCopletAspect.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/CIncludeCopletAspect.java?rev=330865&r1=330864&r2=330865&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CIncludeCopletAspect.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CIncludeCopletAspect.java
Fri Nov  4 10:54:05 2005
@@ -72,14 +72,16 @@
 	throws SAXException {
         final PreparedConfiguration config = (PreparedConfiguration)context.getAspectConfiguration();
         final CopletInstanceData cid = ((CopletLayout)layout).getCopletInstanceData();
-
-        if ( config.rootTag ) {
+        if (!(context.isRendering())) {
+            context.invokeNext(layout, service, handler);
+        }
+        if ( config.rootTag) {
             XMLUtils.startElement(handler, config.tagName);
         }
 
         this.createCInclude("coplet://" + cid.getId(), handler);
 
-        if ( config.rootTag ) {
+        if ( config.rootTag) {
             XMLUtils.endElement(handler, config.tagName);
         }
 

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CompositeContentAspect.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/CompositeContentAspect.java?rev=330865&r1=330864&r2=330865&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CompositeContentAspect.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CompositeContentAspect.java
Fri Nov  4 10:54:05 2005
@@ -61,7 +61,7 @@
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
  * 
- * @version CVS $Id: CompositeContentAspect.java,v 1.7 2004/04/25 20:09:34 haul Exp $
+ * @version CVS $Id:CompositeContentAspect.java 30932 2004-07-29 17:35:38Z vgritsenko $
  */
 public class CompositeContentAspect extends AbstractCompositeAspect {
 
@@ -76,12 +76,12 @@
                         ContentHandler handler)
     throws SAXException {
         PreparedConfiguration config = (PreparedConfiguration)context.getAspectConfiguration();
-        
-        if ( config.rootTag ) {
+        boolean renderable = context.isRendering();
+        if ( config.rootTag && renderable) {
             XMLUtils.startElement(handler, config.tagName);
         }
         super.toSAX(context, layout, service, handler);
-        if ( config.rootTag ) {
+        if ( config.rootTag && renderable) {
             XMLUtils.endElement(handler, config.tagName);
         }
 

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/DefaultCopletAspect.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/DefaultCopletAspect.java?rev=330865&r1=330864&r2=330865&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/DefaultCopletAspect.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/DefaultCopletAspect.java
Fri Nov  4 10:54:05 2005
@@ -50,7 +50,7 @@
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
  * 
- * @version CVS $Id: DefaultCopletAspect.java,v 1.5 2004/04/25 20:09:34 haul Exp $
+ * @version CVS $Id$
  */
 public class DefaultCopletAspect extends AbstractAspect {
 
@@ -62,7 +62,12 @@
                 		PortalService service,
                 		ContentHandler handler)
 	throws SAXException {
-        
+
+        if (!(context.isRendering())) {
+            context.invokeNext(layout, service, handler);
+            return;
+        }
+
         XMLUtils.startElement(handler, "content");
         CopletInstanceData cid = ((CopletLayout)layout).getCopletInstanceData();
 

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/DefaultRendererContext.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/DefaultRendererContext.java?rev=330865&r1=330864&r2=330865&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/DefaultRendererContext.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/DefaultRendererContext.java
Fri Nov  4 10:54:05 2005
@@ -34,7 +34,7 @@
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
  * 
- * @version CVS $Id: DefaultRendererContext.java,v 1.6 2004/04/25 20:09:34 haul Exp $
+ * @version CVS $Id$
  */
 public final class DefaultRendererContext implements RendererAspectContext {
 
@@ -43,10 +43,12 @@
     private Object config;
     private Map attributes;
     private Map objectModel;
+    private boolean isRendering;
     
-    public DefaultRendererContext(RendererAspectChain chain) {
+    public DefaultRendererContext(RendererAspectChain chain, boolean isRendering) {
         this.iterator = chain.getIterator();
         this.configIterator = chain.getConfigIterator();
+        this.isRendering = chain.isRequired() || isRendering;
     }
     
 	/* (non-Javadoc)
@@ -61,12 +63,15 @@
             final RendererAspect aspect = (RendererAspect) iterator.next();
             aspect.toSAX(this, layout, service, handler);
 		}
-
 	}
 
-	/* (non-Javadoc)
-	 * @see org.apache.cocoon.portal.layout.renderer.RendererAspectContext#getConfiguration()
-	 */
+    public boolean isRendering() {
+        return this.isRendering;
+    }
+
+    /* (non-Javadoc)
+    * @see org.apache.cocoon.portal.layout.renderer.RendererAspectContext#getConfiguration()
+    */
 	public Object getAspectConfiguration() {
 		return this.config;
 	}

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/ParameterAspect.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/ParameterAspect.java?rev=330865&r1=330864&r2=330865&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/ParameterAspect.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/ParameterAspect.java
Fri Nov  4 10:54:05 2005
@@ -69,6 +69,10 @@
         
         final PreparedConfiguration config = (PreparedConfiguration)context.getAspectConfiguration();
 
+        if (!(context.isRendering())) {
+            context.invokeNext( layout, service, contenthandler );
+            return;
+        }
         Map parameter = layout.getParameters();
         if (parameter.size() > 0) {
             AttributesImpl attributes = new AttributesImpl();

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=330865&r1=330864&r2=330865&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
Fri Nov  4 10:54:05 2005
@@ -114,6 +114,11 @@
         final PreparedConfiguration config = (PreparedConfiguration)context.getAspectConfiguration();
         final CopletInstanceData copletInstanceData = ((CopletLayout)layout).getCopletInstanceData();
 
+        if (!(context.isRendering())) {
+            context.invokeNext( layout, service, contenthandler );
+            return;
+        }
+
         if ( config.rootTag ) {
             XMLUtils.startElement(contenthandler, config.tagName);
         }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/RendererAspectChain.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/RendererAspectChain.java?rev=330865&r1=330864&r2=330865&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/RendererAspectChain.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/RendererAspectChain.java
Fri Nov  4 10:54:05 2005
@@ -44,7 +44,7 @@
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
  * 
- * @version CVS $Id: RendererAspectChain.java,v 1.6 2004/04/25 20:09:34 haul Exp $
+ * @version CVS $Id$
  */
 public final class RendererAspectChain {
     
@@ -53,6 +53,8 @@
     protected List configs = new ArrayList(3);
     
     protected List aspectDescriptions = new ArrayList(2);
+
+    private boolean isRequired = false;
     
     public void configure(ServiceSelector selector, Configuration conf) 
     throws ConfigurationException {
@@ -64,7 +66,10 @@
                     final String role = current.getAttribute("type");
                     try {
                         RendererAspect rAspect = (RendererAspect) selector.select(role);
-                        this.aspects.add(rAspect);               
+                        this.aspects.add(rAspect);
+                        if (rAspect.isRequired()) {
+                            isRequired = true;
+                        }
                         Parameters aspectConfiguration = Parameters.fromConfiguration(current);
                         Object compiledConf = rAspect.prepareConfiguration(aspectConfiguration);
                         this.configs.add(compiledConf);
@@ -105,5 +110,9 @@
             selector.release(i.next()); 
         }
         this.aspects.clear();
+    }
+
+    public boolean isRequired() {
+        return this.isRequired;
     }
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.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/TabContentAspect.java?rev=330865&r1=330864&r2=330865&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.java
Fri Nov  4 10:54:05 2005
@@ -113,9 +113,17 @@
 public class TabContentAspect 
     extends CompositeContentAspect {
 
-    /* (non-Javadoc)
-     * @see org.apache.cocoon.portal.layout.renderer.RendererAspect#toSAX(org.apache.cocoon.portal.layout.renderer.RendererAspectContext,
org.apache.cocoon.portal.layout.Layout, org.apache.cocoon.portal.PortalService, org.xml.sax.ContentHandler)
+    /**
+     * Chains that include this aspect must always render
+     * @return true
      */
+    public boolean isRequired() {
+        return true;
+    }
+
+    /* (non-Javadoc)
+    * @see org.apache.cocoon.portal.layout.renderer.RendererAspect#toSAX(org.apache.cocoon.portal.layout.renderer.RendererAspectContext,
org.apache.cocoon.portal.layout.Layout, org.apache.cocoon.portal.PortalService, org.xml.sax.ContentHandler)
+    */
     public void toSAX(RendererAspectContext context,
                         Layout layout,
                         PortalService service,
@@ -160,7 +168,7 @@
                 
                 XMLUtils.startElement(handler, "named-item", attributes);
                 if (j == selected) {
-                    this.processLayout(getNextLayout(service, tab), service, handler);
+                    this.processLayout(tab.getLayout(), service, handler);
                     if (config.includeSelected) {
                         List events = new ArrayList();
                         events.add(event);
@@ -190,13 +198,13 @@
      */
     public Iterator getAspectDescriptions(Object configuration) {
         TabPreparedConfiguration pc = (TabPreparedConfiguration)configuration;
-        
+
         DefaultAspectDescription desc = new DefaultAspectDescription();
         desc.setName(pc.aspectName);
         desc.setClassName("java.lang.Integer");
         desc.setPersistence(pc.store);
         desc.setAutoCreate(true);
-        
+
         return Collections.singletonList(desc).iterator();
     }
 

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/WindowAspect.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/WindowAspect.java?rev=330865&r1=330864&r2=330865&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/WindowAspect.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/WindowAspect.java
Fri Nov  4 10:54:05 2005
@@ -68,6 +68,10 @@
         final PreparedConfiguration config = (PreparedConfiguration)context.getAspectConfiguration();
         final CopletInstanceData copletInstanceData = ((CopletLayout)layout).getCopletInstanceData();
 
+        if (!(context.isRendering())) {
+            context.invokeNext( layout, service, contenthandler );
+            return;
+        }
         if ( config.rootTag ) {
             XMLUtils.startElement(contenthandler, config.tagName);
         }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/XSLTAspect.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/XSLTAspect.java?rev=330865&r1=330864&r2=330865&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/XSLTAspect.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/XSLTAspect.java
Fri Nov  4 10:54:05 2005
@@ -126,6 +126,10 @@
                         PortalService service,
                         ContentHandler handler)
     throws SAXException {
+        if (!(context.isRendering())) {
+            context.invokeNext( layout, service, handler );
+            return;
+        }
         PreparedConfiguration config = (PreparedConfiguration)context.getAspectConfiguration();
 
         XSLTProcessor processor = null;

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/impl/AspectRenderer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/impl/AspectRenderer.java?rev=330865&r1=330864&r2=330865&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/impl/AspectRenderer.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/impl/AspectRenderer.java
Fri Nov  4 10:54:05 2005
@@ -54,7 +54,7 @@
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
  * 
- * @version CVS $Id: AspectRenderer.java,v 1.6 2004/04/25 20:10:29 haul Exp $
+ * @version CVS $Id$
  */
 public class AspectRenderer
     extends AbstractLogEnabled
@@ -80,7 +80,7 @@
      * Stream out raw layout 
      */
     public void toSAX(Layout layout, PortalService service, ContentHandler handler) throws
SAXException {
-        DefaultRendererContext renderContext = new DefaultRendererContext(this.chain);
+        DefaultRendererContext renderContext = new DefaultRendererContext(this.chain, service.isRenderable().booleanValue());
         renderContext.setObjectModel(ContextHelper.getObjectModel(this.context));
         renderContext.invokeNext(layout, service, handler);
     }



Mime
View raw message