You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2003/05/26 15:18:21 UTC

cvs commit: cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/subscriber/impl SizingEventSubscriber.java

cziegeler    2003/05/26 06:18:20

  Modified:    src/blocks/portal/java/org/apache/cocoon/portal/layout/impl
                        DefaultLayoutFactory.java
               src/blocks/portal/java/org/apache/cocoon/portal/layout
                        CompositeLayout.java
               src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl
                        RemovableAspect.java SizingAspect.java
               src/blocks/portal/java/org/apache/cocoon/portal/event/impl
                        DefaultEventManager.java
               src/blocks/portal/java/org/apache/cocoon/portal/coplet/status
                        SizingStatus.java
               src/blocks/portal/samples/profiles/mapping layout.xml
               src/blocks/portal/java/org/apache/cocoon/portal/transformation
                        EventLinkTransformer.java
               src/blocks/portal/conf portal.xconf
  Added:       src/blocks/portal/java/org/apache/cocoon/portal/layout/impl
                        CompositeLayoutImpl.java
               src/blocks/portal/java/org/apache/cocoon/portal/event/impl
                        CopletLinkEvent.java
  Removed:     src/blocks/portal/java/org/apache/cocoon/portal/event/impl
                        LinkEvent.java SizingStatusEvent.java
               src/blocks/portal/java/org/apache/cocoon/portal/event/subscriber/impl
                        SizingEventSubscriber.java
  Log:
  Further code-cleanup
  
  Revision  Changes    Path
  1.7       +74 -2     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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DefaultLayoutFactory.java	22 May 2003 12:32:46 -0000	1.6
  +++ DefaultLayoutFactory.java	26 May 2003 13:18:19 -0000	1.7
  @@ -57,6 +57,7 @@
   import java.util.Map;
   
   import org.apache.avalon.framework.activity.Disposable;
  +import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
  @@ -72,6 +73,12 @@
   import org.apache.cocoon.portal.aspect.AspectDataStore;
   import org.apache.cocoon.portal.aspect.impl.DefaultAspectDataHandler;
   import org.apache.cocoon.portal.aspect.impl.DefaultAspectDescription;
  +import org.apache.cocoon.portal.event.Event;
  +import org.apache.cocoon.portal.event.EventManager;
  +import org.apache.cocoon.portal.event.Filter;
  +import org.apache.cocoon.portal.event.LayoutEvent;
  +import org.apache.cocoon.portal.event.Subscriber;
  +import org.apache.cocoon.portal.event.impl.LayoutRemoveEvent;
   import org.apache.cocoon.portal.layout.*;
   import org.apache.cocoon.portal.layout.Item;
   import org.apache.cocoon.portal.layout.Layout;
  @@ -87,7 +94,14 @@
    */
   public class DefaultLayoutFactory
   	extends AbstractLogEnabled
  -    implements ThreadSafe, Component, LayoutFactory, Configurable, Disposable, Composable {
  +    implements ThreadSafe, 
  +                 Component, 
  +                 LayoutFactory, 
  +                 Configurable, 
  +                 Disposable, 
  +                 Composable,
  +                 Initializable,
  +                 Subscriber {
   
       protected Map layouts = new HashMap();
       
  @@ -189,6 +203,7 @@
           layout.setDescription( layoutDescription );
           layout.setAspectDataHandler((AspectDataHandler)o[1]);
   
  +        // TODO - register this at the profile manager
           return layout;
       }
       
  @@ -202,6 +217,14 @@
        */
       public void dispose() {
           if ( this.manager != null ) {
  +            EventManager eventManager = null;
  +            try { 
  +                eventManager = (EventManager)this.manager.lookup(EventManager.ROLE);
  +                eventManager.getRegister().unsubscribe( this );
  +            } catch (Exception ignore) {
  +            } finally {
  +                this.manager.release( eventManager ); 
  +            }
               this.manager.release( this.storeSelector );
               this.storeSelector = null;
               this.manager = null;
  @@ -217,4 +240,53 @@
           this.storeSelector = (ComponentSelector)this.manager.lookup( AspectDataStore.ROLE+"Selector" );
       }
   
  +    /* (non-Javadoc)
  +     * @see org.apache.avalon.framework.activity.Initializable#initialize()
  +     */
  +    public void initialize() throws Exception {
  +        EventManager eventManager = null;
  +        try { 
  +            eventManager = (EventManager)this.manager.lookup(EventManager.ROLE);
  +            eventManager.getRegister().subscribe( this );
  +        } finally {
  +            this.manager.release( eventManager );
  +        }
  +    }
  +
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.portal.event.Subscriber#getFilter()
  +     */
  +    public Filter getFilter() {
  +        return null;
  +    }
  +
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.portal.event.Subscriber#getEventType()
  +     */
  +    public Class getEventType() {
  +        return LayoutEvent.class;
  +    }
  +
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.portal.event.Subscriber#inform(org.apache.cocoon.portal.event.Event)
  +     */
  +    public void inform(Event e) {
  +        // event dispatching
  +        if ( e instanceof LayoutRemoveEvent ) {
  +            LayoutRemoveEvent event = (LayoutRemoveEvent)e;
  +            Layout layout = (Layout)event.getTarget();
  +            this.remove( layout );
  +        }
  +    }
  +
  +    public void remove(Layout layout) {
  +        // TODO - if this is a coplet layout remove coplet instance data
  +        // TODO - remove this from the profile manager
  +        // TODO - if this is a composite layout, recursive remove
  +        Item parent = layout.getParent();
  +        if ( parent != null && parent.getParent() != null) {
  +            parent.getParent().removeItem( parent );
  +        }
  +        
  +    }
   }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/CompositeLayoutImpl.java
  
  Index: CompositeLayoutImpl.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  <st...@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.List;
  
  import org.apache.cocoon.portal.layout.AbstractLayout;
  import org.apache.cocoon.portal.layout.CompositeLayout;
  import org.apache.cocoon.portal.layout.Item;
  
  
  /**
   * 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: CompositeLayoutImpl.java,v 1.1 2003/05/26 13:18:19 cziegeler Exp $
   */
  public class CompositeLayoutImpl 
      extends AbstractLayout
      implements CompositeLayout {
  
  	protected List items = new ArrayList();
  
      /**
       * Constructor
       */
      public CompositeLayoutImpl() {}
      
  	/**
  	 * 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);
          item.setParent(this);
  	}
  
  	/**
  	 * Add Item to the ItemList.
  	 * @param item, item to add
  	 */
  	public final void addItem(Item item) {
  		items.add(item);
  		item.setParent(this);
  	}
  
  	/**
  	 * 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);
          item.setParent(null);
      }
      
  }
  
  
  
  1.6       +9 -37     cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/CompositeLayout.java
  
  Index: CompositeLayout.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/CompositeLayout.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CompositeLayout.java	26 May 2003 12:49:12 -0000	1.5
  +++ CompositeLayout.java	26 May 2003 13:18:19 -0000	1.6
  @@ -50,7 +50,6 @@
   */
   package org.apache.cocoon.portal.layout;
   
  -import java.util.ArrayList;
   import java.util.List;
   
   
  @@ -60,65 +59,38 @@
    * @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>
    * 
  - * TODO Make an interface out of this
  - * 
    * @version CVS $Id$
    */
  -public class CompositeLayout extends AbstractLayout {
  -
  -	protected List items = new ArrayList();
  +public interface CompositeLayout 
  +    extends Layout {
   
  -    /**
  -     * Constructor
  -     */
  -    public CompositeLayout() {}
  -    
   	/**
   	 * 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);
  -        item.setParent(this);
  -	}
  +    void addItem(int index, Item item);
   
   	/**
   	 * Add Item to the ItemList.
   	 * @param item, item to add
   	 */
  -	public final void addItem(Item item) {
  -		items.add(item);
  -		item.setParent(this);
  -	}
  +	void addItem(Item item);
   
  -	/**
  -	 * Get Item from the ItemList.
  -	 * @return Item
  -	 */
  -	public final Item getItem(int index) {
  -		return (Item) items.get(index);
  -	}
  +	Item getItem(int index);
   
   	/**
   	 * Get the ItemList.
   	 * @return items
   	 */
  -	public final List getItems() {
  -		return items;
  -	}
  +	List getItems();
   
   	/**
   	 * Get size of ItemList.
   	 * @return size
   	 */
  -	public final int getSize() {
  -		return items.size();
  -	}
  +	int getSize();
       
  -    public final void removeItem(Item item) {
  -        this.items.remove(item);
  -        item.setParent(null);
  -    }
  +    void removeItem(Item item);
       
   }
  
  
  
  1.4       +2 -21     cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/RemovableAspect.java
  
  Index: RemovableAspect.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/RemovableAspect.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RemovableAspect.java	26 May 2003 12:49:13 -0000	1.3
  +++ RemovableAspect.java	26 May 2003 13:18:19 -0000	1.4
  @@ -52,7 +52,6 @@
   
   import org.apache.cocoon.portal.PortalService;
   import org.apache.cocoon.portal.coplet.CopletInstanceData;
  -import org.apache.cocoon.portal.event.Event;
   import org.apache.cocoon.portal.event.impl.LayoutRemoveEvent;
   import org.apache.cocoon.portal.layout.Layout;
   import org.apache.cocoon.portal.layout.impl.CopletLayout;
  @@ -69,7 +68,7 @@
    * @version CVS $Id$
    */
   public class RemovableAspect 
  -    extends AbstractActionAspect {
  +    extends AbstractAspect {
   
   	/* (non-Javadoc)
   	 * @see org.apache.cocoon.portal.layout.renderer.RendererAspect#toSAX(org.apache.cocoon.portal.layout.renderer.RendererAspectContext, org.apache.cocoon.portal.layout.Layout, org.apache.cocoon.portal.PortalService, org.xml.sax.ContentHandler)
  @@ -90,22 +89,4 @@
           context.invokeNext(layout, service, handler);
   	}
   
  -    /* (non-Javadoc)
  -     * @see org.apache.cocoon.portal.event.Subscriber#getEventType()
  -     */
  -    public Class getEventType() {
  -        return LayoutRemoveEvent.class;
  -    }
  -
  -    /* (non-Javadoc)
  -     * @see org.apache.cocoon.portal.event.Subscriber#inform(org.apache.cocoon.portal.event.Event)
  -     */
  -    public void inform(Event e) {
  -        // TODO - place this subscriber at a more strategic place
  -        // TODO - if this is a coplet layout remove coplet instance data
  -        // TODO - if this is a composite layout, recursive remove
  -        LayoutRemoveEvent event = (LayoutRemoveEvent)e;
  -        Layout layout = (Layout)event.getTarget();
  -        layout.getParent().getParent().removeItem(layout.getParent());
  -    }
   }
  
  
  
  1.4       +12 -10    cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/SizingAspect.java
  
  Index: SizingAspect.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/SizingAspect.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SizingAspect.java	22 May 2003 12:32:46 -0000	1.3
  +++ SizingAspect.java	26 May 2003 13:18:19 -0000	1.4
  @@ -53,7 +53,7 @@
   import org.apache.cocoon.portal.PortalService;
   import org.apache.cocoon.portal.coplet.CopletInstanceData;
   import org.apache.cocoon.portal.coplet.status.SizingStatus;
  -import org.apache.cocoon.portal.event.impl.SizingStatusEvent;
  +import org.apache.cocoon.portal.event.impl.ChangeCopletInstanceAspectDataEvent;
   import org.apache.cocoon.portal.layout.Layout;
   import org.apache.cocoon.portal.layout.impl.CopletLayout;
   import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
  @@ -83,21 +83,23 @@
   
           Boolean sizable = (Boolean)cid.getCopletData().getAspectData("sizable");
           if ( sizable.booleanValue() ) {
  -            SizingStatus size = (SizingStatus)cid.getAspectData("size");
  -            int status = (size == null ? SizingStatus.STATUS_MAXIMIZED : size.getStatus());
  +            Integer size = (Integer)cid.getAspectData("size");
  +            if ( size == null ) {
  +                size = SizingStatus.STATUS_MAXIMIZED;
  +            }
   
  -            SizingStatusEvent event;    
  +            ChangeCopletInstanceAspectDataEvent event;    
   
  -            if ( status != SizingStatus.STATUS_MINIMIZED) {
  -                event = new SizingStatusEvent(cid, SizingStatus.STATUS_MINIMIZED, size);
  +            if ( !size.equals(SizingStatus.STATUS_MINIMIZED)) {
  +                event = new ChangeCopletInstanceAspectDataEvent(cid, "size", SizingStatus.STATUS_MINIMIZED);
                   XMLUtils.createElement(handler, "minimize-uri", service.getLinkService().getLinkURI(event));
               }
   
  -            if ( status != SizingStatus.STATUS_MAXIMIZED) {
  -                event = new SizingStatusEvent(cid, SizingStatus.STATUS_MAXIMIZED, size);
  +            if ( !size.equals(SizingStatus.STATUS_MAXIMIZED)) {
  +                event = new ChangeCopletInstanceAspectDataEvent(cid, "size", SizingStatus.STATUS_MAXIMIZED);
                   XMLUtils.createElement(handler, "maximize-uri", service.getLinkService().getLinkURI(event));
               }
  -            if (status != SizingStatus.STATUS_MINIMIZED) {
  +            if (size != SizingStatus.STATUS_MINIMIZED) {
                   context.invokeNext(layout, service, handler);
               }
           } else {
  
  
  
  1.9       +1 -3      cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/DefaultEventManager.java
  
  Index: DefaultEventManager.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/DefaultEventManager.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DefaultEventManager.java	26 May 2003 12:49:13 -0000	1.8
  +++ DefaultEventManager.java	26 May 2003 13:18:19 -0000	1.9
  @@ -80,7 +80,6 @@
   import org.apache.cocoon.portal.event.Subscriber;
   import org.apache.cocoon.portal.event.aspect.EventAspect;
   import org.apache.cocoon.portal.event.subscriber.impl.DefaultChangeAspectDataEventSubscriber;
  -import org.apache.cocoon.portal.event.subscriber.impl.SizingEventSubscriber;
   
   /**
    *
  @@ -155,7 +154,6 @@
   
           // FIXME (CZ,HIGH) : Make this configurable
           this.subscribe(new DefaultChangeAspectDataEventSubscriber(this.manager));
  -        this.subscribe(new SizingEventSubscriber(this.manager));
       }
   
       public void publish( final Event event ) {
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/CopletLinkEvent.java
  
  Index: CopletLinkEvent.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  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.portal.event.impl;
  
  import org.apache.cocoon.portal.coplet.CopletInstanceData;
  import org.apache.cocoon.portal.event.CopletInstanceEvent;
  
  /**
   * This class realizes a link event created by the EventLinkTransformer.
   *  
   * @author <a href="mailto:bluetkemeier@s-und-n.de">Bj�rn L�tkemeier</a>
   * 
   * @version CVS $Id: CopletLinkEvent.java,v 1.1 2003/05/26 13:18:19 cziegeler Exp $
   */
  public class CopletLinkEvent
  extends AbstractActionEvent
  implements CopletInstanceEvent {
      
      /**
       * The link to be handled by this event.
       */
      protected String link;
      
      /**
       * Creates a new LinkEvent.
       */
      public CopletLinkEvent(CopletInstanceData target, String link) {
          super(target);
          this.link = link;
      }
      
      /**
       * Gets this event's link.
       */
      public String getLink() {
          return this.link;
      }
  }
  
  
  
  1.3       +5 -26     cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/coplet/status/SizingStatus.java
  
  Index: SizingStatus.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/coplet/status/SizingStatus.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SizingStatus.java	22 May 2003 12:32:46 -0000	1.2
  +++ SizingStatus.java	26 May 2003 13:18:20 -0000	1.3
  @@ -51,7 +51,8 @@
   package org.apache.cocoon.portal.coplet.status;
   
   /**
  - *
  + * Constants for sizing
  + * 
    * @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>
    * 
  @@ -59,29 +60,7 @@
    */
   public final class SizingStatus {
   
  -    public final static int STATUS_MINIMIZED = 0;
  -    public final static int STATUS_MAXIMIZED = 1;
  -
  -    protected int status;
  -    
  -    public SizingStatus() {
  -        this.status = STATUS_MAXIMIZED;
  -    }
  -    
  -    /**
  -     * Returns the status.
  -     * @return int
  -     */
  -    public int getStatus() {
  -        return status;
  -    }
  +    public final static Integer STATUS_MINIMIZED = new Integer(0);
  +    public final static Integer STATUS_MAXIMIZED = new Integer(1);
   
  -    /**
  -     * Sets the status.
  -     * @param status The status to set
  -     */
  -    public void setStatus(int status) {
  -        this.status = status;
  -    }
  -    
   }
  
  
  
  1.10      +3 -2      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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- layout.xml	22 May 2003 15:19:38 -0000	1.9
  +++ layout.xml	26 May 2003 13:18:20 -0000	1.10
  @@ -46,9 +46,10 @@
           </field>
       </class>
   
  -    <class name="org.apache.cocoon.portal.layout.CompositeLayout"
  +    <class name="org.apache.cocoon.portal.layout.impl.CompositeLayoutImpl"
              extends="org.apache.cocoon.portal.layout.AbstractLayout">
  -        <field name="items" type="org.apache.cocoon.portal.layout.Item" collection="collection">
  +        <map-to xml="composite-layout"/>
  +        <field name="items" type="org.apache.cocoon.portal.layout.Item" collection="collection" set-method="addItem">
               <bind-xml auto-naming="deriveByClass" />
           </field>
       </class>
  
  
  
  1.3       +4 -4      cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/transformation/EventLinkTransformer.java
  
  Index: EventLinkTransformer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/transformation/EventLinkTransformer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- EventLinkTransformer.java	26 May 2003 12:49:13 -0000	1.2
  +++ EventLinkTransformer.java	26 May 2003 13:18:20 -0000	1.3
  @@ -55,7 +55,7 @@
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.cocoon.portal.LinkService;
   import org.apache.cocoon.portal.coplet.CopletInstanceData;
  -import org.apache.cocoon.portal.event.impl.LinkEvent;
  +import org.apache.cocoon.portal.event.impl.CopletLinkEvent;
   import org.w3c.dom.DocumentFragment;
   import org.xml.sax.Attributes;
   import org.xml.sax.SAXException;
  @@ -192,7 +192,7 @@
                               linkService = (LinkService)this.manager.lookup(LinkService.ROLE);
           
                               // create event link
  -                            LinkEvent event = new LinkEvent(cid, link);
  +                            CopletLinkEvent event = new CopletLinkEvent(cid, link);
                               String eventLink = linkService.getLinkURI(event);
           
                               // insert event link
  @@ -218,7 +218,7 @@
                           linkService = (LinkService)this.manager.lookup(LinkService.ROLE);
           
                           // create event link
  -                        LinkEvent event = new LinkEvent(cid, link);
  +                        CopletLinkEvent event = new CopletLinkEvent(cid, link);
                           eventLink = linkService.getLinkURI(event);
                       } catch (ComponentException e) {
                           throw new SAXException(e);
  
  
  
  1.10      +3 -2      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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- portal.xconf	26 May 2003 09:52:59 -0000	1.9
  +++ portal.xconf	26 May 2003 13:18:20 -0000	1.10
  @@ -185,9 +185,10 @@
               
               <coplet-instance-data-aspects>
                   <aspect name="size"
  -                        class="org.apache.cocoon.portal.aspect.AspectStatus"
  +                        class="java.lang.Integer"
                           store="session"
  -                        auto-create="true"/>
  +                        auto-create="true"
  +                        value="1"/>
               </coplet-instance-data-aspects>
           </coplet>
       </coplets>