cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r330770 - in /cocoon/blocks: portal-sample/trunk/samples/conf/ portal-sample/trunk/samples/skins/basic/styles/ portal-sample/trunk/samples/skins/common/styles/ portal/trunk/java/org/apache/cocoon/portal/coplet/ portal/trunk/java/org/apache/...
Date Fri, 04 Nov 2005 09:51:04 GMT
Author: cziegeler
Date: Fri Nov  4 01:50:49 2005
New Revision: 330770

URL: http://svn.apache.org/viewcvs?rev=330770&view=rev
Log:
Add default values for the static property of layout objects
rename max-paged to maximized

Modified:
    cocoon/blocks/portal-sample/trunk/samples/conf/cocoon-portal-sample.xconf
    cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/window.xsl
    cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/window.xsl
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletDataFeatures.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceDataFeatures.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/CopletAdapter.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/AbstractLayout.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/Layout.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutDescription.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/CopletLayout.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutDescription.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/RendererAspectChain.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/SizingAspect.java

Modified: cocoon/blocks/portal-sample/trunk/samples/conf/cocoon-portal-sample.xconf
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/conf/cocoon-portal-sample.xconf?rev=330770&r1=330769&r2=330770&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/conf/cocoon-portal-sample.xconf (original)
+++ cocoon/blocks/portal-sample/trunk/samples/conf/cocoon-portal-sample.xconf Fri Nov  4 01:50:49
2005
@@ -358,7 +358,8 @@
       </layout>
       <layout name="tab" 
               class="org.apache.cocoon.portal.layout.impl.CompositeLayoutImpl"
-              item-class="org.apache.cocoon.portal.layout.NamedItem">
+              item-class="org.apache.cocoon.portal.layout.NamedItem"
+              default-is-static="true">
         <renderers default="tab">
           <renderer name="tab"/>
         </renderers>
@@ -372,7 +373,8 @@
       </layout>
       <layout name="linktab"
               class="org.apache.cocoon.portal.layout.impl.CompositeLayoutImpl"
-              item-class="org.apache.cocoon.portal.layout.NamedItem">
+              item-class="org.apache.cocoon.portal.layout.NamedItem"
+              default-is-static="true">
         <renderers default="linktab">
           <renderer name="linktab"/>
         </renderers>

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=330770&r1=330769&r2=330770&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 Fri Nov  4 01:50:49
2005
@@ -74,26 +74,27 @@
 	  			    <img src="images/view.gif" border="0" alt="View"/>
 	  			</a>
 			</xsl:if>
-			<xsl:if test="fullscreen-uri and not(maximize-uri)">
-				<a href="{fullscreen-uri}">
-	  			    <img src="images/customize.gif" border="0" alt="Full Screen"/>
-	  			</a>
-			</xsl:if>
-			<xsl:if test="maxpage-uri">
-				<a href="{maxpage-uri}">
-	  			    <img src="images/show.gif" border="0" alt="Max Page"/>
-	  			</a>
-			</xsl:if>
-			<xsl:if test="minpage-uri">
-				<a href="{minpage-uri}">
-	  			    <img src="images/show.gif" border="0" alt="Min Page"/>
-	  			</a>
-			</xsl:if>
-			<xsl:if test="maximize-uri">
-				<a href="{maximize-uri}">
-	  			    <img src="images/maximize.gif" border="0" alt="Maximize"/>
-	  			</a>
-			</xsl:if>
+            <xsl:if test="fullscreen-uri and not(normal-uri)">
+              <td width="15">
+                <a href="{fullscreen-uri}">
+                  <img src="images/customize.gif" border="0" alt="Full Screen"/>
+                </a>
+              </td>
+            </xsl:if>
+            <xsl:if test="maximize-uri">
+              <td width="15">
+                <a href="{maximize-uri}">
+                  <img src="images/show.gif" border="0" alt="Max Page"/>
+                </a>
+              </td>
+            </xsl:if>
+            <xsl:if test="normal-uri">
+              <td width="15">
+                <a href="{normal-uri}">
+                  <img src="images/maximize.gif" border="0" alt="Normal"/>
+                </a>
+              </td>
+            </xsl:if>
 			<xsl:if test="minimize-uri">
 				<a href="{minimize-uri}">
 	  			    <img src="images/minimize.gif" border="0" alt="Minimize"/>

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=330770&r1=330769&r2=330770&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 Fri Nov  4 01:50:49
2005
@@ -50,86 +50,79 @@
        </td>
       <td align="right" valign="middle" bgColor="{$bgColor}">
         <table cellSpacing="0" cellpadding="0" border="0"><tbody><tr>
