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/07 08:22:31 UTC

cvs commit: cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/aspect/impl AbstractAspectalizable.java

cziegeler    2003/05/06 23:22:30

  Modified:    .        blocks.properties
  Added:       src/blocks/portal/java/org/apache/cocoon/portal/layout/impl
                        TabLayoutStatus.java TabLayout.java LinkLayout.java
                        RowLayout.java FrameLayout.java ColumnLayout.java
                        FrameStatus.java CopletLayout.java
                        CompositeLayout.java Parameter.java
                        CompositeLayoutStatus.java
               src/blocks/portal/java/org/apache/cocoon/portal/source
                        CopletSourceFactory.java CopletSource.java
               src/blocks/portal/samples/profiles/mapping layout.xml
               src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/impl
                        AspectRenderer.java DefaultLinkRenderer.java
                        AbstractRenderer.java
               src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl
                        SizingAspect.java CompositeContentAspect.java
                        DefaultCopletAspect.java AbstractAspect.java
                        TabMaxPageAspect.java RendererAspectChain.java
                        CIncludeCopletAspect.java XSLTAspect.java
                        RemoveableAspect.java TabContentAspect.java
                        FullScreenCopletAspect.java MaxPageAspect.java
                        FrameAspect.java WindowAspect.java
                        AbstractCompositeAspect.java
                        DefaultRendererContext.java
               src/blocks/portal/java/org/apache/cocoon/portal/event/impl
                        SizingStatusEvent.java LayoutRemoveEvent.java
                        LayoutEventImpl.java DefaultEventConverter.java
                        InvalidEventTypeException.java
                        AbstractActionEvent.java DefaultEventManager.java
                        CopletStatusEvent.java FrameSourceEvent.java
                        FullScreenCopletEvent.java
               src/blocks/portal/java/org/apache/cocoon/portal/profile/impl
                        ParameterSourceAdapter.java
                        SimpleProfileManager.java
               src/blocks/portal/java/org/apache/cocoon/portal/layout
                        Item.java Parameters.java NamedItem.java
                        Layout.java AbstractParameters.java
                        AbstractLayout.java
               src/blocks/portal/samples/styles portal_layout.xsl tab.xsl
                        window.xsl column.xsl header.xsl row.xsl
               src/blocks/portal/java/org/apache/cocoon/portal/event/aspect
                        DefaultEventAspectContext.java EventAspect.java
                        EventAspectContext.java EventAspectChain.java
               src/blocks/portal/samples/profiles/layout portal.xml
               src/blocks/portal/samples/news/content/rss CZ_weblog.xml
                        CNET_news.xml Weblog.xml CSTNews.xml
                        CNET_business.xml NYTBusiness.xml BBCNews.xml
                        NYTSport.xml ML_weblog.xml CNNEurope.xml
                        newsweek.xml CNET_news2.xml
               src/blocks/portal/java/org/apache/cocoon/portal/impl
                        PortalManagerImpl.java PortalServiceImpl.java
                        DefaultLinkService.java
               src/blocks/portal/samples/images customize.gif maximize.gif
                        delete.gif show.gif minimize.gif logo.jpg
               src/blocks/portal/java/org/apache/cocoon/portal/aspect
                        Aspectalizable.java AspectStatus.java
               src/blocks/portal/java/org/apache/cocoon/portal/event
                        Filter.java ActionEvent.java Event.java
                        RequestEvent.java LayoutEvent.java
                        EventConverter.java Register.java Publisher.java
                        ComparableEvent.java Subscriber.java
                        EventManager.java
               src/blocks/portal/java/org/apache/cocoon/portal/coplet/status
                        MandatoryStatus.java SizeableStatus.java
                        SizingStatus.java
               src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl
                        SizingEventSubscriber.java
                        ActionCounterEventAspect.java
                        RequestParameterEventAspect.java
                        FullScreenCopletEventAspect.java
                        FrameEventAspect.java
               src/blocks/portal/java/org/apache/cocoon/portal
                        PortalService.java LinkService.java
                        PortalManager.java
               src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect
                        RendererAspect.java RendererAspectContext.java
               src/blocks/portal/java/org/apache/cocoon/portal/profile
                        ProfileManager.java ProfileLS.java
               src/blocks/portal/samples/news/content/resources/xsl
                        rss2html_news.xsl document2html.xsl
               src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer
                        Renderer.java
               src/blocks/portal/conf portal.xconf protocol.xconf
                        portal.xsamples
               src/blocks/portal/samples/news/content/xdocs overview.xml
                        introduction.xml
               src/blocks/portal/samples/news/content/resources/images
                        pyramid-model.gif
               src/blocks/portal/java/org/apache/cocoon/portal/generation
                        PortalGenerator.java
               src/blocks/portal/lib .cvsignore
               src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter
                        CopletAdapter.java
               src/blocks/portal/java/org/apache/cocoon/portal/coplet
                        CopletData.java CopletBaseData.java
                        CopletInstanceData.java
               src/blocks/portal/java/org/apache/cocoon/portal/event/subscriber/impl
                        DefaultLayoutEventSubscriber.java
               src/blocks/portal/samples sitemap.xmap
               src/blocks/portal/java/org/apache/cocoon/portal/transformation
                        HTMLRootTransformer.java
               src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl
                        URICopletAdapter.java
               src/blocks/portal/samples/news sitemap.xmap
               src/blocks/portal/java/org/apache/cocoon/components/persistance
                        ConverterException.java CastorSourceConverter.java
               src/blocks/portal/java/org/apache/cocoon/portal/aspect/impl
                        AbstractAspectalizable.java
  Log:
  The new portal framework as announced by Matthew
  He were go...
  
  Revision  Changes    Path
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/TabLayoutStatus.java
  
  Index: TabLayoutStatus.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 org.apache.cocoon.portal.aspect.AspectStatus;
  
  /**
   *
   * @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: TabLayoutStatus.java,v 1.1 2003/05/07 06:22:21 cziegeler Exp $
   */
  public class TabLayoutStatus 
  implements AspectStatus {
  
      protected int selectedItem;
  
      public TabLayoutStatus() {
      }
      
      /**
       * Returns the selectedTab.
       * @return int
       */
      public int getSelectedItem() {
          return selectedItem;
      }
  
      /**
       * Sets the selectedTab.
       * @param selectedTab The selectedTab to set
       */
      public void setSelectedItem(int selectedTab) {
          this.selectedItem = selectedTab;
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/TabLayout.java
  
  Index: TabLayout.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;
  
  
  /**
   *
   * @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: TabLayout.java,v 1.1 2003/05/07 06:22:21 cziegeler Exp $
   */
  public final class TabLayout extends CompositeLayout {
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/LinkLayout.java
  
  Index: LinkLayout.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 org.apache.cocoon.portal.layout.AbstractLayout;
  import org.apache.cocoon.portal.layout.Layout;
  
  
  /**
   *
   * @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: LinkLayout.java,v 1.1 2003/05/07 06:22:21 cziegeler Exp $
   */
  public final class LinkLayout 
      extends AbstractLayout
      implements Layout {
  
      private String linkedLayoutId;
      
      public void setLayoutId(String layoutId) {
          this.linkedLayoutId = layoutId;
      }
      
      public String getLayoutId() {
          return this.linkedLayoutId;
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/RowLayout.java
  
  Index: RowLayout.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;
  
  
  /**
   *
   * @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: RowLayout.java,v 1.1 2003/05/07 06:22:21 cziegeler Exp $
   */
  public final class RowLayout
  	extends CompositeLayout {
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/FrameLayout.java
  
  Index: FrameLayout.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  <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 org.apache.cocoon.portal.layout.AbstractLayout;
  
  /**
   *
   * @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: FrameLayout.java,v 1.1 2003/05/07 06:22:21 cziegeler Exp $
   */
  public class FrameLayout extends AbstractLayout {
      
      private String source;
      
      /**
       * @return String
       */
      public String getSource() {
          return source;
      }
  
      /**
       * Sets the source.
       * @param source The source to set
       */
      public void setSource(String source) {
          this.source = source;
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/ColumnLayout.java
  
  Index: ColumnLayout.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;
  
  /**
   *
   * @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: ColumnLayout.java,v 1.1 2003/05/07 06:22:21 cziegeler Exp $
   */
  public final class ColumnLayout
  	extends CompositeLayout {
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/FrameStatus.java
  
  Index: FrameStatus.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 org.apache.cocoon.portal.aspect.AspectStatus;
  
  /**
   *
   * @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: FrameStatus.java,v 1.1 2003/05/07 06:22:21 cziegeler Exp $
   */
  public class FrameStatus 
  implements AspectStatus {
  
      protected String link;
  
      public FrameStatus() {
      }
      
      public String getLink() {
          return this.link;
      }
  
      public void setLink(String link) {
          this.link = link;
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/CopletLayout.java
  
  Index: CopletLayout.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 org.apache.cocoon.portal.coplet.CopletInstanceData;
  import org.apache.cocoon.portal.layout.AbstractLayout;
  
  /**
   *
   * @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: CopletLayout.java,v 1.1 2003/05/07 06:22:21 cziegeler Exp $
   */
  public final class CopletLayout extends AbstractLayout {
      
      private CopletInstanceData copletInstanceData;
      
      public void setCopletInstanceData(CopletInstanceData cid) {
          this.copletInstanceData = cid;
      }
      
      public CopletInstanceData getCopletInstanceData() {
          return this.copletInstanceData;
      }
  
      public String getRendererName() {
          if (this.rendererName == null) {
              return this.copletInstanceData.getCopletData().getCopletBaseData().getDefaultRendererName();
          }
          return this.rendererName;
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/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  <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.Item;
  
  /**
   *
   * @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/07 06:22:21 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/impl/Parameter.java
  
  Index: Parameter.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  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.portal.layout.impl;
  
  /**
   *
   * @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: Parameter.java,v 1.1 2003/05/07 06:22:21 cziegeler Exp $
   */
  public final class Parameter {
      
      private String name;
      private String value;
      
      
      public Parameter() {
      }
      
      public Parameter(String name, String value) {
          this.name = name;
          this.value = value;
      }
  
      /**
       * @return String
       */
      public String getName() {
          return name;
      }
  
      /**
       * @return String
       */
      public String getValue() {
          return value;
      }
  
      /**
       * Sets the name.
       * @param name The name to set
       */
      public void setName(String name) {
          this.name = name;
      }
  
      /**
       * Sets the value.
       * @param value The value to set
       */
      public void setValue(String value) {
          this.value = value;
      }
      
      /* (non-Javadoc)
       * @see java.lang.Object#toString()
       */
      public String toString() {
          return name + " = " + value;
      }
  
      /* (non-Javadoc)
       * @see java.lang.Object#equals(java.lang.Object)
       */
      public boolean equals(Object obj) {
          if (obj instanceof String)
              return name.equals(obj);
          if (obj instanceof Parameter)
              return name.equals(((Parameter) obj).getName());
          return false;
      }
  
      /* (non-Javadoc)
       * @see java.lang.Object#hashCode()
       */
      public int hashCode() {
          return name.hashCode();
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/CompositeLayoutStatus.java
  
  Index: CompositeLayoutStatus.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 org.apache.cocoon.portal.aspect.AspectStatus;
  import org.apache.cocoon.portal.layout.Layout;
  
  /**
   *
   * @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: CompositeLayoutStatus.java,v 1.1 2003/05/07 06:22:21 cziegeler Exp $
   */
  public class CompositeLayoutStatus implements AspectStatus {
  
      protected Layout maxpageLayout;
      
      /**
       * @return Layout
       */
      public Layout getMaxpageLayout() {
          return this.maxpageLayout;
      }
  
      /**
       * Sets the maxpageLayout.
       * @param maxpageLayout The maxpageLayout to set
       */
      public void setMaxpageLayout(Layout maxpageLayout) {
          this.maxpageLayout = maxpageLayout;
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/source/CopletSourceFactory.java
  
  Index: CopletSourceFactory.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.source;
  
  import java.io.IOException;
  import java.net.MalformedURLException;
  import java.util.Map;
  
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.Composable;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.thread.ThreadSafe;
  import org.apache.cocoon.portal.coplet.CopletInstanceData;
  import org.apache.cocoon.portal.profile.ProfileManager;
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceException;
  import org.apache.excalibur.source.SourceFactory;
  
  /**
   *
   * @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: CopletSourceFactory.java,v 1.1 2003/05/07 06:22:21 cziegeler Exp $
   */
  public class CopletSourceFactory     
      extends AbstractLogEnabled
      implements SourceFactory, Composable, ThreadSafe {
  
      private ComponentManager componentManager;
      
      /**
       * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
       */
      public void compose(ComponentManager componentManager)
          throws ComponentException {
          this.componentManager = componentManager;
      }
  
  	/**
  	 * @see org.apache.excalibur.source.SourceFactory#getSource(String, Map)
  	 */
  	public Source getSource(String location, Map parameters)
  		throws MalformedURLException, IOException {
              
          // remove the protocol
          int position = location.indexOf(':') + 1;
          if (position != 0) {
              location = location.substring(position+2);
          }
          ProfileManager profileManager = null;
          CopletInstanceData coplet = null;
          try {
              profileManager = (ProfileManager)this.componentManager.lookup(ProfileManager.ROLE);
              coplet = profileManager.getCopletInstanceData(location);
              CopletSource copletSource =
                  new CopletSource(coplet.getCopletData().getCopletBaseData().getCopletAdapterName(),
                                   coplet);
              copletSource.compose(this.componentManager);
              return copletSource;
          } catch (ComponentException ce) {
              throw new SourceException("Unable to lookup profile manager.", ce);
          } finally {
              this.componentManager.release(profileManager);
          }
  	}
  
      /**
       * @see org.apache.excalibur.source.SourceFactory#release(Source)
       */
      public void release(Source source) {
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/source/CopletSource.java
  
  Index: CopletSource.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.source;
  
  import java.io.IOException;
  import java.io.InputStream;
  
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.ComponentSelector;
  import org.apache.avalon.framework.component.Composable;
  import org.apache.cocoon.portal.coplet.CopletInstanceData;
  import org.apache.cocoon.portal.coplet.adapter.CopletAdapter;
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceNotFoundException;
  import org.apache.excalibur.source.SourceValidity;
  import org.apache.excalibur.xml.sax.XMLizable;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @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: CopletSource.java,v 1.1 2003/05/07 06:22:21 cziegeler Exp $
   */
  public final class CopletSource 
      implements Source, XMLizable, Composable {
  
      private ComponentManager componentManager;
      
      private String copletControllerName;
      private CopletInstanceData copletInstanceData;
      
      /** The used protocol */
      private String scheme = "coplet";
      
      public CopletSource(String copletControllerName,
                           CopletInstanceData coplet) {
           this.copletInstanceData = coplet;
           this.copletControllerName = copletControllerName;
      }
      
  	/**
  	 * @see org.apache.excalibur.source.Source#getInputStream()
  	 */
  	public InputStream getInputStream() throws IOException, SourceNotFoundException {
  		return null;
  	}
  
  	/**
  	 * @see org.apache.excalibur.source.Source#getURI()
  	 */
  	public String getURI() {
          // FIXME
  		return "hallo";
  	}
  
  	/**
  	 * @see org.apache.excalibur.source.Source#getValidity()
  	 */
  	public SourceValidity getValidity() {
  		return null;
  	}
  
  	/**
  	 * @see org.apache.excalibur.source.Source#refresh()
  	 */
  	public void refresh() {
  	}
  
  	/**
  	 * @see org.apache.excalibur.source.Source#getMimeType()
  	 */
  	public String getMimeType() {
  		return null;
  	}
  
  	/**
  	 * @see org.apache.excalibur.source.Source#getContentLength()
  	 */
  	public long getContentLength() {
  		return -1;
  	}
  
  	/**
  	 * @see org.apache.excalibur.source.Source#getLastModified()
  	 */
  	public long getLastModified() {
  		return 0;
  	}
  
  	/**
  	 * @see org.apache.avalon.excalibur.xml.XMLizable#toSAX(ContentHandler)
  	 */
  	public void toSAX(ContentHandler handler) 
      throws SAXException {
          ComponentSelector copletAdapterSelector = null;
          CopletAdapter copletAdapter = null;
          try {
              copletAdapterSelector = (ComponentSelector)this.componentManager.lookup(CopletAdapter.ROLE+"Selector");
              copletAdapter = (CopletAdapter)copletAdapterSelector.select(this.copletControllerName);
              
              copletAdapter.toSAX(this.copletInstanceData, handler);
          } catch (ComponentException ce) {
              throw new SAXException("Unable to lookup coplet adaptor or adaptor selector.", ce);
          } finally {
              if ( null != copletAdapter ) {
                   copletAdapterSelector.release( copletAdapter );
              }
              this.componentManager.release(copletAdapterSelector);
          }
              
  	}
  
  	/**
  	 * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
  	 */
  	public void compose(ComponentManager componentManager)
  		throws ComponentException {
          this.componentManager = componentManager;
  	}
  
      /**
       * @see org.apache.excalibur.source.Source#exists()
       */
      public boolean exists() {
          return true;
      }
  
      /**
       * @see org.apache.excalibur.source.Source#getScheme()
       */
      public String getScheme() {
          return scheme;
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/profiles/mapping/layout.xml
  
  Index: layout.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <mapping>
      <description>Portalprofile mapping file</description>
  
  	<class name="org.apache.cocoon.portal.layout.AbstractParameters">
          <field name="parameters" type="org.apache.cocoon.portal.layout.impl.Parameter" collection="map">
              <bind-xml auto-naming="deriveByClass" />
          </field>
      </class>
      
      <class name="org.apache.cocoon.portal.layout.AbstractLayout"
             extends="org.apache.cocoon.portal.layout.AbstractParameters">
          <field name="rendererName" type="java.lang.String">
              <bind-xml name="renderer-name" node="attribute" />
          </field>
          <field name="static" type="boolean">
              <bind-xml name="static" node="attribute" />
          </field>
          <field name="id" type="java.lang.String" />
      </class>
      
      <class name="org.apache.cocoon.portal.layout.impl.LinkLayout"
             extends="org.apache.cocoon.portal.layout.AbstractLayout">
          <map-to xml="link-layout" />
          <field name="layoutId" type="java.lang.String">
              <bind-xml name="layout-id" node="attribute" />
          </field>
      </class>
  
      <class name="org.apache.cocoon.portal.layout.impl.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" />
          </field>
      </class>
  
      <class name="org.apache.cocoon.portal.layout.impl.ColumnLayout"
             extends="org.apache.cocoon.portal.layout.impl.CompositeLayout">
          <map-to xml="column-layout" />
      </class>
  
      <class name="org.apache.cocoon.portal.layout.impl.CopletLayout" auto-complete="false"
             extends="org.apache.cocoon.portal.layout.AbstractLayout">
          <map-to xml="coplet-layout" />
      </class>
      
      <class name="org.apache.cocoon.portal.layout.impl.FrameLayout"
             extends="org.apache.cocoon.portal.layout.AbstractLayout">
          <map-to xml="frame-layout" />
          <field name="source" type="java.lang.String" />
      </class>
  
      <class name="org.apache.cocoon.portal.layout.Item"
             extends="org.apache.cocoon.portal.layout.AbstractParameters">
          <field name="layout" type="org.apache.cocoon.portal.layout.Layout">
              <bind-xml auto-naming="deriveByClass" />
          </field>
      </class>
  
      <class name="org.apache.cocoon.portal.layout.NamedItem"
             extends="org.apache.cocoon.portal.layout.Item">
          <map-to xml="named-item" />
          <field name="name" type="java.lang.String">
              <bind-xml name="name" node="attribute" />
          </field>
      </class>
  
      <class name="org.apache.cocoon.portal.layout.impl.Parameter">
          <map-to xml="parameter" />
          <field name="name" type="string">
              <bind-xml name="name" node="attribute" />
          </field>
          <field name="value" type="string">
              <bind-xml name="value" node="attribute" />
          </field>
      </class>
  
      <class name="org.apache.cocoon.portal.layout.impl.RowLayout"
             extends="org.apache.cocoon.portal.layout.impl.CompositeLayout">
          <map-to xml="row-layout" />
      </class>
  
      <class name="org.apache.cocoon.portal.layout.impl.TabLayout"
             extends="org.apache.cocoon.portal.layout.impl.CompositeLayout">
          <map-to xml="tab-layout" />
      </class>
  
  </mapping>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/impl/AspectRenderer.java
  
  Index: AspectRenderer.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.renderer.impl;
  
  import org.apache.avalon.framework.activity.Disposable;
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.ComponentSelector;
  import org.apache.avalon.framework.component.Composable;
  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.portal.PortalService;
  import org.apache.cocoon.portal.layout.Layout;
  import org.apache.cocoon.portal.layout.renderer.Renderer;
  import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspect;
  import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
  import org.apache.cocoon.portal.layout.renderer.aspect.impl.*;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
   * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
   * 
   * @version CVS $Id: AspectRenderer.java,v 1.1 2003/05/07 06:22:22 cziegeler Exp $
   */
  public class AspectRenderer
      extends AbstractLogEnabled
      implements Renderer, Composable, Configurable, Disposable, ThreadSafe {
  
      protected ComponentManager manager;
  
      protected RendererAspectChain chain;
      
      protected ComponentSelector aspectSelector;
      
      /**
       * Stream out raw layout 
       */
      public void toSAX(Layout layout, PortalService service, ContentHandler handler) throws SAXException {
           RendererAspectContext context = new DefaultRendererContext(this.chain);
           context.invokeNext(layout, service, handler);
      }
  
  	/* (non-Javadoc)
  	 * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
  	 */
  	public void configure(Configuration conf) throws ConfigurationException {
          this.chain = new RendererAspectChain();
          this.chain.configure(this.aspectSelector, conf.getChild("aspects"));
  	}
  
  	/* (non-Javadoc)
  	 * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
  	 */
  	public void compose(ComponentManager manager) throws ComponentException {
  		this.manager = manager;
          this.aspectSelector = (ComponentSelector) this.manager.lookup( RendererAspect.ROLE+"Selector");
  	}
  
  	/* (non-Javadoc)
  	 * @see org.apache.avalon.framework.activity.Disposable#dispose()
  	 */
  	public void dispose() {
  		if (this.manager != null) {
              if ( this.chain != null) {
                  this.chain.dispose( this.aspectSelector );
              }
              this.manager.release( this.aspectSelector );
              this.aspectSelector = null;
              this.manager = null;
  		}
  	}
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/impl/DefaultLinkRenderer.java
  
  Index: DefaultLinkRenderer.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.renderer.impl;
  
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.layout.Layout;
  import org.apache.cocoon.portal.layout.impl.LinkLayout;
  import org.apache.cocoon.portal.profile.ProfileManager;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @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: DefaultLinkRenderer.java,v 1.1 2003/05/07 06:22:22 cziegeler Exp $
   */
  public class DefaultLinkRenderer extends AbstractRenderer {
  
      public void process(Layout layout, PortalService service, ContentHandler handler)
      throws SAXException {
          if (layout instanceof LinkLayout) {
              ProfileManager profileManager = null;
              try {
                  profileManager = (ProfileManager)this.componentManager.lookup(ProfileManager.ROLE);
                  final String layoutId = ((LinkLayout)layout).getLayoutId();
                  this.processLayout(profileManager.getPortalLayout(layoutId), service, handler);
              } catch (ComponentException ce) {
                  throw new SAXException("Unable to lookup profile manager.", ce);
              } finally {
                  this.componentManager.release(profileManager);
              }
          } else {
              throw new SAXException("Wrong layout type, LinkLayout expected: " + layout.getClass().getName());
          }        
      }
      
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/impl/AbstractRenderer.java
  
  Index: AbstractRenderer.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.renderer.impl;
  
  import javax.xml.transform.sax.SAXResult;
  import javax.xml.transform.sax.TransformerHandler;
  
  import org.apache.avalon.framework.CascadingRuntimeException;
  import org.apache.avalon.framework.activity.Disposable;
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.ComponentSelector;
  import org.apache.avalon.framework.component.Composable;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.thread.ThreadSafe;
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.aspect.AspectStatus;
  import org.apache.cocoon.portal.layout.Layout;
  import org.apache.cocoon.portal.layout.renderer.Renderer;
  import org.apache.cocoon.portal.profile.ProfileManager;
  import org.apache.cocoon.xml.IncludeXMLConsumer;
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceResolver;
  import org.apache.excalibur.xml.xslt.XSLTProcessor;
  import org.apache.excalibur.xml.xslt.XSLTProcessorImpl;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  import org.xml.sax.ext.LexicalHandler;
  
  /**
   *
   * @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: AbstractRenderer.java,v 1.1 2003/05/07 06:22:22 cziegeler Exp $
   */
  public abstract class AbstractRenderer
      extends AbstractLogEnabled
      implements Renderer, Composable, Disposable, ThreadSafe {
  
      protected ComponentSelector rendererSelector;
      protected ComponentManager componentManager;
  
      public String getStylesheetURI(Layout layout) {
          return null;
      }
  
      public boolean useStylesheet() {
          return false;
      }
  
      /**
       * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
       */
      public void compose(ComponentManager componentManager) throws ComponentException {
          this.componentManager = componentManager;
      }
  
      /**
       * @see org.apache.avalon.framework.activity.Disposable#dispose()
       */
      public void dispose() {
          if (null != this.componentManager) {
              this.componentManager.release(this.rendererSelector);
              this.componentManager = null;
              this.rendererSelector = null;
          }
      }
  
      /**
       * Stream out raw layout 
       */
      public void toSAX(Layout layout, PortalService service, ContentHandler handler) throws SAXException {
          if (this.useStylesheet()) {
              XSLTProcessor processor = null;
              Source stylesheet = null;
              SourceResolver resolver = null;
              try {
                  resolver = (SourceResolver) this.componentManager.lookup(SourceResolver.ROLE);
                  stylesheet = resolver.resolveURI(this.getStylesheetURI(layout));
                  processor = (XSLTProcessor) this.componentManager.lookup(XSLTProcessorImpl.ROLE);
                  TransformerHandler transformer = processor.getTransformerHandler(stylesheet);
                  SAXResult result = new SAXResult(new IncludeXMLConsumer((handler)));
                  if (handler instanceof LexicalHandler) {
                      result.setLexicalHandler((LexicalHandler) handler);
                  }
                  transformer.setResult(result);
                  transformer.startDocument();
                  this.process(layout, service, transformer);
                  transformer.endDocument();
              } catch (Exception ce) {
                  throw new SAXException("Unable to lookup component.", ce);
              } finally {
                  if (null != resolver) {
                      resolver.release(stylesheet);
                      this.componentManager.release(resolver);
                  }
                  this.componentManager.release(processor);
              }
          } else {
              this.process(layout, service, handler);
          }
      }
  
      /**
       * Process a Layout
       */
      protected void processLayout(Layout layout, PortalService service, ContentHandler handler) throws SAXException {
          final String rendererName = layout.getRendererName();
          Renderer renderer = null;
          try {
              renderer = (Renderer) this.getRenderSelector().select(rendererName);
              renderer.toSAX(layout, service, handler);
          } catch (ComponentException ce) {
              throw new SAXException("Unable to lookup renderer for role " + rendererName, ce);
          } finally {
              this.getRenderSelector().release(renderer);
          }
      }
  
      protected ComponentSelector getRenderSelector() {
          if ( null == this.rendererSelector ) {
              try {
                  this.rendererSelector = (ComponentSelector) this.componentManager.lookup(Renderer.ROLE + "Selector");
              } catch (ComponentException local) {
                  throw new CascadingRuntimeException("Unable to lookup component selector for portal layout selector.", local);
              }
          }
          return this.rendererSelector;
      }
      
      /**
       * Get the layout status
       */
      protected AspectStatus getLayoutStatus(Layout layout) {
          ProfileManager profileManager = null;
          try {
              profileManager = (ProfileManager) this.componentManager.lookup(ProfileManager.ROLE);
              return profileManager.getAspectStatus(null, null, layout.getId());
          } catch (ComponentException ce) {
              // ignore
          } finally {
              this.componentManager.release(profileManager);
          }
          return null;
      }
      
      protected abstract void process(Layout layout, PortalService service, ContentHandler handler) throws SAXException;
      
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/SizingAspect.java
  
  Index: SizingAspect.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.renderer.aspect.impl;
  
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.coplet.CopletInstanceData;
  import org.apache.cocoon.portal.coplet.status.SizeableStatus;
  import org.apache.cocoon.portal.coplet.status.SizingStatus;
  import org.apache.cocoon.portal.event.impl.SizingStatusEvent;
  import org.apache.cocoon.portal.layout.Layout;
  import org.apache.cocoon.portal.layout.impl.CopletLayout;
  import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
  import org.apache.cocoon.portal.profile.ProfileManager;
  import org.apache.cocoon.xml.XMLUtils;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @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: SizingAspect.java,v 1.1 2003/05/07 06:22:22 cziegeler Exp $
   */
  public class SizingAspect 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)
  	 */
  	public void toSAX(RendererAspectContext context,
                  		Layout layout,
                  		PortalService service,
                  		ContentHandler handler)
  	throws SAXException {
          
          CopletInstanceData cid = ((CopletLayout)layout).getCopletInstanceData();
  
          SizeableStatus sizeable = (SizeableStatus) this.getStatus(SizeableStatus.class, ProfileManager.SESSION_STATUS, cid.getCopletData().getName());
          if ( sizeable != null ) {
              SizingStatus sizingstatus = (SizingStatus)this.getStatus(SizingStatus.class, ProfileManager.SESSION_STATUS, cid.getCopletId());
              int status = (sizingstatus == null ? SizingStatus.STATUS_MAXIMIZED : sizingstatus.getStatus());
  
              SizingStatusEvent event;    
  
              if (sizeable.isMinimizable() && status != SizingStatus.STATUS_MINIMIZED) {
                  event = new SizingStatusEvent(cid, SizingStatus.STATUS_MINIMIZED, sizingstatus);
                  XMLUtils.createElement(handler, "minimize-uri", service.getLinkService().getLinkURI(event));
              }
  
              if (sizeable.isMaximizable() && status != SizingStatus.STATUS_MAXIMIZED) {
                  event = new SizingStatusEvent(cid, SizingStatus.STATUS_MAXIMIZED, sizingstatus);
                  XMLUtils.createElement(handler, "maximize-uri", service.getLinkService().getLinkURI(event));
              }
              if (status != SizingStatus.STATUS_MINIMIZED) {
                  context.invokeNext(layout, service, handler);
              }
          } else {
              context.invokeNext(layout, service, handler);
          }
  	}
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CompositeContentAspect.java
  
  Index: CompositeContentAspect.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.renderer.aspect.impl;
  
  import java.util.Iterator;
  import java.util.Map;
  
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.layout.Item;
  import org.apache.cocoon.portal.layout.Layout;
  import org.apache.cocoon.portal.layout.impl.Parameter;
  import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
  import org.apache.cocoon.xml.AttributesImpl;
  import org.apache.cocoon.xml.XMLUtils;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
   * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
   * 
   * @version CVS $Id: CompositeContentAspect.java,v 1.1 2003/05/07 06:22:22 cziegeler Exp $
   */
  public class CompositeContentAspect extends AbstractCompositeAspect {
  
      protected static final String ITEM_STRING = "item";
  
      protected String getTagName(RendererAspectContext context) {
          return context.getAspectParameters().getParameter("tag-name", "composite");
      }
      
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.layout.renderer.RendererAspect#toSAX(org.apache.cocoon.portal.layout.renderer.RendererAspectContext, org.apache.cocoon.portal.layout.Layout, org.apache.cocoon.portal.PortalService, org.xml.sax.ContentHandler)
       */
      public void toSAX(RendererAspectContext context,
                          Layout layout,
                          PortalService service,
                          ContentHandler handler)
      throws SAXException {
  
          AttributesImpl attributes = new AttributesImpl();
          Map parameter = layout.getParameters();
          for (Iterator iter = parameter.values().iterator(); iter.hasNext();) {
              Parameter param = (Parameter) iter.next();
              attributes.addCDATAAttribute(param.getName(), param.getValue());
          }
          XMLUtils.startElement(handler, this.getTagName(context), attributes);
          super.toSAX(context, layout, service, handler);
          XMLUtils.endElement(handler, this.getTagName(context));
  
      }
  
  	/* (non-Javadoc)
  	 * @see org.apache.cocoon.portal.layout.renderer.impl.AbstractContentAspect#processItem(org.apache.cocoon.portal.layout.Item, org.xml.sax.ContentHandler, org.apache.cocoon.portal.PortalService)
  	 */
  	protected void processItem(Item item,
  		                         ContentHandler handler,
  		                         PortalService service)
      throws SAXException {
          Layout layout = item.getLayout();
  
          Map parameters = item.getParameters();
          if (parameters.size() == 0) {
              XMLUtils.startElement(handler, ITEM_STRING);
          } else {
              AttributesImpl attributes = new AttributesImpl();
  
              for (Iterator iter = parameters.values().iterator(); iter.hasNext();) {
                  Parameter param = (Parameter) iter.next();
                  attributes.addCDATAAttribute(param.getName(), param.getValue());
              }
              XMLUtils.startElement(handler, ITEM_STRING, attributes);
          }
          processLayout(layout, service, handler);
          XMLUtils.endElement(handler, ITEM_STRING);
  
  	}
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/DefaultCopletAspect.java
  
  Index: DefaultCopletAspect.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.renderer.aspect.impl;
  
  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.coplet.CopletInstanceData;
  import org.apache.cocoon.portal.coplet.adapter.CopletAdapter;
  import org.apache.cocoon.portal.layout.Layout;
  import org.apache.cocoon.portal.layout.impl.CopletLayout;
  import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
  import org.apache.cocoon.xml.IncludeXMLConsumer;
  import org.apache.cocoon.xml.XMLUtils;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   * This aspect directly invokes the coplet adapter to stream out the coplet content.
   *
   * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
   * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
   * 
   * @version CVS $Id: DefaultCopletAspect.java,v 1.1 2003/05/07 06:22:22 cziegeler Exp $
   */
  public class DefaultCopletAspect 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)
  	 */
  	public void toSAX(RendererAspectContext context,
                  		Layout layout,
                  		PortalService service,
                  		ContentHandler handler)
  	throws SAXException {
          
          XMLUtils.startElement(handler, "content");
          CopletInstanceData cid = ((CopletLayout)layout).getCopletInstanceData();
  
          final String adapterName = cid.getCopletData().getCopletBaseData().getCopletAdapterName();
          CopletAdapter copletAdapter = null;
          ComponentSelector adapterSelector = null;
          try {
              adapterSelector = (ComponentSelector) this.manager.lookup(CopletAdapter.ROLE + "Selector");
              copletAdapter = (CopletAdapter) adapterSelector.select(adapterName);
              copletAdapter.toSAX(cid, new IncludeXMLConsumer(handler));
          } catch (ComponentException ce) {
              throw new SAXException("Exception", ce);
          } finally {
              if (null != copletAdapter) {
                  adapterSelector.release(copletAdapter);
              }
              this.manager.release(adapterSelector);
          }
  
          XMLUtils.endElement(handler, "content");
          context.invokeNext(layout, service, handler);
  	}
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractAspect.java
  
  Index: AbstractAspect.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.renderer.aspect.impl;
  
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.Composable;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.thread.ThreadSafe;
  import org.apache.cocoon.portal.aspect.AspectStatus;
  import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspect;
  import org.apache.cocoon.portal.profile.ProfileManager;
  
  /**
   *
   * @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: AbstractAspect.java,v 1.1 2003/05/07 06:22:22 cziegeler Exp $
   */
  public abstract class AbstractAspect
      extends AbstractLogEnabled
      implements Composable, ThreadSafe, RendererAspect {
  
      protected ComponentManager manager;
  
      /**
       * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
       */
      public void compose(ComponentManager componentManager) throws ComponentException {
          this.manager = componentManager;
      }
  
      /**
       * Get the layout status
       */
      protected AspectStatus getStatus(Class type, String mode, String key) {
          ProfileManager profileManager = null;
          try {
              profileManager = (ProfileManager) this.manager.lookup(ProfileManager.ROLE);
              return profileManager.getAspectStatus(type, mode, key);
          } catch (ComponentException ce) {
              // ignore
          } finally {
              this.manager.release(profileManager);
          }
          return null;
      }
      
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabMaxPageAspect.java
  
  Index: TabMaxPageAspect.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.renderer.aspect.impl;
  
  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.impl.TabLayoutStatus;
  import org.apache.cocoon.portal.profile.ProfileManager;
  
  /**
   *
   * @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: TabMaxPageAspect.java,v 1.1 2003/05/07 06:22:22 cziegeler Exp $
   */
  public class TabMaxPageAspect 
      extends MaxPageAspect {
  
      /**
       * @return Layout
       */
      public Layout getMaxpageLayout(CompositeLayout layout) {
          TabLayoutStatus status = (TabLayoutStatus) this.getStatus( null, ProfileManager.SESSION_STATUS, layout.getId() ); 
          int selected = (status == null ? 0 : status.getSelectedItem());
  
          Item item = (Item) layout.getItem(selected);
          Layout child = item.getLayout();
          if (child.isStatic() == false && child instanceof CompositeLayout) {
              return this.getMaxpageLayout( (CompositeLayout)child );
          }
  
          return null;
      
  	}
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/RendererAspectChain.java
  
  Index: RendererAspectChain.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.renderer.aspect.impl;
  
  import java.util.ArrayList;
  import java.util.Iterator;
  import java.util.List;
  
  import org.apache.avalon.framework.component.Component;
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentSelector;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.parameters.Parameters;
  
  /**
   *
   * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
   * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
   * 
   * @version CVS $Id: RendererAspectChain.java,v 1.1 2003/05/07 06:22:22 cziegeler Exp $
   */
  public final class RendererAspectChain {
      
      private List aspects = new ArrayList();
      
      private List configs = new ArrayList();
      
      public void configure(ComponentSelector selector, Configuration conf) 
      throws ConfigurationException {
          if ( conf != null ) {
              Configuration[] aspects = conf.getChildren("aspect");
              if ( aspects != null ) {
                  for(int i=0; i < aspects.length; i++) {
                      final Configuration current = aspects[i];
                      final String role = current.getAttribute("type");
                      try {
                          this.aspects.add(selector.select(role));
                          this.configs.add(Parameters.fromConfiguration(current));
                      } catch (ComponentException se) {
                          throw new ConfigurationException("Unable to lookup aspect " + role, se);
                      }
                  }
              }
          } else {
              throw new ConfigurationException("No aspects configured");
          }
      }
      
      public Iterator getIterator() {
          return this.aspects.iterator();
      }
      
      public Iterator getConfigIterator() {
          return this.configs.iterator();
      }
      
      public void dispose(ComponentSelector selector) {
          Iterator i = this.aspects.iterator();
          while (i.hasNext()) {
              selector.release((Component)i.next()); 
          }
          this.aspects.clear();
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CIncludeCopletAspect.java
  
  Index: CIncludeCopletAspect.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.renderer.aspect.impl;
  
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.coplet.CopletInstanceData;
  import org.apache.cocoon.portal.layout.Layout;
  import org.apache.cocoon.portal.layout.impl.CopletLayout;
  import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
  import org.apache.cocoon.transformation.CIncludeTransformer;
  import org.apache.cocoon.xml.AttributesImpl;
  import org.apache.cocoon.xml.XMLUtils;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   * This aspect streams a cinclude statement into the stream that
   * will include the coplet using the coplet protocol.
   *
   * @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: CIncludeCopletAspect.java,v 1.1 2003/05/07 06:22:22 cziegeler Exp $
   */
  public class CIncludeCopletAspect extends AbstractAspect {
  
      protected static final String PREFIX = "cinclude";
      protected static final String NAMESPACE = CIncludeTransformer.CINCLUDE_NAMESPACE_URI;
      protected static final String ELEMENT = CIncludeTransformer.CINCLUDE_INCLUDE_ELEMENT;
      protected static final String QELEMENT= PREFIX + ":" + ELEMENT;
      protected static final String ATTRIBUTE = CIncludeTransformer.CINCLUDE_INCLUDE_ELEMENT_SRC_ATTRIBUTE; 
  
      /* (non-Javadoc)
  	 * @see org.apache.cocoon.portal.layout.renderer.RendererAspect#toSAX(org.apache.cocoon.portal.layout.renderer.RendererAspectContext, org.apache.cocoon.portal.layout.Layout, org.apache.cocoon.portal.PortalService, org.xml.sax.ContentHandler)
  	 */
  	public void toSAX(RendererAspectContext context,
                  		Layout layout,
                  		PortalService service,
                  		ContentHandler handler)
  	throws SAXException {
  
          CopletInstanceData cid = ((CopletLayout)layout).getCopletInstanceData();
          
          XMLUtils.startElement(handler, "content");
  
          handler.startPrefixMapping(PREFIX, NAMESPACE);
          AttributesImpl attributes = new AttributesImpl();
          attributes.addCDATAAttribute("src", "coplet://" + cid.getCopletId());
          handler.startElement(NAMESPACE, ELEMENT, QELEMENT, attributes);
          handler.endElement(NAMESPACE, ELEMENT, QELEMENT);
          handler.endPrefixMapping(NAMESPACE);
  
          XMLUtils.endElement(handler, "content");
          
          context.invokeNext(layout, service, handler);
  	}
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/XSLTAspect.java
  
  Index: XSLTAspect.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.renderer.aspect.impl;
  
  import javax.xml.transform.sax.SAXResult;
  import javax.xml.transform.sax.TransformerHandler;
  
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.Composable;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.thread.ThreadSafe;
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.layout.Layout;
  import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspect;
  import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
  import org.apache.cocoon.xml.IncludeXMLConsumer;
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceResolver;
  import org.apache.excalibur.xml.xslt.XSLTProcessor;
  import org.apache.excalibur.xml.xslt.XSLTProcessorImpl;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  import org.xml.sax.ext.LexicalHandler;
  
  /**
   *
   * @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: XSLTAspect.java,v 1.1 2003/05/07 06:22:22 cziegeler Exp $
   */
  public class XSLTAspect 
      extends AbstractLogEnabled 
      implements RendererAspect, ThreadSafe, Composable {
  
      protected ComponentManager manager;
      
  	/* (non-Javadoc)
  	 * @see org.apache.cocoon.portal.layout.renderer.RendererAspect#toSAX(org.apache.cocoon.portal.layout.renderer.RendererAspectContext, org.apache.cocoon.portal.layout.Layout, org.apache.cocoon.portal.PortalService, org.xml.sax.ContentHandler)
  	 */
  	public void toSAX(RendererAspectContext context,
                          Layout layout,
                          PortalService service,
                          ContentHandler handler)
      throws SAXException {
          XSLTProcessor processor = null;
          Source stylesheet = null;
          SourceResolver resolver = null;
          try {
              resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
              stylesheet = resolver.resolveURI(this.getStylesheetURI(context, layout));
              processor = (XSLTProcessor) this.manager.lookup(XSLTProcessorImpl.ROLE);
              TransformerHandler transformer = processor.getTransformerHandler(stylesheet);
              SAXResult result = new SAXResult(new IncludeXMLConsumer((handler)));
              if (handler instanceof LexicalHandler) {
                  result.setLexicalHandler((LexicalHandler) handler);
              }
              transformer.setResult(result);
              transformer.startDocument();
              context.invokeNext(layout, service, transformer);
  
              transformer.endDocument();
          } catch (Exception ce) {
              throw new SAXException("Unable to lookup component.", ce);
          } finally {
              if (null != resolver) {
                  resolver.release(stylesheet);
                  this.manager.release(resolver);
              }
              this.manager.release(processor);
          }
  	}
  
      protected String getStylesheetURI(RendererAspectContext context, Layout layout) {
          // FIXME Get the stylesheet either from a layout attribute or another aspect
          return context.getAspectParameters().getParameter("style", "NOTFOUND");
      }
  	/* (non-Javadoc)
  	 * @see org.apache.avalon.framework.component.Composable#compose(org.apache.avalon.framework.component.ComponentManager)
  	 */
  	public void compose(ComponentManager manager) throws ComponentException {
          this.manager = manager;
  	}
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/RemoveableAspect.java
  
  Index: RemoveableAspect.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.renderer.aspect.impl;
  
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.coplet.CopletInstanceData;
  import org.apache.cocoon.portal.coplet.status.MandatoryStatus;
  import org.apache.cocoon.portal.event.impl.LayoutRemoveEvent;
  import org.apache.cocoon.portal.layout.Layout;
  import org.apache.cocoon.portal.layout.impl.CopletLayout;
  import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
  import org.apache.cocoon.portal.profile.ProfileManager;
  import org.apache.cocoon.xml.XMLUtils;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @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: RemoveableAspect.java,v 1.1 2003/05/07 06:22:22 cziegeler Exp $
   */
  public class RemoveableAspect 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)
  	 */
  	public void toSAX(RendererAspectContext context,
                  		Layout layout,
                  		PortalService service,
                  		ContentHandler handler)
  	throws SAXException {
          
          CopletInstanceData cid = ((CopletLayout)layout).getCopletInstanceData();
  
          if (cid.getCopletData().isRemovable()) {
          } 
  
          MandatoryStatus mandatory = (MandatoryStatus) this.getStatus(MandatoryStatus.class, ProfileManager.SESSION_STATUS, cid.getCopletData().getName());
          if ( mandatory == null || !mandatory.isMandatory()) {
              LayoutRemoveEvent lre = new LayoutRemoveEvent(layout, 0);
              XMLUtils.createElement(handler, "remove-uri", service.getLinkService().getLinkURI(lre));
          }
          context.invokeNext(layout, service, handler);
  	}
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.java
  
  Index: TabContentAspect.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.renderer.aspect.impl;
  
  import java.util.Iterator;
  import java.util.Map;
  
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.event.impl.LayoutEventImpl;
  import org.apache.cocoon.portal.layout.Layout;
  import org.apache.cocoon.portal.layout.NamedItem;
  import org.apache.cocoon.portal.layout.impl.Parameter;
  import org.apache.cocoon.portal.layout.impl.TabLayout;
  import org.apache.cocoon.portal.layout.impl.TabLayoutStatus;
  import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
  import org.apache.cocoon.portal.profile.ProfileManager;
  import org.apache.cocoon.xml.AttributesImpl;
  import org.apache.cocoon.xml.XMLUtils;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @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: TabContentAspect.java,v 1.1 2003/05/07 06:22:22 cziegeler Exp $
   */
  public class TabContentAspect extends CompositeContentAspect {
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.layout.renderer.RendererAspect#toSAX(org.apache.cocoon.portal.layout.renderer.RendererAspectContext, org.apache.cocoon.portal.layout.Layout, org.apache.cocoon.portal.PortalService, org.xml.sax.ContentHandler)
       */
      public void toSAX(RendererAspectContext context,
                          Layout layout,
                          PortalService service,
                          ContentHandler handler)
      throws SAXException {
          if (layout instanceof TabLayout) {
              AttributesImpl attributes = new AttributesImpl();
              Map parameter = layout.getParameters();
              for (Iterator iter = parameter.values().iterator(); iter.hasNext();) {
                  Parameter param = (Parameter) iter.next();
                  attributes.addCDATAAttribute(param.getName(), param.getValue());
              }
              XMLUtils.startElement(handler, this.getTagName(context), attributes);
  
              PortalService portalService = null;
              try {
                  portalService = (PortalService) this.manager.lookup(PortalService.ROLE);
                  attributes = new AttributesImpl();
                  TabLayout tabLayout = (TabLayout) layout;
  
                  // selected tab
                  TabLayoutStatus status = (TabLayoutStatus) this.getStatus( TabLayoutStatus.class, ProfileManager.SESSION_STATUS, tabLayout.getId() ); 
                  int selected = (status == null ? 0 : status.getSelectedItem());
  
                  // loop over all tabs
                  for (int j = 0; j < tabLayout.getSize(); j++) {
                      NamedItem tab = (NamedItem) tabLayout.getItem(j);
  
                      // open named-item tag
                      attributes.clear();
                      attributes.addCDATAAttribute("name", String.valueOf(tab.getName()));
                      if (j == selected) {
                          attributes.addCDATAAttribute("selected", "true");
                      } else {
                          LayoutEventImpl event = new LayoutEventImpl(tabLayout, j);
                          attributes.addCDATAAttribute("parameter", portalService.getLinkService().getLinkURI(event));
                      }
                      XMLUtils.startElement(handler, "named-item", attributes);
                      if (j == selected) {
                          this.processLayout(tab.getLayout(), service, handler);
                      }
                      // close named-item tag
                      XMLUtils.endElement(handler, "named-item");
                  }
              } catch (ComponentException ce) {
                  throw new SAXException("Unable to lookup event manager.", ce);
              } finally {
                  this.manager.release(portalService);
              }
              XMLUtils.endElement(handler, this.getTagName(context));
          } else {
              throw new SAXException("Wrong layout type, TabLayout expected: " + layout.getClass().getName());
          }
  
  
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/FullScreenCopletAspect.java
  
  Index: FullScreenCopletAspect.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.renderer.aspect.impl;
  
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.coplet.CopletInstanceData;
  import org.apache.cocoon.portal.event.impl.FullScreenCopletEvent;
  import org.apache.cocoon.portal.layout.Layout;
  import org.apache.cocoon.portal.layout.impl.CopletLayout;
  import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
  import org.apache.cocoon.xml.XMLUtils;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @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: FullScreenCopletAspect.java,v 1.1 2003/05/07 06:22:22 cziegeler Exp $
   */
  public class FullScreenCopletAspect 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)
  	 */
  	public void toSAX(RendererAspectContext context,
                  		Layout layout,
                  		PortalService service,
                  		ContentHandler handler)
  	throws SAXException {
          
          CopletInstanceData cid = ((CopletLayout)layout).getCopletInstanceData();
  
          Layout fullScreenLayout = (Layout)service.getTemporaryAttribute("DEFAULT_LAYOUT");
          if ( fullScreenLayout != null && fullScreenLayout.getId().equals( layout.getId() )) {
              FullScreenCopletEvent event = new FullScreenCopletEvent( cid, null );
              XMLUtils.createElement(handler, "fullscreen-uri", service.getLinkService().getRefreshLinkURI());
          } else {
              FullScreenCopletEvent event = new FullScreenCopletEvent( cid, layout );
              XMLUtils.createElement(handler, "fullscreen-uri", service.getLinkService().getLinkURI(event));
          }
  
          context.invokeNext(layout, service, handler);
  	}
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/MaxPageAspect.java
  
  Index: MaxPageAspect.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.renderer.aspect.impl;
  
  import java.util.Iterator;
  
  import org.apache.cocoon.portal.PortalService;
  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.impl.CompositeLayoutStatus;
  import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
  import org.apache.cocoon.portal.profile.ProfileManager;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @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: MaxPageAspect.java,v 1.1 2003/05/07 06:22:22 cziegeler Exp $
   */
  public class MaxPageAspect 
      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)
  	 */
  	public void toSAX(RendererAspectContext context,
                          Layout layout,
                          PortalService service,
                          ContentHandler handler)
      throws SAXException {
          if (layout instanceof CompositeLayout) {
  
              CompositeLayout compositeLayout = (CompositeLayout) layout;
              Layout maxPageLayout = this.getMaxpageLayout( compositeLayout );
  
              if (maxPageLayout != null) {
                  for (Iterator iter = compositeLayout.getItems().iterator(); iter.hasNext();) {
                      Item item = (Item) iter.next();
                      Layout itemLayout = item.getLayout();
                      if (itemLayout.isStatic() || itemLayout == maxPageLayout) {
                          // FIXME MaxPage
                          //processItem(item, handler, service);
                          continue;
                      }
                      if (itemLayout instanceof CompositeLayout) {
                          Layout maxLayout = this.getMaxpageLayout( (CompositeLayout)itemLayout);
                          if (maxLayout == null) {
                              continue;
                          }
                          // FIXME MaxPage
                          //processItem(item, maxLayout, handler, service);
                      }
                  }
              } else {
                  context.invokeNext( layout, service, handler );
              }
          } else {
              throw new SAXException("Expecting composite layout, received: " + layout);
          }
      }
  
      /**
       * @return Layout
       */
      public Layout getMaxpageLayout(CompositeLayout layout) {
          CompositeLayoutStatus status = (CompositeLayoutStatus)this.getStatus( null, ProfileManager.REQUEST_STATUS, layout.getId());
          Layout maxpageLayout = (status == null ? null : status.getMaxpageLayout());
          
          if (maxpageLayout != null)
              return maxpageLayout;
          for (Iterator iter = layout.getItems().iterator(); iter.hasNext();) {
              Item item = (Item) iter.next();
              Layout current = item.getLayout();
              if (current.isStatic() == false && current instanceof CompositeLayout) {
                  maxpageLayout = this.getMaxpageLayout((CompositeLayout)current );
                  if (maxpageLayout != null) {
                      return maxpageLayout;
                  }
              }
          }
          return null;
      
  	}
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/FrameAspect.java
  
  Index: FrameAspect.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  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.portal.layout.renderer.aspect.impl;
  
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.layout.Layout;
  import org.apache.cocoon.portal.layout.impl.FrameLayout;
  import org.apache.cocoon.portal.layout.impl.FrameStatus;
  import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
  import org.apache.cocoon.portal.profile.ProfileManager;
  import org.apache.cocoon.transformation.CIncludeTransformer;
  import org.apache.cocoon.xml.AttributesImpl;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @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: FrameAspect.java,v 1.1 2003/05/07 06:22:22 cziegeler Exp $
   */
  public class FrameAspect extends AbstractAspect {
  
      // FIXME needs to be shared with CInludeCopletAspect
      protected static final String PREFIX = "cinclude";
      protected static final String NAMESPACE = CIncludeTransformer.CINCLUDE_NAMESPACE_URI;
      protected static final String ELEMENT = CIncludeTransformer.CINCLUDE_INCLUDE_ELEMENT;
      protected static final String QELEMENT = PREFIX + ":" + ELEMENT;
      protected static final String ATTRIBUTE = CIncludeTransformer.CINCLUDE_INCLUDE_ELEMENT_SRC_ATTRIBUTE;
  
      public void toSAX(RendererAspectContext context, Layout layout, PortalService service, ContentHandler handler)
          throws SAXException {
  
          if (!(layout instanceof FrameLayout)) {
              throw new SAXException("Wrong layout type, FrameLayout expected: " + layout.getClass().getName());
          }
  
          FrameStatus status =
              (FrameStatus) this.getStatus(FrameStatus.class, ProfileManager.REQUEST_STATUS, layout.getId());
          String source = (status == null ? null : status.getLink());
          if (source == null) {
              source = ((FrameLayout) layout).getSource();
          }
          /*
          AttributesImpl attributes = new AttributesImpl();
          handler.startPrefixMapping("portal", "urn:apache:cocoon:portal");
          attributes.addCDATAAttribute("id", source);
          handler.startElement("urn:apache:cocoon:portal", "content-source", "portal:content-source", attributes);
          handler.endElement("urn:apache:cocoon:portal", "content-source", "portal:content-source");
          handler.endPrefixMapping("portal");
          */
  
          handler.startPrefixMapping(PREFIX, NAMESPACE);
          AttributesImpl attributes = new AttributesImpl();
          attributes.addCDATAAttribute("src", source);
          handler.startElement(NAMESPACE, ELEMENT, QELEMENT, attributes);
          handler.endElement(NAMESPACE, ELEMENT, QELEMENT);
          handler.endPrefixMapping(NAMESPACE);
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/WindowAspect.java
  
  Index: WindowAspect.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.renderer.aspect.impl;
  
  import java.util.Iterator;
  import java.util.Map;
  
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.coplet.CopletInstanceData;
  import org.apache.cocoon.portal.layout.Layout;
  import org.apache.cocoon.portal.layout.impl.CopletLayout;
  import org.apache.cocoon.portal.layout.impl.Parameter;
  import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
  import org.apache.cocoon.xml.AttributesImpl;
  import org.apache.cocoon.xml.XMLUtils;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @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: WindowAspect.java,v 1.1 2003/05/07 06:22:22 cziegeler Exp $
   */
  public final class WindowAspect extends AbstractAspect {
  
      protected String getTagName(RendererAspectContext context) {
          return context.getAspectParameters().getParameter("tag-name", "window");
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.layout.renderer.RendererAspect#toSAX(org.apache.cocoon.portal.layout.renderer.RendererAspectContext, org.apache.cocoon.portal.layout.Layout, org.apache.cocoon.portal.PortalService, org.xml.sax.ContentHandler)
       */
      public void toSAX(RendererAspectContext context,
                          Layout layout,
                          PortalService service,
                          ContentHandler contenthandler)
      throws SAXException {
          final CopletInstanceData copletInstanceData = ((CopletLayout)layout).getCopletInstanceData();
          AttributesImpl attributes = new AttributesImpl();
          Map parameter = layout.getParameters();
          for (Iterator iter = parameter.values().iterator(); iter.hasNext();) {
              Parameter param = (Parameter) iter.next();
              attributes.addCDATAAttribute(param.getName(), param.getValue());
          }
          XMLUtils.startElement(contenthandler, this.getTagName(context), attributes);
          int status = copletInstanceData.getStatus();
          XMLUtils.createElement(contenthandler, "title", copletInstanceData.getCopletData().getTitle());
          XMLUtils.createElement(contenthandler, "status", "" + status);
  
          context.invokeNext( layout, service, contenthandler );
  
          XMLUtils.endElement(contenthandler, this.getTagName(context));
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCompositeAspect.java
  
  Index: AbstractCompositeAspect.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.renderer.aspect.impl;
  
  import java.util.Iterator;
  
  import org.apache.avalon.framework.CascadingRuntimeException;
  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.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;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @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: AbstractCompositeAspect.java,v 1.1 2003/05/07 06:22:22 cziegeler Exp $
   */
  public abstract class AbstractCompositeAspect
      extends AbstractAspect {
  
      private ComponentSelector rendererSelector;
  
  	/* (non-Javadoc)
  	 * @see org.apache.cocoon.portal.layout.renderer.RendererAspect#toSAX(org.apache.cocoon.portal.layout.renderer.RendererAspectContext, org.apache.cocoon.portal.layout.Layout, org.apache.cocoon.portal.PortalService, org.xml.sax.ContentHandler)
  	 */
  	public void toSAX(RendererAspectContext context,
                  		Layout layout,
                  		PortalService service,
                  		ContentHandler handler)
  	throws SAXException {
          if ( layout instanceof CompositeLayout) {
              CompositeLayout compositeLayout = (CompositeLayout)layout;
              // loop over all rows
              for (Iterator iter = compositeLayout.getItems().iterator(); iter.hasNext();) {
                  Item item = (Item) iter.next();
                  this.processItem(item, handler, service);
              }
          } else {
              throw new SAXException("CompositeLayout expected.");
          }
  	}
  
      protected abstract void processItem(Item item, ContentHandler handler, PortalService service)
          throws SAXException;
  
      /**
       * Process a Layout
       */
      protected void processLayout(Layout layout, PortalService service, ContentHandler handler) throws SAXException {
          final String rendererName = layout.getRendererName();
          Renderer renderer = null;
          try {
              renderer = (Renderer) this.getRenderSelector().select(rendererName);
              renderer.toSAX(layout, service, handler);
          } catch (ComponentException ce) {
              throw new SAXException("Unable to lookup renderer for role " + rendererName, ce);
          } finally {
              this.getRenderSelector().release(renderer);
          }
      }
  
      protected ComponentSelector getRenderSelector() {
          if ( null == this.rendererSelector ) {
              try {
                  this.rendererSelector = (ComponentSelector) this.manager.lookup(Renderer.ROLE + "Selector");
              } catch (ComponentException local) {
                  throw new CascadingRuntimeException("Unable to lookup component selector for portal layout selector.", local);
              }
          }
          return this.rendererSelector;
      }
  
      /**
       * @see org.apache.avalon.framework.activity.Disposable#dispose()
       */
      public void dispose() {
          if (null != this.manager) {
              this.manager.release(this.rendererSelector);
              this.manager = null;
              this.rendererSelector = null;
          }
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/DefaultRendererContext.java
  
  Index: DefaultRendererContext.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.renderer.aspect.impl;
  
  import java.util.HashMap;
  import java.util.Iterator;
  import java.util.Map;
  
  import org.apache.avalon.framework.parameters.Parameters;
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.layout.Layout;
  import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspect;
  import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
   * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
   * 
   * @version CVS $Id: DefaultRendererContext.java,v 1.1 2003/05/07 06:22:22 cziegeler Exp $
   */
  public final class DefaultRendererContext implements RendererAspectContext {
  
      private RendererAspectChain chain;
      
      private Iterator iterator;
      private Iterator configIterator;
      private Parameters config;
      private Map attributes;
      
      public DefaultRendererContext(RendererAspectChain chain) {
          this.chain = chain;
          this.iterator = chain.getIterator();
          this.configIterator = chain.getConfigIterator();
      }
      
  	/* (non-Javadoc)
  	 * @see org.apache.cocoon.portal.layout.renderer.RendererAspectContext#invokeNext(org.apache.cocoon.portal.layout.Layout, org.apache.cocoon.portal.PortalService, org.xml.sax.ContentHandler)
  	 */
  	public void invokeNext(Layout layout,
                      		PortalService service,
                      		ContentHandler handler)
  	throws SAXException {
  		if (iterator.hasNext()) {
              this.config = (Parameters) this.configIterator.next();
              final RendererAspect aspect = (RendererAspect) iterator.next();
              aspect.toSAX(this, layout, service, handler);
  		}
  
  	}
  
  	/* (non-Javadoc)
  	 * @see org.apache.cocoon.portal.layout.renderer.RendererAspectContext#getConfiguration()
  	 */
  	public Parameters getAspectParameters() {
  		return this.config;
  	}
  
      /**
       * Set an attribute
       */
      public void setAttribute(String key, Object attribute) {
          if ( key != null ) {
              if ( this.attributes == null ) {
                  this.attributes = new HashMap(10); 
              }
              this.attributes.put( key, attribute );
          }
      }
  
      /**
       * Get an attribute
       */
      public Object getAttribute(String key) {
          if ( key != null && this.attributes != null) {
              return this.attributes.get( key );
          }
          return null;
      }
  
      /**
       * Remove an attribute
       */
      public void removeAttribute(String key) {
          if ( this.attributes != null && key != null) {
              this.attributes.remove( key );
          }
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/SizingStatusEvent.java
  
  Index: SizingStatusEvent.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.coplet.status.SizingStatus;
  
  /**
   *
   * @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: SizingStatusEvent.java,v 1.1 2003/05/07 06:22:23 cziegeler Exp $
   */
  public final class SizingStatusEvent 
      extends CopletStatusEvent {
  
      public static final int WINDOW_MINIMIZING  = 0;
      public static final int WINDOW_MAXIMIZING  = 1;
  
      // FIXME Do we want configurable parameter names?
      public static String URI_PARAMETER = "sizing-event";
      
      private int action;
      
      private SizingStatus status;
      
      public SizingStatusEvent(CopletInstanceData target, 
                                int action, 
                                SizingStatus status) {
          this.coplet = target;
          this.action = action;
          this.status = status;
      }
  
      public int getAction() {
          return this.action;
      }
      
      public SizingStatus getStatus() {
          return this.status;
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/LayoutRemoveEvent.java
  
  Index: LayoutRemoveEvent.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.event.LayoutEvent;
  
  /**
   *
   * @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: LayoutRemoveEvent.java,v 1.1 2003/05/07 06:22:23 cziegeler Exp $
   */
  public class LayoutRemoveEvent
      extends AbstractActionEvent
      implements LayoutEvent {
  
      /**
       * @param target
       * @param action
       */
      public LayoutRemoveEvent(Object target, int action) {
          super(target, action);
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/LayoutEventImpl.java
  
  Index: LayoutEventImpl.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.event.LayoutEvent;
  
  /**
   *
   * @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: LayoutEventImpl.java,v 1.1 2003/05/07 06:22:23 cziegeler Exp $
   */
  public final class LayoutEventImpl 
      extends AbstractActionEvent
      implements LayoutEvent {
  
       // FIXME - remove this
      public LayoutEventImpl(Object target, int action) {
          super(target, action);
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/DefaultEventConverter.java
  
  Index: DefaultEventConverter.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 java.util.ArrayList;
  import java.util.List;
  
  import org.apache.avalon.framework.CascadingRuntimeException;
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.Composable;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.thread.ThreadSafe;
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.event.Event;
  import org.apache.cocoon.portal.event.EventConverter;
  
  /**
   *
   * @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: DefaultEventConverter.java,v 1.1 2003/05/07 06:22:23 cziegeler Exp $
   */
  public class DefaultEventConverter
      extends AbstractLogEnabled
      implements EventConverter, Composable, ThreadSafe {
  
      protected static final String DECODE_LIST = DefaultEventConverter.class.getName() + "D";
      protected static final String ENCODE_LIST = DefaultEventConverter.class.getName() + "E";
      
      protected ComponentManager manager;
      
      public String encode(Event event) {
          PortalService service = null;
          try {
              service = (PortalService)this.manager.lookup(PortalService.ROLE);
              List list = (List)service.getAttribute(ENCODE_LIST);
              if ( null == list ) {
                  list = new ArrayList();
                  service.setAttribute(ENCODE_LIST, list);
              }
              list.add(event);
              return String.valueOf(list.size()-1);
          } catch (ComponentException ce) {
              throw new CascadingRuntimeException("Unable to lookup component.", ce);            
          } finally {
              this.manager.release(service);
          }
          
      }
  
      public Event decode(String value) {
          if (value != null) {
              PortalService service = null;
              try {
                  service = (PortalService)this.manager.lookup(PortalService.ROLE);
                  List list = (List)service.getAttribute(DECODE_LIST);
                  if ( null != list ) {
                      int index = new Integer(value).intValue();
                      if (index < list.size()) {
                          return (Event)list.get(index);
                      }
                  }
              } catch (ComponentException ce) {
                  throw new CascadingRuntimeException("Unable to lookup component.", ce);            
              } finally {
                  this.manager.release(service);
              }
          }
          return null;
      }
  
      public void start() {
          PortalService service = null;
          try {
              service = (PortalService)this.manager.lookup(PortalService.ROLE);
              List list = (List)service.getAttribute(ENCODE_LIST);
              if ( null != list ) {
                  service.setAttribute(DECODE_LIST, list);
                  service.removeAttribute(ENCODE_LIST);
              }
          } catch (ComponentException ce) {
              throw new CascadingRuntimeException("Unable to lookup component.", ce);            
          } finally {
              this.manager.release(service);
          }
      }
      
      public void finish() {
          PortalService service = null;
          try {
              service = (PortalService)this.manager.lookup(PortalService.ROLE);
              service.removeAttribute(DECODE_LIST);
          } catch (ComponentException ce) {
              throw new CascadingRuntimeException("Unable to lookup component.", ce);            
          } finally {
              this.manager.release(service);
          }
      }
      
      /* (non-Javadoc)
       * @see org.apache.avalon.framework.component.Composable#compose(org.apache.avalon.framework.component.ComponentManager)
       */
      public void compose(ComponentManager manager) 
      throws ComponentException {
          this.manager = manager;
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/InvalidEventTypeException.java
  
  Index: InvalidEventTypeException.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;
  
  /**
   * InvalidEventTypeException is thrown whenever the event type of a <tt>Subscriber</tt>
   * is not assignable from the root event type.
   *
   * @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>
   * @author Mauro Talevi
   * 
   * @version CVS $Id: InvalidEventTypeException.java,v 1.1 2003/05/07 06:22:23 cziegeler Exp $
   */
  public class InvalidEventTypeException extends RuntimeException 
  {
  }
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/AbstractActionEvent.java
  
  Index: AbstractActionEvent.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.event.ActionEvent;
  
  /**
   *
   * @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: AbstractActionEvent.java,v 1.1 2003/05/07 06:22:23 cziegeler Exp $
   */
  public abstract class AbstractActionEvent implements ActionEvent {
  
      final protected Object target;
      
      final protected int action;
      
      public AbstractActionEvent(Object target, int action) {
          this.target = target;
          this.action = action;
      }
      
      /**
       * @return int
       */
      public int getAction() {
          return action;
      }
  
      /**
       * @return Object
       */
      public Object getTarget() {
          return target;
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/DefaultEventManager.java
  
  Index: DefaultEventManager.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 java.util.ArrayList;
  import java.util.Iterator;
  import java.util.List;
  
  import org.apache.avalon.framework.activity.Disposable;
  import org.apache.avalon.framework.activity.Initializable;
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.ComponentSelector;
  import org.apache.avalon.framework.component.Composable;
  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.components.CocoonComponentManager;
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.event.Event;
  import org.apache.cocoon.portal.event.EventConverter;
  import org.apache.cocoon.portal.event.EventManager;
  import org.apache.cocoon.portal.event.Publisher;
  import org.apache.cocoon.portal.event.Register;
  import org.apache.cocoon.portal.event.Subscriber;
  import org.apache.cocoon.portal.event.aspect.DefaultEventAspectContext;
  import org.apache.cocoon.portal.event.aspect.EventAspect;
  import org.apache.cocoon.portal.event.aspect.EventAspectChain;
  import org.apache.cocoon.portal.event.aspect.impl.SizingEventSubscriber;
  import org.apache.cocoon.portal.event.subscriber.impl.DefaultLayoutEventSubscriber;
  
  /**
   *
   * @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: DefaultEventManager.java,v 1.1 2003/05/07 06:22:23 cziegeler Exp $
   */
  public class DefaultEventManager 
      extends AbstractLogEnabled
      implements EventManager, 
                  Composable, 
                  Initializable, 
                  ThreadSafe,
                  Configurable,
                  Disposable {
                      
      private final String rootEventType = Event.class.getName();
      private Class eventClass;
      private Publisher publisher = new DefaultPublisher();
      private Register register = new DefaultRegister();
      private List subscribers = new ArrayList();
      private ComponentManager manager;
      private Configuration configuration;
      
      protected EventAspectChain chain;
      
      protected ComponentSelector aspectSelector;
  
      public Publisher getPublisher() {
          return this.publisher;
      }
      
      public Register getRegister() {
          return this.register;
      }
  
      /* (non-Javadoc)
       * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
       */
      public void configure(Configuration conf) 
      throws ConfigurationException {
          this.configuration = conf;
      }
  
      /* (non-Javadoc)
       * @see org.apache.avalon.framework.activity.Disposable#dispose()
       */
      public void dispose() {
          if (this.manager != null) {
              if ( this.chain != null) {
                  this.chain.dispose( this.aspectSelector );
              }
              this.manager.release( this.aspectSelector );
              this.aspectSelector = null;
              this.manager = null;
          }
      }
  
      public void initialize()
      throws Exception {
          this.eventClass = Class.forName( rootEventType );
          if ( this.getLogger().isDebugEnabled() ) {
              this.getLogger().debug("Initialising eventClass " + eventClass);
          }
  
          // FIXME (CZ,HIGH) : Make this configurable
          this.register.subscribe(new DefaultLayoutEventSubscriber(this.manager));
          this.register.subscribe(new SizingEventSubscriber(this.manager));
      }
  
      class DefaultPublisher implements Publisher {
          
          public void publish( final Event event ) {
              
              if ( getLogger().isDebugEnabled() ) {
                  getLogger().debug("Publishing event " + event.getClass());
              } 
              for ( Iterator e = subscribers.iterator(); e.hasNext(); ){
                  Subscriber subscriber = (Subscriber)e.next();
                  if (subscriber.getEventType().isAssignableFrom(event.getClass())
                  && (subscriber.getFilter() == null || subscriber.getFilter().filter(event))) {
                      if ( getLogger().isDebugEnabled() ) {
                          getLogger().info("Informing subscriber "+subscriber+" of event "+event.getClass());
                      }
                      subscriber.inform(event);
                  }
              }
          }
          
      }
  
      class DefaultRegister implements Register {
          
          public void subscribe( final Subscriber subscriber )
          throws InvalidEventTypeException {
              if ( !eventClass.isAssignableFrom( subscriber.getEventType() ) ) {
                  throw new InvalidEventTypeException();
              }
  
              if ( getLogger().isDebugEnabled() ) {
                  getLogger().debug( "Subscribing event " + subscriber.getEventType().getName() );
              }
              
              // Add to list but prevent duplicate subscriptions
              if ( !subscribers.contains( subscriber ) ) {
                  subscribers.add( subscriber );
                  if ( getLogger().isDebugEnabled() ) {
                      getLogger().debug( "Subscribed Event " + subscriber.getEventType().getName() );
                      getLogger().debug( "Subscribers now active: " + subscribers.size() );
                  }
              }
          }
          
          public void unsubscribe( Subscriber subscriber )
          throws InvalidEventTypeException {
              
              if ( !eventClass.isAssignableFrom( subscriber.getEventType() ) ) {
                  throw new InvalidEventTypeException();
              }
              if ( subscribers.contains( subscriber ) ) {
                  subscribers.remove( subscriber );
                  if ( getLogger().isDebugEnabled() ) {
                      getLogger().debug( "Unsubscribed Event " + subscriber.getEventType().getName() );
                      getLogger().debug( "Subscribers now active: " + subscribers.size() );
                  }
              } else {
                  getLogger().warn( "Subscriber " + subscriber + " not found" );
              }
          }
      }
  
      /* (non-Javadoc)
       * @see org.apache.avalon.framework.component.Composable#compose(org.apache.avalon.framework.component.ComponentManager)
       */
      public void compose(ComponentManager manager) 
      throws ComponentException {
          this.manager = manager;
      }
  
      /**
       * Process the events
       */
      public void processEvents()
      throws ProcessingException {
          if ( this.configuration != null ) {
              try {
                  this.aspectSelector = (ComponentSelector) this.manager.lookup( EventAspect.ROLE+"Selector");
                  this.chain = new EventAspectChain();
                  this.chain.configure(this.aspectSelector, this.configuration.getChild("event-aspects"));
              } catch (ConfigurationException ce) {
                  throw new ProcessingException("Unable configure component.", ce);
              } catch (ComponentException ce) {
                  throw new ProcessingException("Unable to lookup component.", ce);
              }
              this.configuration = null;
          }
          DefaultEventAspectContext context = new DefaultEventAspectContext(this.chain);
          EventConverter converter = null;
          PortalService service = null;
          try {
              service = (PortalService)this.manager.lookup(PortalService.ROLE);
              converter = (EventConverter) this.manager.lookup(EventConverter.ROLE);
              Publisher publisher = this.getPublisher();
  
              converter.start();
              
              // Invoke aspects
              context.setEventPublisher( publisher );
              context.setObjectModel(CocoonComponentManager.getCurrentEnvironment().getObjectModel());
              context.setEventConverter(converter);
              context.invokeNext( service );
  
              converter.finish();
  
          } catch (ComponentException ce) {
              throw new ProcessingException("Unable to lookup component.", ce);
          } finally {
              this.manager.release(converter);
              this.manager.release(service);
          }
  
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/CopletStatusEvent.java
  
  Index: CopletStatusEvent.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.ComparableEvent;
  import org.apache.cocoon.portal.event.Event;
  
  /**
   * EventSource: copletID
   *
   * @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: CopletStatusEvent.java,v 1.1 2003/05/07 06:22:23 cziegeler Exp $
   */
  public abstract class CopletStatusEvent 
      implements Event, ComparableEvent {
  
      protected CopletInstanceData coplet;
      
      public CopletInstanceData getCopletInstanceData() {
          return this.coplet;
      }
      
      public void setCopletInstanceData(CopletInstanceData data) {
          this.coplet = data;
      }
      
      public boolean equalsEvent(ComparableEvent event) {
          if (event instanceof CopletStatusEvent) {
              return ((CopletStatusEvent)event).getCopletInstanceData().getCopletId().equals( this.coplet.getCopletId() );
          }
          return false;
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/FrameSourceEvent.java
  
  Index: FrameSourceEvent.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.event.Event;
  
  /**
   *
   * @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: FrameSourceEvent.java,v 1.1 2003/05/07 06:22:23 cziegeler Exp $
   */
  public final class FrameSourceEvent 
      implements Event {
  
      // FIXME Do we want configurable parameter names?
      public static String URI_PARAMETER = "frame-event";
      
      private String layoutID;
      
      private String link;
      
      public FrameSourceEvent(String layoutID, String link) {
          this.layoutID = layoutID;
          this.link = link;
      }
  
      /**
       * @return Layout The corresponding Layout
       */
      public String getLayoutId() {
          return this.layoutID;
      }
  
      public String getLink() {
          return this.link;
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/impl/FullScreenCopletEvent.java
  
  Index: FullScreenCopletEvent.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.RequestEvent;
  import org.apache.cocoon.portal.layout.Layout;
  
  /**
   * EventSource: copletID
   *
   * @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: FullScreenCopletEvent.java,v 1.1 2003/05/07 06:22:23 cziegeler Exp $
   */
  public class FullScreenCopletEvent 
      extends CopletStatusEvent 
      implements RequestEvent {
  
      public static final String REQUEST_PARAMETER_NAME = "cocoon-portal-fs";
      
      protected Layout layout;
      
      public FullScreenCopletEvent(CopletInstanceData data, Layout layout) {
          this.coplet = data;
          this.layout = layout;
      }
      
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.event.RequestEvent#getRequestParameterName()
       */
      public String getRequestParameterName() {
          return REQUEST_PARAMETER_NAME;
      }
      
      public Layout getLayout() {
          return this.layout;
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/ParameterSourceAdapter.java
  
  Index: ParameterSourceAdapter.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  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.portal.profile.impl;
  
  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;
  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.parameters.Parameters;
  import org.apache.avalon.framework.thread.ThreadSafe;
  import org.apache.cocoon.components.persistance.CastorSourceConverter;
  import org.apache.cocoon.portal.profile.ProfileLS;
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceResolver;
  import org.apache.excalibur.source.SourceValidity;
  
  /**
   *
   * @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: ParameterSourceAdapter.java,v 1.1 2003/05/07 06:22:24 cziegeler Exp $
   */
  public class ParameterSourceAdapter
      extends AbstractLogEnabled
      implements Component, Composable, Configurable, ProfileLS, ThreadSafe {
  
      public static final String ROLE = ParameterSourceAdapter.class.getName();
      private ComponentManager manager;
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.profile.ProfileLS#loadProfile(java.lang.Object)
       */
      public Object loadProfile(Object key) throws Exception {
          Parameters paramKey = (Parameters) key;
          // TODO
          //String sourceURI = "context://samples/portal/profiles/layout/" + paramKey.getParameter("portalname") + ".xml";
          String sourceURI = "profiles/layout/" + paramKey.getParameter("portalname") + ".xml";
          SourceResolver resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
          Source source = null;
          CastorSourceConverter converter = null;
          try {
              source = resolver.resolveURI(sourceURI);
              converter = (CastorSourceConverter) this.manager.lookup(CastorSourceConverter.ROLE);
              return converter.getObject(source);
  
          } finally {
              resolver.release(source);
              manager.release(converter);
              manager.release(resolver);
          }
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.profile.ProfileLS#saveProfile(java.lang.Object, java.lang.Object)
       */
      public void saveProfile(Object key, Object profile) {
          // TODO Auto-generated method stub
  
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.profile.ProfileLS#getValidity(java.lang.Object)
       */
      public SourceValidity getValidity(Object key) {
          SourceResolver resolver = null;
          Source source = null;
          try {
              Parameters paramKey = (Parameters) key;
              // TODO
              String sourceURI =
                  "profiles/layout/" + paramKey.getParameter("portalname") + ".xml";
  //            String sourceURI =
  //                "context://samples/portal/profiles/layout/" + paramKey.getParameter("portalname") + ".xml";
              resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
              source = resolver.resolveURI(sourceURI);
              return source.getValidity();
          } catch (Exception e) {
              getLogger().warn(e.getMessage(), e);
              return null;
          } finally {
              if (source != null)
                  resolver.release(source);
              manager.release(resolver);
          }
      }
  
      /* (non-Javadoc)
       * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
       */
      public void configure(Configuration config) throws ConfigurationException {
          // TODO Auto-generated method stub
  
      }
  
      /* (non-Javadoc)
       * @see org.apache.avalon.framework.component.Composable#compose(org.apache.avalon.framework.component.ComponentManager)
       */
      public void compose(ComponentManager manager) throws ComponentException {
          this.manager = manager;
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/SimpleProfileManager.java
  
  Index: SimpleProfileManager.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.profile.impl;
  
  import java.io.PrintWriter;
  import java.util.HashMap;
  import java.util.Map;
  
  import org.apache.avalon.framework.CascadingRuntimeException;
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.Composable;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.parameters.Parameters;
  import org.apache.avalon.framework.thread.ThreadSafe;
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.aspect.AspectStatus;
  import org.apache.cocoon.portal.coplet.CopletBaseData;
  import org.apache.cocoon.portal.coplet.CopletData;
  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.Item;
  import org.apache.cocoon.portal.layout.Layout;
  import org.apache.cocoon.portal.layout.impl.CompositeLayout;
  import org.apache.cocoon.portal.layout.impl.CopletLayout;
  import org.apache.cocoon.portal.profile.ProfileManager;
  import org.apache.excalibur.source.SourceValidity;
  import org.exolab.castor.mapping.Mapping;
  import org.exolab.castor.xml.Marshaller;
  
  /**
   *
   * @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: SimpleProfileManager.java,v 1.1 2003/05/07 06:22:24 cziegeler Exp $
   */
  public class SimpleProfileManager 
      extends AbstractLogEnabled 
      implements Composable, ProfileManager, ThreadSafe {
  
      protected ComponentManager componentManager;
  
      private Mapping layoutMapping;
  
      private Map layoutStati = new HashMap(100);
      
      /**
       * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
       */
      public void compose(ComponentManager componentManager) throws ComponentException {
          this.componentManager = componentManager;
      }
  
      /**
       * @see org.apache.cocoon.portal.profile.ProfileManager#getPortalLayout(Object)
       */
      public Layout getPortalLayout(String key) {
          PortalService service = null;
          ParameterSourceAdapter adapter = null;
          try {
              service = (PortalService) this.componentManager.lookup(PortalService.ROLE);
              
              if ( null == key ) {
                  Layout l = (Layout) service.getTemporaryAttribute("DEFAULT_LAYOUT");
                  if ( null != l) {
                      return l;
                  }
              }
  
              Object[] objects = (Object[]) service.getAttribute(SimpleProfileManager.class.getName() + "/Layout");
  
              int valid = SourceValidity.INVALID;
              SourceValidity sourceValidity = null;
              if (objects != null) {
                  sourceValidity = (SourceValidity) objects[1];
                  valid = sourceValidity.isValid();
                  if (valid == SourceValidity.VALID)
                      return (Layout) objects[0];
              }
              adapter = (ParameterSourceAdapter) this.componentManager.lookup(ParameterSourceAdapter.ROLE);
              Parameters param = new Parameters();
              param.setParameter("portalname", service.getPortalName());
              SourceValidity newValidity = adapter.getValidity(param);
              if (valid == SourceValidity.UNKNWON) {
                  if (sourceValidity.isValid(newValidity) == SourceValidity.VALID)
                      return (Layout) objects[0];
              }
              Layout layout = (Layout) adapter.loadProfile(param);
              if (newValidity != null) {
                  objects = new Object[] { layout, newValidity };
                  service.setAttribute(SimpleProfileManager.class.getName() + "/Layout", objects);
              }
              // resolve parents
              resolveParents(layout, null);
              return layout;
          } catch (Exception ce) {
              // TODO
              throw new CascadingRuntimeException("Arg", ce);
          } finally {
              this.componentManager.release(service);
              this.componentManager.release(adapter);
          }
      }
  
      public CopletInstanceData getCopletInstanceData(String copletID) {
          PortalService service = null;
          String key = null;
          try {
              service = (PortalService) this.componentManager.lookup(PortalService.ROLE);
              key = service.getPortalName() + ":" + copletID;
  
              Map coplets = (Map) service.getAttribute(SimpleProfileManager.class.getName() + "/Coplets");
              if (null == coplets) {
                  coplets = new HashMap();
                  service.setAttribute(SimpleProfileManager.class.getName() + "/Coplets", coplets);
              }
  
              CopletInstanceData cid = (CopletInstanceData) coplets.get(key);
              if (null == cid) {
                  CopletBaseData base = new CopletBaseData();
                  base.setName("URICoplet");
                  base.setCopletAdapterName("uri");
                  base.setDefaultRendererName("window");
                  cid = new CopletInstanceData();
                  CopletData cd = new CopletData();
                  cd.setName(copletID);
                  cid.setCopletData(cd);
                  cid.setCopletId(copletID); // TODO generate unique copletID
                  cid.getCopletData().setCopletBaseData(base);
                  cid.getCopletData().setAttribute("uri", copletID);
                  cid.getCopletData().setTitle(copletID);
                  coplets.put(key, cid);
  
                  Marshaller marshaller;
                  try {
                      marshaller = new Marshaller(new PrintWriter(System.out));
                      marshaller.setSuppressXSIType(true);
                      marshaller.setMapping(layoutMapping);
                      marshaller.marshal(cid);
                  } catch (Exception e) {
                      //e.printStackTrace();
                  }
              }
              return cid;
          } catch (ComponentException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
              throw new CascadingRuntimeException("CE", e);
          } finally {
              this.componentManager.release(service);
          }
      }
  
      public void setDefaultLayout(Layout object) {
          PortalService service = null;
          try {
              service = (PortalService) this.componentManager.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);
          }
      }
  
      private void resolveParents(final Layout layout, final Item item) {
          String id = layout.getId();
          if ( id == null ) {
              id = Integer.toString(layout.hashCode());
              ((AbstractLayout)layout).setId(id);
          }
          if (layout instanceof CompositeLayout) {
  
              final CompositeLayout compositeLayout = (CompositeLayout) layout;
  
              for (int j = 0; j < compositeLayout.getSize(); j++) {
                  final Item layoutItem = (Item) compositeLayout.getItem(j);
                  layoutItem.setParent(compositeLayout);
                  this.resolveParents(layoutItem.getLayout(), layoutItem);
              }
          }
          if (layout instanceof CopletLayout) {
              final CopletLayout cl = (CopletLayout)layout;
              final CopletInstanceData cid = this.getCopletInstanceData(cl.getId());
              cl.setCopletInstanceData(cid);
              this.setAspectStatus(ProfileManager.SESSION_STATUS, cid.getCopletData().getName(), new SizeableStatus());
          }
          layout.setParent(item);
      }
  	/* (non-Javadoc)
  	 * @see org.apache.cocoon.portal.profile.ProfileManager#getLayoutStatus(java.lang.String)
  	 */
  	public AspectStatus getAspectStatus(Class type, String mode, String key) {
          if ( ProfileManager.REQUEST_STATUS.equals( mode )) {
              PortalService service = null;
              try {
                  service = (PortalService) this.componentManager.lookup(PortalService.ROLE);
                  return (AspectStatus)service.getTemporaryAttribute(type.getName()+"."+key);
              } catch (ComponentException ce) {
                  // ignore
                  return null;
              } finally {
                  this.componentManager.release( service );
              }
          } else {
              // FIXME implement session mode
              Map stati = (Map) this.layoutStati.get( type.getName() );
              return (stati == null ? null : (AspectStatus)stati.get(key));
          }
  	}
  
  	/* (non-Javadoc)
  	 * @see org.apache.cocoon.portal.profile.ProfileManager#setLayoutStatus(java.lang.String, org.apache.cocoon.portal.layout.LayoutStatus)
  	 */
  	public void setAspectStatus( String mode, String key, AspectStatus status) {
          if ( ProfileManager.REQUEST_STATUS.equals( mode )) {
              PortalService service = null;
              try {
                  service = (PortalService) this.componentManager.lookup(PortalService.ROLE);
                  final String attribute = status.getClass().getName() + "." + key;
                  if (null == status) {
                      service.removeTemporaryAttribute(attribute);
                  } else {
                      service.setTemporaryAttribute(attribute, status);
                  }
              } catch (ComponentException ce) {
                  // ignore
              } finally {
                  this.componentManager.release( service );
              }
          } else {
              // FIXME implement session mode
              Map stati = (Map) this.layoutStati.get( status.getClass().getName() );
              if ( stati == null ) {
                  stati = new HashMap(5);
                  this.layoutStati.put( status.getClass().getName(), stati );
              }
              stati.put(key, status);
          }
  	}
  
  }
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/Item.java
  
  Index: Item.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;
  
  import org.apache.cocoon.portal.layout.impl.CompositeLayout;
  
  /**
   *
   * @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: Item.java,v 1.1 2003/05/07 06:22:24 cziegeler Exp $
   */
  public class Item extends AbstractParameters {
  	
  	private Layout layout;
  
      private CompositeLayout parentLayout;
      
  	/**
  	 * Returns the layout.
  	 * @return Layout
  	 */
  	public final Layout getLayout() {
  		return layout;
  	}
  
  	/**
  	 * Sets the layout.
  	 * @param layout The layout to set
  	 */
  	public final void setLayout(Layout layout) {
  		this.layout = layout;
  	}
      
      public final CompositeLayout getParent() {
          return this.parentLayout;
      }
  
      public final void setParent(CompositeLayout layout) {
          this.parentLayout = layout;
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/Parameters.java
  
  Index: Parameters.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  <st...@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.Map;
  
  /**
   *
   * @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: Parameters.java,v 1.1 2003/05/07 06:22:24 cziegeler Exp $
   */
  public interface Parameters {
      /**
       * Get custom parameters as List of
       * org.apache.cocoon.portal.layout.impl.Parameters. This method
       * never returns null.
       * @return List
       */
      Map getParameters();
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/NamedItem.java
  
  Index: NamedItem.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;
  
  /**
   *
   * @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: NamedItem.java,v 1.1 2003/05/07 06:22:24 cziegeler Exp $
   */
  public class NamedItem extends Item {
  
  	private String name;
  
  	/**
  	 * Returns the name.
  	 * @return String
  	 */
  	public String getName() {
  		return name;
  	}
  
  	/**
  	 * Sets the name.
  	 * @param name The name to set
  	 */
  	public void setName(String name) {
  		this.name = name;
  	}
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/Layout.java
  
  Index: Layout.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;
  
  
  /**
   *
   * @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: Layout.java,v 1.1 2003/05/07 06:22:24 cziegeler Exp $
   */
  public interface Layout extends Parameters {
  
      /**
       * Get the name of the {@link Renderer} to draw this layout.
       * @return String The role name
       */
      String getRendererName();
  
      /**
       * Get the unique id of this layout object
       * @return String Unique id
       */
      String getId();
  
      Item getParent();
  
      void setParent(Item item);
  
      boolean isStatic();
  
      void setStatic(boolean value);
      
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/AbstractParameters.java
  
  Index: AbstractParameters.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  <st...@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.Map;
  
  import org.apache.commons.collections.SequencedHashMap;
  
  /**
   *
   * @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: AbstractParameters.java,v 1.1 2003/05/07 06:22:24 cziegeler Exp $
   */
  public abstract class AbstractParameters implements Parameters {
  
      protected Map parameters = new SequencedHashMap();
       
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.layout.Parameters#getParameters()
       */
      public final Map getParameters() {
          return parameters;
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/AbstractLayout.java
  
  Index: AbstractLayout.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  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.portal.layout;
  
  
  /**
   *
   * @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: AbstractLayout.java,v 1.1 2003/05/07 06:22:24 cziegeler Exp $
   */
  public abstract class AbstractLayout extends AbstractParameters implements Layout {
      
      protected String rendererName;
      
      protected String id;
      
      protected Item parent;
      
      protected boolean _static;
      
      
      /**
       * @see org.apache.cocoon.portal.layout.Layout#getRendererName()
       */
      public String getRendererName() {
          return rendererName;
      }
  
      public void setRendererName(String value) {
  		this.rendererName = value;
  	}
      
      /**
       * @return String
       */
      public String getId() {
          return id;
      }
  
      /**
       * Sets the id.
       * @param id The id to set
       */
      public void setId(String id) {
          this.id = id;
      }
  
      public Item getParent() {
          return this.parent;
      }
      
      public void setParent(Item item) {
          this.parent = item;
      }
  	/* (non-Javadoc)
  	 * @see org.apache.cocoon.portal.layout.Layout#isStatic()
  	 */
  	public boolean isStatic() {
  		return _static;
  
  	}
  
  	/* (non-Javadoc)
  	 * @see org.apache.cocoon.portal.layout.Layout#setStatic(boolean)
  	 */
  	public void setStatic(boolean value) {
  		this._static = value;
  
  	}
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/styles/portal_layout.xsl
  
  Index: portal_layout.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" 
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <xsl:template match="/">
  
  <html>
  <body>
    <xsl:apply-templates/>
  </body>
  </html>
  
  </xsl:template>
  
  <!-- Copy all and apply templates -->
  
  <xsl:template match="@*|node()">
     <xsl:copy>
      <xsl:apply-templates select="@*|node()" />
     </xsl:copy>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/styles/tab.xsl
  
  Index: tab.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" 
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <!-- Process a tab  -->
  <xsl:template match="tab-layout">
  <table border="2" cellSpacing="0" width="100%">
    <tr vAlign="top">
      <xsl:for-each select="named-item">
        <xsl:choose>
            <xsl:when test="@selected">
                <td bgColor="#46627A"><p align="center" style="color:white;font-size:18pt"><b><xsl:value-of select="@name"/></b></p></td>
            </xsl:when>
            <xsl:otherwise>
                <td bgColor="#666666"><p align="center"><a style="text-decoration:none;color:white;text-decoration:underline;font-size:16pt" href="{@parameter}"><xsl:value-of select="@name"/></a></p></td>
            </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each>
    </tr>
    <tr>
      <td colSpan="{count(named-item)}">
        <xsl:apply-templates select="named-item"/>
      </td>
    </tr>
  </table>
  </xsl:template>
  
  <xsl:template match="named-item">
    <xsl:apply-templates />
  </xsl:template>
  
  <!-- Copy all and apply templates -->
  
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()" />
    </xsl:copy>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/styles/window.xsl
  
  Index: window.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" 
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <xsl:template match="window">
  
  <xsl:variable name="bgColor">
    <xsl:choose>
      <xsl:when test="@bgColor">
          <xsl:value-of select="@bgColor" />
      </xsl:when>
      <xsl:otherwise>
        <xsl:text>#46627A</xsl:text>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  
  <table border="0" cellSpacing="0" width="100%">
  	<tr vAlign="top">
  		<td bgColor="{$bgColor}">
  			<font>
  				<xsl:attribute name="color">#ffffff</xsl:attribute>
  				<xsl:attribute name="face">Arial</xsl:attribute>
  				<xsl:attribute name="size">2</xsl:attribute>	
  				<xsl:choose>
  				    <xsl:when test="@title">
  					    <b><xsl:value-of select="@title"/></b>
  					</xsl:when>
  				    <xsl:otherwise>
  					    <b><xsl:value-of select="title"/></b>
  					</xsl:otherwise>
  				</xsl:choose>	
  			</font>
  	    </td>
  		<td align="right" bgColor="{$bgColor}">
  			<xsl:if test="fullscreen-uri">
  				<a href="{fullscreen-uri}">
  	  			    <img src="sunspotdemoimg-customize.gif" border="0" alt="Full Screen"/>
  	  			</a>
  			</xsl:if>
  			<xsl:if test="maxpage-uri">
  				<a href="{maxpage-uri}">
  	  			    <img src="sunspotdemoimg-show.gif" border="0" alt="Max Page"/>
  	  			</a>
  			</xsl:if>
  			<xsl:if test="maximize-uri">
  				<a href="{maximize-uri}">
  	  			    <img src="sunspotdemoimg-maximize.gif" border="0" alt="Maximize"/>
  	  			</a>
  			</xsl:if>
  			<xsl:if test="minimize-uri">
  				<a href="{minimize-uri}">
  	  			    <img src="sunspotdemoimg-minimize.gif" border="0" alt="Minimize"/>
  	  			</a>
  			</xsl:if>
  			<xsl:if test="remove-uri">
  				<a href="{remove-uri}">
  	  			    <img src="sunspotdemoimg-delete.gif" border="0" alt="Delete"/>
  	  			</a>
  			</xsl:if>
  		</td>
  	</tr>
  	<xsl:if test="status!=0">
  		<tr>
  			<td colSpan="2">
                  <xsl:apply-templates select="content"/>
  			</td>
  		</tr>
  	</xsl:if>
  </table>
  </xsl:template>
  
  <xsl:template match="content">
      <xsl:apply-templates/>
  </xsl:template>
  
  <!-- Copy all and apply templates -->
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()" />
    </xsl:copy>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/styles/column.xsl
  
  Index: column.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" 
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <!-- Process a Column  -->
  <xsl:template match="column-layout">
  
    <xsl:variable name="border">
      <xsl:choose>
        <xsl:when test="@border">
          <xsl:value-of select="@border" />
        </xsl:when>
        <xsl:otherwise>
          <xsl:text>1</xsl:text>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
  
    <table border="{$border}" cellSpacing="0" width="100%">
      <xsl:if test="@bgcolor">
        <xsl:attribute name="bgcolor">
          <xsl:value-of select="@bgcolor" /> 
        </xsl:attribute>
      </xsl:if>
      <tr vAlign="top">
        <xsl:for-each select="item">
          <td>
            <xsl:if test="@bgcolor">
              <xsl:attribute name="bgcolor">
                <xsl:value-of select="@bgcolor" /> 
              </xsl:attribute>
            </xsl:if>
            <xsl:if test="@width">
              <xsl:attribute name="width">
                <xsl:value-of select="@width" /> 
              </xsl:attribute>
            </xsl:if>
            <xsl:apply-templates />
          </td>
        </xsl:for-each>
      </tr>
    </table>
  </xsl:template>
  
  
  <!-- Copy all and apply templates -->
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()" />
    </xsl:copy>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/styles/header.xsl
  
  Index: header.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" 
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <xsl:template match="/">
  
  <table bgColor="#ffffff" border="0" cellPadding="0" cellSpacing="0" width="100%"><tbody> 
  <tr>    		
  <td colspan="2"> 
  	<table border="0" cellPadding="0" cellSpacing="2" width="100%">
  	<tbody> 
  	<tr> 
  	<td colspan="2" noWrap="" height="1%" bgcolor="#AAB9BF"> <img height="5" src="sunspotdemoimg-space.gif" width="1"/></td>
  	</tr>
  	<tr> 
  	<td noWrap="" align="center" bgcolor="#AAB9BF" height="98%"> <img src="sunspotdemoimg-logo.jpg" width="178" height="90"/></td>
  		<td bgcolor="#AAB9BF" height="98%" align="center" valign="middle"> 
  					<font face="Arial, Helvetica, sans-serif" size="6" color="#46627A">
  		<b>Cocoon Portal</b>
  	</font>
  	</td>
  	</tr>
  	<tr> 
  	<td align="center" height="1%" noWrap="" bgcolor="#cccccc" width="1%"> 
  		<img src="sunspotdemoimg-space.gif" width="300" height="10"/></td>
  		<td bgcolor="#cccccc" height="1%" width="98%"> <img height="10" src="sunspotdemoimg-space.gif" width="1"/> 
  	</td>
  	</tr>
  	</tbody>
  	</table>
  </td>
  </tr>
  <tr>
  <td>
  </td>
  <td>
    <xsl:apply-templates/>
  </td>
  </tr>
  <tr>
  <td colspan="2"> 
  	<table border="0" cellPadding="0" cellSpacing="2" width="100%">
  	<tbody> 
  	<tr> 
  	<td colspan="2" noWrap="" height="10" bgcolor="#cccccc"> <img height="1" src="sunspotdemoimg-space.gif" width="1"/></td>
  	</tr>
  	<tr> 
  	<td colspan="2" noWrap="" height="30" bgcolor="#AAB9BF"> <img height="1" src="sunspotdemoimg-space.gif" width="1"/></td>
  	</tr>
  	</tbody>
  	</table>
  </td>
  </tr>
  </tbody>
  </table>
  
  
  
  
  </xsl:template>
  
  <!-- Copy all and apply templates -->
  
  <xsl:template match="@*|node()">
     <xsl:copy>
      <xsl:apply-templates select="@*|node()" />
     </xsl:copy>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/styles/row.xsl
  
  Index: row.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" 
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <!-- Process a row  -->
  <xsl:template match="row-layout">
  
    <xsl:variable name="border">
      <xsl:choose>
        <xsl:when test="@border">
          <xsl:value-of select="@border" />
        </xsl:when>
        <xsl:otherwise>
          <xsl:text>1</xsl:text>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
  
    <table border="{$border}" cellSpacing="0" width="100%">
      <xsl:if test="@bgcolor">
        <xsl:attribute name="bgcolor">
          <xsl:value-of select="@bgcolor" /> 
        </xsl:attribute>
      </xsl:if>
      <xsl:for-each select="item">
        <tr vAlign="top">
          <xsl:if test="@bgcolor">
            <xsl:attribute name="bgcolor">
              <xsl:value-of select="@bgcolor" /> 
            </xsl:attribute>
          </xsl:if>
          <td>
            <xsl:apply-templates />
          </td>
        </tr>
      </xsl:for-each>
    </table>
  </xsl:template>
  
  
  <!-- Copy all and apply templates -->
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()" />
    </xsl:copy>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/DefaultEventAspectContext.java
  
  Index: DefaultEventAspectContext.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.aspect;
  
  import java.util.Iterator;
  import java.util.Map;
  
  import org.apache.avalon.framework.parameters.Parameters;
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.event.EventConverter;
  import org.apache.cocoon.portal.event.Publisher;
  
  /**
   *
   * @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: DefaultEventAspectContext.java,v 1.1 2003/05/07 06:22:25 cziegeler Exp $
   */
  public final class DefaultEventAspectContext 
      implements EventAspectContext {
  
      private EventAspectChain chain;
      
      private Iterator iterator;
      private Iterator configIterator;
      private Parameters config;
      
      private Publisher publisher;
      private Map objectModel;
      private EventConverter converter;
  
      public DefaultEventAspectContext(EventAspectChain chain) {
          this.chain = chain;
          this.iterator = chain.getIterator();
          this.configIterator = chain.getConfigIterator();
      }
      
  	/* (non-Javadoc)
  	 * @see org.apache.cocoon.portal.layout.renderer.RendererAspectContext#invokeNext(org.apache.cocoon.portal.layout.Layout, org.apache.cocoon.portal.PortalService, org.xml.sax.ContentHandler)
  	 */
  	public void invokeNext(PortalService service) {
  		if (iterator.hasNext()) {
              this.config = (Parameters) this.configIterator.next();
              final EventAspect aspect = (EventAspect) iterator.next();
              aspect.process( this, service );
  		}
  
  	}
  
  	/* (non-Javadoc)
  	 * @see org.apache.cocoon.portal.layout.renderer.RendererAspectContext#getConfiguration()
  	 */
  	public Parameters getAspectParameters() {
  		return this.config;
  	}
  
      /**
       * Get the encoder
       */
      public EventConverter getEventConverter(){
          return this.converter;
      }
      
      /**
       * Get the publisher
       */
      public Publisher getEventPublisher(){
          return this.publisher;
      }
      
      /**
       * Get the object model
       */
      public Map getObjectModel() {
          return this.objectModel;
      }
  
  	/**
  	 * @param converter
  	 */
  	public void setEventConverter(EventConverter converter) {
  		this.converter = converter;
  	}
  
  	/**
  	 * @param map
  	 */
  	public void setObjectModel(Map map) {
  		objectModel = map;
  	}
  
  	/**
  	 * @param publisher
  	 */
  	public void setEventPublisher(Publisher publisher) {
  		this.publisher = publisher;
  	}
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/EventAspect.java
  
  Index: EventAspect.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.aspect;
  
  import org.apache.avalon.framework.component.Component;
  import org.apache.cocoon.portal.PortalService;
  
  /**
   *
   * @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: EventAspect.java,v 1.1 2003/05/07 06:22:25 cziegeler Exp $
   */
  public interface EventAspect extends Component {
  
      String ROLE = EventAspect.class.getName();
      
      void process(EventAspectContext context,
                    PortalService  service);
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/EventAspectContext.java
  
  Index: EventAspectContext.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.aspect;
  
  import java.util.Map;
  
  import org.apache.avalon.framework.parameters.Parameters;
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.event.EventConverter;
  import org.apache.cocoon.portal.event.Publisher;
  
  /**
   *
   * @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: EventAspectContext.java,v 1.1 2003/05/07 06:22:25 cziegeler Exp $
   */
  public interface EventAspectContext {
      
      /**
       * Invoke next aspect 
       */
      void invokeNext(PortalService service);
  
      /** 
       * Get the {@link Parameters} of the aspect.
       */
      Parameters getAspectParameters();
      
      /**
       * Get the encoder
       */
      EventConverter getEventConverter();
      
      /**
       * Get the publisher
       */
      Publisher getEventPublisher();
      
      /**
       * Get the object model
       */
      Map getObjectModel();
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/EventAspectChain.java
  
  Index: EventAspectChain.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.aspect;
  
  import java.util.ArrayList;
  import java.util.Iterator;
  import java.util.List;
  
  import org.apache.avalon.framework.component.Component;
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentSelector;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.parameters.Parameters;
  
  /**
   *
   * @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: EventAspectChain.java,v 1.1 2003/05/07 06:22:25 cziegeler Exp $
   */
  public final class EventAspectChain {
      
      private List aspects = new ArrayList();
      
      private List configs = new ArrayList();
      
      public void configure(ComponentSelector selector, Configuration conf) 
      throws ConfigurationException {
          if ( conf != null ) {
              Configuration[] aspects = conf.getChildren("aspect");
              if ( aspects != null ) {
                  for(int i=0; i < aspects.length; i++) {
                      final Configuration current = aspects[i];
                      final String role = current.getAttribute("type");
                      try {
                          this.aspects.add(selector.select(role));
                          this.configs.add(Parameters.fromConfiguration(current));
                      } catch (ComponentException se) {
                          throw new ConfigurationException("Unable to lookup aspect " + role, se);
                      }
                  }
              }
          } else {
              throw new ConfigurationException("No aspects configured");
          }
      }
      
      public Iterator getIterator() {
          return this.aspects.iterator();
      }
      
      public Iterator getConfigIterator() {
          return this.configs.iterator();
      }
      
      public void dispose(ComponentSelector selector) {
          Iterator i = this.aspects.iterator();
          while (i.hasNext()) {
              selector.release((Component)i.next()); 
          }
          this.aspects.clear();
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/profiles/layout/portal.xml
  
  Index: portal.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <tab-layout renderer-name="tab" static="true">
      <named-item name="News">
          <column-layout renderer-name="column">
              <item>
                  <parameter name="width" value="350" />
                  <row-layout renderer-name="row" static="true">
                      <item>
  		                <coplet-layout renderer-name="window" static="true">
  		                    <id>cocoon://samples/portal/news/newsweek.rss</id>
  		                    <parameter name="title" value="Newsweek" />
  		                </coplet-layout>
                      </item>
                      <item>
  		                <coplet-layout renderer-name="window">
  		                    <id>cocoon://samples/portal/news/NYTBusiness.rss</id>
  		                    <parameter name="title" value="NYT Business" />
  		                </coplet-layout>
                      </item>
                  </row-layout>
              </item>
              <item>
                  <row-layout renderer-name="row" static="false">
                      <item>
  		                <coplet-layout renderer-name="window">
  		                    <id>cocoon://samples/portal/news/BBCNews.rss</id>
  		                    <parameter name="title" value="BBC News" />
  		                </coplet-layout>
                      </item>
                      <item>
                          <column-layout renderer-name="column">
                              <item>
                                  <frame-layout renderer-name="frame">
                                      <id>a</id>
                                      <source>cocoon://samples/portal/news/NYTSport.rss</source>
                                  </frame-layout>
                              </item>
                              <item>
                                  <coplet-layout renderer-name="window">
  				                    <id>cocoon://samples/portal/news/CNET_news.rss</id>
  				                    <parameter name="title" value="CNET News" />
                                  </coplet-layout>
                              </item>
                          </column-layout>
  		            </item>
                      <item>
                          <column-layout renderer-name="column">
                              <item>
                                  <coplet-layout renderer-name="window">
  				                    <id>cocoon://samples/portal/news/CNET_business.rss</id>
  				                    <parameter name="title" value="CNET Business News" />
                                  </coplet-layout>
                              </item>
                              <item>
                                  <parameter name="bgcolor" value="grey" />
                                  <frame-layout renderer-name="frame">
                                      <id>b</id>
                                      <source>cocoon://samples/portal/news/CNNEurope.rss</source>
                                  </frame-layout>
                              </item>
                          </column-layout>
                      </item>
                  </row-layout>
              </item>
              <item>
                  <row-layout renderer-name="row" static="false">
                      <item>
  		                <coplet-layout renderer-name="window">
  		                    <id>cocoon://samples/portal/news/CSTNews.rss</id>
  		                    <parameter name="title" value="Chicago Sunday Times" />
  		                </coplet-layout>
                      </item>
                      <item>
  		                <coplet-layout renderer-name="window">
  		                    <id>cocoon://samples/portal/news/CNNEurope.rss</id>
  		                    <parameter name="title" value="CNN Europe" />
  		                </coplet-layout>
                      </item>
                  </row-layout>
              </item>
          </column-layout>
      </named-item>
      <named-item name="Weblogs">
          <column-layout renderer-name="column">
              <item>
                  <row-layout renderer-name="row">
                      <item>
  		                <coplet-layout renderer-name="window">
  		                    <id>cocoon://samples/portal/news/ML_weblog.rss</id>
  		                    <parameter name="title" value="ML's Weblog" />
  		                    <parameter name="bgcolor" value="#ffff00" />
  		                </coplet-layout>
                      </item>
                      <item>
  		                <coplet-layout renderer-name="window">
  		                    <id>cocoon://samples/portal/news/CZ_weblog.rss</id>
  		                    <parameter name="title" value="CZ's Weblog" />
  		                    <parameter name="bgcolor" value="#ffff00" />
  		                </coplet-layout>
                      </item>
                  </row-layout>
              </item>
              <item>
                  <row-layout renderer-name="row">
                      <item>
  		                <coplet-layout renderer-name="window">
  		                    <id>cocoon://samples/portal/news/weblog.rss</id>
  		                    <parameter name="title" value="Another Weblog" />
  		                    <parameter name="bgcolor" value="#ffff00" />
  		                </coplet-layout>
                      </item>
                  </row-layout>
              </item>
          </column-layout>
      </named-item>
      <named-item name="Cocoon">
          <row-layout renderer-name="row">
              <item>
                  <column-layout renderer-name="column">
                      <item>
  		                <coplet-layout renderer-name="window">
  		                    <id>cocoon://samples/portal/news/introduction.html</id>
  		                    <parameter name="title" value="Cocoon Introduction" />
  		                </coplet-layout>
                      </item>
                      <item>
  		                <coplet-layout renderer-name="window">
  		                    <id>cocoon://samples/portal/news/overview.html</id>
  		                    <parameter name="title" value="Cocoon Overview" />
  		                </coplet-layout>
                      </item>
  	            </column-layout>
              </item>
          </row-layout>
      </named-item>
  </tab-layout>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/news/content/rss/CZ_weblog.xml
  
  Index: CZ_weblog.xml
  ===================================================================
  <?xml version="1.0" ?> 
   <rss version="2.0">
   <channel>
    <title>Cocoon and more</title> 
    <link>http://radio.weblogs.com/0107211/</link> 
    <description>This is the personal weblog of Carsten Ziegeler.</description> 
    <copyright>Copyright 2003 Carsten Ziegeler</copyright> 
    <lastBuildDate>Tue, 29 Apr 2003 07:56:00 GMT</lastBuildDate> 
    <docs>http://backend.userland.com/rss</docs> 
    <generator>Radio UserLand v8.0.8</generator> 
    <managingEditor>cziegeler@s-und-n.de</managingEditor> 
    <webMaster>cziegeler@s-und-n.de</webMaster> 
    <category domain="http://www.weblogs.com/rssUpdates/changes.xml">rssUpdates</category> 
   <skipHours>
    <hour>23</hour> 
    <hour>0</hour> 
    <hour>1</hour> 
    <hour>2</hour> 
    <hour>3</hour> 
    <hour>4</hour> 
    <hour>5</hour> 
    <hour>6</hour> 
    </skipHours>
    <cloud domain="radio.xmlstoragesystem.com" port="80" path="/RPC2" registerProcedure="xmlStorageSystem.rssPleaseNotify" protocol="xml-rpc" /> 
    <ttl>60</ttl> 
   <item>
    <title>Growing Up</title> 
    <link>http://petergabriel.com/moonclub/tours/tour_page.html</link> 
    <description><P>Tomorrow: <A href="http://www.koenig-pilsener-arena.de/index.htm">Live in Oberhausen</A></P></description> 
    <guid>http://radio.weblogs.com/0107211/2003/04/29.html#a111</guid> 
    <pubDate>Tue, 29 Apr 2003 07:55:59 GMT</pubDate> 
    </item>
   <item>
    <title>Cocoon Milestone 1</title> 
    <link>http://radio.weblogs.com/0107211/2003/04/28.html#a110</link> 
    <description>Hurray, it seems that Cocoon is reaching a new milestone: 2.1-M1 (a.k.a. 2.1-Beta1). Although we don't have such a detailed plan as for example Eclipse, I guess we will reach the release candidate phase this year :)</description> 
    <guid>http://radio.weblogs.com/0107211/2003/04/28.html#a110</guid> 
    <pubDate>Mon, 28 Apr 2003 13:24:46 GMT</pubDate> 
    </item>
   <item>
    <title>Home, sweet home - sort of</title> 
    <link>http://radio.weblogs.com/0107211/2003/04/28.html#a109</link> 
    <description>After travelling around for the last four weeks, I'm finally back in my home...eh...office and can work at my own desk again. Don't get me wrong, I like being at customer sites but most times you are limited with respect to emails, internet access, cvs etc.</description> 
    <guid>http://radio.weblogs.com/0107211/2003/04/28.html#a109</guid> 
    <pubDate>Mon, 28 Apr 2003 13:23:28 GMT</pubDate> 
    </item>
   <item>
    <title>Books about open source</title> 
    <link>http://radio.weblogs.com/0107211/2003/04/17.html#a108</link> 
    <description><P>I just read a book about using open source in own projects and I was a little bit disappointed. In general the book is good as it details different open source projects, for example for logging, for persistence, for server-site programming etc. And then I came to the Struts chapter...and read this: "Whenever you start a project, you should not ask 'can we use Struts for this?', you should ask 'Why not using Struts?' Struts is the perfect fit for every web application."</P> <P>Now, I really value Struts and I think it makes perfect sense in some cases, but Struts is not the golden hammer tool, if you understand what I mean. It doesn't make sense to use the same tool for every problem. This is nonsense for Struts and this is nonsense for Cocoon and this is nonsense for every server-site programming as well. </P> <P>The key in successful programming is to choose the right tools or frameworks or libraries for the job to do.</P></description> 
    <guid>http://radio.weblogs.com/0107211/2003/04/17.html#a108</guid> 
    <pubDate>Thu, 17 Apr 2003 13:51:26 GMT</pubDate> 
    </item>
   <item>
    <title>CruiseControl - the endless story has an end</title> 
    <link>http://radio.weblogs.com/0107211/2003/04/07.html#a107</link> 
    <description><P>Finally I got CruiseControl 2.0.2 running - it wasn't that easy as the documentation is a little bit confusing, the default settings are unusable and sometimes you have to guess what the correct settings are.</P> <P>Ok, I guess, most of you have cruisecontrol or anthill or whatever running since years, anyway; but for me it's a little success because during the last months I accidentally tried to install it from time to time and always failed :(. But I never gave up!So after all: a little success.</P> <P>The next question is: Where to use it? Hmm....</P></description> 
    <guid>http://radio.weblogs.com/0107211/2003/04/07.html#a107</guid> 
    <pubDate>Mon, 07 Apr 2003 13:12:35 GMT</pubDate> 
    </item>
   <item>
    <title>New music</title> 
    <link>http://radio.weblogs.com/0107211/2003/04/07.html#a106</link> 
    <description><P>Over the weekend I had some time to listen to some new music:</P> <P>The new album "Sleeping with Ghosts" from <A href="http://www.placeboworld.co.uk/">Placebo</A> is very good. Now, putting it simple: it's like the other albums with new songs. So if you like this kind of music, it's a must buy.</P> <P>The new album "Long gone before daylight" from the <A href="http://www.cardigans.com">Cardigans</A> is in my eyes not so good. The released single is nice to listen to (again, as always :) ), but the other songs are in my ears only nice, like the usual everyday songs.</P> <P>Next up is a copy of the latest Coldplay album - I only listened to two tracks.</P> <P>I will upload the albums to my (new) mp3 player with 20GB space for all my CDs; so I can listen everywhere to "my" music without carrying tons of CDs with me.</P></description> 
    <guid>http://radio.weblogs.com/0107211/2003/04/07.html#a106</guid> 
    <pubDate>Mon, 07 Apr 2003 12:28:13 GMT</pubDate> 
    </item>
   <item>
    <title>The Lion King</title> 
    <link>http://radio.weblogs.com/0107211/2003/03/31.html#a105</link> 
    <description><P>Last week I visited the <A href="http://www.loewenkoenig.de/index2.php">Lion King</A> in Hamburg. It's really a great musical with very good sound and visual effects.</P> <P>Ok, the story is not very good and the texts are not very sophisticated - so, at the end it's like a good action movie: the story doesn't matter but the effects are worth seeing it. Especially the african music (sounded a little bit like some PG songs) and the interesting animal costumes.</P> <P>So, if you have time to see the musical, watch it! The stage is located in the habor of Hamburg at the opposite site of the city. So you can take a boat for free to travel over the river to the stage or you can use the old tunnel and walk by feet under(!) the river (which takes some time).</P></description> 
    <guid>http://radio.weblogs.com/0107211/2003/03/31.html#a105</guid> 
    <pubDate>Mon, 31 Mar 2003 13:38:43 GMT</pubDate> 
    </item>
   <item>
    <title>The Cocoon Family</title> 
    <link>http://radio.weblogs.com/0107211/2003/03/31.html#a104</link> 
    <description><FONT size="2"> <P>Some users/readers might be wondering what's going on in Cocoonland and perhaps some users might get worried about the "mysterious things" taking place in the mailing list over the past weeks. And this might scare them.</P> <P>So, what's going on and what will be the meaning for Cocoon? Now, to be honest I currently don't know what's going on (well at least, I know some things that are happening, but unfortunately not all). But I'm trying to figure it out.</P> <P>So, what does this mean for using Cocoon? I really think: viewed globally: nothing. There were some bad comments over the last weeks, one important committer left the project (which is really sad) because of that, and currently others are thinking about leaving/taking a break as well. </P> <P>Everything seems quiet now, but I still think that the storm is not over yet. Perhaps we can get the new release out without any problems, but it's unlikely that sooner or later the same problems will arise, because I guess that the root of the problems is not really solved yet - and the root is not clearly visible by now, but again, I'm trying to figure it out.</P> <P>But on the other hand, there are many other committers keeping on the great work taking place over the last years, and there are many users helping as well. Most of them were active over the last years and are still committed to Cocoon, and they will not discontinue their work because of some stupid comments. And even more important, there is a big commercial committment to Cocoon, and all these (big) companies will asure that Cocoon will continue.</P> <P>So don't worry if you see these ego-fights and verbal attacks in the mailing list; this happens from time to time, but it has no real impact on the success of the project. It's like a big family - there is not always sunshine and from time to time some black sheep arrive and try to cause confusion and discredit. But after a time, the problems will be solved and the family can keep on living happily.</P></FONT></description> 
    <guid>http://radio.weblogs.com/0107211/2003/03/31.html#a104</guid> 
    <pubDate>Mon, 31 Mar 2003 13:33:39 GMT</pubDate> 
    </item>
   <item>
    <title>Once Upon a Time</title> 
    <link>http://radio.weblogs.com/0107211/2003/03/21.html#a103</link> 
    <description><P>Today I had some time to think about the good old past: the first time I got in contact with Cocoon. So here are some facts:</P> <P>It's nearly three years ago.  I started in June 2000 by exploring the differences between Cocoon 1 - which was the current version of that time - and the pre-pre-pre alpha version of Cocoon 2.</P> <P>Although most features of Cocoon 2 were even not implemented, for example the sitemap did not compile well, actions were not defined, selectors were not implemented etc, it became clear that Cocoon 2 would be the way to go.</P> <P>And then a time with real fun started (and I really mean it the way I say). As we started in July 2000 with using the available Cocoon 2 version, we ran into several problems, bugs and missing features from day to day. And we tried to fix each issue and submit a patch to the community. Don't get me wrong, it's absolutely natural, that a project at that stage has bugs and problems. So we knew what lay ahead of us.</P> <P>Although this was a hard time, we believed the community of Cocoon that a first version of 2.0 would be available in November 2000 - now, we know that this was wrong :) The first version was indeed released in November, but in 2001.</P> <P>Then one day, the Cocoon community had enough of my patches ;) and voted me in as a committer! Wow! It became evident that some important parts were still missing, like caching, internal cocoon calls etc. As I already implemented such things for our product called sunShine, I added those things to Cocoon as well.</P> <P>The whole time between June 2000 and November 2001 was really fun, because we acted really like a community (or family if you want). When a problem was detected, you were never alone. Most time, the problem was fixed by working together. And also new things were always discussed by most committers and then implemented.</P> <P>This changed after the first release of Cocoon 2.0 in November 2001, because there were no real itches to scratch. Everything (well, at least the core) was working very well.</P> <P>So, looking back it was a real great time to be directly involved in the development of such a great open source project. </P> <P>Today, it's still fun to be part of the great Cocoon community but I'm really missing the collaboration between the different committers.<br/>From time to time two or three committers try to solve together a problem/add a feature but mostly this lasts only for this single issue.</P> <P>But it's <EM>still</EM> fun even if the weather is not too sunny at the moment.</P></description> 
    <guid>http://radio.weblogs.com/0107211/2003/03/21.html#a103</guid> 
    <pubDate>Fri, 21 Mar 2003 10:17:49 GMT</pubDate> 
    </item>
   <item>
    <title>Everything about Cocoon - JAX Speaker</title> 
    <link>http://www.jax2003.de</link> 
    <description><P>If you want to get to know something about Cocoon, well the <A href="http://www.jax2003.de/">JAX 2003</A> might be the right place for it. I will present two sessions about Cocoon (in German) and together with <A href="http://www.need-a-cake.com">Matthew</A> I will give a one day power workshop about Cocoon! And Matthew gives of course some sessions as well, so you have to be there.</P> <P>Apart from our presentations, the JAX will have several other very interesting talks as well. So make sure that you mark the date in your calendar.</P></description> 
    <guid>http://radio.weblogs.com/0107211/2003/03/20.html#a102</guid> 
    <pubDate>Thu, 20 Mar 2003 12:25:33 GMT</pubDate> 
    </item>
    </channel>
    </rss>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/news/content/rss/CNET_news.xml
  
  Index: CNET_news.xml
  ===================================================================
  <?xml version="1.0" ?> 
   <rss version="2.0">
   <channel>
    <title>CNET News.com</title> 
    <link>http://www.news.com/</link> 
    <description>Tech News First</description> 
    <language>en-us</language> 
    <pubDate>Tue, 29 Apr 2003 07:29:05 PDT</pubDate> 
    <lastBuildDate>Tue, 29 Apr 2003 07:29:05 PDT</lastBuildDate> 
    <category domain="syndic8">14171</category> 
    <category>CNET News.com</category> 
    <generator>CNET</generator> 
    <docs>http://news.com.com/2009-1090-980549.html</docs> 
    <ttl>20</ttl> 
   <image>
    <title>CNET News.com</title> 
    <url>http://i.i.com.com/cnwk.1d/i/ne/gr/prtnr/rss_logo.gif</url> 
    <link>http://www.news.com/</link> 
    <width>88</width> 
    <height>31</height> 
    </image>
   <item>
    <title>Intel worker accused of aiding terrorists</title> 
    <link>http://rss.com.com</link> 
    <description>The Justice Department charges engineer Mike Hawash, who has been in solitary confinement since March 20, with conspiracy to levy war against America and of supporting terror groups.</description> 
    <category>Media</category> 
    <guid isPermaLink="true">http://rss.com.com/2100-1028-998718.html</guid> 
    <pubDate>Tue, 29 Apr 2003 07:15:00 PDT</pubDate> 
    </item>
   <item>
    <title>Commentary: Breaking the digital music logjam</title> 
    <link>http://rss.com.com</link> 
    <description>The iTunes Music Store will raise the bar for digital music under Windows and change the industry, but it won't get Apple out of its 5 percent ghetto in the PC business.</description> 
    <category>News.Commentary</category> 
    <guid isPermaLink="true">http://rss.com.com/2009-1122-998707.html</guid> 
    <pubDate>Tue, 29 Apr 2003 06:10:00 PDT</pubDate> 
    </item>
   <item>
    <title>Off the hype meter</title> 
    <link>http://rss.com.com</link> 
    <description>Industry watcher <b>Jon Oltsik</b> offers his nominations for technology categories in which the elevation of hype has become an art form.</description> 
    <category>Perspectives</category> 
    <guid isPermaLink="true">http://rss.com.com/2010-1071-998529.html</guid> 
    <pubDate>Tue, 29 Apr 2003 04:00:00 PDT</pubDate> 
    </item>
   <item>
    <title>Sweet Semel of success</title> 
    <link>http://rss.com.com</link> 
    <description>After two years as leader of Yahoo, CEO Terry Semel is silencing naysayers with the results of his low-key approach.</description> 
    <category>Media</category> 
    <guid isPermaLink="true">http://rss.com.com/2100-1030-998665.html</guid> 
    <pubDate>Tue, 29 Apr 2003 04:00:00 PDT</pubDate> 
    </item>
   <item>
    <title>Apple's music: Evolution, not revolution</title> 
    <link>http://rss.com.com</link> 
    <description>For all the glitz surrounding the unveiling of Apple's new music service, a quick look suggests that it's a solid, but hardly revolutionary, addition to the market.</description> 
    <category>Media</category> 
    <guid isPermaLink="true">http://rss.com.com/2100-1027-998675.html</guid> 
    <pubDate>Tue, 29 Apr 2003 04:00:00 PDT</pubDate> 
    </item>
    </channel>
    </rss>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/news/content/rss/Weblog.xml
  
  Index: Weblog.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1" ?> 
   <rss version="0.91">
   <channel>
   <item>
    <title>Giving the world a pluggable Gnutella</title> 
    <link>http://writetheweb.com/read.php?item=24</link> 
    <description>WorldOS is a framework on which to build programs that work like Freenet or Gnutella -allowing distributed applications using peer-to-peer routing.</description> 
    </item>
   <item>
    <title>Syndication discussions hot up</title> 
    <link>http://writetheweb.com/read.php?item=23</link> 
    <description>After a period of dormancy, the Syndication mailing list has become active again, with contributions from leaders in traditional media and Web syndication.</description> 
    </item>
   <item>
    <title>Personal web server integrates file sharing and messaging</title> 
    <link>http://writetheweb.com/read.php?item=22</link> 
    <description>The Magi Project is an innovative project to create a combined personal web server and messaging system that enables the sharing and synchronization of information across desktop, laptop and palmtop devices.</description> 
    </item>
   <item>
    <title>Syndication and Metadata</title> 
    <link>http://writetheweb.com/read.php?item=21</link> 
    <description>RSS is probably the best known metadata format around. RDF is probably one of the least understood. In this essay, published on my O'Reilly Network weblog, I argue that the next generation of RSS should be based on RDF.</description> 
    </item>
   <item>
    <title>UK bloggers get organised</title> 
    <link>http://writetheweb.com/read.php?item=20</link> 
    <description>Looks like the weblogs scene is gathering pace beyond the shores of the US. There's now a UK-specific page on weblogs.com, and a mailing list at egroups.</description> 
    </item>
   <item>
    <title>Yournamehere.com more important than anything</title> 
    <link>http://writetheweb.com/read.php?item=19</link> 
    <description>Whatever you're publishing on the web, your site name is the most valuable asset you have, according to Carl Steadman.</description> 
    </item>
    </channel>
    </rss>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/news/content/rss/CSTNews.xml
  
  Index: CSTNews.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1" ?> 
   <rss version="0.91">
   <channel>
   <item>
    <title>Number of missing DCFS wards doubles</title> 
    <link>http://www.newsisfree.com/click/-2,17198736,2282/</link> 
    </item>
   <item>
    <title>13 reported killed in shootout with soldiers</title> 
    <link>http://www.newsisfree.com/click/-2,17203867,2282/</link> 
    </item>
   <item>
    <title>Waukegan awaits Catholic high school</title> 
    <link>http://www.newsisfree.com/click/-2,17203868,2282/</link> 
    </item>
   <item>
    <title>Rogues help themselves to X-Men movie posters</title> 
    <link>http://www.newsisfree.com/click/-2,17203869,2282/</link> 
    </item>
   <item>
    <title>Teens take a pass on exclusive relationships</title> 
    <link>http://www.newsisfree.com/click/-2,17198737,2282/</link> 
    </item>
    </channel>
    </rss>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/news/content/rss/CNET_business.xml
  
  Index: CNET_business.xml
  ===================================================================
  <?xml version="1.0"?> 
   <rss version="2.0">
   <channel>
    <title>CNET News.com - E-Business</title> 
    <link>http://www.news.com/</link> 
    <description>Tech News First</description> 
    <language>en-us</language> 
    <pubDate>Tue, 29 Apr 2003 07:35:23 PDT</pubDate> 
    <lastBuildDate>Tue, 29 Apr 2003 07:35:23 PDT</lastBuildDate> 
    <category domain="syndic8">14173</category> 
    <category>CNET News.com - E-Business</category> 
    <generator>CNET</generator> 
    <docs>http://news.com.com/2009-1090-980549.html</docs> 
    <ttl>20</ttl> 
   <image>
    <title>CNET News.com</title> 
    <url>http://i.i.com.com/cnwk.1d/i/ne/gr/prtnr/rss_logo.gif</url> 
    <link>http://www.news.com/</link> 
    <width>88</width> 
    <height>31</height> 
    </image>
   <item>
    <title>OASIS: Net procurement needs to align</title> 
    <link>http://rss.com.com</link> 
    <description>The Web services standards group launches an effort to create uniform practices for the way companies procure supplies over the Internet.</description> 
    <category>E-Business</category> 
    <guid isPermaLink="true">http://rss.com.com/2100-1019-998596.html</guid> 
    <pubDate>Mon, 28 Apr 2003 12:34:00 PDT</pubDate> 
    </item>
   <item>
    <title>Earnings: Amazon tapers loss</title> 
    <link>http://rss.com.com</link> 
    <description><!-- PLEASE BE SURE TO UPDATE THE BRIEF WITH THE LATEST HEADLINES -->The Web retailer narrows loss...Nortel posts surprise profit...Spider-Man can't save Sony from slipping into the red.</description> 
    <category>E-Business</category> 
    <guid isPermaLink="true">http://rss.com.com/2009-1017-255584.html</guid> 
    <pubDate>Sun, 27 Apr 2003 06:00:00 PDT</pubDate> 
    </item>
   <item>
    <title>Monster backpedals on listings purge</title> 
    <link>http://rss.com.com</link> 
    <description>Amid protests from Arab-American groups, the career Web site partially backs away from a decision to exclude references to job postings and r&#233;sum&#233;s from seven countries.</description> 
    <category>E-Business</category> 
    <guid isPermaLink="true">http://rss.com.com/2100-1022-998357.html</guid> 
    <pubDate>Fri, 25 Apr 2003 17:08:00 PDT</pubDate> 
    </item>
   <item>
    <title>VC Watch: Nanosys receives $30 million</title> 
    <link>http://rss.com.com</link> 
    <description>The company is an intellectual property licensing player in nanotechnology...Demantra rakes in $16 million...NeoScale Systems whips up $12 million.</description> 
    <category>E-Business</category> 
    <guid isPermaLink="true">http://rss.com.com/2100-1021-998356.html</guid> 
    <pubDate>Fri, 25 Apr 2003 09:35:00 PDT</pubDate> 
    </item>
   <item>
    <title>Taiwan dreads Computex ghost town</title> 
    <link>http://rss.com.com</link> 
    <description>Fears of empty halls at Computex Taipei due to the SARS outbreak have prompted the city's mayor to send out 200,000 letters of reassurance to overseas buyers.</description> 
    <category>E-Business</category> 
    <guid isPermaLink="true">http://rss.com.com/2100-1021-998329.html</guid> 
    <pubDate>Fri, 25 Apr 2003 06:26:00 PDT</pubDate> 
    </item>
   <item>
    <title>Amazon lifted by international sales</title> 
    <link>http://rss.com.com</link> 
    <description>The Web retailer reports a narrower loss and higher revenue on the back of a 68 percent rise in overseas sales, special promotions and cost-cutting.</description> 
    <category>E-Business</category> 
    <guid isPermaLink="true">http://rss.com.com/2100-1021-998280.html</guid> 
    <pubDate>Thu, 24 Apr 2003 15:22:00 PDT</pubDate> 
    </item>
   <item>
    <title>Best Software reshuffles, cuts jobs</title> 
    <link>http://rss.com.com</link> 
    <description /> 
    <category>E-Business</category> 
    <guid isPermaLink="true">http://rss.com.com/2110-1021-998278.html</guid> 
    <pubDate>Thu, 24 Apr 2003 14:54:00 PDT</pubDate> 
    </item>
   <item>
    <title>SEC set to swoop in insider trading suit</title> 
    <link>http://rss.com.com</link> 
    <description>A wife-and-husband pair of Wall Street high-flyers will reportedly soon face civil suit charges of irregularities in trading in shares of eBay and Drugstore.com.</description> 
    <category>E-Business</category> 
    <guid isPermaLink="true">http://rss.com.com/2100-1021-998215.html</guid> 
    <pubDate>Thu, 24 Apr 2003 11:02:00 PDT</pubDate> 
    </item>
   <item>
    <title>Federal charges shock Silicon Valley</title> 
    <link>http://rss.com.com</link> 
    <description>To many in Silicon Valley, there is a growing sense that the once high-flying banker Frank P. Quattrone is taking the heat for the entire industry. <br /><span class="a1">The New York Times</span></description> 
    <category>E-Business</category> 
    <guid isPermaLink="true">http://rss.com.com/2100-1021-998124.html</guid> 
    <pubDate>Wed, 23 Apr 2003 21:30:00 PDT</pubDate> 
    </item>
   <item>
    <title>eBay to stay in San Jose</title> 
    <link>http://rss.com.com</link> 
    <description /> 
    <category>E-Business</category> 
    <guid isPermaLink="true">http://rss.com.com/2110-1018-998123.html</guid> 
    <pubDate>Wed, 23 Apr 2003 21:00:00 PDT</pubDate> 
    </item>
    </channel>
    </rss>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/news/content/rss/NYTBusiness.xml
  
  Index: NYTBusiness.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1" ?> 
   <rss version="0.91">
   <channel>
    <title>New York Times: Business</title> 
    <link>http://www.nytimes.com/pages/business/</link> 
    <description>(By http://www.newsisfree.com/syndicate.php - FOR PERSONAL AND NON COMMERCIAL USE ONLY!)</description> 
    <language>en</language> 
    <webMaster>mkrus@newsisfree.com</webMaster> 
    <lastBuildDate>04/29/03 14:26 CEST</lastBuildDate> 
   <image>
    <link>http://www.newsisfree.com/sources/info/759/</link> 
    <url>http://www.newsisfree.com/HPE/Images/button.gif</url> 
    <title>Powered by NewsIsFree</title> 
    <width>88</width> 
    <height>31</height> 
    </image>
   <item>
    <title>In a Wall St. Hierarchy, Short Shrift to Little Guy</title> 
    <link>http://www.newsisfree.com/click/-2,17188428,759/</link> 
    </item>
   <item>
    <title>10 Wall St. Firms Settle With U.S. in Analyst Inquiry</title> 
    <link>http://www.newsisfree.com/click/-2,17188429,759/</link> 
    </item>
   <item>
    <title>Airline Workers Losing Perks</title> 
    <link>http://www.newsisfree.com/click/-2,17188430,759/</link> 
    </item>
   <item>
    <title>MasterCard Settles Case With Retailers Ahead of Trial</title> 
    <link>http://www.newsisfree.com/click/-2,17188431,759/</link> 
    </item>
   <item>
    <title>Radio Performance Closely Watched at Viacom</title> 
    <link>http://www.newsisfree.com/click/-2,17188432,759/</link> 
    </item>
    </channel>
    </rss>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/news/content/rss/BBCNews.xml
  
  Index: BBCNews.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1" ?> 
   <rss version="0.91">
   <channel>
    <title>BBC News | World | UK Edition</title> 
    <link>http://news.bbc.co.uk/go/click/rss/0.91/public/-/1/hi/world/default.stm</link> 
    <description>Updated every minute of every day</description> 
    <language>en-gb</language> 
    <lastBuildDate>Tue, 29 Apr 03 14:41:21 GMT</lastBuildDate> 
    <copyright>Copyright: (C) British Broadcasting Corporation, http://news.bbc.co.uk/2/shared/bsp/hi/services/copyright/html/default.stm</copyright> 
    <docs>http://www.bbc.co.uk/syndication/</docs> 
   <image>
    <title>BBC News Online</title> 
    <url>http://news.bbc.co.uk/furniture/syndication/bbc_news_120x60.gif</url> 
    <link>http://news.bbc.co.uk</link> 
    </image>
   <item>
    <title>US pulls out of Saudi Arabia</title> 
    <description>The United States says virtually all its troops, except some training personnel, are to be withdrawn from Saudi Arabia.</description> 
    <link>http://news.bbc.co.uk/go/click/rss/0.91/public/-/1/hi/world/middle_east/2984547.stm</link> 
    </item>
   <item>
    <title>Sars 'a long-term epidemic'</title> 
    <description>The outbreak of the Sars virus in China is a grave and long-term problem, Prime Minister Wen Jiabao says.</description> 
    <link>http://news.bbc.co.uk/go/click/rss/0.91/public/-/1/hi/world/asia-pacific/2985649.stm</link> 
    </item>
   <item>
    <title>PM rejects Mid-East violence</title> 
    <description>The Palestinian prime minister-designate says there is no military solution to the Isralei conflict, as he faces a crucial vote.</description> 
    <link>http://news.bbc.co.uk/go/click/rss/0.91/public/-/1/hi/world/middle_east/2983939.stm</link> 
    </item>
   <item>
    <title>Charges over Serb PM murder</title> 
    <description>Serbian ultra-nationalist Vojislav Seselj and 44 others are charged over the killing of PM Zoran Djindjic.</description> 
    <link>http://news.bbc.co.uk/go/click/rss/0.91/public/-/1/hi/world/europe/2985423.stm</link> 
    </item>
   <item>
    <title>'Anti-war' four stress euro-role</title> 
    <description>Four anti-war EU leaders end a summit reaffirming their commitment to Nato - but seeking closer European ties.</description> 
    <link>http://news.bbc.co.uk/go/click/rss/0.91/public/-/1/hi/world/europe/2984021.stm</link> 
    </item>
   <item>
    <title>Vajpayee 'not to go to Pakistan'</title> 
    <description>India's prime minister is unlikely to visit Pakistan for talks in the near future, despite an invitation from his counterpart.</description> 
    <link>http://news.bbc.co.uk/go/click/rss/0.91/public/-/1/hi/world/south_asia/2984265.stm</link> 
    </item>
   <item>
    <title>Croat 'war crimes' general dies</title> 
    <description>The former head of the Croatian army, seen as a national hero but indicted by the war crimes tribunal, dies.</description> 
    <link>http://news.bbc.co.uk/go/click/rss/0.91/public/-/1/hi/world/europe/2985633.stm</link> 
    </item>
   <item>
    <title>Militant killed in Gaza attack</title> 
    <description>A Palestinian militant dies in a strike by Israeli helicopter gunships in Gaza, while two others are reported killed in the West Bank.</description> 
    <link>http://news.bbc.co.uk/go/click/rss/0.91/public/-/1/hi/world/middle_east/2984559.stm</link> 
    </item>
   <item>
    <title>Blair arrives for Russia talks</title> 
    <description>The UK prime minister is holding his first meeting with President Putin since the start of the Iraq war.</description> 
    <link>http://news.bbc.co.uk/go/click/rss/0.91/public/-/1/hi/uk_politics/2983789.stm</link> 
    </item>
   <item>
    <title>Iraqis killed in anti-US protest</title> 
    <description>US troops open fire on demonstrators in the town of Falluja, killing at least 13 people according to witnesses.</description> 
    <link>http://news.bbc.co.uk/go/click/rss/0.91/public/-/1/hi/world/middle_east/2984663.stm</link> 
    </item>
   <item>
    <title>Iraqi antiquities summit held</title> 
    <description>Museum experts meet in London to discuss how to help restore the looted cultural heritage of Iraq.</description> 
    <link>http://news.bbc.co.uk/go/click/rss/0.91/public/-/1/hi/world/europe/2984171.stm</link> 
    </item>
   <item>
    <title>US anger at war crimes threat</title> 
    <description>The US warns Belgium not to proceed with a possible war crimes case against Iraq war commander Tommy Franks.</description> 
    <link>http://news.bbc.co.uk/go/click/rss/0.91/public/-/1/hi/world/middle_east/2983911.stm</link> 
    </item>
   <item>
    <title>Wimbledon ups prize money</title> 
    <description>This year's Wimbledon men's singles champion will receive �575,000.</description> 
    <link>http://news.bbc.co.uk/go/click/rss/0.91/public/-/sport1/hi/tennis/2985277.stm</link> 
    </item>
   <item>
    <title>Kiwis bat out Colombo draw</title> 
    <description>New Zealand and Sri Lanka draw the first Test, despite three late wickets for Muttiah Muralitharan.</description> 
    <link>http://news.bbc.co.uk/go/click/rss/0.91/public/-/sport1/hi/cricket/2984095.stm</link> 
    </item>
   <item>
    <title>Fears for Nigerian oil hostages</title> 
    <description>Negotiations are under way to free foreign oil workers - including 50 Britons - held on rigs off the Nigerian coast.</description> 
    <link>http://news.bbc.co.uk/go/click/rss/0.91/public/-/1/hi/world/africa/2983577.stm</link> 
    </item>
    </channel>
    </rss>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/news/content/rss/NYTSport.xml
  
  Index: NYTSport.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1" ?> 
   <rss version="0.91">
   <channel>
   <item>
    <title>High-Priced Mets Struggle With K's and E's</title> 
    <link>http://www.newsisfree.com/click/-2,17186485,760/</link> 
    </item>
   <item>
    <title>Suddenly, Pacers' Miller Loses Postseason Prowess</title> 
    <link>http://www.newsisfree.com/click/-2,17186486,760/</link> 
    </item>
   <item>
    <title>Sorenstam Tunes Up and Tunes Out</title> 
    <link>http://www.newsisfree.com/click/-2,17186487,760/</link> 
    </item>
   <item>
    <title>A First Draft of the Winners and Losers</title> 
    <link>http://www.newsisfree.com/click/-2,17186488,760/</link> 
    </item>
   <item>
    <title>Defying Odds on Road to Derby</title> 
    <link>http://www.newsisfree.com/click/-2,17186489,760/</link> 
    </item>
    </channel>
    </rss>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/news/content/rss/ML_weblog.xml
  
  Index: ML_weblog.xml
  ===================================================================
  <?xml version="1.0" ?> 
  <rss version="2.0">
   <channel>
    <title>Matthew Langham's Radio Weblog</title> 
    <link>http://radio.weblogs.com/0103021/</link> 
    <description><br/><small>Most of the time, for most of the world, no matter how hard people work at it, nothing of any significance happens. (G. Weinberg)</small></description> 
    <copyright>Copyright 2003 Matthew Langham</copyright> 
    <lastBuildDate>Sat, 26 Apr 2003 09:51:54 GMT</lastBuildDate> 
    <docs>http://backend.userland.com/rss</docs> 
    <generator>Radio UserLand v8.0.7</generator> 
    <managingEditor>mlangham@s-und-n.de</managingEditor> 
    <webMaster>mlangham@s-und-n.de</webMaster> 
    <category domain="http://www.weblogs.com/rssUpdates/changes.xml">rssUpdates</category> 
   <skipHours>
    <hour>5</hour> 
    <hour>4</hour> 
    <hour>2</hour> 
    <hour>3</hour> 
    <hour>6</hour> 
    <hour>23</hour> 
    <hour>1</hour> 
    <hour>0</hour> 
    </skipHours>
    <cloud domain="radio.xmlstoragesystem.com" port="80" path="/RPC2" registerProcedure="xmlStorageSystem.rssPleaseNotify" protocol="xml-rpc" /> 
    <ttl>60</ttl> 
   <item>
    <title>Hotel California</title> 
    <link>http://radio.weblogs.com/0103021/2003/04/26.html#a994</link> 
    <description><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2"><STRONG>Hotel California</STRONG>: Russell is at it <A href="http://www.russellbeattie.com/notebook/20030426.html#010547">again</A>. Just when you thought he'd settled down - <EM>Bang</EM>. This time he's decided to go back to California and take up a mobile/java related consulting position. Sounds just like the sort of thing he should do as well. And California...well...what can I say....envy.</FONT></description> 
    <guid>http://radio.weblogs.com/0103021/2003/04/26.html#a994</guid> 
    <pubDate>Sat, 26 Apr 2003 09:26:09 GMT</pubDate> 
    </item>
   <item>
    <title>Saturday summary</title> 
    <link>http://radio.weblogs.com/0103021/2003/04/26.html#a993</link> 
    <description><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif"><FONT size="2"><STRONG>Saturday summary</STRONG>: This morning I'm waiting for the <STRIKE>mob</STRIKE>gang to arrive back from their UK trip. I've cleared away all the leftovers from last-nights party (Yeah right) and made sure most of the stuff I bought is hidden or looks as though it has always been here :-).</FONT></FONT></description> 
    <guid>http://radio.weblogs.com/0103021/2003/04/26.html#a993</guid> 
    <pubDate>Sat, 26 Apr 2003 09:22:33 GMT</pubDate> 
    </item>
   <item>
    <title>7 Habits of Blogging</title> 
    <link>http://radio.weblogs.com/0103021/2003/04/25.html#a992</link> 
    <description><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2"><STRONG>7 Habits of Blogging</STRONG>: I laughed out loud at </FONT><A href="http://www.russellbeattie.com/notebook/20030424.html#170238"><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2">this</FONT></A><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2">. So good.</FONT></description> 
    <guid>http://radio.weblogs.com/0103021/2003/04/25.html#a992</guid> 
    <pubDate>Fri, 25 Apr 2003 14:50:23 GMT</pubDate> 
    </item>
   <item>
    <title>Founders licence</title> 
    <link>http://radio.weblogs.com/0103021/2003/04/25.html#a991</link> 
    <description><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2"><STRONG>Founders licence</STRONG>: O'Reilly to </FONT><A href="http://creativecommons.org/projects/founderscopyright/oreilly"><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2">release</FONT></A><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2"> over a hundred out-of-print books for free download.</FONT></description> 
    <guid>http://radio.weblogs.com/0103021/2003/04/25.html#a991</guid> 
    <pubDate>Fri, 25 Apr 2003 11:38:49 GMT</pubDate> 
    </item>
   <item>
    <title>Read all about it</title> 
    <link>http://radio.weblogs.com/0103021/2003/04/25.html#a990</link> 
    <description><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif"><FONT size="2"><STRONG>Read all about it</STRONG>: If you're looking for some of the presentation material from ETCon then go </FONT></FONT><A href="http://www.socialtext.net/etech/index.cgi?PowerPoint%20Gallery"><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2">here</FONT></A><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2">.</FONT></description> 
    <guid>http://radio.weblogs.com/0103021/2003/04/25.html#a990</guid> 
    <pubDate>Fri, 25 Apr 2003 11:22:41 GMT</pubDate> 
    </item>
   <item>
    <title>Hydra - a collaborative experience</title> 
    <link>http://radio.weblogs.com/0103021/2003/04/25.html#a989</link> 
    <description><P><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif"><FONT size="2"><STRONG>Hydra - a collaborative experience</STRONG>: The Mac OS X tool </FONT></FONT><A href="http://hydra.globalse.org/"><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2">Hydra</FONT></A><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2"> is popular at ETCon. It's being used there to aid group-notetaking at the various presentations. What's even more interesting is the fact that the authors are a group of <A href="http://www.codingmonkeys.de/">students</A> out of Munich university.</FONT></P></description> 
    <guid>http://radio.weblogs.com/0103021/2003/04/25.html#a989</guid> 
    <pubDate>Fri, 25 Apr 2003 06:42:27 GMT</pubDate> 
    </item>
   <item>
    <title>Alan Kay on children</title> 
    <link>http://radio.weblogs.com/0103021/2003/04/25.html#a988</link> 
    <description><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2"><STRONG>Alan Kay on children</STRONG>: At ETCon, Alan Kay gave a keynote "Daddy are we there yet" and talked on how children use computers. Interesting picture </FONT><A href="http://www.oreillynet.com/pub/a/network/et2003/thursday_photos.html?page=6"><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2">here</FONT></A><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2">.</FONT></description> 
    <guid>http://radio.weblogs.com/0103021/2003/04/25.html#a988</guid> 
    <pubDate>Fri, 25 Apr 2003 06:30:11 GMT</pubDate> 
    </item>
   <item>
    <title>FM on iPod</title> 
    <link>http://radio.weblogs.com/0103021/2003/04/24.html#a987</link> 
    <description><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2"><STRONG>FM on iPod</STRONG>: Add <A href="http://www.griffintechnology.com/products/ifm/">this</A> to your <A href="http://www.apple.com/ipod">iPod</A> and you get radio as well.</FONT></description> 
    <guid>http://radio.weblogs.com/0103021/2003/04/24.html#a987</guid> 
    <pubDate>Thu, 24 Apr 2003 11:19:03 GMT</pubDate> 
    </item>
   <item>
    <title>Stefano, Linotype and weblogs:</title> 
    <link>http://radio.weblogs.com/0103021/2003/04/24.html#a986</link> 
    <description><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2"><STRONG>Stefano, Linotype and weblogs</STRONG>: Stefano </FONT><A href="http://marc.theaimsgroup.com/?l=xml-cocoon-dev&amp;m=105111976011472&amp;w=2"><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2">starts</FONT></A><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2"> his own </FONT><A href="http://www.betaversion.org/~stefano/linotype/"><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2">weblog</FONT></A><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2"> using Linotype (which is Cocoon plus his own additions).</FONT></description> 
    <guid>http://radio.weblogs.com/0103021/2003/04/24.html#a986</guid> 
    <pubDate>Thu, 24 Apr 2003 06:46:07 GMT</pubDate> 
    </item>
   <item>
    <title>Blogger meets TypePad</title> 
    <link>http://radio.weblogs.com/0103021/2003/04/24.html#a985</link> 
    <description><FONT face="Verdana,Geneva,Arial,Helvetica,Sans-Serif" size="2"><STRONG>Blogger meets TypePad</STRONG>: In an interesting development on the blogging scene, Ben and Mena Trott (the <A href="http://www.movabletype.org/">MovableType</A> husband and wife team) have quietly launched <A href="http://www.typepad.com">TypePad</A>. Basically an enhanced version of the Movable Type software - but hosted (like <A href="http://www.blogger.com">blogger</A>). Read <A href="http://www.benhammersley.com/">Ben's</A> <A href="http://www.guardian.co.uk/online/news/0,12597,942024,00.html">article</A> for more. With the recent "Google buys blogger" move, this means that TypePad will be facing stiff competition. On the other hand I really like MT and so look forward to the start of TP.</FONT></description> 
    <guid>http://radio.weblogs.com/0103021/2003/04/24.html#a985</guid> 
    <pubDate>Thu, 24 Apr 2003 06:37:00 GMT</pubDate> 
    </item>
    </channel>
    </rss>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/news/content/rss/CNNEurope.xml
  
  Index: CNNEurope.xml
  ===================================================================
  <?xml version="1.0" encoding="iso-8859-1" ?> 
   <rss version="0.91">
   <channel>
    <title>CNN Europe</title> 
    <link>http://edition.cnn.com/EUROPE/</link> 
    <description>Current news with audio and video clips; latest news headlines for business, world, weather, sport, entertainment, technology (By http://www.newsisfree.com/syndicate.php - FOR PERSONAL AND NON COMMERCIAL USE ONLY!)</description> 
    <language>en</language> 
    <webMaster>mkrus@newsisfree.com</webMaster> 
    <lastBuildDate>04/29/03 16:50 CEST</lastBuildDate> 
   <image>
    <link>http://www.newsisfree.com/sources/info/697/</link> 
    <url>http://www.newsisfree.com/HPE/Images/button.gif</url> 
    <title>Powered by NewsIsFree</title> 
    <width>88</width> 
    <height>31</height> 
    </image>
   <item>
    <title>Customize this feed</title> 
    <link>http://www.newsisfree.com/sources/rss/697/</link> 
    <description>Add more items, descriptions, time stamps, select your version of RSS, aggregate several feeds... Check out NewsIsFree's premium syndication services! (18)</description> 
    </item>
   <item>
    <title>French business morale slumps</title> 
    <link>http://www.newsisfree.com/click/-2,17203200,697/</link> 
    </item>
   <item>
    <title>War helps BP to record profits</title> 
    <link>http://www.newsisfree.com/click/-2,17203201,697/</link> 
    </item>
   <item>
    <title>Ericsson to slash 13,000 jobs</title> 
    <link>http://www.newsisfree.com/click/-2,17198132,697/</link> 
    </item>
   <item>
    <title>Europe shares up on job cuts</title> 
    <link>http://www.newsisfree.com/click/-2,17198133,697/</link> 
    </item>
   <item>
    <title>Soyuz crew dock with space station</title> 
    <link>http://www.newsisfree.com/click/-1,17136548,697/</link> 
    </item>
    </channel>
    </rss>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/news/content/rss/newsweek.xml
  
  Index: newsweek.xml
  ===================================================================
  <?xml version="1.0" encoding="iso-8859-1" ?> 
  <!--  <!DOCTYPE rss (View Source for full doctype...)>  -->
   <rss version="0.91">
   <channel>
    <title>Moreover - moreover...</title> 
    <link>http://www.moreover.com</link> 
    <description>moreover... - news headlines from around the web, refreshed every 15 minutes</description> 
    <language>en-us</language> 
   <image>
    <title>moreover...</title> 
    <url>http://i.moreover.com/pics/rss.gif</url> 
    <link>http://www.moreover.com</link> 
    <width>144</width> 
    <height>16</height> 
    <description>News headlines from more than 4,000 sources, harvested every 15 minutes...</description> 
    </image>
   <item>
    <title>The Hunt Goes On</title> 
    <link>http://c.moreover.com/click/here.pl?r69731069</link> 
    <description>Newsweek Apr 29 2003 1:21AM ET</description> 
    </item>
   <item>
    <title>Iraq: Another Chem Weapon False Alarm</title> 
    <link>http://c.moreover.com/click/here.pl?r69700317</link> 
    <description>Newsweek Apr 28 2003 5:52PM ET</description> 
    </item>
   <item>
    <title>Online Forum: Facing the Future</title> 
    <link>http://c.moreover.com/click/here.pl?r69655016</link> 
    <description>Newsweek Apr 28 2003 10:40AM ET</description> 
    </item>
   <item>
    <title>American Idol is taking over the world and an interview with former Yankee pitcher Jim Bouton</title> 
    <link>http://c.moreover.com/click/here.pl?r69536024</link> 
    <description>Newsweek Apr 27 2003 7:44AM ET</description> 
    </item>
   <item>
    <title>Look forward to a high-flying season at the movies</title> 
    <link>http://c.moreover.com/click/here.pl?r69536021</link> 
    <description>Newsweek Apr 27 2003 7:44AM ET</description> 
    </item>
   <item>
    <title>Next month the second installment of The Matrix will storm into theatersand launch a high-flying season at t</title> 
    <link>http://c.moreover.com/click/here.pl?r69536019</link> 
    <description>Newsweek Apr 27 2003 7:44AM ET</description> 
    </item>
   <item>
    <title>Still Leaving The Light On</title> 
    <link>http://c.moreover.com/click/here.pl?r69531391</link> 
    <description>Newsweek Apr 27 2003 6:25AM ET</description> 
    </item>
   <item>
    <title>State Parks: Gas, Food and Lodging</title> 
    <link>http://c.moreover.com/click/here.pl?r69531380</link> 
    <description>Newsweek Apr 27 2003 6:25AM ET</description> 
    </item>
   <item>
    <title>The father of the American Navy was an insecure, brash, brave officer who would have fit right in with Donald</title> 
    <link>http://c.moreover.com/click/here.pl?r69519968</link> 
    <description>Newsweek Apr 27 2003 3:43AM ET</description> 
    </item>
   <item>
    <title>Singer Ibrahim Ferrers got highly placed friends</title> 
    <link>http://c.moreover.com/click/here.pl?r69519966</link> 
    <description>Newsweek Apr 27 2003 3:43AM ET</description> 
    </item>
   <item>
    <title>How to sell a hip-hop movie: make it about white people. Blacks arent amused</title> 
    <link>http://c.moreover.com/click/here.pl?r69519962</link> 
    <description>Newsweek Apr 27 2003 3:43AM ET</description> 
    </item>
   <item>
    <title>Ready to rage against the machines? Next month the second installment of The Matrix will storm into theaters</title> 
    <link>http://c.moreover.com/click/here.pl?r69519954</link> 
    <description>Newsweek Apr 27 2003 3:43AM ET</description> 
    </item>
   <item>
    <title>Bush Looks Ahead</title> 
    <link>http://c.moreover.com/click/here.pl?r69506774</link> 
    <description>Newsweek Apr 26 2003 11:01PM ET</description> 
    </item>
   <item>
    <title>An Excerpt From Gearheads: The Turbulent Rise of Robotic Sports</title> 
    <link>http://c.moreover.com/click/here.pl?r69493898</link> 
    <description>Newsweek Apr 26 2003 5:16PM ET</description> 
    </item>
   <item>
    <title>Dickey: Beware Long Occupations</title> 
    <link>http://c.moreover.com/click/here.pl?r69430244</link> 
    <description>Newsweek Apr 26 2003 1:10AM ET</description> 
    </item>
    </channel>
    </rss>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/news/content/rss/CNET_news2.xml
  
  Index: CNET_news2.xml
  ===================================================================
  <?xml version="1.0"?>
   <rss version="2.0">
   <channel>
   <image>
    <title>CNET News.com</title> 
    <url>http://i.i.com.com/cnwk.1d/i/ne/gr/prtnr/rss_logo.gif</url> 
    <link>http://www.news.com/</link> 
    <width>88</width> 
    <height>31</height> 
    </image>
   <item>
    <title>Intel worker accused of aiding terrorists</title> 
    <link>http://rss.com.com</link> 
    <description>The Justice Department charges engineer Mike Hawash, who has been in solitary confinement since March 20, with conspiracy to levy war against America and of supporting terror groups.</description> 
    <category>Media</category> 
    <guid isPermaLink="true">http://rss.com.com/2100-1028-998718.html</guid> 
    <pubDate>Tue, 29 Apr 2003 07:15:00 PDT</pubDate> 
    </item>
    </channel>
    </rss>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java
  
  Index: PortalManagerImpl.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.impl;
  
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.ComponentSelector;
  import org.apache.avalon.framework.component.Composable;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.parameters.Parameters;
  import org.apache.avalon.framework.thread.ThreadSafe;
  import org.apache.cocoon.ProcessingException;
  import org.apache.cocoon.portal.PortalManager;
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.event.EventManager;
  import org.apache.cocoon.portal.layout.Layout;
  import org.apache.cocoon.portal.layout.renderer.Renderer;
  import org.apache.cocoon.portal.profile.ProfileManager;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @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: PortalManagerImpl.java,v 1.1 2003/05/07 06:22:25 cziegeler Exp $
   */
  public final class PortalManagerImpl
  	extends AbstractLogEnabled
  	implements PortalManager, Composable, ThreadSafe {
  
      private ComponentManager componentManager;
          
      public void process()
      throws ProcessingException {
          EventManager eventManager = null;
          try {
              eventManager = (EventManager)this.componentManager.lookup(EventManager.ROLE);
              eventManager.processEvents();
          } catch (ComponentException ce) {
              throw new ProcessingException("Unable to lookup portal service.", ce);
          } finally {
              this.componentManager.release(eventManager);
          }
      }
  
  	/**
  	 * @see org.apache.cocoon.portal.core.PortalManager#showPortal(ContentHandler)
  	 */
  	public void showPortal(ContentHandler contentHandler, Parameters parameters) 
      throws SAXException {
  //        final boolean useContentDeliverer = (parameters == null ? true :
  //                                               parameters.getParameterAsBoolean("use-content-deliverer", true));
          
          ProfileManager profileManager = null;
          ComponentSelector rendererSelector = null;
          Renderer portalLayoutRenderer = null;
          PortalService service = null;
          try {
              service = (PortalService)this.componentManager.lookup(PortalService.ROLE);
              profileManager = (ProfileManager)this.componentManager.lookup(ProfileManager.ROLE);
              Layout portalLayout = profileManager.getPortalLayout(null);
  
              rendererSelector = (ComponentSelector)this.componentManager.lookup(Renderer.ROLE+"Selector");
              portalLayoutRenderer = (Renderer)rendererSelector.select(portalLayout.getRendererName());       
  
              contentHandler.startDocument();
              portalLayoutRenderer.toSAX(portalLayout, service, contentHandler);
              contentHandler.endDocument();
          } catch (ComponentException ce) {
              throw new SAXException("Unable to lookup profile manager.", ce);
          } finally {
              if ( null != portalLayoutRenderer) {
                  rendererSelector.release(portalLayoutRenderer);
              }
              this.componentManager.release(rendererSelector);
              if (null != profileManager) {
                  this.componentManager.release(profileManager);
              }
              this.componentManager.release(service);
          }
  	}
  
  	/**
  	 * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
  	 */
  	public void compose(ComponentManager componentManager)
  		throws ComponentException {
          this.componentManager = componentManager;
  	}
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
  
  Index: PortalServiceImpl.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.impl;
  
  import java.io.IOException;
  import java.util.Collections;
  import java.util.HashMap;
  import java.util.Iterator;
  import java.util.Map;
  
  import org.apache.avalon.excalibur.pool.Recyclable;
  import org.apache.avalon.framework.CascadingRuntimeException;
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.Composable;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.cocoon.ProcessingException;
  import org.apache.cocoon.components.RequestLifecycleComponent;
  import org.apache.cocoon.environment.ObjectModelHelper;
  import org.apache.cocoon.environment.Session;
  import org.apache.cocoon.environment.SourceResolver;
  import org.apache.cocoon.portal.LinkService;
  import org.apache.cocoon.portal.PortalService;
  import org.xml.sax.SAXException;
  
  /**
   * TODO: Check attribute names and make them unique
   * 
   * @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: PortalServiceImpl.java,v 1.1 2003/05/07 06:22:26 cziegeler Exp $
   */
  public class PortalServiceImpl
      extends AbstractLogEnabled
      implements Composable,
                  RequestLifecycleComponent, 
                  PortalService, 
                  Recyclable {
  
      // FIXME - Make ServletRLC out of this
      
      private static final String REQUEST_XFRAME_PARAMETER_NAME = "xframe";
  
      protected Map objectModel;
      protected Map temporaryAttributes = new HashMap();
      protected LinkService linkService;
      
      protected ComponentManager manager;
  
      protected String portalName;
  
      public void compose(ComponentManager componentManager) throws ComponentException {
          this.manager = componentManager;
      }
  
  
      public void setup(SourceResolver resolver, Map objectModel) throws ProcessingException, SAXException, IOException {
          this.objectModel = objectModel;
      }
  
      public String getPortalName() {
          return this.portalName;
      }
  
      public void setPortalName(String value) {
          this.portalName = value;
      }
  
      /* (non-Javadoc)
       * @see org.apache.avalon.excalibur.pool.Recyclable#recycle()
       */
      public void recycle() {
          this.portalName = null;
          this.temporaryAttributes.clear();
          this.manager.release( this.linkService );
          this.linkService = null;
      }
  
      public Object getAttribute(String key) {
          Session session = ObjectModelHelper.getRequest(this.objectModel).getSession(false);
          if (session == null) {
              return null;
          }
          Map map = (Map) session.getAttribute(this.portalName);
          if (null != map) {
              return map.get(key);
          }
          return null;
      }
  
      public void setAttribute(String key, Object value) {
          Session session = ObjectModelHelper.getRequest(this.objectModel).getSession();
          Map map = (Map) session.getAttribute(this.portalName);
          if (null == map) {
              map = new HashMap();
              session.setAttribute(this.portalName, map);
          }
          map.put(key, value);
      }
  
      public void removeAttribute(String key) {
          Session session = ObjectModelHelper.getRequest(this.objectModel).getSession();
          Map map = (Map) session.getAttribute(this.portalName);
          if (null != map) {
              map.remove(key);
          }
      }
  
      public Iterator getAttributeNames() {
          Session session = ObjectModelHelper.getRequest(this.objectModel).getSession();
          Map map = (Map) session.getAttribute(this.portalName);
          if (null != map) {
              return map.keySet().iterator();
          }
          // TODO
          return Collections.EMPTY_MAP.keySet().iterator();
      }
  
      public Object getTemporaryAttribute(String key) {
          return this.temporaryAttributes.get( key );
      }
      
      public void setTemporaryAttribute(String key, Object value) {
          this.temporaryAttributes.put( key, value );
      }
      
      public void removeTemporaryAttribute(String key) {
          this.temporaryAttributes.remove( key );
      }
      
      public Iterator getTemporaryAttributeNames() {
          return this.temporaryAttributes.keySet().iterator();
      }
  
      /**
       * Get the link service
       */
      public LinkService getLinkService() {
          if ( null == this.linkService ) {
              try {
                  this.linkService = (LinkService)this.manager.lookup( LinkService.ROLE);
              } catch (ComponentException e) {
                  throw new CascadingRuntimeException("Unable to lookup link service.", e);
              }
          }
          return this.linkService;
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/impl/DefaultLinkService.java
  
  Index: DefaultLinkService.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.impl;
  
  import java.util.ArrayList;
  import java.util.Iterator;
  import java.util.List;
  import java.util.Map;
  
  import org.apache.avalon.framework.activity.Disposable;
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.Composable;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.thread.ThreadSafe;
  import org.apache.cocoon.components.CocoonComponentManager;
  import org.apache.cocoon.portal.LinkService;
  import org.apache.cocoon.portal.event.ComparableEvent;
  import org.apache.cocoon.portal.event.Event;
  import org.apache.cocoon.portal.event.EventConverter;
  import org.apache.cocoon.portal.event.RequestEvent;
  
  /**
   *
   * @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: DefaultLinkService.java,v 1.1 2003/05/07 06:22:26 cziegeler Exp $
   */
  public class DefaultLinkService 
      extends AbstractLogEnabled
      implements ThreadSafe, LinkService, Composable, Disposable {
  
  // FIXME - make public and use it in RequestParameter..
      protected static final String REQUEST_EVENT_PARAMETER_NAME = "cocoon-portal-event";
  
      class Info {
          StringBuffer  linkBase = new StringBuffer();
          boolean      hasParameters = false;
          ArrayList     comparableEvents = new ArrayList(5);
      }
      
      
      protected EventConverter   converter;
      protected ComponentManager manager;
      // FIXME - comparable events are not completly implemented yet
      
      protected Info getInfo() {
          final Map objectModel = CocoonComponentManager.getCurrentEnvironment().getObjectModel();
          Info info = (Info)objectModel.get(DefaultLinkService.class.getName());
          if ( info == null ) {
              info = new Info();
              objectModel.put(DefaultLinkService.class.getName(), info);
          }
          return info;
      }
      
      public String getLinkURI(Event event) {
          final Info info = this.getInfo();
          final StringBuffer buffer = new StringBuffer(info.linkBase.toString());
          boolean hasParams = info.hasParameters;
          Iterator iter = info.comparableEvents.iterator();
          while (iter.hasNext()) {
              ComparableEvent ce = (ComparableEvent)iter.next();
              if (event instanceof ComparableEvent) {
                  if ( !ce.equalsEvent((ComparableEvent)event)) {
                      if ( hasParams ) {
                          buffer.append('&');
                      } else {
                          buffer.append('?');
                      }
                      hasParams = true;
                      String parameterName = REQUEST_EVENT_PARAMETER_NAME;
                      if (ce instanceof RequestEvent) {
                          parameterName = ((RequestEvent)ce).getRequestParameterName();
                      }
                      // FIXME Encode value
                      final String value = this.converter.encode( ce );
                      buffer.append(parameterName).append('=').append(value);
                  }
              }
          }
          
          final String value = this.converter.encode( event );
          if ( hasParams ) {
              buffer.append('&');
          } else {
              buffer.append('?');
          }
          String parameterName = REQUEST_EVENT_PARAMETER_NAME;
          if (event instanceof RequestEvent) {
              parameterName = ((RequestEvent)event).getRequestParameterName();
          }
          // FIXME Encode value
          buffer.append(parameterName).append('=').append(value);
  
          return buffer.toString();
      }
  
      public String getLinkURI(List events) {
          final Info info = this.getInfo();
          final StringBuffer buffer = new StringBuffer(info.toString());
          
          Iterator iter = events.iterator();
          boolean hasPars = info.hasParameters;
          while ( iter.hasNext()) {
              final Event current = (Event)iter.next();
              final String value = this.converter.encode( current );
              if ( hasPars ) {
                  buffer.append('&');
              } else {
                  buffer.append('?');
              }
              hasPars = true;
              String parameterName = REQUEST_EVENT_PARAMETER_NAME;
              if (current instanceof RequestEvent) {
                  parameterName = ((RequestEvent)current).getRequestParameterName();
              }
              // FIXME Encode value
              buffer.append(parameterName).append('=').append(value);
          }
          return buffer.toString();
      }
  
      public void addEventToLink(Event event) {
          final Info info = this.getInfo();
          if ( event instanceof ComparableEvent) {
              info.comparableEvents.add( event );
          } else {
              final String value = converter.encode(event);
              // FIXME - remove hardcoded parameter name
              String parameterName = "frame-event";
              if (event instanceof RequestEvent) {
                  parameterName = ((RequestEvent)event).getRequestParameterName();
              }
              this.addParameterToLink(parameterName, value);
          }
      }
  
      public void addParameterToLink(String name, String value) {
          final Info info = this.getInfo();
          if ( info.hasParameters ) {
              info.linkBase.append('&');
          } else {
              info.linkBase.append('?');
          }
          // FIXME Encode value
          info.linkBase.append(name).append('=').append(value);
          info.hasParameters = true;
      }
  
      public String getRefreshLinkURI() {
          final Info info = this.getInfo();
          return info.linkBase.toString();
      }
      
      /* (non-Javadoc)
       * @see org.apache.avalon.framework.component.Composable#compose(org.apache.avalon.framework.component.ComponentManager)
       */
      public void compose(ComponentManager manager)
      throws ComponentException {
          this.manager = manager;
          this.converter = (EventConverter)this.manager.lookup(EventConverter.ROLE);
      }
  
      /* (non-Javadoc)
       * @see org.apache.avalon.framework.activity.Disposable#dispose()
       */
      public void dispose() {
          if (this.manager != null) {
              this.manager.release( this.converter );
              this.converter = null;
              this.manager = null;
          }
  
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/images/customize.gif
  
  	<<Binary file>>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/images/maximize.gif
  
  	<<Binary file>>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/images/delete.gif
  
  	<<Binary file>>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/images/show.gif
  
  	<<Binary file>>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/images/minimize.gif
  
  	<<Binary file>>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/images/logo.jpg
  
  	<<Binary file>>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/aspect/Aspectalizable.java
  
  Index: Aspectalizable.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.aspect;
  
  
  /**
   *
   * @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: Aspectalizable.java,v 1.1 2003/05/07 06:22:26 cziegeler Exp $
   */
  public interface Aspectalizable {
  
      String REQUEST_STATUS = "request.status";
      
      String SESSION_STATUS = "session.status";
      
      String PERSISTENT_SESSION_STATUS = "session.status.persistent";
  
      AspectStatus getAspectStatus(Class statusClass, String mode);
      
      void setAspectStatus(Class statusClass, String mode, AspectStatus status);
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/aspect/AspectStatus.java
  
  Index: AspectStatus.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.aspect;
  
  /**
   * Marker interface for a status of an aspect
   *
   * @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: AspectStatus.java,v 1.1 2003/05/07 06:22:26 cziegeler Exp $
   */
  public interface AspectStatus {
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/Filter.java
  
  Index: Filter.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;
  
  import java.io.Serializable;
  /**
   * A Filter allows subscribers to specify which events
   * they should be informed of.  
   * It is Serializable to allow events to be published and received 
   * in a distributed architecture.
   *
   * @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>
   * @author Mauro Talevi
   * 
   * @version CVS $Id: Filter.java,v 1.1 2003/05/07 06:22:26 cziegeler Exp $
   */
  public interface Filter extends Serializable {
       /**
        * Filters event, discarding those not of interest to the subscriber.
        * 
        * @param event the <tt>Event</tt>
        * @return boolean <code>true</code> if Event passes filter
        */
       boolean filter( Event event );
  
  }
  
  
  
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/ActionEvent.java
  
  Index: ActionEvent.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;
  
  /**
   *
   * @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: ActionEvent.java,v 1.1 2003/05/07 06:22:26 cziegeler Exp $
   */
  public interface ActionEvent extends Event {
  
      Object getTarget();
      
      int getAction();
      
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/Event.java
  
  Index: Event.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;
  
  /**
   * Marker interface for an portal event
   *
   * @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: Event.java,v 1.1 2003/05/07 06:22:26 cziegeler Exp $
   */
  public interface Event {
      
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/RequestEvent.java
  
  Index: RequestEvent.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;
  
  /**
   * Marker interface for portal event 
   *
   * @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: RequestEvent.java,v 1.1 2003/05/07 06:22:26 cziegeler Exp $
   */
  public interface RequestEvent 
      extends Event {
      
      String getRequestParameterName();
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/LayoutEvent.java
  
  Index: LayoutEvent.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;
  
  /**
   *
   * @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: LayoutEvent.java,v 1.1 2003/05/07 06:22:26 cziegeler Exp $
   */
  public interface LayoutEvent extends ActionEvent {
      
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/EventConverter.java
  
  Index: EventConverter.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;
  
  import org.apache.avalon.framework.component.Component;
  
  /**
   * Convert events from and into strings
   *
   * @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: EventConverter.java,v 1.1 2003/05/07 06:22:26 cziegeler Exp $
   */
  public interface EventConverter extends Component {
  
      String ROLE = EventConverter.class.getName();
      
      
      String encode(Event event);
      
      Event decode(String value);
  
      void start();
      
      void finish();
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/Register.java
  
  Index: Register.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;
  
  
  /**
   * <tt>Register</tt> allows a <tt>Subscriber</tt> to subscribe to 
   * and unsubscribe from <tt>EventManager</tt>.
   *  
   * @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>
   * @author Mauro Talevi
   * 
   * @version CVS $Id: Register.java,v 1.1 2003/05/07 06:22:26 cziegeler Exp $
   */
  public interface Register {
      
       /**
        * Subscribes a Subscriber to the EventManager.  
        * The Subscriber abstracts all the information needed for the subscription.
        * @param subscriber the Subscriber
        * @see Subscriber
        */
       void subscribe( Subscriber subscriber );
      
       /**
        * Unsubscribes an Subscriber from the EventManager.
        * @param subscriber the Subscriber 
        * @see Subscriber
        */
       void unsubscribe( Subscriber subscriber );
       
  } 
  
  
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/Publisher.java
  
  Index: Publisher.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;
  
  
  /**
   * <tt>Publisher</tt> produces or publishes events that are brokered by <tt>EventManager</tt>
   * and of which the appropriate subscribers are informed of.
   *
   * @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>
   * @author Mauro Talevi
   * 
   * @version CVS $Id: Publisher.java,v 1.1 2003/05/07 06:22:26 cziegeler Exp $
   */
  public interface Publisher {
      
      /**
       *  Publishes an event for subscribers to be informed of.
       *
       *  @param event the <tt>Event</tt> being published
       */
      void publish( Event event );
  
  } 
  
  
  
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/ComparableEvent.java
  
  Index: ComparableEvent.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;
  
  /**
   * Marker interface for portal event that is comparable
   *
   * @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: ComparableEvent.java,v 1.1 2003/05/07 06:22:26 cziegeler Exp $
   */
  public interface ComparableEvent 
      extends Event {
      
      boolean equalsEvent(ComparableEvent event);
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/Subscriber.java
  
  Index: Subscriber.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;
  
  /**
   * <tt>Subscriber</tt> registers its interest in a class of events and 
   * filters the events of which it should be notified.
   *
   * @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>
   * @author Mauro Talevi
   * 
   * @version CVS $Id: Subscriber.java,v 1.1 2003/05/07 06:22:26 cziegeler Exp $
   */
  public interface Subscriber {
      
      /**
       *  Returns the event type of the event on which the Subscriber is interested.
       *  The event type is encoded by a <tt>Class</tt>.
       *
       *  @return the <tt>Class</tt> encoding the event type  
       */
       Class getEventType();
  
      /**
       *  Returns the filter used to select the events in which the subscriber is 
       *  interested.
       *
       *  @return the <tt>Filter</tt> 
       */
       Filter getFilter();
       
      /**
       * Callback method informing the Subscriber of the occurence of an event.
       *
       * @param event the <tt>Event</tt> of which the <tt>Subscriber</tt> is informed
       */
       void inform( Event event );
  }
  
  
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/EventManager.java
  
  Index: EventManager.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;
  
  import org.apache.avalon.framework.component.Component;
  import org.apache.cocoon.ProcessingException;
  
  /**
   * <p>Service to manage event notification. The designed has been inspired by the paper by 
   * Gupta, S., J. M. Hartkopf, and S. Ramaswamy, in Java Report, Vol. 3, No. 7, July 1998, 19-36,
   * "Event Notifier: A Pattern for Event Notification".</p>  
   * 
   * <p>EventManager brokers events between a <tt>Publisher</tt>, which produces events,
   * and a <tt>Subscriber</tt>, which handles the notification of events.
   * A <tt>Filter</tt> discards events not of interest to a subscriber.
   * All Events have a common ancestor type <tt>Event</tt> and the event types are 
   * identified by a <tt>Class</tt>.</p>
   * 
   * @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>
   * @author Mauro Talevi
   * 
   * @version CVS $Id: EventManager.java,v 1.1 2003/05/07 06:22:26 cziegeler Exp $
   */
  public interface EventManager extends Component {
   
      /**
       * Represents Role of the service
       */
      String ROLE = EventManager.class.getName(); 
      
       /**
        *  Returns the Publisher with which events can be published.
        */
      Publisher getPublisher();
      
       /**
        *  Returns the Register with which subscribers can 
        *  subscribe and unsubscribe interest to given Events.
        */
      Register getRegister();
  
      /**
       * Process the events
       */
      void processEvents()
      throws ProcessingException;
       
  
  }
  
  
  
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/coplet/status/MandatoryStatus.java
  
  Index: MandatoryStatus.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.coplet.status;
  
  import org.apache.cocoon.portal.aspect.AspectStatus;
  
  /**
   * Indicates if a coplet is mandatory
   *
   * @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: MandatoryStatus.java,v 1.1 2003/05/07 06:22:27 cziegeler Exp $
   */
  public final class MandatoryStatus 
      implements AspectStatus {
  
      protected boolean mandatory;
  
      public MandatoryStatus() {
          this.mandatory = false;
      }
      
      /**
       * Returns the maximizable.
       * @return boolean
       */
      public boolean isMandatory() {
          return this.mandatory;
      }
  
      /**
       * Sets the maximizable.
       * @param maximizable The maximizable to set
       */
      public void setMandatory(boolean mandatory) {
          this.mandatory = mandatory;
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/coplet/status/SizeableStatus.java
  
  Index: SizeableStatus.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.coplet.status;
  
  import org.apache.cocoon.portal.aspect.AspectStatus;
  
  /**
   *
   * @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: SizeableStatus.java,v 1.1 2003/05/07 06:22:27 cziegeler Exp $
   */
  public final class SizeableStatus implements AspectStatus {
  
      protected boolean minimizable;
  
      protected boolean maximizable;
  
      public SizeableStatus() {
          this.maximizable = true;
          this.minimizable = true;
      }
      
      /**
       * Returns the maximizable.
       * @return boolean
       */
      public boolean isMaximizable() {
          return maximizable;
      }
  
      /**
       * Returns the minimizable.
       * @return boolean
       */
      public boolean isMinimizable() {
          return minimizable;
      }
  
      /**
       * Sets the maximizable.
       * @param maximizable The maximizable to set
       */
      public void setMaximizable(boolean maximizable) {
          this.maximizable = maximizable;
      }
  
      /**
       * Sets the minimizable.
       * @param minimizable The minimizable to set
       */
      public void setMinimizable(boolean minimizable) {
          this.minimizable = minimizable;
      }
      
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/coplet/status/SizingStatus.java
  
  Index: SizingStatus.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.coplet.status;
  
  import org.apache.cocoon.portal.aspect.AspectStatus;
  
  /**
   *
   * @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: SizingStatus.java,v 1.1 2003/05/07 06:22:27 cziegeler Exp $
   */
  public final class SizingStatus implements AspectStatus {
  
      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;
      }
  
      /**
       * Sets the status.
       * @param status The status to set
       */
      public void setStatus(int status) {
          this.status = status;
      }
      
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/SizingEventSubscriber.java
  
  Index: SizingEventSubscriber.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.aspect.impl;
  
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.cocoon.portal.coplet.status.SizingStatus;
  import org.apache.cocoon.portal.event.Event;
  import org.apache.cocoon.portal.event.Filter;
  import org.apache.cocoon.portal.event.Subscriber;
  import org.apache.cocoon.portal.event.impl.*;
  import org.apache.cocoon.portal.profile.ProfileManager;
  
  /**
   *
   * @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: SizingEventSubscriber.java,v 1.1 2003/05/07 06:22:27 cziegeler Exp $
   */
  public final class SizingEventSubscriber implements Subscriber {
  
      private ComponentManager componentManager;
  
      public SizingEventSubscriber(ComponentManager manager) {
          this.componentManager = manager;
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.event.Subscriber#getEventType()
       */
      public Class getEventType() {
          return SizingStatusEvent.class;
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.event.Subscriber#getFilter()
       */
      public Filter getFilter() {
          return null;
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.event.Subscriber#inform(org.apache.cocoon.portal.event.Event)
       */
      public void inform(Event event) {
          SizingStatusEvent statusEvent = (SizingStatusEvent) event;
          SizingStatus target = statusEvent.getStatus();
          ProfileManager profileManager = null;
          try {
              profileManager = (ProfileManager) this.componentManager.lookup(ProfileManager.ROLE);
              target = new SizingStatus();
              profileManager.setAspectStatus(ProfileManager.SESSION_STATUS, 
                                             statusEvent.getCopletInstanceData().getCopletId(), 
                                             target);
          } catch (ComponentException ce) {
              // ignore
          } finally {
              this.componentManager.release(profileManager);
          }
          
          int action = statusEvent.getAction();
  
          target.setStatus(action);
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/ActionCounterEventAspect.java
  
  Index: ActionCounterEventAspect.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.aspect.impl;
  
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.parameters.ParameterException;
  import org.apache.avalon.framework.parameters.Parameterizable;
  import org.apache.avalon.framework.parameters.Parameters;
  import org.apache.avalon.framework.thread.ThreadSafe;
  import org.apache.cocoon.environment.ObjectModelHelper;
  import org.apache.cocoon.environment.Request;
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.event.aspect.EventAspect;
  import org.apache.cocoon.portal.event.aspect.EventAspectContext;
  
  /**
   *
   * @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: ActionCounterEventAspect.java,v 1.1 2003/05/07 06:22:27 cziegeler Exp $
   */
  public class ActionCounterEventAspect
  	extends AbstractLogEnabled
  	implements EventAspect, 
                  ThreadSafe,
                  Parameterizable {
      protected final static String ATTRIBUTE_NAME = ActionCounterEventAspect.class.getName();
      
  
      /** The name of the parameter to check */
      protected String parameterName;
      
  	/* (non-Javadoc)
  	 * @see org.apache.cocoon.portal.event.aspect.EventAspect#process(org.apache.cocoon.portal.event.aspect.EventAspectContext, org.apache.cocoon.portal.PortalService)
  	 */
  	public void process(EventAspectContext context, PortalService service) {
          final String requestParameterName = context.getAspectParameters().getParameter("parameter-name", this.parameterName);
  
          int actionCount;
          
          Integer actionValue = (Integer) service.getAttribute(ATTRIBUTE_NAME);
          if (null == actionValue) {
              actionValue = new Integer(0);
              service.setAttribute(ATTRIBUTE_NAME, actionValue);
              actionCount = 0;
          } else {
              actionCount = actionValue.intValue() + 1;
              service.setAttribute(ATTRIBUTE_NAME, new Integer(actionCount));
          }
  
          final Request request = ObjectModelHelper.getRequest( context.getObjectModel() );
          String value = request.getParameter( requestParameterName );
          if ( value != null && actionCount > 0) {
              // get number
              int number = 0;
              try {
                  number = Integer.parseInt( value );
              } catch (Exception ignore) {
                  number = -1;
              }
              
              if ( number == actionCount - 1) {
                  // and invoke next one
                  context.invokeNext( service );
              }
          }
          service.getLinkService().addParameterToLink( requestParameterName, String.valueOf(actionCount));        
  	}
  
  
      /* (non-Javadoc)
       * @see org.apache.avalon.framework.parameters.Parameterizable#parameterize(org.apache.avalon.framework.parameters.Parameters)
       */
      public void parameterize(Parameters parameters) 
      throws ParameterException {
          this.parameterName = parameters.getParameter("parameter-name", "cocoon-portal-action");
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/RequestParameterEventAspect.java
  
  Index: RequestParameterEventAspect.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.aspect.impl;
  
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.parameters.Parameters;
  import org.apache.avalon.framework.thread.ThreadSafe;
  import org.apache.cocoon.environment.ObjectModelHelper;
  import org.apache.cocoon.environment.Request;
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.event.Event;
  import org.apache.cocoon.portal.event.Publisher;
  import org.apache.cocoon.portal.event.aspect.EventAspect;
  import org.apache.cocoon.portal.event.aspect.EventAspectContext;
  
  /**
   *
   * @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: RequestParameterEventAspect.java,v 1.1 2003/05/07 06:22:27 cziegeler Exp $
   */
  public class RequestParameterEventAspect
  	extends AbstractLogEnabled
  	implements EventAspect, ThreadSafe {
  
  	/* (non-Javadoc)
  	 * @see org.apache.cocoon.portal.event.aspect.EventAspect#process(org.apache.cocoon.portal.event.aspect.EventAspectContext, org.apache.cocoon.portal.PortalService)
  	 */
  	public void process(EventAspectContext context, PortalService service) {
          final Parameters config = context.getAspectParameters();
          // FIXME Configure more than one parameter name
          final String requestParameterName = config.getParameter("parameter-name", "cocoon-portal-event");
          final Request request = ObjectModelHelper.getRequest( context.getObjectModel() );
          String[] values = request.getParameterValues( requestParameterName );
          if ( values != null ) {
              final Publisher publisher = context.getEventPublisher();
              for(int i=0; i<values.length; i++) {
                  final String current = values[i];
                  final Event e = context.getEventConverter().decode(current);
                  if ( null != e) {
                      publisher.publish(e);
                  }
              }
          }
          context.invokeNext( service );        
  	}
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/FullScreenCopletEventAspect.java
  
  Index: FullScreenCopletEventAspect.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.aspect.impl;
  
  import org.apache.avalon.framework.activity.Disposable;
  import org.apache.avalon.framework.activity.Initializable;
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.Composable;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.thread.ThreadSafe;
  import org.apache.cocoon.environment.ObjectModelHelper;
  import org.apache.cocoon.environment.Request;
  import org.apache.cocoon.portal.PortalService;
  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.Publisher;
  import org.apache.cocoon.portal.event.Subscriber;
  import org.apache.cocoon.portal.event.aspect.EventAspect;
  import org.apache.cocoon.portal.event.aspect.EventAspectContext;
  import org.apache.cocoon.portal.event.impl.FullScreenCopletEvent;
  import org.apache.cocoon.portal.layout.Layout;
  import org.apache.cocoon.portal.profile.ProfileManager;
  
  /**
   *
   * @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: FullScreenCopletEventAspect.java,v 1.1 2003/05/07 06:22:27 cziegeler Exp $
   */
  public class FullScreenCopletEventAspect
  	extends AbstractLogEnabled
  	implements EventAspect, 
                  ThreadSafe, 
                  Composable,
                  Disposable, 
                  Subscriber, 
                  Initializable {
  
      protected ComponentManager manager;
      
  	/* (non-Javadoc)
  	 * @see org.apache.cocoon.portal.event.aspect.EventAspect#process(org.apache.cocoon.portal.event.aspect.EventAspectContext, org.apache.cocoon.portal.PortalService)
  	 */
  	public void process(EventAspectContext context, PortalService service) {
          final String requestParameterName = FullScreenCopletEvent.REQUEST_PARAMETER_NAME;
          final Request request = ObjectModelHelper.getRequest( context.getObjectModel() );
          String[] values = request.getParameterValues( requestParameterName );
          if ( values != null ) {
              final Publisher publisher = context.getEventPublisher();
              for(int i=0; i<values.length; i++) {
                  final String current = values[i];
                  Event e = context.getEventConverter().decode(current);
                  if ( null != e ) {
                      publisher.publish(e);
                      FullScreenCopletEvent fsce = (FullScreenCopletEvent)e;
                      if ( fsce.getLayout() != null) {
                          service.getLinkService().addEventToLink( e );
                      }
                  }
              }
          }
          // and invoke next one
          context.invokeNext( service );
  	}
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.event.Subscriber#getEventType()
       */
      public Class getEventType() {
          return FullScreenCopletEvent.class;
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.event.Subscriber#getFilter()
       */
      public Filter getFilter() {
          return null;
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.event.Subscriber#inform(org.apache.cocoon.portal.event.Event)
       */
      public void inform(Event event) {
          FullScreenCopletEvent e = (FullScreenCopletEvent) event;
          final Layout startingLayout = e.getLayout();
          if ( null != startingLayout ) {
              ProfileManager profileManager = null;
              try {
                  profileManager = (ProfileManager) this.manager.lookup(ProfileManager.ROLE);
                  profileManager.setDefaultLayout( startingLayout );
              } catch (ComponentException ce) {
                  // ignore
              } finally {
                  this.manager.release(profileManager);
              }
          }
      }
  
      /* (non-Javadoc)
       * @see org.apache.avalon.framework.component.Composable#compose(org.apache.avalon.framework.component.ComponentManager)
       */
      public void compose(ComponentManager manager) throws ComponentException {
          this.manager = manager;
      }
  
      /* (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 );
          }
      }
  
      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 );
              }
          }
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/FrameEventAspect.java
  
  Index: FrameEventAspect.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.aspect.impl;
  
  import org.apache.avalon.framework.activity.Disposable;
  import org.apache.avalon.framework.activity.Initializable;
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.Composable;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.thread.ThreadSafe;
  import org.apache.cocoon.environment.ObjectModelHelper;
  import org.apache.cocoon.environment.Request;
  import org.apache.cocoon.portal.PortalService;
  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.Publisher;
  import org.apache.cocoon.portal.event.Subscriber;
  import org.apache.cocoon.portal.event.aspect.EventAspect;
  import org.apache.cocoon.portal.event.aspect.EventAspectContext;
  import org.apache.cocoon.portal.event.impl.*;
  import org.apache.cocoon.portal.layout.impl.FrameStatus;
  import org.apache.cocoon.portal.profile.ProfileManager;
  
  /**
   *
   * @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: FrameEventAspect.java,v 1.1 2003/05/07 06:22:27 cziegeler Exp $
   */
  public class FrameEventAspect
      extends AbstractLogEnabled
      implements EventAspect, ThreadSafe, Composable, Disposable, Subscriber, Initializable {
  
      protected ComponentManager manager;
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.event.aspect.EventAspect#process(org.apache.cocoon.portal.event.aspect.EventAspectContext, org.apache.cocoon.portal.PortalService)
       */
      public void process(EventAspectContext context, PortalService service) {
          final String requestParameterName = FrameSourceEvent.URI_PARAMETER;
          final Request request = ObjectModelHelper.getRequest(context.getObjectModel());
          String[] values = request.getParameterValues(requestParameterName);
          if (values != null) {
              final Publisher publisher = context.getEventPublisher();
              for (int i = 0; i < values.length; i++) {
                  final String value = values[i];
                  Event e = null;
                  try {
                      e = context.getEventConverter().decode(value);
                      if (null != e) {
                          publisher.publish(e);
                          service.getLinkService().addEventToLink(e);
                      }
                  } catch (Exception ignore) {
                  }
                  if (e == null) {
                      // Use '|' character as delimiter between ID and URI
                      int index = value.indexOf('|');
                      if (index != -1) {
                          String id = value.substring(0, index);
                          String uri = null;
                          if (index != (value.length() - 1)) {
                              uri = value.substring(index + 1);
                          }
                          e = new FrameSourceEvent(id, uri);
                          publisher.publish(e);
                          if (uri != null) {
                              service.getLinkService().addEventToLink(e);
                          }
                      }
                  }
              }
          }
          // and invoke next one
          context.invokeNext(service);
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.event.Subscriber#getEventType()
       */
      public Class getEventType() {
          return FrameSourceEvent.class;
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.event.Subscriber#getFilter()
       */
      public Filter getFilter() {
          return null;
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.event.Subscriber#inform(org.apache.cocoon.portal.event.Event)
       */
      public void inform(Event event) {
          FrameSourceEvent statusEvent = (FrameSourceEvent) event;
          final String layoutID = statusEvent.getLayoutId();
          ProfileManager profileManager = null;
          try {
              profileManager = (ProfileManager) this.manager.lookup(ProfileManager.ROLE);
              FrameStatus status =
                  (FrameStatus) profileManager.getAspectStatus(
                      FrameStatus.class,
                      ProfileManager.REQUEST_STATUS,
                      layoutID);
              String link = statusEvent.getLink();
              if (status == null) {
                  if (link != null) {
                      status = new FrameStatus();
                      status.setLink(link);
                      profileManager.setAspectStatus(ProfileManager.REQUEST_STATUS, layoutID, status);
                  }
              } else if (link != null) {
                  status.setLink(link);
              } else {
                  // remove status if link == null
                  profileManager.setAspectStatus(ProfileManager.REQUEST_STATUS, layoutID, null);
              }
          } catch (ComponentException ce) {
              // ignore
          } finally {
              this.manager.release(profileManager);
          }
      }
  
      /* (non-Javadoc)
       * @see org.apache.avalon.framework.component.Composable#compose(org.apache.avalon.framework.component.ComponentManager)
       */
      public void compose(ComponentManager manager) throws ComponentException {
          this.manager = manager;
      }
  
      /* (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);
          }
      }
  
      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);
              }
          }
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/PortalService.java
  
  Index: PortalService.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;
  
  import java.util.Iterator;
  
  import org.apache.avalon.framework.component.Component;
  
  /**
   *
   * @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: PortalService.java,v 1.1 2003/05/07 06:22:27 cziegeler Exp $
   */
  public interface PortalService extends Component {
  
      String ROLE = PortalService.class.getName();
      
      String getPortalName();
      
      void setPortalName(String value);
      
      Object getAttribute(String key);
      
      void setAttribute(String key, Object value);
      
      void removeAttribute(String key);
      
      Iterator getAttributeNames();
      
      Object getTemporaryAttribute(String key);
      
      void setTemporaryAttribute(String key, Object value);
      
      void removeTemporaryAttribute(String key);
      
      Iterator getTemporaryAttributeNames();
  
      /**
       * Get the link service
       */
      LinkService getLinkService();
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/LinkService.java
  
  Index: LinkService.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;
  
  import java.util.List;
  
  import org.apache.avalon.framework.component.Component;
  import org.apache.cocoon.portal.event.Event;
  
  /**
   *
   * @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: LinkService.java,v 1.1 2003/05/07 06:22:28 cziegeler Exp $
   */
  public interface LinkService extends Component {
  
      String ROLE = LinkService.class.getName();
      
      String getLinkURI(Event event);
  
      String getLinkURI(List events);
      
      void addEventToLink(Event event);
      
      void addParameterToLink(String name, String value);
      
      String getRefreshLinkURI();
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/PortalManager.java
  
  Index: PortalManager.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;
  
  import org.apache.avalon.framework.component.Component;
  import org.apache.avalon.framework.parameters.Parameters;
  import org.apache.cocoon.ProcessingException;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @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: PortalManager.java,v 1.1 2003/05/07 06:22:28 cziegeler Exp $
   */
  public interface PortalManager extends Component {
  
      String ROLE = PortalManager.class.getName();
      
      void process()
      throws ProcessingException;
      
      void showPortal(ContentHandler ch,
                       Parameters     parameters)
      throws SAXException;
      
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/RendererAspect.java
  
  Index: RendererAspect.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.renderer.aspect;
  
  import org.apache.avalon.framework.component.Component;
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.layout.Layout;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
   * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
   * 
   * @version CVS $Id: RendererAspect.java,v 1.1 2003/05/07 06:22:28 cziegeler Exp $
   */
  public interface RendererAspect 
      extends Component {
      
      String ROLE = RendererAspect.class.getName();
      
      /**
       * Stream out raw layout 
       */
      void toSAX(RendererAspectContext context,
                  Layout layout, 
                  PortalService service, 
                  ContentHandler handler)
      throws SAXException;
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/RendererAspectContext.java
  
  Index: RendererAspectContext.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.renderer.aspect;
  
  import org.apache.avalon.framework.parameters.Parameters;
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.layout.Layout;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
   * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
   * 
   * @version CVS $Id: RendererAspectContext.java,v 1.1 2003/05/07 06:22:28 cziegeler Exp $
   */
  public interface RendererAspectContext {
      
      /**
       * Stream out raw layout 
       */
      void invokeNext(Layout layout, PortalService service, ContentHandler handler)
      throws SAXException;
  
      /** 
       * Get the {@link Parameters} of the aspect.
       */
      Parameters getAspectParameters();
      
      /**
       * Set an attribute
       */
      void setAttribute(String key, Object attribute);
  
      /**
       * Get an attribute
       */
      Object getAttribute(String key);
  
      /**
       * Remove an attribute
       */
      void removeAttribute(String key);
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/profile/ProfileManager.java
  
  Index: ProfileManager.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.profile;
  
  import org.apache.avalon.framework.component.Component;
  import org.apache.cocoon.portal.aspect.AspectStatus;
  import org.apache.cocoon.portal.coplet.CopletInstanceData;
  import org.apache.cocoon.portal.layout.Layout;
  
  /**
   *
   * @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: ProfileManager.java,v 1.1 2003/05/07 06:22:28 cziegeler Exp $
   */
  public interface ProfileManager extends Component {
      
      String ROLE = ProfileManager.class.getName();
      
      String REQUEST_STATUS = "request.status";
      
      String SESSION_STATUS = "session.status";
      
      String PERSISTENT_SESSION_STATUS = "session.status.persistent";
      
      Layout getPortalLayout(String key);
      
      void setDefaultLayout(Layout object);
      
      CopletInstanceData getCopletInstanceData(String copletID);
      
      AspectStatus getAspectStatus(Class statusClass, String mode, String key);
      
      // FIXME - rename this
      void setAspectStatus(String mode, String key, AspectStatus status);
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/profile/ProfileLS.java
  
  Index: ProfileLS.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  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.portal.profile;
  
  import org.apache.excalibur.source.SourceValidity;
  
  /**
   *
   * @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: ProfileLS.java,v 1.1 2003/05/07 06:22:28 cziegeler Exp $
   */
  public interface ProfileLS {
      Object loadProfile(Object key) throws Exception;  //TODO define ExceptionType later
      void saveProfile(Object key, Object profile);
      SourceValidity getValidity(Object key);
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/news/content/resources/xsl/rss2html_news.xsl
  
  Index: rss2html_news.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <!-- $Id: rss2html_news.xsl,v 1.1 2003/05/07 06:22:28 cziegeler Exp $ 
  
  -->
  
  <!--<xsl:template match="*|/"><xsl:apply-templates/></xsl:template>
  <xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>
  -->
  
  <xsl:template match="channel">
  	<table>
  		<xsl:apply-templates select ="item">
  		</xsl:apply-templates>
  	</table>
  </xsl:template>
  
  <xsl:template match="item">
  			<xsl:if test="position() &lt; 6">
  				<tr bgcolor="#ffffff"><td><font face="Arial, Helvetica, sans-serif">
      			<a target="_blank"><xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
  				<font size="-1" color="#333333"><b><xsl:value-of select="title"/></b></font></a><br/>
  	<!--			<a target="_blank"><xsl:attribute name="href"><xsl:value-of select="authorlink"/></xsl:attribute> 
      			<font size="-2" color="#46627A"><xsl:value-of select = "author"/></font></a>-->
  				<font size="-2" color="#46627A">&#160;&#160;<xsl:value-of select="description"/></font>
      			</font></td></tr>
  				<tr bgcolor="#ffffff"><td bgcolor="#ffffff" height="5"></td></tr>
  			</xsl:if>
  </xsl:template>
  
  
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/news/content/resources/xsl/document2html.xsl
  
  Index: document2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:param name="isfaq"/>
    <xsl:template match="document">
    	<!-- Allready done by portal!
      <td colspan="2" valign="top" class="content"-->
        <xsl:if test="normalize-space(header/title)!=''">
          <h1>
            <xsl:value-of select="header/title"/>
          </h1>
        </xsl:if>
        <xsl:if test="normalize-space(header/subtitle)!=''">
          <h3>
            <xsl:value-of select="header/subtitle"/>
          </h3>
        </xsl:if>
        <xsl:if test="header/authors">
          <p>
            <font size="-2">
              <xsl:for-each select="header/authors/person">
                <xsl:choose>
                  <xsl:when test="position()=1">by&#160;</xsl:when>
                  <xsl:otherwise>,&#160;</xsl:otherwise>
                </xsl:choose>
                <xsl:value-of select="@name"/>
              </xsl:for-each>
            </font>
          </p>
        </xsl:if>
        <xsl:apply-templates select="body"/>
      <!--/td  see above!-->
    </xsl:template>
    <xsl:template match="body">
      <xsl:if test="section and not($isfaq='true')">
        <ul class="minitoc">
          <xsl:for-each select="section">
            <li>
              <a href="#{generate-id()}">
                <xsl:value-of select="title"/>
              </a>
              <xsl:if test="section">
                <ul class="minitoc">
                  <xsl:for-each select="section">
                    <li>
                      <a href="#{generate-id()}">
                        <xsl:value-of select="title"/>
                      </a>
                    </li>
                  </xsl:for-each>
                </ul>
              </xsl:if>
            </li>
          </xsl:for-each>
        </ul>
      </xsl:if>
      <xsl:apply-templates/>
    </xsl:template>
  <!--  section handling
    - <a name/> anchors are added if the id attribute is specified
    - generated anchors are still included for TOC - what should we do about this?
    - FIXME: provide a generic facility to process section irrelevant to their
      nesting depth
  -->
    <xsl:template match="section">
      <a name="{generate-id()}"/>
      <xsl:if test="normalize-space(@id)!=''">
        <a name="{@id}"/>
      </xsl:if>
      <h3>
        <xsl:value-of select="title"/>
      </h3>
      <xsl:apply-templates select="*[not(self::title)]"/>
    </xsl:template>
    <xsl:template match="section/section">
      <a name="{generate-id()}"/>
      <xsl:if test="normalize-space(@id)!=''">
        <a name="{@id}"/>
      </xsl:if>
      <h4>
        <xsl:value-of select="title"/>
      </h4>
      <xsl:apply-templates select="*[not(self::title)]"/>
    </xsl:template>
    <xsl:template match="note | warning | fixme">
      <div class="frame {local-name()}">
        <div class="label">
          <xsl:choose>
            <xsl:when test="local-name() = 'note'">Note</xsl:when>
            <xsl:when test="local-name() = 'warning'">Warning</xsl:when>
            <xsl:otherwise>Fixme (
                 <xsl:value-of select="@author"/>
  
                 )</xsl:otherwise>
          </xsl:choose>
        </div>
        <div class="content">
          <xsl:apply-templates/>
        </div>
      </div>
    </xsl:template>
    <xsl:template match="link">
      <a href="{@href}">
        <xsl:apply-templates/>
      </a>
    </xsl:template>
    <xsl:template match="jump">
      <a href="{@href}" target="_top">
        <xsl:apply-templates/>
      </a>
    </xsl:template>
    <xsl:template match="fork">
      <a href="{@href}" target="_blank">
        <xsl:apply-templates/>
      </a>
    </xsl:template>
    <xsl:template match="source">
      <pre class="code">
        <xsl:apply-templates/>
      </pre>
    </xsl:template>
    <xsl:template match="anchor">
      <a name="{@id}"/>
    </xsl:template>
    <xsl:template match="icon">
      <img src="{@src}" alt="{@alt}">
        <xsl:if test="@height">
          <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
        </xsl:if>
        <xsl:if test="@width">
          <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
        </xsl:if>
      </img>
    </xsl:template>
    <xsl:template match="figure">
      <div align="center">
        <img src="{@src}" alt="{@alt}" class="figure">
          <xsl:if test="@height">
            <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
          </xsl:if>
          <xsl:if test="@width">
            <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
          </xsl:if>
        </img>
      </div>
    </xsl:template>
    <xsl:template match="table">
      <table class="table" cellpadding="4" cellspacing="1">
        <xsl:apply-templates/>
      </table>
    </xsl:template>
    <xsl:template match="node()|@*" priority="-1">
      <xsl:copy>
        <xsl:apply-templates select="@*"/>
        <xsl:apply-templates/>
      </xsl:copy>
    </xsl:template>
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/Renderer.java
  
  Index: Renderer.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.renderer;
  
  import org.apache.avalon.framework.component.Component;
  import org.apache.cocoon.portal.PortalService;
  import org.apache.cocoon.portal.layout.Layout;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @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: Renderer.java,v 1.1 2003/05/07 06:22:28 cziegeler Exp $
   */
  public interface Renderer 
      extends Component {
      
      String ROLE = Renderer.class.getName();
      
      /**
       * Stream out raw layout 
       */
      void toSAX(Layout layout, PortalService service, ContentHandler handler)
      throws SAXException;
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/conf/portal.xconf
  
  Index: portal.xconf
  ===================================================================
  <?xml version="1.0"?>
  
  <xconf xpath="/cocoon" unless="component[@role='org.apache.cocoon.portal.event.aspect.EventAspectSelector']">
  
   <!-- Event Aspect configuration -->
   <component class="org.apache.cocoon.components.ExtendedComponentSelector" role="org.apache.cocoon.portal.event.aspect.EventAspectSelector">
      <aspect name="action-counter" class="org.apache.cocoon.portal.event.aspect.impl.ActionCounterEventAspect"/>
      <aspect name="request-parameter" class="org.apache.cocoon.portal.event.aspect.impl.RequestParameterEventAspect"/>
      <aspect name="frame" class="org.apache.cocoon.portal.event.aspect.impl.FrameEventAspect"/>
      <aspect name="full-screen-coplet" class="org.apache.cocoon.portal.event.aspect.impl.FullScreenCopletEventAspect"/>
   </component>
  
   <component class="org.apache.cocoon.portal.event.impl.DefaultEventManager" logger="portal" role="org.apache.cocoon.portal.event.EventManager">
      <event-aspects>
          <aspect type="action-counter"/>
          <aspect type="frame"/>
          <aspect type="full-screen-coplet"/>
          <aspect type="request-parameter"/>
      </event-aspects>
   </component>
  
   <component class="org.apache.cocoon.portal.profile.impl.SimpleProfileManager" logger="portal" role="org.apache.cocoon.portal.profile.ProfileManager">
   </component>
  
   <component class="org.apache.cocoon.portal.impl.PortalManagerImpl" logger="portal" role="org.apache.cocoon.portal.PortalManager"/>
  
   <component class="org.apache.cocoon.portal.impl.PortalServiceImpl" logger="portal" role="org.apache.cocoon.portal.PortalService"/>
  
   <component class="org.apache.cocoon.portal.impl.DefaultLinkService" logger="portal" role="org.apache.cocoon.portal.LinkService"/>
  
   <component class="org.apache.cocoon.portal.event.impl.DefaultEventConverter" logger="portal" role="org.apache.cocoon.portal.event.EventConverter">
   </component>
   <!-- Coplet Adapter configuration -->
   <component class="org.apache.cocoon.components.ExtendedComponentSelector" role="org.apache.cocoon.portal.coplet.adapter.CopletAdapterSelector">
       <coplet-adapter name="uri" class="org.apache.cocoon.portal.coplet.adapter.impl.URICopletAdapter" logger="portal"/>
   </component>
  
  
   <!-- Renderer Aspect configuration -->
   <component class="org.apache.cocoon.components.ExtendedComponentSelector" role="org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectSelector">
      <aspect name="composite-content" class="org.apache.cocoon.portal.layout.renderer.aspect.impl.CompositeContentAspect"/>
      <aspect name="tab-content" class="org.apache.cocoon.portal.layout.renderer.aspect.impl.TabContentAspect"/>
      <aspect name="window" class="org.apache.cocoon.portal.layout.renderer.aspect.impl.WindowAspect"/>
  
      <!-- This aspect can be used to render the minimize/maximize buttons -->
      <aspect name="coplet-sizing" class="org.apache.cocoon.portal.layout.renderer.aspect.impl.SizingAspect"/>
  
      <!-- This aspect can be used to render the remove button -->
      <aspect name="coplet-removing" class="org.apache.cocoon.portal.layout.renderer.aspect.impl.RemoveableAspect"/>
  
      <!-- This aspect can be used to render a full-screen button -->
      <aspect name="coplet-full-screen" class="org.apache.cocoon.portal.layout.renderer.aspect.impl.FullScreenCopletAspect"/>
  
      <!-- This aspect can be used to render cinclude statements that will be used to include the coplet content,
           use the coplet aspect below to directly stream the content -->
      <aspect name="coplet-cinclude" class="org.apache.cocoon.portal.layout.renderer.aspect.impl.CIncludeCopletAspect"/>
  
      <!-- This aspect can be used to render the content of the coplet -->
      <aspect name="coplet" class="org.apache.cocoon.portal.layout.renderer.aspect.impl.DefaultCopletAspect"/>
      <aspect name="frame" class="org.apache.cocoon.portal.layout.renderer.aspect.impl.FrameAspect"/>
      <aspect name="xslt" class="org.apache.cocoon.portal.layout.renderer.aspect.impl.XSLTAspect"/>
   </component>
  
   <!-- Renderer configuration -->
   <component class="org.apache.cocoon.components.ExtendedComponentSelector" role="org.apache.cocoon.portal.layout.renderer.RendererSelector">
       <renderer name="column" class="org.apache.cocoon.portal.layout.renderer.impl.AspectRenderer" logger="portal" >
           <aspects>
               <aspect type="xslt">
                   <parameter name="style" value="styles/column.xsl"/>
               </aspect>
               <aspect type="composite-content">
                   <parameter name="tag-name" value="column-layout"/>
               </aspect>
           </aspects>
       </renderer>
       <renderer name="row" class="org.apache.cocoon.portal.layout.renderer.impl.AspectRenderer" logger="portal" >
           <aspects>
               <aspect type="xslt">
                   <parameter name="style" value="styles/row.xsl"/>
               </aspect>
               <aspect type="composite-content">
                   <parameter name="tag-name" value="row-layout"/>
               </aspect>
           </aspects>
       </renderer>
       <renderer name="tab" class="org.apache.cocoon.portal.layout.renderer.impl.AspectRenderer" logger="portal" >
           <aspects>
               <aspect type="xslt">
                   <parameter name="style" value="styles/tab.xsl"/>
               </aspect>
               <aspect type="tab-content">
                   <parameter name="tag-name" value="tab-layout"/>
               </aspect>
           </aspects>
       </renderer>
       <renderer name="window" class="org.apache.cocoon.portal.layout.renderer.impl.AspectRenderer" logger="portal" >
           <aspects>
               <aspect type="xslt">
                   <parameter name="style" value="styles/window.xsl"/>
               </aspect>
               <aspect type="window">
                   <parameter name="tag-name" value="window"/>
               </aspect>
               <aspect type="coplet-removing"/>
               <aspect type="coplet-full-screen"/>
               <aspect type="coplet-sizing"/>
               <aspect type="coplet-cinclude"/>
           </aspects>
       </renderer>
       <renderer name="frame" class="org.apache.cocoon.portal.layout.renderer.impl.AspectRenderer" logger="portal" >
           <aspects>
               <aspect type="frame"/>
           </aspects>
       </renderer>
       <!--renderer name="frame" class="org.apache.cocoon.portal.layout.renderer.impl.FrameRenderer" logger="portal"/-->
       <!--renderer name="nowindow" class="org.apache.cocoon.portal.layout.renderer.impl.NoWindowRenderer" logger="portal"/-->
       <renderer name="nowindow" class="org.apache.cocoon.portal.layout.renderer.impl.AspectRenderer" logger="portal" >
           <aspects>
               <aspect type="coplet"/>
           </aspects>
       </renderer>
       <renderer name="link" class="org.apache.cocoon.portal.layout.renderer.impl.DefaultLinkRenderer" logger="portal"/>
   </component>
   
   <component class="org.apache.cocoon.components.persistance.CastorSourceConverter" role="org.apache.cocoon.components.persistance.CastorSourceConverter">
   	<mapping-source>context://samples/portal/profiles/mapping/layout.xml</mapping-source>
   </component>
   <component class="org.apache.cocoon.portal.profile.impl.ParameterSourceAdapter" role="org.apache.cocoon.portal.profile.impl.ParameterSourceAdapter" />
  </xconf>
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/conf/protocol.xconf
  
  Index: protocol.xconf
  ===================================================================
  <?xml version="1.0"?>
  
  <xconf xpath="/cocoon/source-factories" unless="component-instance[@name='coplet']">
  
      <!-- portal protocol -->
      <component-instance class="org.apache.cocoon.portal.source.CopletSourceFactory" name="coplet"/>
  </xconf>
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/conf/portal.xsamples
  
  Index: portal.xsamples
  ===================================================================
  <?xml version="1.0"?>
  
  <xsamples xpath="/samples" unless="group[@name='portal']">
  
    <group name="portal">
      <sample name="Portal Engine" href="portal/portal">
      This is a demo of the new powerfull portal engine based on Apache Cocoon.
     </sample>
    </group>
    
  </xsamples>
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/news/content/xdocs/overview.xml
  
  Index: overview.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <document> 
    <header> 
  	 <title>Overview of Apache Cocoon</title>
  	 <version>0.2</version> 
  	 <type>Overview document</type> 
  	 <authors><person name="Tom Klaasen" email="tom.klaasen@the-ecorp.com"/> 
  	 </authors> 
    </header> 
    <body> 
  	 <s1 title="What is Apache Cocoon"> 
  		<p>Cocoon is an XML publishing framework. It allows you to define XML
  		  documents and transformations to be applied on it, to eventually generate a
  		  presentation format of your choice (HTML, PDF, SVG, ...).</p> 
  		<p>Cocoon also gives you the possibility to apply logic to your XML files
  		  (so that the XML pipeline can be dynamic).</p> 
  
      <p>The <link href="userdocs/index.html">User documentation</link>
       and especially <link href="userdocs/concepts/index.html">Concepts</link>
       will help to understand Cocoon.
      </p>
     </s1> 
  
     <anchor id="samples"/>
     <s1 title="Examples and demonstration applications"> 
      <p>
       There are a whole suite of sample applications to demonstrate the power
       of Cocoon. These samples are available from the "welcome" page after
       you have downloaded, built, and installed the distribution.
       Each example portrays a different aspect of the vast capabilities of
       Cocoon ...
       <code>http://localhost:8080/cocoon/</code>
      </p>
  
      <note>With the 2.1 version,
       <code>http://localhost:8080/cocoon/</code> goes directly to the
       documentation, while
       <code>http://localhost:8080/cocoon/samples/</code> is the Samples.
      </note>
  
      <p>
       It will greatly assist your understanding of Cocoon to investigate
       behind-the-scenes, to find out how each sample is processed. Do this
       by looking at the actual XML documents provided in the distribution at
       <code>src/webapp/samples/</code> and by consulting each sitemap to see
       the processing steps that are defined.
      </p>
     </s1> 
  
     <s1 title="Overview of XML document processing"> 
      <p>This section gives a general overview of how an XML document is
       handled by Cocoon. See also the document
       <link href="userdocs/concepts/index.html">Understanding Cocoon</link> for explanation of
       the separation of content, style, logic and management functions.
      </p> 
  
  		<s2 title="Pipeline"> 
  		  <p>Cocoon relies on the pipeline model: an XML document is pushed
  			 through a pipeline, that exists in several transformation steps of your
  			 document. Every pipeline begins with a generator, continues with zero or more
  			 transformers, and ends with a serializer. This can be compared to the
  			 "servlet-chaining" concept of a servlet engine. We'll explain the components of
  			 the pipeline now in more detail.</p> 
  		  <s3 title="Generator"> 
  			 <p>The Generator is the starting point for the pipeline. It is
  				responsible for delivering SAX events down the pipeline.</p> 
  			 <p>The simplest Generator is the FileGenerator: it takes a local XML
  				document, parses it, and sends the SAX events down the pipeline. </p> 
  			 <p>The Generator is constructed to be independent of the concept
  				"file". If you are able to generate SAX events from another source, you can use
  				that without having to go via a temporary file.</p> 
  		  </s3> 
  		  <s3 title="Transformer"> 
  			 <p>A Transformer can be compared to an XSL: it gets an XML document
  				(or SAX events), and generates another XML document (or SAX events).</p> 
  			 <p>The simplest Transformer is the XalanTransformer: it applies an
  				XSL to the SAX events it receives.</p> 
  		  </s3> 
  		  <s3 title="Serializer"> 
  			 <p>A Serializer is responsible for transforming SAX events to a
  				presentation format. For actors looking at the back of the pipeline, it looks
  				like a static file is delivered. So a browser can receive HTML, and will not be
  				able to tell the difference with a static file on the filesystem of the server.
  				</p> 
  			 <p>We have Serializers for generating HTML, XML, PDF, VRML, WAP, and
  				of course you can create your own.</p> 
  			 <p>The simplest Serializer is the XMLSerializer: it receives the SAX
  				events from up the pipeline, and returns a "human-readable" XML file.</p> 
  		  </s3> 
  		</s2> 
  	 </s1> 
    </body>
  </document>
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/news/content/xdocs/introduction.xml
  
  Index: introduction.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <document>
  
    <header>
      <title>Introducing Cocoon</title>
      <authors>
        <person name="Stefano Mazzocchi" email="stefano@apache.org"/>
      </authors>
    </header>
  
    <body>
  
      <s1 title="The XML Hype">
  
  <p>
  Everybody talks about XML. XML here, XML there. All application servers
  support XML, everybody wants to do B2B using XML, web services using
  XML, even databases using XML.
  </p>
  
  <p>
  Should you care about it? Given the amount of hype, you can't afford to
  go around ignoring the argument, would be like ignoring the world wide
  web 10 years ago: a clear mistake. But why is this so for XML? What is
  this "magic" that XML seems to have to solve my problems? Isn't this
  another hype to change once again the IT infrastructure that you spent
  so much time implementing and fixing in the last few years? Isn't
  another way to spill money out of your pockets?
  </p>
  
  <p>
  If you ever asked yourself one of the above questions, this paper is for
  you. You won't find singing-and-dancing marketing crap, you won't find
  boring and useless feature lists, you won't find the usual acronym
  bombing or those good looking vaporware schemas that connect your
  databases to your coffee machines via CORBA or stuff like that.
  </p>
  
  <p>
  This document will explain you what the Cocoon project is about and what we are
  doing to solve the problems that we encountered in our web engineering
  experiences, but from an executive perspective, yes, because we all had
  the problems of managing a web site, dealing with our colleagues, rushing
  to the graphical guru to have the little GIF with the new title, or
  calling the web administrator at night because the database is returning
  errors without reasons.
  </p>
  
  <p>
  It was frustrating to see the best and most clever information
  technology ever invented (the web) ruined by the lack of engineering
  practices, tortured by those "let's-reinvent-the-wheel-once-again"
  craftmen that were great at doing their jobs as individuals but that
  couldn't scale and imposed a growth saturation to the whole project.
  </p>
  
  <p>
  There had to be a better way of doing things.
  </p>
  
      </s1>
  
  
      <s1 title="Personal Experiences">
  
  <p>
  In 1998, Stefano Mazzocchi volunteered to create the documentation infrastructure for
  the java.apache.org project, which is composed by a bunch of different
  codebases, maintained by a bunch of different people, with different
  skills, different geographical locations and different degree of will
  and time to dedicate to the documentation effort.
  </p>
  
  <p>
  But pretty soon he realized that no matter how great and well designed the
  system was, HTML was a problem: it was *not* designed for those kind of
  things. Looking at the main page (<link href="http://java.apache.org/">http://java.apache.org/</link>) from the
  browser and you could clearly identify the areas of the screen: sidebar,
  topbar, news, status. But if you opened the HTML, boom: a nightmare or
  table tags and nesting and small little tricks to make the HTML appear
  the same on every browser.
  </p>
  
  <p>
  So he looked around for alternative technologies, but *all* of them were
  trying to add more complexity at the GUI level (Microsoft Frontpage,
  Macromedia Dreamweaver, Adobe GoLive, etc...) hoping to "hide" the
  design problems of HTML under a thick layer of WYSIWYG looks.
  </p>
  
  <p>
  What you see is what you get.
  </p>
  
  <p>
  But what you see is all you've got.
  </p>
  
  <p>
  How can you tell your web server to "extract" the information from the
  sitebar? How can you have the news feeds out of a complex HTML page?
  </p>
  
  <p>
  Damn, it's easy for a human reader: just look at the page and it's very
  easy to distinguish between a sidebar, a banner, a news and a stock
  quote. Why is it so hard for a machine?
  </p>
  
      </s1>
  
      <s1 title="The HTML Model">
  
  <p>
  HTML is a language that tells your browser how to "draw" things on its
  window. An image here, a letter there, a color down here. Nothing more.
  The browser doesn't have the "higher level" notion of "sidebar": it
  lacks the ability to perform "semantic analysis" on the HTML content.
  </p>
  
  <p>
  Semantic analysis? Yeah, it's the kind of thing the human brain is
  simply great at doing, while computer programs simply suck big time.
  </p>
  
  <p>
  So, with HTML, we went a step up and created a highly visual and
  appealing web of HTML content, but we went two steps back by removing
  all the higher level semantic information from the content itself.
  </p>
  
  <p>
  Ok, let's make an example...  most of you have seen an HTML
  page... if not, here is an example:
  </p>
  
  <source><![CDATA[
   <html>
    <body>
     <p>Hi, I'm an HTML page</p>
     <p align="center">Written by Stefano</p>
    </body>
   </html>
  ]]></source>
  
  <p>
  which says to the browser:
  </p>
  
  <ul>
   <li>I'm a HTML page</li>
   <li>I have a body</li>
   <li>I have a paragraph</li>
   <li>I contain the sentence "Hi, I'm an HTML page."</li>
   <li>I contain the sentence "Written by Stefano"</li>
  </ul>
  
  <p>
  Suppose you are a chinese guy that doesn't understand our alphabet, try
  to answer the following question:
  </p>
  
  <p>
   who wrote the page?
  </p>
  
  <p>
  You can't perform semantic analysis, you are as blind as a web browser.
  The only thing you can do is draw it on the screen since this is what
  you were programmed to do. In other words, your semantic capacity is
  fixed to the drawing capabilities and a few other things (like linking),
  thus limited.
  </p>
  
      </s1>
  
      <s1 title="Semantic Markup">
  
  <p>
  Suppose you receive this page:
  </p>
  
  <source><![CDATA[
   <page>
    <author>sflkjoiuer</author>
    <content>
     <para>sofikdjflksj</para>
    </content>
   </page>
  ]]></source>
  
  <p>
  can you tell me who wrote the page? easy, you say, "sflkjoiuer" did. Good, but later
  you receive:
  </p>
  
  <source><![CDATA[
   <dlkj>
    <ruijfl>sofikdjflksj</ruijfl>
    <wijlkjf>
      <oamkfkj>sflkjoiuer</oamkfkj>
    </wijlkjf>
   </dlkj>
  ]]></source>
  
  <p>
  now, who wrote the page? You could guess by comparing the structure,
  but how do you know the two structures reflect the same semantic
  information?
  </p>
  
  <p>
  The above two pages are both XML documents.
  </p>
  
  <p>
  Are they going to help you? Are they doing to simplify your work? Are
  they going to simplify your problems?
  </p>
  
  <p>
  At this point, clearly not so, rather the opposite.
  </p>
  
  <p>
  So, you could be wondering, why did we spend so much effort to 
  write an XML publishing framework? This document was written exactly
  to clear your doubts on this, so let's keep going.
  </p>
  
  
      </s1>
  
      <s1 title="The XML Language">
  
  <p>
  XML is most of the times referred to as the "eXtensible Markup Language"
  specification. A fairly small yet complex specification that indicates
  how to write languages. It's a syntax. To tell you the truth, nothing fancy at all. So
  </p>
  
  <source><![CDATA[
   <hello></hello>
  ]]></source>
  
  <p>
  is correct, while
  </p>
  
  <source><![CDATA[
   <hello></hi>
  ]]></source>
  
  <p>
  is not, but
  </p>
  
  <source><![CDATA[
   <hello><hi/></hello>
  ]]></source>
  
  <p>
  is correct. That's more than this, but I'll skip the technical details here.
  </p>
  
  <p>
  XML is the ASCII for the new millenium, it's a step forward from ASCII
  or UNICODE (the international extension to ASCII that includes all
  characters from all modern languages). It defines a "lingua franca" for
  textual languages.
  </p>
  
  <p>
  Ok, great, so now instead of having one uniform language with visual
  semantics (HTML) we have a babel of languages each with its own
  semantics. How this can possibly help you?
  </p>
  
      </s1>
  
      <s1 title="XML Transformations">
  
  <p>
  This was the point where Stefano was more or less two years ago for
  java.apache.org: I could use XML and define my own semantics with
  <![CDATA[<sidebar>]]>, <![CDATA[<news>]]>, <![CDATA[<status>]]> 
  and all that and I'm sure people would have
  found those XML documents much easier to write (since the XML syntax is
  very similar to the HTML one and very user friendly)... but I would have
  moved from "all browsers" to "no browser".
  </p>
  
  <p>
  And having a documentation that nobody can browse is totally useless.
  </p>
  
  <p>
  The turning point was the creation of the XSL specification which
  included a way to "transform" an XML page into something else. (it's
  more complex than this, but, again, I'll skip the technical details).
  </p>
  
  <p>
  So now you have:
  </p>
  
  <source><![CDATA[
   XML page ---(transformation)--> HTML page
                      ^
                      |
            transformation rules
  ]]></source>
  
  <p>
  that allows you to write your pages in XML, create your "graphics" as
  transformation rules and generate HTML pages on the fly directly from your
  web server.
  </p>
  
  <p>
  Apache Cocoon 1.0 did exactly this.
  </p>
  
      </s1>
  
      <s1 title="The Model Evolves">
  
  <p>
  If XML is a lingua franca, it means that XML software can work on almost
  anything without caring about what it is. So, if a cell phone requests
  the page, Cocoon just has to change transformation rules and send the
  WAP page to the phone. Or, if you want a nice PDF to printout your
  monthly report, you change the transformation rules and Cocoon creates
  the PDF for you, or the VRML, or the VoiceML, or your own proprietary
  B2B markup.
  </p>
  
  <p>
  Anything without changing the basic architecture that is simply based on
  the simple "angle bracket" XML syntax.
  </p>
  
      </s1>
  
      <s1 title="Separation of Concerns (SoC)">
  
  <p>
  Cocoon was not the first product to perform server side XML
  transformations, nor will be the last one (in a few years, these
  solutions will be the rule rather than the exception). So, what is the
  "plus" that the Cocoon project adds?
  </p>
  
  <p>
  We believe the single most important Cocoon innovation is SoC-based design.
  </p>
  
  <p>
  SoC is something that you've always been aware of: not everybody is
  equal, not everybody performs the same job with the same ability.
  </p>
  
  <p>
  It can be observed that separating people with common skills in
  different working groups increases productivity and reduces management
  costs, but only if the groups do not overlap and have clear "contracts"
  that define their operability and their concerns.
  </p>
  
  <p>
  For a web publishing system, the Cocoon project uses what we call the
  <em>pyramid of contacts</em> which outlines four major concern areas and five
  contracts between them. Here is the picture:
  </p>
  
  <figure src="news/images/pyramid-model.gif"
          alt="The Cocoon Pyramid Model of Contracts"
          width="313" height="159"/>
  
  <p>
  Cocoon is <em>engineered</em> to provide you a way to isolate these four
  concern areas using just those 5 contracts, removing the contract
  between style and logic that has been bugging web site development since
  the beginning of the web.
  </p>
  
  <p>
  Why? because programmers and graphic people have very different skills
  and work habits... so, instead of creating GUIs to hide the things that
  can be harmful (like graphic to programmers or logic to designers),
  Cocoon allows you to separate the things into different files, allowing
  you to "seal" your working groups into separate virtual rooms connected
  with the other rooms only by those "pipes" (the contracts), that you
  give them from the management area.
  </p>
  
  <p>
  Let's have an example:
  </p>
  
  <source><![CDATA[
   <page>
    <content>
     <para>Today is <dynamic:today/></para>
    </content>
   </page>
  ]]></source>
  
        <p>
  	is written by the content writers and you give them the
  	"contract" that states that the tag
  	<![CDATA[<dynamic:today/>]]> prints out the time of the day
  	when included in the page. Content writers don't care (nor
  	should) about what language has been used for that, nor they
  	can mess up with the programming logic that generates the
  	content since it's stored in another part of the system they
  	don't have access to.
        </p>
  
  <p>
  So <![CDATA[<dynamic:today/>]]> is the "logic - content" contract.
  </p>
  
  <p>
  At the same time, the structure of the page is given as a contract to
  the graphic designers who have to come up with the transformation rules
  that transform this structure in a language that the browser can
  understand (HTML, for example).
  </p>
  
  <p>
  So, the page structure is the "content - style" contract.
  </p>
  
  <p>
  As long as these contract don't change, the three areas can work in a
  completely parallel way without saturating the human resources used to
  manage them: costs decrease because time to market is reduced and
  maintenance costs is decreased because errors do not propagate out of
  the concern areas.
  </p>
  
  <p>
  For example, you can tell your designers to come up with a "Xmas look"
  for your web site, without even telling the other people: just switch
  the XMas transformation rules at XMas morning and you're done.... just
  imagine how painful it would be to do this on your web site today.
  </p>
  
  <p>
  With the Cocoon architecture all this is a couple of line changes away.
  </p>
  
      </s1>
  
      <s1 title="Here we go">
  
  <p>
  If you reached this far by reading all sections, you should have grasped the
  value of the Cocoon Project and distinguish most of the marketing
  hype that surrounds XML and friends.
  </p>
  
  <p>
  Just like you shouldn't care if somebody offers you a software that is
  "ASCII compliant" or "ASCII based", you shouldn't care about "XML
  compliant" or "XML based": it doesn't mean anything.
  </p>
  
  <p>
  Cocoon uses XML as a core piece of its framework, but improves the model
  to give you the tools you need and is designed to be flexible enough to
  follow your needs as well as paradigm shifts that will happen in the
  future.
  </p>
  
      </s1>
  
    </body>
  </document>
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/news/content/resources/images/pyramid-model.gif
  
  	<<Binary file>>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/generation/PortalGenerator.java
  
  Index: PortalGenerator.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.generation;
  
  import java.io.IOException;
  import java.io.Serializable;
  import java.util.Map;
  
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.parameters.ParameterException;
  import org.apache.avalon.framework.parameters.Parameters;
  import org.apache.cocoon.ProcessingException;
  import org.apache.cocoon.caching.CacheableProcessingComponent;
  import org.apache.cocoon.environment.SourceResolver;
  import org.apache.cocoon.generation.ComposerGenerator;
  import org.apache.cocoon.portal.PortalManager;
  import org.apache.cocoon.portal.PortalService;
  import org.apache.excalibur.source.SourceValidity;
  import org.apache.excalibur.source.impl.validity.NOPValidity;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @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: PortalGenerator.java,v 1.1 2003/05/07 06:22:29 cziegeler Exp $
   */
  public class PortalGenerator extends ComposerGenerator
  implements CacheableProcessingComponent {
  
  	/**
  	 * @see org.apache.cocoon.generation.Generator#generate()
  	 */
  	public void generate()
  		throws IOException, SAXException, ProcessingException {
          
          PortalManager pm = null;
          try {
              pm = (PortalManager)this.manager.lookup(PortalManager.ROLE);
              pm.process();
              pm.showPortal(this.xmlConsumer, this.parameters);
          } catch (ComponentException ce) {
              throw new ProcessingException("Unable to lookup portal manager.", ce);
          } finally {
              this.manager.release(pm);
          }
  	}
  
  	/* (non-Javadoc)
  	 * @see org.apache.cocoon.caching.CacheableProcessingComponent#generateKey()
  	 */
  	public Serializable getKey() {
  		// FIXME quick hack
          return null; //ObjectModelHelper.getRequest(this.objectModel).getQueryString();
  
  	}
  
  	/* (non-Javadoc)
  	 * @see org.apache.cocoon.caching.CacheableProcessingComponent#generateValidity()
  	 */
  	public SourceValidity getValidity() {
  		return new NOPValidity();
  
  	}
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.sitemap.SitemapModelComponent#setup(org.apache.cocoon.environment.SourceResolver, java.util.Map, java.lang.String, org.apache.avalon.framework.parameters.Parameters)
       */
      public void setup(SourceResolver resolver,
                         Map objectModel,
                         String src,
                         Parameters par)
      throws ProcessingException, SAXException, IOException {
          super.setup(resolver, objectModel, src, par);
          
          PortalService service = null;
          try {
              service = (PortalService)this.manager.lookup(PortalService.ROLE);
              service.setPortalName(par.getParameter("portal-name"));
          } catch (ParameterException pe) {
              throw new ProcessingException("Parameter portal-name is required.");
          } catch (ComponentException ce) {
              throw new ProcessingException("Unable to lookup portal service.", ce);
          } finally {
              this.manager.release(service);
          }
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/lib/.cvsignore
  
  	<<Binary file>>
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/CopletAdapter.java
  
  Index: CopletAdapter.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.coplet.adapter;
  
  import org.apache.avalon.framework.component.Component;
  import org.apache.cocoon.portal.coplet.CopletInstanceData;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @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: CopletAdapter.java,v 1.1 2003/05/07 06:22:29 cziegeler Exp $
   */
  public interface CopletAdapter 
      extends Component {
  
      String ROLE = CopletAdapter.class.getName();
      
      void init(CopletInstanceData coplet);
      
      void toSAX(CopletInstanceData coplet, ContentHandler contentHandler)
      throws SAXException;
      
      void destroy(CopletInstanceData coplet);
      
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/coplet/CopletData.java
  
  Index: CopletData.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.coplet;
  
  import java.util.HashMap;
  import java.util.Map;
  
  /**
   *
   * @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: CopletData.java,v 1.1 2003/05/07 06:22:29 cziegeler Exp $
   */
  public class CopletData {
  
      protected String name;
  
      protected String title;
  
      protected boolean maxpageable;
      
      protected boolean removable;
  
      protected CopletBaseData copletBaseData;
  
      protected Map attributes = new HashMap();
  
      /**
       * Constructor
       */
      public CopletData() {
          this.maxpageable = true;
          this.removable = true;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      /**
        * Returns the maxpageable.
        * @return boolean
        */
      public boolean isMaxpageable() {
          return maxpageable;
      }
  
      /**
       * Returns the removable.
       * @return boolean
       */
      public boolean isRemovable() {
          return removable;
      }
  
      /**
       * Sets the maxpageable.
       * @param maxpageable The maxpageable to set
       */
      public void setMaxpageable(boolean maxpageable) {
          this.maxpageable = maxpageable;
      }
  
      /**
       * Sets the removable.
       * @param removable The removable to set
       */
      public void setRemovable(boolean removable) {
          this.removable = removable;
      }
  
      /**
       * Returns the title.
       * @return String
       */
      public String getTitle() {
          return title;
      }
  
      /**
       * Sets the title.
       * @param title The title to set
       */
      public void setTitle(String title) {
          this.title = title;
      }
  
      /**
       * Returns the copletBaseData.
       * @return CopletBaseData
       */
      public CopletBaseData getCopletBaseData() {
          return copletBaseData;
      }
  
      /**
       * Sets the copletBaseData.
       * @param copletBaseData The copletBaseData to set
       */
      public void setCopletBaseData(CopletBaseData copletBaseData) {
          this.copletBaseData = copletBaseData;
      }
  
      public Object getAttribute(String key) {
          return this.attributes.get(key);
      }
  
      public void setAttribute(String key, Object value) {
          this.attributes.put(key, value);
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/coplet/CopletBaseData.java
  
  Index: CopletBaseData.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.coplet;
  
  import java.util.HashMap;
  import java.util.Map;
  
  /**
   *
   * @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: CopletBaseData.java,v 1.1 2003/05/07 06:22:29 cziegeler Exp $
   */
  public final class CopletBaseData {
  
  	private Map copletConfig;
  
  	private String name;
  
  	private String copletAdapterName;
  
  	private String defaultRendererName;
  
  	public CopletBaseData() {
  		this.copletConfig = new HashMap();
  	}
  
  	public String getName() {
  		return name;
  	}
  
  	public void setName(String name) {
  		this.name = name;
  	}
  
  	public String getCopletAdapterName() {
  		return this.copletAdapterName;
  	}
  
  	public String getDefaultRendererName() {
  		return this.defaultRendererName;
  	}
  
  	public void setDefaultRendererName(String defaultName) {
  		this.defaultRendererName = defaultName;
  	}
  
  	public Object getCopletConfig(String key) {
  		return this.copletConfig.get(key);
  	}
  
  	public void setCopletConfig(String key, Object value) {
  		this.copletConfig.put(key, value);
  	}
  
  	public Map getCopletConfig() {
  		return this.copletConfig;
  	}
  
  	public void setCopletConfig(Map config) {
  		this.copletConfig = config;
  	}
  
  	public void setCopletAdapterName(String name) {
  		this.copletAdapterName = name;
  	}
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
  
  Index: CopletInstanceData.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.coplet;
  
  /**
   *
   * @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: CopletInstanceData.java,v 1.1 2003/05/07 06:22:29 cziegeler Exp $
   */
  public final class CopletInstanceData {
  
  	public final static int STATUS_MINIMIZED = 0;
  	public final static int STATUS_MAXIMIZED = 1;
  
      private String copletId;
      
  	private CopletData copletData;
  
  	protected int status;
  
  	/**
  	 * Constructor
  	 */
  	public CopletInstanceData() {
  		this.status = STATUS_MAXIMIZED;
  	}
  
  	/**
  	 * Returns the copletId.
  	 * @return String
  	 */
  	public String getCopletId() {
  		return copletId;
  	}
  
  	/**
  	 * Sets the copletId.
  	 * @param copletId The copletId to set
  	 */
  	public void setCopletId(String copletId) {
  		this.copletId = copletId;
  	}
  
  	/**
  	 * @return CopletData
  	 */
  	public CopletData getCopletData() {
  		return copletData;
  	}
  
  	/**
  	 * Sets the copletData.
  	 * @param copletData The copletData to set
  	 */
  	public void setCopletData(CopletData copletData) {
  		this.copletData = copletData;
  	}
  
  	/**
  	 * Returns the status.
  	 * @return int
  	 */
  	public int getStatus() {
  		return status;
  	}
  
  	/**
  	 * Sets the status.
  	 * @param status The status to set
  	 */
  	public void setStatus(int status) {
  		this.status = status;
  	}
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/subscriber/impl/DefaultLayoutEventSubscriber.java
  
  Index: DefaultLayoutEventSubscriber.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.subscriber.impl;
  
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.cocoon.portal.event.Event;
  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.Layout;
  import org.apache.cocoon.portal.layout.impl.TabLayout;
  import org.apache.cocoon.portal.layout.impl.TabLayoutStatus;
  import org.apache.cocoon.portal.profile.ProfileManager;
  
  /**
   *
   * @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: DefaultLayoutEventSubscriber.java,v 1.1 2003/05/07 06:22:29 cziegeler Exp $
   */
  public final class DefaultLayoutEventSubscriber 
      implements Subscriber {
  
      private ComponentManager componentManager;
  
      public DefaultLayoutEventSubscriber(ComponentManager manager) {
          this.componentManager = manager;
      }
  
      /* (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#getFilter()
       */
      public Filter getFilter() {
          return null;
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.portal.event.Subscriber#inform(org.apache.cocoon.portal.event.Event)
       */
      public void inform(Event event) {
          if (event instanceof LayoutRemoveEvent) { 
              LayoutRemoveEvent removeEvent = (LayoutRemoveEvent)event;
              Layout layout = (Layout)removeEvent.getTarget();
              layout.getParent().getParent().removeItem(layout.getParent());
          } else {
              LayoutEvent statusEvent = (LayoutEvent)event;
              Layout layout = (Layout)statusEvent.getTarget();
              // TODO should not depend on special Layout 
              if (layout instanceof TabLayout) {
                  ProfileManager profileManager = null;
                  try {
                      profileManager = (ProfileManager) this.componentManager.lookup(ProfileManager.ROLE);
                      TabLayoutStatus status = (TabLayoutStatus) profileManager.getAspectStatus(TabLayoutStatus.class, ProfileManager.SESSION_STATUS, layout.getId());
                      if ( status == null ) {
                          // FIXME
                          status = new TabLayoutStatus();
                          profileManager.setAspectStatus(ProfileManager.SESSION_STATUS, layout.getId(), status);
                      }
                      status.setSelectedItem(statusEvent.getAction());
                  } catch (ComponentException ce) {
                      // ignore
                  } finally {
                      this.componentManager.release(profileManager);
                  }
              }
          }
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  <?xml version="1.0"?>
  <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  <!-- =========================== Components ================================ -->
  
   <map:components>
  
    <map:generators default="file">
      <map:generator name="portal" src="org.apache.cocoon.portal.generation.PortalGenerator"/>
    </map:generators>
    <map:transformers default="xslt">
      <map:transformer name="htmlroot" src="org.apache.cocoon.portal.transformation.HTMLRootTransformer" logger="sitemap.transformer.htmlroot" />
    </map:transformers>
    <map:readers default="resource"/>
    <map:serializers default="html"/>
    <map:matchers default="wildcard"/>
    <map:selectors default="browser"/>
   </map:components>
   
  <!-- =========================== Views =================================== -->
  
   <map:views>
    <map:view name="content" from-label="content">
     <map:serialize type="xml"/>
    </map:view>
   </map:views>
  
  
  <!-- =========================== Pipelines ================================= -->
  
   <map:pipelines>
    <map:pipeline>
  
     <map:match pattern="news/**">
        <map:mount check-reload="yes" src="news/" uri-prefix="news"/>
      </map:match>
  
      <!-- Test pipeline for layout engine -->
      <map:match pattern="portal">
          <map:generate type="portal" label="content">
          	<map:parameter name="portal-name" value="portal" />
          </map:generate>
          <map:transform type="cinclude"/> 
          <map:transform src="styles/header.xsl"/>
          <map:transform type="htmlroot" />
          <map:serialize type="html"/> 
      </map:match>
      
      <!-- images -->
  	<map:match pattern="sunspotdemoimg-*.gif">
  		<map:read mime-type="image/gif" src="images/{1}.gif"/>
  	</map:match>
  	<map:match pattern="sunspotdemoimg-*.jpg">
      	<map:read mime-type="image/jpg" src="images/{1}.jpg"/>
     	</map:match>
      
    </map:pipeline>
   </map:pipelines>
  
  </map:sitemap>
  
  <!-- end of file -->
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/transformation/HTMLRootTransformer.java
  
  Index: HTMLRootTransformer.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.transformation;
  
  import java.io.IOException;
  import java.util.Map;
  
  import org.apache.avalon.framework.parameters.Parameters;
  import org.apache.cocoon.ProcessingException;
  import org.apache.cocoon.environment.SourceResolver;
  import org.apache.cocoon.transformation.AbstractTransformer;
  import org.apache.cocoon.xml.XMLUtils;
  import org.xml.sax.SAXException;
  
  /**
   * This transformer simply adds an html and a body element
   * around the sax stream.
   * 
   * @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: HTMLRootTransformer.java,v 1.1 2003/05/07 06:22:29 cziegeler Exp $
   */
  public class HTMLRootTransformer extends AbstractTransformer {
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.sitemap.SitemapModelComponent#setup(org.apache.cocoon.environment.SourceResolver, java.util.Map, java.lang.String, org.apache.avalon.framework.parameters.Parameters)
       */
      public void setup(SourceResolver resolver,
                         Map objectModel,
                         String src,
                         Parameters par)
      throws ProcessingException, SAXException, IOException {
          // do nothing
  
      }
  
      /* (non-Javadoc)
       * @see org.xml.sax.ContentHandler#endDocument()
       */
      public void endDocument() throws SAXException {
          XMLUtils.endElement(this.xmlConsumer, "body");
          XMLUtils.endElement(this.xmlConsumer, "html");
          super.endDocument();
      }
  
      /* (non-Javadoc)
       * @see org.xml.sax.ContentHandler#startDocument()
       */
      public void startDocument() throws SAXException {
          super.startDocument();
          XMLUtils.startElement(this.xmlConsumer, "html");
          XMLUtils.startElement(this.xmlConsumer, "body");
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/URICopletAdapter.java
  
  Index: URICopletAdapter.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.coplet.adapter.impl;
  
  import java.io.IOException;
  
  import org.apache.avalon.framework.activity.Disposable;
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.Composable;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.thread.ThreadSafe;
  import org.apache.cocoon.ProcessingException;
  import org.apache.cocoon.components.source.SourceUtil;
  import org.apache.cocoon.portal.coplet.CopletInstanceData;
  import org.apache.cocoon.portal.coplet.adapter.CopletAdapter;
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceResolver;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   * This is the adapter to use pipelines as coplets
   *
   * @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: URICopletAdapter.java,v 1.1 2003/05/07 06:22:30 cziegeler Exp $
   */
  public class URICopletAdapter 
      extends AbstractLogEnabled
      implements CopletAdapter, ThreadSafe, Composable, Disposable {
  	
      /** The component manager */
      protected ComponentManager manager;
  
      /** The source resolver */
      protected SourceResolver resolver;
      /**
       * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
       */
      public void compose(ComponentManager componentManager)
          throws ComponentException {
          this.manager = componentManager;
          this.resolver = (SourceResolver)this.manager.lookup(SourceResolver.ROLE);
      }
  
      
      public void toSAX(CopletInstanceData coplet, ContentHandler contentHandler)
      throws SAXException {
          Source copletSource = null;
          try {
              copletSource = this.resolver.resolveURI((String)coplet.getCopletData().getAttribute("uri"));
              SourceUtil.toSAX(copletSource, contentHandler);
          } catch (IOException ioe) {
              throw new SAXException("IOException", ioe);
          } catch (ProcessingException pe) {
              throw new SAXException("ProcessingException", pe);
          } finally {
              this.resolver.release( copletSource );
          }
      }
      
      public void init(CopletInstanceData coplet) {
      }
      
      public void destroy(CopletInstanceData coplet) {
      }
      
      /* (non-Javadoc)
       * @see org.apache.avalon.framework.activity.Disposable#dispose()
       */
      public void dispose() {
          if ( this.manager != null ) {
              this.manager.release( this.resolver );
              this.resolver = null;
              this.manager = null;
          }
      }
  
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/samples/news/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  <?xml version="1.0"?>
  
  <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  <!-- =========================== Components ================================ -->
  <!-- =========================== Views =================================== -->
  
   <map:views>
    <map:view name="content" from-label="content">
     <map:serialize type="xml"/>
    </map:view>
   </map:views>
  <!-- =========================== Pipelines ================================= -->
  
   <map:pipelines>
    <!-- News Portal2 Demo Pipelines. Structure like forrest seed. -->
  		
    <map:pipeline>	
  
      <map:match pattern="images/*.gif">
          <map:read mime-type="image/gif" src="content/resources/images/{1}.gif"/>
      </map:match>
      <map:match pattern="images/*.jpg">
          <map:read mime-type="image/jpg" src="content/resources/images/{1}.jpg"/>
      </map:match>
      <map:match pattern="*.html">
          <map:generate type="file" src="content/xdocs/{1}.xml" label="content" />
          <map:transform type="xslt" src="content/resources/xsl/document2html.xsl"/>
          <map:serialize type="html"/>
      </map:match>
      <map:match pattern="*.rss">
          <map:generate type="file" src="content/rss/{1}.xml" label="content" />
          <map:transform type="xslt" src="content/resources/xsl/rss2html_news.xsl"/>
          <map:serialize type="xml"/>
      </map:match>
  
    </map:pipeline>
  
  
   </map:pipelines>
  
  </map:sitemap>
  
  <!-- end of file -->
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/components/persistance/ConverterException.java
  
  Index: ConverterException.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  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.persistance;
  
  import org.apache.avalon.framework.CascadingException;
  
  /**
   *
   * @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: ConverterException.java,v 1.1 2003/05/07 06:22:30 cziegeler Exp $
   */
  public class ConverterException extends CascadingException {
  
      public ConverterException(String message) {
          super(message);
      }
  
      public ConverterException(String message, Throwable throwable) {
          super(message, throwable);
      }
  }
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/components/persistance/CastorSourceConverter.java
  
  Index: CastorSourceConverter.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  <st...@apache.org>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.components.persistance;
  
  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;
  import org.apache.avalon.framework.component.Composable;
  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.components.source.SourceUtil;
  import org.apache.excalibur.source.Source;
  import org.apache.excalibur.source.SourceResolver;
  import org.exolab.castor.mapping.Mapping;
  import org.exolab.castor.mapping.MappingException;
  import org.exolab.castor.xml.UnmarshalHandler;
  import org.exolab.castor.xml.Unmarshaller;
  
  /**
   *
   * @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: CastorSourceConverter.java,v 1.1 2003/05/07 06:22:30 cziegeler Exp $
   */
  public class CastorSourceConverter
      extends AbstractLogEnabled
      implements Component, Composable, Configurable, Initializable, ThreadSafe {
          
      public static final String ROLE = CastorSourceConverter.class.getName();
  
      private String mappingSource;
      private ComponentManager manager;
      private Mapping mapping;
  
      public Object getObject(Source source) throws ConverterException {
          try {
              Unmarshaller unmarshaller = new Unmarshaller(mapping);
              UnmarshalHandler handler = unmarshaller.createHandler();
  
              SourceUtil.toSAX(source, Unmarshaller.getContentHandler(handler));
              return handler.getObject();
          } catch (MappingException e) {
              throw new ConverterException("can't create Unmarshaller", e);
          } catch (Exception e) {
              throw new ConverterException(e.getMessage(), e);
          }
      }
  
      /* (non-Javadoc)
       * @see org.apache.avalon.framework.component.Composable#compose(org.apache.avalon.framework.component.ComponentManager)
       */
      public void compose(ComponentManager manager) throws ComponentException {
          this.manager = manager;
      }
  
      /* (non-Javadoc)
       * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
       */
      public void configure(Configuration config) throws ConfigurationException {
          mappingSource = config.getChild("mapping-source").getValue();
      }
  
      /* (non-Javadoc)
       * @see org.apache.avalon.framework.activity.Initializable#initialize()
       */
      public void initialize() throws Exception {
          SourceResolver resolver = (SourceResolver) manager.lookup(SourceResolver.ROLE);
          Source source = null;
          try {
              source = resolver.resolveURI(mappingSource);
              mapping = new Mapping();
              mapping.loadMapping(SourceUtil.getInputSource(source));
          } finally {
              if (source != null) {
                  resolver.release(source);
              }
              manager.release(resolver);
          }
      }
  }
  
  
  
  1.12      +1 -0      cocoon-2.1/blocks.properties
  
  Index: blocks.properties
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/blocks.properties,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- blocks.properties	6 May 2003 08:49:59 -0000	1.11
  +++ blocks.properties	7 May 2003 06:22:30 -0000	1.12
  @@ -60,5 +60,6 @@
   #exclude.block.precept=true
   #exclude.block.mail=true
   #exclude.block.axis=true
  +#exclude.block.portal=true
   #exclude.block.woody=true
   #exclude.block.qdox=true
  
  
  
  1.1                  cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/aspect/impl/AbstractAspectalizable.java
  
  Index: AbstractAspectalizable.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.aspect.impl;
  
  import org.apache.cocoon.portal.aspect.Aspectalizable;
  
  /**
   *
   * @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: AbstractAspectalizable.java,v 1.1 2003/05/07 06:22:30 cziegeler Exp $
   */
  public abstract class AbstractAspectalizable 
      implements Aspectalizable {
  
  
  }