cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl SimpleProfileManager.java
Date Mon, 19 May 2003 12:51:00 GMT
cziegeler    2003/05/19 05:51:00

  Modified:    src/blocks/portal/java/org/apache/cocoon/portal/layout/impl
                        DefaultLayoutFactory.java TabLayout.java
                        RowLayout.java ColumnLayout.java
               src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl
                        MaxPageAspect.java MaximizableAspect.java
                        AbstractCompositeAspect.java
               src/blocks/portal/samples/profiles/mapping layout.xml
               src/blocks/portal/java/org/apache/cocoon/portal/layout
                        Layout.java Item.java AbstractLayout.java
                        LayoutFactory.java
               src/blocks/portal/conf portal.xconf
               src/blocks/portal/samples/profiles/layout portal.xml
               src/blocks/portal/java/org/apache/cocoon/portal/aspect
                        AspectDataHandler.java
               src/blocks/portal/java/org/apache/cocoon/portal/profile/impl
                        SimpleProfileManager.java
  Added:       src/blocks/portal/java/org/apache/cocoon/portal/layout/impl
                        DefaultLayoutDescription.java
                        DefaultLayoutAspectDescription.java
                        LayoutAspectDataHandler.java
               src/blocks/portal/java/org/apache/cocoon/portal/layout
                        LayoutAspectDescription.java CompositeLayout.java
                        LayoutDescription.java
  Removed:     src/blocks/portal/java/org/apache/cocoon/portal/layout/impl
                        LayoutAspectDescription.java CompositeLayout.java
                        LayoutDescription.java
  Log:
  Next step to a layout factory
  
  Revision  Changes    Path
  1.3       +39 -4     cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
  
  Index: DefaultLayoutFactory.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultLayoutFactory.java	7 May 2003 20:24:02 -0000	1.2
  +++ DefaultLayoutFactory.java	19 May 2003 12:50:58 -0000	1.3
  @@ -50,12 +50,19 @@
   */
   package org.apache.cocoon.portal.layout.impl;
   
  +import java.util.HashMap;
  +import java.util.Iterator;
  +import java.util.Map;
  +
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.thread.ThreadSafe;
  +import org.apache.cocoon.ProcessingException;
  +import org.apache.cocoon.portal.layout.*;
  +import org.apache.cocoon.portal.layout.Item;
   import org.apache.cocoon.portal.layout.Layout;
   import org.apache.cocoon.portal.layout.LayoutFactory;
   
  @@ -70,6 +77,8 @@
   	extends AbstractLogEnabled
       implements ThreadSafe, Component, LayoutFactory, Configurable {
   
  +    protected Map layouts = new HashMap();
  +    
       /* (non-Javadoc)
        * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
        */
  @@ -78,7 +87,7 @@
           final Configuration[] layoutsConf = configuration.getChild("layouts").getChildren("layout");
           if ( layoutsConf != null ) {
               for(int i=0; i < layoutsConf.length; i++ ) {
  -                LayoutDescription desc = new LayoutDescription();
  +                DefaultLayoutDescription desc = new DefaultLayoutDescription();
                   // TODO unique name test
                   desc.setName(layoutsConf[i].getAttribute("name"));
                   desc.setClassName(layoutsConf[i].getAttribute("class"));        
  @@ -88,20 +97,46 @@
                   final Configuration[] aspectsConf = layoutsConf[i].getChild("aspects").getChildren("aspect");
                   if (aspectsConf != null) {
                       for(int m=0; m < aspectsConf.length; m++) {
  -                        LayoutAspectDescription adesc = new LayoutAspectDescription();
  +                        DefaultLayoutAspectDescription adesc = new DefaultLayoutAspectDescription();
                           adesc.setClassName(aspectsConf[m].getAttribute("class"));
                           adesc.setName(aspectsConf[m].getAttribute("name"));
                           adesc.setPersistence(aspectsConf[m].getAttribute("persistence"));
  +                        desc.addAspect( adesc );
                       }
                   }
  +                LayoutAspectDataHandler handler = new LayoutAspectDataHandler(desc);
  +                this.layouts.put(desc.getName(), new Object[] {desc, handler});
               }
           }
       }
   
  -    public void prepareLayout(Layout layout) {
  +    public void prepareLayout(Layout layout) 
  +    throws ProcessingException {
           if ( layout != null ) {
  +     
  +            final String layoutName = layout.getName();
  +            if ( layoutName == null ) {
  +                throw new ProcessingException("Layout "+layout.getId()+" has no associated name.");
  +            }
  +            Object[] o = (Object[]) this.layouts.get( layoutName );
  +            
  +            if ( o == null ) {
  +                throw new ProcessingException("LayoutDescription with name " + layoutName + " not found.");
  +            }
  +            DefaultLayoutDescription layoutDescription = (DefaultLayoutDescription)o[0];
  +
               // TODO do something here 
               // we have to set the aspect data handler
  +            layout.setAspectDataHandler((LayoutAspectDataHandler)o[1]);
  +            
  +            // recursive
  +            if ( layout instanceof CompositeLayout ) {
  +                CompositeLayout composite = (CompositeLayout)layout;
  +                Iterator items = composite.getItems().iterator();
  +                while ( items.hasNext() ) {
  +                    this.prepareLayout( ((Item)items.next()).getLayout() );
  +                }
  +            }
           }
       }
   
  
  
  
  1.2       +3 -1      cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/TabLayout.java
  
  Index: TabLayout.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/TabLayout.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TabLayout.java	7 May 2003 06:22:21 -0000	1.1
  +++ TabLayout.java	19 May 2003 12:50:58 -0000	1.2
  @@ -50,6 +50,8 @@
   */
   package org.apache.cocoon.portal.layout.impl;
   
  +import org.apache.cocoon.portal.layout.CompositeLayout;
  +
   
   /**
    *
  
  
  
  1.2       +3 -1      cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/RowLayout.java
  
  Index: RowLayout.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/RowLayout.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RowLayout.java	7 May 2003 06:22:21 -0000	1.1
  +++ RowLayout.java	19 May 2003 12:50:58 -0000	1.2
  @@ -50,6 +50,8 @@
   */
   package org.apache.cocoon.portal.layout.impl;
   
  +import org.apache.cocoon.portal.layout.CompositeLayout;
  +
   
   /**
    *
  
  
  
  1.2       +3 -1      cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/ColumnLayout.java
  
  Index: ColumnLayout.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/ColumnLayout.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ColumnLayout.java	7 May 2003 06:22:21 -0000	1.1
  +++ ColumnLayout.java	19 May 2003 12:50:58 -0000	1.2
  @@ -50,6 +50,8 @@
   */
   package org.apache.cocoon.portal.layout.impl;
   
  +import org.apache.cocoon.portal.layout.CompositeLayout;
  +
   /**
    *
    * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutDescription.java
  
  Index: DefaultLayoutDescription.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
   */
  package org.apache.cocoon.portal.layout.impl;
  
  import java.util.ArrayList;
  import java.util.Iterator;
  import java.util.List;
  
  import org.apache.cocoon.portal.layout.LayoutAspectDescription;
  import org.apache.cocoon.portal.layout.LayoutDescription;
  
  
  /**
   * A configured layout
   * 
   * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
   * 
   * @version CVS $Id: DefaultLayoutDescription.java,v 1.1 2003/05/19 12:50:58 cziegeler Exp $
   */
  public class DefaultLayoutDescription
      implements LayoutDescription  {
  
      protected String name;
      
      protected String className;
      
      protected String rendererName;
      
      protected List aspects = new ArrayList();
  
      /**
       * toString
       * @return
       */
      public String toString() {
          StringBuffer buffer = new StringBuffer();
          buffer.append("LayoutDescription(").append(super.toString()).append(")\n");
          buffer.append("    Name=").append(this.name).append('\n');
          buffer.append("    ClassName=").append(this.className).append('\n');
          buffer.append("    RendererName=").append(this.rendererName).append('\n');
          buffer.append("    Aspects=(\n");
          Iterator i = this.aspects.iterator();
          while ( i.hasNext() ) {
              DefaultLayoutAspectDescription d = (DefaultLayoutAspectDescription)i.next();
              buffer.append("             Aspect(").append(d.toString()).append(")\n");
              buffer.append("                 Name=").append(d.getName()).append('\n');
              buffer.append("                 ClassName=").append(d.getClassName()).append('\n');
              buffer.append("                 Persistence=").append(d.getPersistence()).append('\n');
          }
          buffer.append("            )\n");
          return buffer.toString();
      }
      
      /**
       * @return
       */
      public List getAspects() {
          return aspects;
      }
  
      public void addAspect(LayoutAspectDescription aspect) {
          this.aspects.add(aspect);
      }
      
      /**
       * Return the description for an aspect
       */
      public LayoutAspectDescription getAspect(String name) {
          LayoutAspectDescription desc = null;
          Iterator i = this.aspects.iterator();
          while (desc == null && i.hasNext() ) {
              LayoutAspectDescription current = (LayoutAspectDescription)i.next();
              if ( name.equals(current.getName())) {
                  desc = current;
              }
          }
          return desc;
      }
      
      /**
       * @return
       */
      public String getClassName() {
          return className;
      }
  
      /**
       * @return
       */
      public String getName() {
          return name;
      }
  
      /**
       * @param string
       */
      public void setClassName(String string) {
          className = string;
      }
  
      /**
       * @param string
       */
      public void setName(String string) {
          name = string;
      }
  
      /**
       * @return
       */
      public String getRendererName() {
          return rendererName;
      }
  
      /**
       * @param string
       */
      public void setRendererName(String string) {
          rendererName = string;
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutAspectDescription.java
  
  Index: DefaultLayoutAspectDescription.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
   */
  package org.apache.cocoon.portal.layout.impl;
  
  import org.apache.cocoon.portal.layout.LayoutAspectDescription;
  import org.apache.cocoon.util.ClassUtils;
  
  
  
  /**
   * A configured layout aspect
   * 
   * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
   * 
   * @version CVS $Id: DefaultLayoutAspectDescription.java,v 1.1 2003/05/19 12:50:58 cziegeler Exp $
   */
  public class DefaultLayoutAspectDescription 
      implements LayoutAspectDescription {
  
      protected String name;
      
      protected String className;
      
      protected String persistence;
  
      /**
       * @return
       */
      public String getClassName() {
          return className;
      }
  
      /**
       * @return
       */
      public String getName() {
          return name;
      }
  
      /**
       * @param string
       */
      public void setClassName(String string) {
          className = string;
      }
  
      /**
       * @param string
       */
      public void setName(String string) {
          name = string;
      }
  
      /**
       * @return
       */
      public String getPersistence() {
          return persistence;
      }
  
      /**
       * @param string
       */
      public void setPersistence(String string) {
          persistence = string;
      }
  
      /**
       * Create a new instance
       */
      public Object createNewInstance() {
          // TODO - cache class
          try {
              return ClassUtils.loadClass(this.className).newInstance();
          } catch (Exception ignore) {
              return null;
          }
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/LayoutAspectDataHandler.java
  
  Index: LayoutAspectDataHandler.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.portal.layout.impl;
  
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  
  import org.apache.cocoon.portal.aspect.AspectDataHandler;
  import org.apache.cocoon.portal.aspect.Aspectalizable;
  
  /**
   *
   * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
   * 
   * @version CVS $Id: LayoutAspectDataHandler.java,v 1.1 2003/05/19 12:50:58 cziegeler Exp $
   */
  public class LayoutAspectDataHandler 
      implements AspectDataHandler {
  
      protected DefaultLayoutDescription description;
      
      // TODO - Implement persistence
      
      protected Map stati;
      
      /**
       * Constructor
       */
      public LayoutAspectDataHandler(DefaultLayoutDescription desc) {
          this.description = desc;
          this.stati = new HashMap();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.aspect.AspectDataHandler#getAspectData(org.apache.cocoon.portal.aspect.Aspectalizable, java.lang.String)
       */
      public Object getAspectData(Aspectalizable owner, String aspectName) {
          // is this aspect allowed?
          DefaultLayoutAspectDescription aspectDesc = (DefaultLayoutAspectDescription)this.description.getAspect( aspectName );
          if ( aspectDesc == null ) return null;
          
          Map datas = (Map)this.stati.get(owner);
          if ( datas == null ) {
              datas = new HashMap();
              this.stati.put( owner, datas );
          }
          Object data = datas.get( aspectName );
          if ( data == null ) {
              data = aspectDesc.createNewInstance();
              datas.put( aspectName, data );
          }
          return data;
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.aspect.AspectDataHandler#getAspectDatas(org.apache.cocoon.portal.aspect.Aspectalizable)
       */
      public List getAspectDatas(Aspectalizable owner) {
          // TODO Auto-generated method stub
          return null;
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.aspect.AspectDataHandler#setAspectData(org.apache.cocoon.portal.aspect.Aspectalizable, java.lang.String, java.lang.Object)
       */
      public void setAspectData(Aspectalizable owner,
                                 String aspectName,
                                 Object data) {
          // is this aspect allowed?
          DefaultLayoutAspectDescription aspectDesc = (DefaultLayoutAspectDescription)this.description.getAspect( aspectName );
          if ( aspectDesc == null ) return;
  
          Map datas = (Map)this.stati.get(owner);
          if ( datas == null ) {
              datas = new HashMap();
              this.stati.put( owner, datas );
          }
          datas.put( aspectName, data );
          
      }
  
  }
  
  
  
  1.4       +2 -2      cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/MaxPageAspect.java
  
  Index: MaxPageAspect.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/MaxPageAspect.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MaxPageAspect.java	8 May 2003 14:01:03 -0000	1.3
  +++ MaxPageAspect.java	19 May 2003 12:50:59 -0000	1.4
  @@ -51,9 +51,9 @@
   package org.apache.cocoon.portal.layout.renderer.aspect.impl;
   
   import org.apache.cocoon.portal.PortalService;
  +import org.apache.cocoon.portal.layout.CompositeLayout;
   import org.apache.cocoon.portal.layout.Layout;
   import org.apache.cocoon.portal.layout.aspect.CompositeLayoutStatus;
  -import org.apache.cocoon.portal.layout.impl.CompositeLayout;
   import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
   import org.apache.cocoon.portal.profile.ProfileManager;
   import org.xml.sax.ContentHandler;
  
  
  
  1.3       +2 -2      cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/MaximizableAspect.java
  
  Index: MaximizableAspect.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/MaximizableAspect.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MaximizableAspect.java	8 May 2003 14:01:03 -0000	1.2
  +++ MaximizableAspect.java	19 May 2003 12:50:59 -0000	1.3
  @@ -59,10 +59,10 @@
   import org.apache.cocoon.portal.event.Filter;
   import org.apache.cocoon.portal.event.Subscriber;
   import org.apache.cocoon.portal.event.impl.MaximizeEvent;
  +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.aspect.MaximizableLayoutStatus;
  -import org.apache.cocoon.portal.layout.impl.CompositeLayout;
   import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
   import org.apache.cocoon.portal.profile.ProfileManager;
   import org.apache.cocoon.xml.XMLUtils;
  
  
  
  1.2       +2 -2      cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCompositeAspect.java
  
  Index: AbstractCompositeAspect.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCompositeAspect.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractCompositeAspect.java	7 May 2003 06:22:22 -0000	1.1
  +++ AbstractCompositeAspect.java	19 May 2003 12:50:59 -0000	1.2
  @@ -56,9 +56,9 @@
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentSelector;
   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.impl.CompositeLayout;
   import org.apache.cocoon.portal.layout.renderer.Renderer;
   import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
   import org.xml.sax.ContentHandler;
  
  
  
  1.3       +7 -4      cocoon-2.1/src/blocks/portal/samples/profiles/mapping/layout.xml
  
  Index: layout.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/samples/profiles/mapping/layout.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- layout.xml	19 May 2003 09:14:05 -0000	1.2
  +++ layout.xml	19 May 2003 12:50:59 -0000	1.3
  @@ -13,6 +13,9 @@
           <field name="rendererName" type="java.lang.String">
               <bind-xml name="renderer-name" node="attribute" />
           </field>
  +        <field name="name" type="java.lang.String">
  +            <bind-xml name="name" node="attribute" />
  +        </field>
           <field name="static" type="boolean">
               <bind-xml name="static" node="attribute" />
           </field>
  @@ -27,7 +30,7 @@
           </field>
       </class>
   
  -    <class name="org.apache.cocoon.portal.layout.impl.CompositeLayout"
  +    <class name="org.apache.cocoon.portal.layout.CompositeLayout"
              extends="org.apache.cocoon.portal.layout.AbstractLayout">
           <field name="items" type="org.apache.cocoon.portal.layout.Item" collection="collection">
               <bind-xml auto-naming="deriveByClass" />
  @@ -35,7 +38,7 @@
       </class>
   
       <class name="org.apache.cocoon.portal.layout.impl.ColumnLayout"
  -           extends="org.apache.cocoon.portal.layout.impl.CompositeLayout">
  +           extends="org.apache.cocoon.portal.layout.CompositeLayout">
           <map-to xml="column-layout" />
       </class>
   
  @@ -71,7 +74,7 @@
       </class>
   
       <class name="org.apache.cocoon.portal.layout.impl.RowLayout"
  -           extends="org.apache.cocoon.portal.layout.impl.CompositeLayout">
  +           extends="org.apache.cocoon.portal.layout.CompositeLayout">
           <map-to xml="row-layout" />
       </class>
   
  @@ -83,7 +86,7 @@
       </class>
   
       <class name="org.apache.cocoon.portal.layout.impl.TabLayout"
  -           extends="org.apache.cocoon.portal.layout.impl.CompositeLayout">
  +           extends="org.apache.cocoon.portal.layout.CompositeLayout">
           <map-to xml="tab-layout" />
       </class>
   
  
  
  
  1.4       +10 -2     cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/Layout.java
  
  Index: Layout.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/Layout.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Layout.java	8 May 2003 14:01:03 -0000	1.3
  +++ Layout.java	19 May 2003 12:50:59 -0000	1.4
  @@ -65,10 +65,18 @@
   
       /**
        * Get the name of the {@link Renderer} to draw this layout.
  +     * If this layout has an own renderer {@link #getLayoutRendererName()}
  +     * return this, otherwise the default renderer is returned.
        * @return String The role name
        */
       String getRendererName();
  -
  +    
  +    /** 
  +     * Get the name of a custom {@link Renderer} for this layout.
  +     * @return String The role name
  +     */
  +    String getLayoutRendererName();
  +    
       /**
        * Get the unique id of this layout object
        * @return String Unique id
  
  
  
  1.2       +1 -2      cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/Item.java
  
  Index: Item.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/Item.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Item.java	7 May 2003 06:22:24 -0000	1.1
  +++ Item.java	19 May 2003 12:50:59 -0000	1.2
  @@ -50,7 +50,6 @@
   */
   package org.apache.cocoon.portal.layout;
   
  -import org.apache.cocoon.portal.layout.impl.CompositeLayout;
   
   /**
    *
  
  
  
  1.4       +12 -4     cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/AbstractLayout.java
  
  Index: AbstractLayout.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/AbstractLayout.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AbstractLayout.java	8 May 2003 14:01:03 -0000	1.3
  +++ AbstractLayout.java	19 May 2003 12:50:59 -0000	1.4
  @@ -128,15 +128,15 @@
   	}
       
       public Object getAspectData(String aspectName) {
  -        return this.aspectDataHandler.getAspectData(this.getId(), aspectName);
  +        return this.aspectDataHandler.getAspectData(this, aspectName);
       }
       
       public void setAspectData(String aspectName, Object data) {
  -        this.aspectDataHandler.setAspectData(this.getId(), aspectName, data);
  +        this.aspectDataHandler.setAspectData(this, aspectName, data);
       }
       
       public List getAspectDatas() {
  -        return this.aspectDataHandler.getAspectDatas(this.getId());
  +        return this.aspectDataHandler.getAspectDatas(this);
       }
       
       /**
  @@ -158,6 +158,14 @@
        */
       public void setName(String string) {
           name = string;
  +    }
  +
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.portal.layout.Layout#getLayoutRendererName()
  +     */
  +    public String getLayoutRendererName() {
  +        // TODO Auto-generated method stub
  +        return null;
       }
   
   }
  
  
  
  1.2       +8 -2      cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/LayoutFactory.java
  
  Index: LayoutFactory.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/LayoutFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LayoutFactory.java	7 May 2003 13:27:29 -0000	1.1
  +++ LayoutFactory.java	19 May 2003 12:50:59 -0000	1.2
  @@ -50,6 +50,8 @@
   */
   package org.apache.cocoon.portal.layout;
   
  +import org.apache.cocoon.ProcessingException;
  +
   /**
    * This factory is for creating and managing layout objects
    * 
  @@ -59,7 +61,11 @@
    * @version CVS $Id$
    */
   public interface LayoutFactory  {
  +    
  +    String ROLE = LayoutFactory.class.getName();
  +    
   	// TODO - define the interface
       
  -    void prepareLayout(Layout layout);
  +    void prepareLayout(Layout layout)
  +    throws ProcessingException;
   }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/LayoutAspectDescription.java
  
  Index: LayoutAspectDescription.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
   */
  package org.apache.cocoon.portal.layout;
  
  
  
  
  /**
   * A configured layout aspect
   * 
   * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
   * 
   * @version CVS $Id: LayoutAspectDescription.java,v 1.1 2003/05/19 12:50:59 cziegeler Exp $
   */
  public interface LayoutAspectDescription  {
  
      /**
       * @return
       */
      String getClassName();
  
      /**
       * @return
       */
      String getName();
  
      /**
       * @return
       */
      String getPersistence();
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/CompositeLayout.java
  
  Index: CompositeLayout.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.portal.layout;
  
  import java.util.ArrayList;
  import java.util.List;
  
  
  /**
   * A composite layout is a layout that contains other layouts.
   * 
   * @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: CompositeLayout.java,v 1.1 2003/05/19 12:50:59 cziegeler Exp $
   */
  public abstract class CompositeLayout extends AbstractLayout {
  
  	protected List items = new ArrayList();
  
  	/**
  	 * Add indexed item to the itemList.
  	 * @param index, index for the position inside the list
  	 * @param item, item to add
  	 */
  	public final void addItem(int index, Item item) {
  		items.add(index, item);
  	}
  
  	/**
  	 * Add Item to the ItemList.
  	 * @param item, item to add
  	 */
  	public final void addItem(Item item) {
  		items.add(item);
  	}
  
  	/**
  	 * Get Item from the ItemList.
  	 * @return Item
  	 */
  	public final Item getItem(int index) {
  		return (Item) items.get(index);
  	}
  
  	/**
  	 * Get the ItemList.
  	 * @return items
  	 */
  	public final List getItems() {
  		return items;
  	}
  
  	/**
  	 * Get size of ItemList.
  	 * @return size
  	 */
  	public final int getSize() {
  		return items.size();
  	}
      
      public final void removeItem(Item item) {
          this.items.remove(item);
      }
      
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/LayoutDescription.java
  
  Index: LayoutDescription.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
      used to  endorse or promote  products derived from  this software without
      prior written permission. For written permission, please contact
      apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation and was  originally created by
   Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
   */
  package org.apache.cocoon.portal.layout;
  
  import java.util.List;
  
  
  
  /**
   * A configured layout
   * 
   * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
   * 
   * @version CVS $Id: LayoutDescription.java,v 1.1 2003/05/19 12:50:59 cziegeler Exp $
   */
  public interface LayoutDescription  {
  
      /**
       * @return
       */
      List getAspects();
  
      /**
       * Return the description for an aspect
       */
      LayoutAspectDescription getAspect(String name);
      
      /**
       * @return
       */
      String getClassName();
  
      /**
       * @return
       */
      String getName();
  
      /**
       * @return
       */
      String getRendererName();
  }
  
  
  
  1.3       +27 -0     cocoon-2.1/src/blocks/portal/conf/portal.xconf
  
  Index: portal.xconf
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/conf/portal.xconf,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- portal.xconf	19 May 2003 09:14:10 -0000	1.2
  +++ portal.xconf	19 May 2003 12:50:59 -0000	1.3
  @@ -122,6 +122,33 @@
        <renderer name="link" class="org.apache.cocoon.portal.layout.renderer.impl.DefaultLinkRenderer" logger="portal"/>
    </component>
    
  +<!-- Layout factory configuration -->
  +<component class="org.apache.cocoon.portal.layout.impl.DefaultLayoutFactory"
  +           role="org.apache.cocoon.portal.layout.LayoutFactory">
  +    <layouts>
  +        <layout name="column" 
  +                class="org.apache.cocoon.portal.layout.impl.CompositeLayout" 
  +                renderer="column">
  +        </layout>
  +        <layout name="row" 
  +                class="org.apache.cocoon.portal.layout.impl.CompositeLayout" 
  +                renderer="row">
  +        </layout>
  +        <layout name="tab" 
  +                class="org.apache.cocoon.portal.layout.impl.TabLayout" 
  +                renderer="tab">
  +        </layout>
  +        <layout name="frame" 
  +                class="org.apache.cocoon.portal.layout.impl.FrameLayout" 
  +                renderer="frame">
  +        </layout>
  +        <layout name="coplet" 
  +                class="org.apache.cocoon.portal.layout.impl.CopletLayout" 
  +                renderer="window">
  +        </layout>
  +    </layouts>
  +</component>
  +
    <component class="org.apache.cocoon.components.persistance.CastorSourceConverter" role="org.apache.cocoon.components.persistance.CastorSourceConverter">
    	<mapping-source source="layout">context://samples/portal/profiles/mapping/layout.xml</mapping-source>
    	<mapping-source source="copletbasedata">context://samples/portal/profiles/mapping/copletbasedata.xml</mapping-source>
  
  
  
  1.3       +26 -26    cocoon-2.1/src/blocks/portal/samples/profiles/layout/portal.xml
  
  Index: portal.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/samples/profiles/layout/portal.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- portal.xml	19 May 2003 09:14:10 -0000	1.2
  +++ portal.xml	19 May 2003 12:51:00 -0000	1.3
  @@ -1,19 +1,19 @@
   <?xml version="1.0" encoding="UTF-8"?>
  -<tab-layout renderer-name="tab" static="true">
  +<tab-layout renderer-name="tab" static="true" name="tab">
       <named-item name="News">
  -        <column-layout renderer-name="column">
  +        <column-layout renderer-name="column" name="column">
               <item>
                   <parameter name="width" value="350" />
  -                <row-layout renderer-name="row" static="true">
  +                <row-layout renderer-name="row" static="true" name="row">
                       <item>
  -		                <coplet-layout renderer-name="window" static="true">
  +		                <coplet-layout renderer-name="window" static="true" name="coplet">
   		                    <id>1</id>
   		                    <parameter name="title" value="Newsweek"/>
   		                    <coplet-instance-data>Newsweek-1</coplet-instance-data>
   		                </coplet-layout>
                       </item>
                       <item>
  -		                <coplet-layout renderer-name="window">
  +		                <coplet-layout renderer-name="window" name="coplet">
   		                    <id>2</id>
   		                    <parameter name="title" value="NYT Business"/> 
   		                    <coplet-instance-data>NYTBusiness-1</coplet-instance-data>
  @@ -22,24 +22,24 @@
                   </row-layout>
               </item>
               <item>
  -                <row-layout renderer-name="row" static="false">
  +                <row-layout renderer-name="row" static="false" name="row">
                       <item>
  -		                <coplet-layout renderer-name="window">
  +		                <coplet-layout renderer-name="window" name="coplet">
   		                    <id>3</id>
   		                    <parameter name="title" value="BBC News"/>
   		                    <coplet-instance-data>BBCNews-1</coplet-instance-data>
   		                </coplet-layout>
                       </item>
                       <item>
  -                        <column-layout renderer-name="column">
  +                        <column-layout renderer-name="column" name="column">
                               <item>
  -                                <frame-layout renderer-name="frame">
  +                                <frame-layout renderer-name="frame" name="frame">
                                       <id>a</id>
                                       <source>cocoon://samples/portal/news/NYTSport.rss</source>
                                   </frame-layout>
                               </item>
                               <item>
  -                                <coplet-layout renderer-name="window">
  +                                <coplet-layout renderer-name="window" name="coplet">
   				                    <id>4</id>
   				                    <parameter name="title" value="CNET News" />
   				                    <coplet-instance-data>CNET News-1</coplet-instance-data>
  @@ -48,9 +48,9 @@
                           </column-layout>
   		            </item>
                       <item>
  -                        <column-layout renderer-name="column">
  +                        <column-layout renderer-name="column" name="column">
                               <item>
  -                                <coplet-layout renderer-name="window">
  +                                <coplet-layout renderer-name="window" name="coplet">
   				                    <id>5</id>
   				                    <parameter name="title" value="CNET Business News" />
   				                    <coplet-instance-data>CNET Business-1</coplet-instance-data>
  @@ -58,7 +58,7 @@
                               </item>
                               <item>
                                   <parameter name="bgcolor" value="grey" />
  -                                <frame-layout renderer-name="frame">
  +                                <frame-layout renderer-name="frame" name="frame">
                                       <id>b</id>
                                       <source>cocoon://samples/portal/news/CNNEurope.rss</source>
                                   </frame-layout>
  @@ -68,16 +68,16 @@
                   </row-layout>
               </item>
               <item>
  -                <row-layout renderer-name="row" static="false">
  +                <row-layout renderer-name="row" static="false" name="row">
                       <item>
  -		                <coplet-layout renderer-name="window">
  +		                <coplet-layout renderer-name="window" name="coplet">
   		                    <id>6</id>
   		                    <parameter name="title" value="Chicago Sunday Times" />
   		                    <coplet-instance-data>CSTNews-1</coplet-instance-data>
   		                </coplet-layout>
                       </item>
                       <item>
  -		                <coplet-layout renderer-name="window">
  +		                <coplet-layout renderer-name="window" name="coplet">
   		                    <id>7</id>
   		                    <parameter name="title" value="CNN Europe" />
   		                    <coplet-instance-data>CNNEurope-1</coplet-instance-data>
  @@ -88,11 +88,11 @@
           </column-layout>
       </named-item>
       <named-item name="Weblogs">
  -        <column-layout renderer-name="column">
  +        <column-layout renderer-name="column" name="column">
               <item>
  -                <row-layout renderer-name="row">
  +                <row-layout renderer-name="row" name="row">
                       <item>
  -		                <coplet-layout renderer-name="window">
  +		                <coplet-layout renderer-name="window" name="coplet">
   		                    <id>8</id>
   		                    <parameter name="title" value="ML's Weblog" />
   		                    <parameter name="bgcolor" value="#ffff00" />
  @@ -100,7 +100,7 @@
   		                </coplet-layout>
                       </item>
                       <item>
  -		                <coplet-layout renderer-name="window">
  +		                <coplet-layout renderer-name="window" name="coplet">
   		                    <id>9</id>
   		                    <parameter name="title" value="CZ's Weblog" />
   		                    <parameter name="bgcolor" value="#ffff00" />
  @@ -110,9 +110,9 @@
                   </row-layout>
               </item>
               <item>
  -                <row-layout renderer-name="row">
  +                <row-layout renderer-name="row" name="row">
                       <item>
  -		                <coplet-layout renderer-name="window">
  +		                <coplet-layout renderer-name="window" name="coplet">
   		                    <id>10</id>
   		                    <parameter name="title" value="Another Weblog" />
   		                    <parameter name="bgcolor" value="#ffff00" />
  @@ -124,18 +124,18 @@
           </column-layout>
       </named-item>
       <named-item name="Cocoon">
  -        <row-layout renderer-name="row">
  +        <row-layout renderer-name="row" name="row">
               <item>
  -                <column-layout renderer-name="column">
  +                <column-layout renderer-name="column" name="column">
                       <item>
  -		                <coplet-layout renderer-name="window">
  +		                <coplet-layout renderer-name="window" name="coplet">
   		                    <id>11</id>
   		                    <parameter name="title" value="Cocoon Introduction" />
   		                    <coplet-instance-data>Introduction-1</coplet-instance-data>
   		                </coplet-layout>
                       </item>
                       <item>
  -		                <coplet-layout renderer-name="window">
  +		                <coplet-layout renderer-name="window" name="coplet">
   		                    <id>12</id>
   		                    <parameter name="title" value="Cocoon Overview" />
   		                    <coplet-instance-data>Overview-1</coplet-instance-data>
  
  
  
  1.2       +5 -4      cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/aspect/AspectDataHandler.java
  
  Index: AspectDataHandler.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/aspect/AspectDataHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AspectDataHandler.java	7 May 2003 20:24:02 -0000	1.1
  +++ AspectDataHandler.java	19 May 2003 12:51:00 -0000	1.2
  @@ -64,9 +64,10 @@
    */
   public interface AspectDataHandler {
   
  -    Object getAspectData(String objectId, String aspectName);
  +    Object getAspectData(Aspectalizable owner, String aspectName);
       
  -    void setAspectData(String objectId, String aspectName, Object data);
  +    void setAspectData(Aspectalizable owner, String aspectName, Object data);
   
  -    List getAspectDatas(String objectId);
  +    List getAspectDatas(Aspectalizable owner);
  +    
   }
  
  
  
  1.3       +32 -25    cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/SimpleProfileManager.java
  
  Index: SimpleProfileManager.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/SimpleProfileManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SimpleProfileManager.java	19 May 2003 09:14:09 -0000	1.2
  +++ SimpleProfileManager.java	19 May 2003 12:51:00 -0000	1.3
  @@ -54,6 +54,7 @@
   import java.util.Map;
   
   import org.apache.avalon.framework.CascadingRuntimeException;
  +import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.Composable;
  @@ -65,9 +66,10 @@
   import org.apache.cocoon.portal.coplet.CopletInstanceData;
   import org.apache.cocoon.portal.coplet.status.SizeableStatus;
   import org.apache.cocoon.portal.layout.AbstractLayout;
  +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.impl.CompositeLayout;
  +import org.apache.cocoon.portal.layout.LayoutFactory;
   import org.apache.cocoon.portal.layout.impl.CopletLayout;
   import org.apache.cocoon.portal.profile.ProfileManager;
   import org.apache.cocoon.portal.util.DeltaApplicable;
  @@ -89,7 +91,7 @@
       extends AbstractLogEnabled 
       implements Composable, ProfileManager, ThreadSafe {
   
  -    protected ComponentManager componentManager;
  +    protected ComponentManager manager;
   
       private Mapping layoutMapping;
   
  @@ -99,7 +101,7 @@
        * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
        */
       public void compose(ComponentManager componentManager) throws ComponentException {
  -        this.componentManager = componentManager;
  +        this.manager = componentManager;
       }
   
       /**
  @@ -107,8 +109,11 @@
        */
       public Layout getPortalLayout(String key) {
           PortalService service = null;
  +        LayoutFactory factory = null;
  +        
           try {
  -            service = (PortalService) this.componentManager.lookup(PortalService.ROLE);
  +            service = (PortalService) this.manager.lookup(PortalService.ROLE);
  +            factory = (LayoutFactory) this.manager.lookup(LayoutFactory.ROLE);
               
               if ( null == key ) {
                   Layout l = (Layout) service.getTemporaryAttribute("DEFAULT_LAYOUT");
  @@ -172,13 +177,15 @@
   			} else {
   				resolveParents(layout, null, null);
   			}
  -
  +            factory.prepareLayout( layout );
  +             
               return layout;
           } catch (Exception ce) {
               // TODO
               throw new CascadingRuntimeException("Arg", ce);
           } finally {
  -            this.componentManager.release(service);
  +            this.manager.release(service);
  +            this.manager.release((Component)factory);
           }
       }
       
  @@ -277,7 +284,7 @@
   			MapSourceAdapter adapter = null;
   			try {
   				// TODO could one perhaps simply copy the file to increase performance??
  -				adapter = (MapSourceAdapter) this.componentManager.lookup(MapSourceAdapter.ROLE);
  +				adapter = (MapSourceAdapter) this.manager.lookup(MapSourceAdapter.ROLE);
   				map.put("type", "user");
   				
                   // FIXME - disabled saving for testing
  @@ -293,7 +300,7 @@
                       service.setAttribute(SimpleProfileManager.class.getName()+location+"-user-"+map.get("user"), objects);
   				}
   			} finally {
  -				this.componentManager.release(adapter);
  +				this.manager.release(adapter);
   			}
   		}
   		
  @@ -312,7 +319,7 @@
   	throws Exception {
   		MapSourceAdapter adapter = null;
   		try {
  -			adapter = (MapSourceAdapter) this.componentManager.lookup(MapSourceAdapter.ROLE);
  +			adapter = (MapSourceAdapter) this.manager.lookup(MapSourceAdapter.ROLE);
   
   			Object[] objects = (Object[]) service.getAttribute(SimpleProfileManager.class.getName() + location);
   			
  @@ -339,7 +346,7 @@
   
   			return new Object[]{object, Boolean.TRUE};
   		} finally {
  -			this.componentManager.release(adapter);
  +			this.manager.release(adapter);
   		}
   	}
   	
  @@ -352,7 +359,7 @@
   	throws Exception {
   		MapSourceAdapter adapter = null;
   		try {
  -			adapter = (MapSourceAdapter) this.componentManager.lookup(MapSourceAdapter.ROLE);
  +			adapter = (MapSourceAdapter) this.manager.lookup(MapSourceAdapter.ROLE);
   
   			// check whether still valid
   			Object[] objects = (Object[]) service.getAttribute(SimpleProfileManager.class.getName() + location);
  @@ -374,7 +381,7 @@
   
   			return new Object[]{object, Boolean.TRUE};
   		} finally {
  -			this.componentManager.release(adapter);
  +			this.manager.release(adapter);
   		}
   	}
   
  @@ -385,7 +392,7 @@
   	throws Exception {
   		MapSourceAdapter adapter = null;
   		try {
  -			adapter = (MapSourceAdapter) this.componentManager.lookup(MapSourceAdapter.ROLE);
  +			adapter = (MapSourceAdapter) this.manager.lookup(MapSourceAdapter.ROLE);
   
   			if (newValidity == null)
   				newValidity = adapter.getValidity(key);
  @@ -397,7 +404,7 @@
   
   			return object;
   		} finally {
  -			this.componentManager.release(adapter);
  +			this.manager.release(adapter);
   		}
   	}
   
  @@ -410,7 +417,7 @@
   	throws Exception { 
   		MapSourceAdapter adapter = null;
   		try {
  -			adapter = (MapSourceAdapter) this.componentManager.lookup(MapSourceAdapter.ROLE);
  +			adapter = (MapSourceAdapter) this.manager.lookup(MapSourceAdapter.ROLE);
   
   			Object[] objects = (Object[]) service.getAttribute(SimpleProfileManager.class.getName() + location);
   			SourceValidity sourceValidity = null;
  @@ -419,7 +426,7 @@
   			
   			return this.getValidity(key, location, sourceValidity, adapter);
   		} finally {
  -			this.componentManager.release(adapter);
  +			this.manager.release(adapter);
   		}
   	}
   
  @@ -456,7 +463,7 @@
           PortalService service = null;
           String attribute = null;
           try {
  -            service = (PortalService) this.componentManager.lookup(PortalService.ROLE);
  +            service = (PortalService) this.manager.lookup(PortalService.ROLE);
   
   			// TODO Change to KeyManager usage
   			UserHandler handler = RequestState.getState().getHandler();
  @@ -504,19 +511,19 @@
               e.printStackTrace();
               throw new CascadingRuntimeException("CE", e);
           } finally {
  -            this.componentManager.release(service);
  +            this.manager.release(service);
           }
       }
   
       public void setDefaultLayout(Layout object) {
           PortalService service = null;
           try {
  -            service = (PortalService) this.componentManager.lookup(PortalService.ROLE);
  +            service = (PortalService) this.manager.lookup(PortalService.ROLE);
               service.setTemporaryAttribute("DEFAULT_LAYOUT", object);
           } catch (ComponentException e) {
               throw new CascadingRuntimeException("Unable to lookup service manager.", e);
           } finally {
  -            this.componentManager.release(service);
  +            this.manager.release(service);
           }
       }
   
  @@ -564,13 +571,13 @@
           if ( ProfileManager.REQUEST_STATUS.equals( mode )) {
               PortalService service = null;
               try {
  -                service = (PortalService) this.componentManager.lookup(PortalService.ROLE);
  +                service = (PortalService) this.manager.lookup(PortalService.ROLE);
                   return (AspectStatus)service.getTemporaryAttribute(type.getName()+"."+key);
               } catch (ComponentException ce) {
                   // ignore
                   return null;
               } finally {
  -                this.componentManager.release( service );
  +                this.manager.release( service );
               }
           } else {
               // FIXME implement session mode
  @@ -586,7 +593,7 @@
           if ( ProfileManager.REQUEST_STATUS.equals( mode )) {
               PortalService service = null;
               try {
  -                service = (PortalService) this.componentManager.lookup(PortalService.ROLE);
  +                service = (PortalService) this.manager.lookup(PortalService.ROLE);
                   final String attribute = status.getClass().getName() + "." + key;
                   if (null == status) {
                       service.removeTemporaryAttribute(attribute);
  @@ -596,7 +603,7 @@
               } catch (ComponentException ce) {
                   // ignore
               } finally {
  -                this.componentManager.release( service );
  +                this.manager.release( service );
               }
           } else {
               // FIXME implement session mode
  
  
  

Mime
View raw message