-			<xsl:if test="basket-add-link">
+		  <xsl:if test="basket-add-link">
             <td width="15">
 				<a href="{basket-add-link}">
 	  			    <img src="images/basket.gif" border="0" alt="Add Link"/>
 	  			</a>
             </td>
-			</xsl:if>
-			<xsl:if test="basket-add-content">
+		  </xsl:if>
+		  <xsl:if test="basket-add-content">
             <td width="15">
 				<a href="{basket-add-content}">
 	  			    <img src="images/basket.gif" border="0" alt="Add Content"/>
 	  			</a>
             </td>
-			</xsl:if>
-			<xsl:if test="edit-uri">
+		  </xsl:if>
+		  <xsl:if test="edit-uri">
             <td width="15">
 				<a href="{edit-uri}">
 	  			    <img src="images/edit.gif" border="0" alt="Edit"/>
 	  			</a>
             </td>
-			</xsl:if>
-			<xsl:if test="help-uri">
+		  </xsl:if>
+		  <xsl:if test="help-uri">
             <td width="15">
 				<a href="{help-uri}">
 	  			    <img src="images/help.gif" border="0" alt="Help"/>
 	  			</a>
             </td>
-			</xsl:if>
-			<xsl:if test="view-uri">
+		  </xsl:if>
+		  <xsl:if test="view-uri">
             <td width="15">
 				<a href="{view-uri}">
 	  			    <img src="images/view.gif" border="0" alt="View"/>
 	  			</a>
             </td>
-			</xsl:if>
+		  </xsl:if>
           <xsl:if test="edit-uri or view-uri or help-uri">
 			  <td width="15">&#160;</td>
           </xsl:if>
-			<xsl:if test="fullscreen-uri and not(maximize-uri)">
+		  <xsl:if test="fullscreen-uri and not(normal-uri)">
             <td width="15">
 				<a href="{fullscreen-uri}">
 	  			    <img src="images/customize.gif" border="0" alt="Full Screen"/>
 	  			</a>
             </td>
-			</xsl:if>
-			<xsl:if test="maxpage-uri">
+		  </xsl:if>
+		  <xsl:if test="maximize-uri">
             <td width="15">
-				<a href="{maxpage-uri}">
+				<a href="maximize-uri">
 	  			    <img src="images/show.gif" border="0" alt="Max Page"/>
 	  			</a>
             </td>
-			</xsl:if>
-			<xsl:if test="minpage-uri">
+		  </xsl:if>
+		  <xsl:if test="normal-uri">
             <td width="15">
-				<a href="{minpage-uri}">
-	  			    <img src="images/show.gif" border="0" alt="Min Page"/>
+				<a href="{normal-uri}">
+	  			    <img src="images/maximize.gif" border="0" alt="Normal"/>
 	  			</a>
             </td>
-			</xsl:if>
-			<xsl:if test="maximize-uri">
-            <td width="15">
-				<a href="{maximize-uri}">
-	  			    <img src="images/maximize.gif" border="0" alt="Maximize"/>
-	  			</a>
-            </td>
-			</xsl:if>
-			<xsl:if test="minimize-uri">
+		  </xsl:if>
+		  <xsl:if test="minimize-uri">
             <td width="15">
 				<a href="{minimize-uri}">
 	  			    <img src="images/minimize.gif" border="0" alt="Minimize"/>
 	  			</a>
             </td>
-			</xsl:if>
-			<xsl:if test="remove-uri">
+		  </xsl:if>
+		  <xsl:if test="remove-uri">
             <td width="15">
 				<a href="{remove-uri}">
 	  			    <img src="images/delete.gif" border="0" alt="Delete"/>
 	  			</a>
             </td>
-			</xsl:if>
+		  </xsl:if>
         </tr></tbody></table>
        </td>
        <td width="5" style="background-color:#294563;" valign="top">

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletDataFeatures.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletDataFeatures.java?rev=330770&r1=330769&r2=330770&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletDataFeatures.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletDataFeatures.java
Fri Nov  4 01:50:49 2005
@@ -38,6 +38,11 @@
      * indicating if the coplet supports the full-screen mode. (default is true) */
     public static final String ATTRIBUTE_FULLSCREEN = "full-screen";
 
+    /** This is the name of the coplet data attribute containing a boolean value
+     * indicating if the coplet handles the minimized sizing state (default is false
+     * meaning the portal handles the state and renders only the title). */
+    public static final String ATTRIBUTE_HANDLE_SIZING = "handle-sizing";
+
     public static Object getAttributeValue(CopletData data, String key, Object defaultValue)
{
         Object value = data.getAttribute(key);
         if ( value == null ) {
@@ -68,6 +73,14 @@
     public static boolean supportsFullScreenMode(CopletData data) {
         Boolean supportsMode = (Boolean)getAttributeValue(data, ATTRIBUTE_FULLSCREEN, Boolean.TRUE);
         return supportsMode.booleanValue();
+    }
+
+    /**
+     * Does this coplet handles sizing by itself?
+     */
+    public static boolean handlesSizing(CopletData data) {
+        Boolean handlesSizing = (Boolean)getAttributeValue(data, ATTRIBUTE_HANDLE_SIZING,
Boolean.FALSE);
+        return handlesSizing.booleanValue();
     }
 
     public static void setSizable(CopletData data, boolean value) {

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java?rev=330770&r1=330769&r2=330770&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
Fri Nov  4 01:50:49 2005
@@ -32,7 +32,7 @@
  *   SIZE_MINIMIZED - the coplet is minimized. Usually in this state only the
  *                    title of the coplet is rendered.
  *   SIZE_FULLSCREEN - the coplet is the only coplet on the screen.
- *   SIZE_MAXPAGE - the coplet gets the most available space, but still shares
+ *   SIZE_MAXIMIZED - the coplet gets the most available space, but still shares
  *                  its space with other coplets, e.g. a navigation etc.
  *
  * TODO - Remove dependency to pluto
@@ -43,7 +43,7 @@
 
     public final static int SIZE_MINIMIZED  = 0;
     public final static int SIZE_NORMAL     = 1;
-    public final static int SIZE_MAXPAGED   = 2;
+    public final static int SIZE_MAXIMIZED   = 2;
     public final static int SIZE_FULLSCREEN = 3;
 
     protected final String id;

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceDataFeatures.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceDataFeatures.java?rev=330770&r1=330769&r2=330770&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceDataFeatures.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceDataFeatures.java
Fri Nov  4 01:50:49 2005
@@ -59,12 +59,14 @@
      */
     public static CopletLayout searchLayout(String copletId, Layout rootLayout) {
         if ( rootLayout instanceof CopletLayout ) {
-            if ( ((CopletLayout)rootLayout).getCopletInstanceData().getId().equals(copletId)
) {
+            final CopletLayout cl = (CopletLayout)rootLayout;
+            if ( cl.getCopletInstanceData() != null
+                 && cl.getCopletInstanceData().getId().equals(copletId) ) {
                 return (CopletLayout) rootLayout;
             }
         } else if ( rootLayout instanceof CompositeLayout ) {
-            CompositeLayout cl = (CompositeLayout)rootLayout;
-            Iterator i = cl.getItems().iterator();
+            final CompositeLayout cl = (CompositeLayout)rootLayout;
+            final Iterator i = cl.getItems().iterator();
             while ( i.hasNext() ) {
                 final Item current = (Item)i.next();
                 CopletLayout result = searchLayout(copletId, current.getLayout());
@@ -100,7 +102,7 @@
         switch (value) {
             case CopletInstanceData.SIZE_NORMAL : return "normal";
             case CopletInstanceData.SIZE_FULLSCREEN : return "fullscreen";
-            case CopletInstanceData.SIZE_MAXPAGED : return "maxpaged";
+            case CopletInstanceData.SIZE_MAXIMIZED : return "maximized";
             case CopletInstanceData.SIZE_MINIMIZED : return "minimized";
             default:
                 return "";

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/CopletAdapter.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/CopletAdapter.java?rev=330770&r1=330769&r2=330770&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/CopletAdapter.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/CopletAdapter.java
Fri Nov  4 01:50:49 2005
@@ -56,7 +56,7 @@
     String ROLE = CopletAdapter.class.getName();
 
     /**
-     * Initialize the coplet
+     * Initialize the coplet.
      * This method is called immediately after a new instance is created.
      * For each coplet, this method is only invoked once.
      * @param coplet The coplet
@@ -64,7 +64,7 @@
     void init(CopletInstanceData coplet);
 
     /**
-     * Destroy the coplet
+     * Destroy the coplet.
      * This method is invoked when a coplet instance will be destroyed
      * For each coplet, this method is only invoked once.
      * @param coplet
@@ -72,20 +72,20 @@
     void destroy(CopletInstanceData coplet);
 
     /**
-     * Stream the content of the coplet
+     * Stream the content of the coplet.
      */
     void toSAX(CopletInstanceData coplet, ContentHandler contentHandler)
     throws SAXException;
 
     /**
-     * User logs in to a coplet
+     * User logs in to a coplet.
      * This method is invoked when a user logs in for each coplet instance
-     * of the user
+     * of the user.
      */
     void login(CopletInstanceData coplet);
 
     /**
-     * User logs out from a coplet
+     * User logs out from a coplet.
      * This method is invoked when a user logs out for each coplet instance
      * of this user.
      */

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/AbstractLayout.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/AbstractLayout.java?rev=330770&r1=330769&r2=330770&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/AbstractLayout.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/AbstractLayout.java Fri
Nov  4 01:50:49 2005
@@ -53,7 +53,7 @@
     transient protected Map temporaryAttributes = new LinkedMap();
 
     /** Is this layout object static? */
-    protected boolean isStatic = false;
+    protected Boolean isStatic;
 
     /**
      * DO NOT USE THIS CONSTRUCTOR - it's just here to keep Castor happy.
@@ -93,6 +93,9 @@
             throw new PortalRuntimeException("The layout has already a layout description.");
         }
         this.description = description;
+        if ( this.isStatic == null ) {
+            this.isStatic = Boolean.valueOf(this.description.defaultIsStatic());
+        }
     }
 
     /**
@@ -168,11 +171,11 @@
     /**
      * @see org.apache.cocoon.portal.layout.Layout#isStatic()
      */
-    public boolean isStatic() {
+    public Boolean isStatic() {
         return this.isStatic;
     }
 
-    public void setIsStatic(boolean value) {
+    public void setIsStatic(Boolean value) {
         this.isStatic = value;
     }
 

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/Layout.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/Layout.java?rev=330770&r1=330769&r2=330770&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/Layout.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/Layout.java Fri Nov  4
01:50:49 2005
@@ -136,5 +136,5 @@
      * If a layout is static, it is not removed when another layout
      * is max paged.
      */
-    boolean isStatic();
+   Boolean isStatic();
 }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutDescription.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutDescription.java?rev=330770&r1=330769&r2=330770&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutDescription.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutDescription.java
Fri Nov  4 01:50:49 2005
@@ -48,6 +48,11 @@
     boolean createId();
 
     /**
+     * Default setting for static.
+     */
+    boolean defaultIsStatic();
+
+    /**
      * This is the name of the renderer used by default to render this layout object.
      * @return the default renderer name
      */

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/CopletLayout.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/CopletLayout.java?rev=330770&r1=330769&r2=330770&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/CopletLayout.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/CopletLayout.java
Fri Nov  4 01:50:49 2005
@@ -27,6 +27,7 @@
  */
 public final class CopletLayout extends AbstractLayout {
 
+    /** The coplet instance data. */
     protected CopletInstanceData copletInstanceData;
 
     /**

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutDescription.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutDescription.java?rev=330770&r1=330769&r2=330770&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutDescription.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutDescription.java
Fri Nov  4 01:50:49 2005
@@ -42,6 +42,8 @@
 
     protected String itemClassName;
 
+    protected boolean defaultIsStatic = false;
+
     public String getDefaultRendererName() {
         return defaultRendererName;
     }
@@ -115,5 +117,16 @@
 
     public void setCreateId(boolean value) {
         this.createId = value;
+    }
+
+    /**
+     * @see org.apache.cocoon.portal.layout.LayoutDescription#defaultIsStatic()
+     */
+    public boolean defaultIsStatic() {
+        return this.defaultIsStatic;
+    }
+
+    public void setDefaultIsStatic(boolean value) {
+        this.defaultIsStatic = value;
     }
 }

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=330770&r1=330769&r2=330770&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
Fri Nov  4 01:50:49 2005
@@ -132,6 +132,7 @@
         desc.setClassName(layoutConf.getAttribute("class"));        
         desc.setCreateId(layoutConf.getAttributeAsBoolean("create-id", false));
         desc.setItemClassName(layoutConf.getAttribute("item-class", null));
+        desc.setDefaultIsStatic(layoutConf.getAttributeAsBoolean("default-is-static", false));
 
         // the renderers
         final String defaultRenderer = layoutConf.getChild("renderers").getAttribute("default");

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/RendererAspectChain.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/RendererAspectChain.java?rev=330770&r1=330769&r2=330770&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/RendererAspectChain.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/RendererAspectChain.java
Fri Nov  4 01:50:49 2005
@@ -45,34 +45,34 @@
  */
 public final class RendererAspectChain {
 
+    /** The list of renderer aspects. */
     protected List aspects = new ArrayList(3);
 
+    /** The list of the configuration obejcts for each renderer aspects. */
     protected List configs = new ArrayList(3);
 
     public void configure(ServiceSelector selector, Configuration conf) 
     throws ConfigurationException {
         if ( conf != null ) {
             Configuration[] aspects = conf.getChildren("aspect");
-            if ( aspects != null ) {
-                for(int i=0; i < aspects.length; i++) {
-                    final Configuration current = aspects[i];
-                    final String role = current.getAttribute("type");
-                    try {
-                        RendererAspect rAspect = (RendererAspect) selector.select(role);
-                        this.aspects.add(rAspect);               
-                        Parameters aspectConfiguration = Parameters.fromConfiguration(current);
-                        Object compiledConf = rAspect.prepareConfiguration(aspectConfiguration);
-                        this.configs.add(compiledConf);
+            for(int i=0; i < aspects.length; i++) {
+                final Configuration current = aspects[i];
+                final String role = current.getAttribute("type");
+                try {
+                    RendererAspect rAspect = (RendererAspect) selector.select(role);
+                    this.aspects.add(rAspect);               
+                    Parameters aspectConfiguration = Parameters.fromConfiguration(current);
+                    Object compiledConf = rAspect.prepareConfiguration(aspectConfiguration);
+                    this.configs.add(compiledConf);
 
-                    } catch (ParameterException pe) {
-                        throw new ConfigurationException("Unable to configure renderer aspect
" + role, pe);
-                    } catch (ServiceException se) {
-                        throw new ConfigurationException("Unable to lookup aspect " + role,
se);
-                    }
+                } catch (ParameterException pe) {
+                    throw new ConfigurationException("Unable to configure renderer aspect:
" + role, pe);
+                } catch (ServiceException se) {
+                    throw new ConfigurationException("Unable to lookup renderer aspect: "
+ role, se);
                 }
             }
         } else {
-            throw new ConfigurationException("No aspects configured");
+            throw new ConfigurationException("No aspects configured.");
         }
     }
 

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=330770&r1=330769&r2=330770&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
Fri Nov  4 01:50:49 2005
@@ -74,51 +74,36 @@
             XMLUtils.createElement(handler, "coplet-size", CopletInstanceDataFeatures.sizeToString(size));
             Event event;
 
-            if ( size == CopletInstanceData.SIZE_NORMAL ) {
+            if ( size != CopletInstanceData.SIZE_MINIMIZED ) {
                 event = new CopletInstanceSizingEvent(cid, CopletInstanceData.SIZE_MINIMIZED);
                 XMLUtils.createElement(handler, "minimize-uri", service.getComponentManager().getLinkService().getLinkURI(event));
             }
-
-            if ( size == CopletInstanceData.SIZE_MINIMIZED) {
+            if ( size != CopletInstanceData.SIZE_NORMAL) {
                 event = new CopletInstanceSizingEvent(cid, CopletInstanceData.SIZE_NORMAL);
+                XMLUtils.createElement(handler, "normal-uri", service.getComponentManager().getLinkService().getLinkURI(event));
+            }
+            if ( size != CopletInstanceData.SIZE_MAXIMIZED ) {
+                event = new CopletInstanceSizingEvent(cid, CopletInstanceData.SIZE_MAXIMIZED);
                 XMLUtils.createElement(handler, "maximize-uri", service.getComponentManager().getLinkService().getLinkURI(event));
             }
 
-            if (size == CopletInstanceData.SIZE_MINIMIZED) {
-                showContent = false;
-            }
             boolean supportsFullScreen = CopletDataFeatures.supportsFullScreenMode(cid.getCopletData());
             if ( supportsFullScreen ) {
                 final Layout fullScreenLayout = service.getEntryLayout(null);
                 if ( fullScreenLayout != null && fullScreenLayout.equals( layout
)) {
                     event = new CopletInstanceSizingEvent( cid, CopletInstanceData.SIZE_NORMAL
);
-                    XMLUtils.createElement(handler, "maximize-uri", service.getComponentManager().getLinkService().getLinkURI(event));
+                    XMLUtils.createElement(handler, "normal-uri", service.getComponentManager().getLinkService().getLinkURI(event));
                 } else {
                     event = new CopletInstanceSizingEvent( cid, CopletInstanceData.SIZE_FULLSCREEN
);
                     XMLUtils.createElement(handler, "fullscreen-uri", service.getComponentManager().getLinkService().getLinkURI(event));
                 }
             }
-        } 
-/*        boolean maxPageable = ((Boolean)cid.getCopletData().getAspectData("maxpageable")).booleanValue();
-        if ( maxPageable ) {
-            if ( size == null ) {
-                size = (Integer)cid.getAspectData("size");
-                if ( size == null ) {
-                    size = SizingStatus.STATUS_MAXIMIZED;
-                }
-            }
-            ChangeCopletInstanceAspectDataEvent event;    
 
-            if ( size == SizingStatus.STATUS_MAXIMIZED) {
-                event = new ChangeCopletInstanceAspectDataEvent(cid, "size", SizingStatus.STATUS_MAXPAGED);
-                XMLUtils.createElement(handler, "maxpage-uri", service.getComponentManager().getLinkService().getLinkURI(event));
-            }
-            if ( size == SizingStatus.STATUS_MAXPAGED) {
-                event = new ChangeCopletInstanceAspectDataEvent(cid, "size", SizingStatus.STATUS_MAXIMIZED);
-                XMLUtils.createElement(handler, "minpage-uri", service.getComponentManager().getLinkService().getLinkURI(event));
+            if (!CopletDataFeatures.handlesSizing(cid.getCopletData())
+                && size == CopletInstanceData.SIZE_MINIMIZED) {
+                showContent = false;
             }
-        }
-*/               
+        } 
         if ( showContent ) {
             context.invokeNext(layout, service, handler);
         }



Mime
View raw message