cziegeler    2003/05/07 13:24:03

  Modified:    src/blocks/portal/java/org/apache/cocoon/portal/layout/impl
                        DefaultLayoutFactory.java
               src/blocks/portal/java/org/apache/cocoon/portal/aspect
                        AspectStatus.java Aspectalizable.java
               src/blocks/portal/java/org/apache/cocoon/portal/layout
                        Layout.java AbstractLayout.java
               src/blocks/portal/java/org/apache/cocoon/portal
                        LinkService.java
               
src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl
                        FrameAspect.java CIncludeCopletAspect.java
               src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl
                        RequestParameterEventAspect.java
               src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer
                        Renderer.java
               
src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect
                        RendererAspectContext.java RendererAspect.java
               src/blocks/portal/java/org/apache/cocoon/portal/impl
                        DefaultLinkService.java
  Added:       src/blocks/portal/java/org/apache/cocoon/portal/aspect
                        AspectDataHandler.java
               
src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl
                        AbstractCIncludeAspect.java
  Log:
  Updating code
  
  Revision  Changes    Path
  1.2       +3 -2      
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
  
  Index: DefaultLayoutFactory.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultLayoutFactory.java 7 May 2003 13:28:00 -0000       1.1
  +++ DefaultLayoutFactory.java 7 May 2003 20:24:02 -0000       1.2
  @@ -100,7 +100,8 @@
   
       public void prepareLayout(Layout layout) {
           if ( layout != null ) {
  -            // TODO do something here
  +            // TODO do something here 
  +            // we have to set the aspect data handler
           }
       }
   
  
  
  
  1.2       +2 -1      
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/aspect/AspectStatus.java
  
  Index: AspectStatus.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/aspect/AspectStatus.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AspectStatus.java 7 May 2003 06:22:26 -0000       1.1
  +++ AspectStatus.java 7 May 2003 20:24:02 -0000       1.2
  @@ -52,6 +52,7 @@
   
   /**
    * Marker interface for a status of an aspect
  + * TODO - remove this
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Volker Schmitt</a>
  
  
  
  1.3       +15 -2     
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/aspect/Aspectalizable.java
  
  Index: Aspectalizable.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/aspect/Aspectalizable.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Aspectalizable.java       7 May 2003 13:28:35 -0000       1.2
  +++ Aspectalizable.java       7 May 2003 20:24:02 -0000       1.3
  @@ -50,9 +50,15 @@
   */
   package org.apache.cocoon.portal.aspect;
   
  +import java.util.List;
  +
   
   /**
  - *
  + * This interface marks an object that can be used by aspects.
  + * An aspect can store any arbitrary information in an aspectalizable object.
  + * 
  + * TODO - check if this is ok
  + * 
    * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Volker Schmitt</a>
    * 
  @@ -63,4 +69,11 @@
       Object getAspectData(String aspectName);
       
       void setAspectData(String aspectName, Object data);
  +    
  +    List getAspectDatas();
  +    
  +    /**
  +     * This method is invoked once to set the handler
  +     */
  +    void setAspectDataHandler(AspectDataHandler handler);
   }
  
  
  
  1.1                  
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/aspect/AspectDataHandler.java
  
  Index: AspectDataHandler.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
      [EMAIL PROTECTED]
  
   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  <[EMAIL PROTECTED]>. For more  information on the Apache
   Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.cocoon.portal.aspect;
  
  import java.util.List;
  
  /**
   * This interface is able to get a stored aspect
   * 
   * TODO - check if this is ok
   *
   * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
   * @author <a href="mailto:[EMAIL PROTECTED]">Volker Schmitt</a>
   * 
   * @version CVS $Id: AspectDataHandler.java,v 1.1 2003/05/07 20:24:02 
cziegeler Exp $
   */
  public interface AspectDataHandler {
  
      Object getAspectData(String objectId, String aspectName);
      
      void setAspectData(String objectId, String aspectName, Object data);
  
      List getAspectDatas(String objectId);
  }
  
  
  
  1.2       +5 -2      
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/Layout.java
  
  Index: Layout.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/Layout.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Layout.java       7 May 2003 06:22:24 -0000       1.1
  +++ Layout.java       7 May 2003 20:24:02 -0000       1.2
  @@ -50,6 +50,8 @@
    */
   package org.apache.cocoon.portal.layout;
   
  +import org.apache.cocoon.portal.aspect.Aspectalizable;
  +
   
   /**
    *
  @@ -58,7 +60,8 @@
    * 
    * @version CVS $Id$
    */
  -public interface Layout extends Parameters {
  +public interface Layout 
  +    extends Parameters, Aspectalizable {
   
       /**
        * Get the name of the [EMAIL PROTECTED] Renderer} to draw this layout.
  
  
  
  1.2       +29 -2     
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/AbstractLayout.java
  
  Index: AbstractLayout.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/AbstractLayout.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractLayout.java       7 May 2003 06:22:24 -0000       1.1
  +++ AbstractLayout.java       7 May 2003 20:24:02 -0000       1.2
  @@ -50,6 +50,10 @@
   */
   package org.apache.cocoon.portal.layout;
   
  +import java.util.List;
  +
  +import org.apache.cocoon.portal.aspect.AspectDataHandler;
  +
   
   /**
    *
  @@ -58,7 +62,9 @@
    * 
    * @version CVS $Id$
    */
  -public abstract class AbstractLayout extends AbstractParameters implements 
Layout {
  +public abstract class AbstractLayout 
  +    extends AbstractParameters 
  +    implements Layout {
       
       protected String rendererName;
       
  @@ -68,6 +74,7 @@
       
       protected boolean _static;
       
  +    transient protected AspectDataHandler aspectDataHandler;
       
       /**
        * @see org.apache.cocoon.portal.layout.Layout#getRendererName()
  @@ -117,4 +124,24 @@
                this._static = value;
   
        }
  +    
  +    public Object getAspectData(String aspectName) {
  +        return this.aspectDataHandler.getAspectData(this.getId(), 
aspectName);
  +    }
  +    
  +    public void setAspectData(String aspectName, Object data) {
  +        this.aspectDataHandler.setAspectData(this.getId(), aspectName, data);
  +    }
  +    
  +    public List getAspectDatas() {
  +        return this.aspectDataHandler.getAspectDatas(this.getId());
  +    }
  +    
  +    /**
  +     * This method is invoked once to set the handler
  +     */
  +    public void setAspectDataHandler(AspectDataHandler handler) {
  +        this.aspectDataHandler = handler;
  +    }
  +    
   }
  
  
  
  1.2       +3 -1      
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/LinkService.java
  
  Index: LinkService.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/LinkService.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LinkService.java  7 May 2003 06:22:28 -0000       1.1
  +++ LinkService.java  7 May 2003 20:24:02 -0000       1.2
  @@ -66,6 +66,8 @@
   
       String ROLE = LinkService.class.getName();
       
  +    String DEFAULT_REQUEST_EVENT_PARAMETER_NAME = "cocoon-portal-event";
  +    
       String getLinkURI(Event event);
   
       String getLinkURI(List events);
  
  
  
  1.2       +4 -26     
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/FrameAspect.java
  
  Index: FrameAspect.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/FrameAspect.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FrameAspect.java  7 May 2003 06:22:22 -0000       1.1
  +++ FrameAspect.java  7 May 2003 20:24:02 -0000       1.2
  @@ -56,8 +56,6 @@
   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;
   
  @@ -68,14 +66,7 @@
    * 
    * @version CVS $Id$
    */
  -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 class FrameAspect extends AbstractCIncludeAspect {
   
       public void toSAX(RendererAspectContext context, Layout layout, 
PortalService service, ContentHandler handler)
           throws SAXException {
  @@ -90,20 +81,7 @@
           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);
  +        
  +        this.createCInclude(source, handler);
       }
   }
  
  
  
  1.2       +4 -16     
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CIncludeCopletAspect.java
  
  Index: CIncludeCopletAspect.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CIncludeCopletAspect.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CIncludeCopletAspect.java 7 May 2003 06:22:22 -0000       1.1
  +++ CIncludeCopletAspect.java 7 May 2003 20:24:02 -0000       1.2
  @@ -55,8 +55,6 @@
   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;
  @@ -70,13 +68,8 @@
    * 
    * @version CVS $Id$
    */
  -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; 
  +public class CIncludeCopletAspect 
  +    extends AbstractCIncludeAspect {
   
       /* (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)
  @@ -91,12 +84,7 @@
           
           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);
  +        this.createCInclude("coplet://" + cid.getCopletId(), handler);
   
           XMLUtils.endElement(handler, "content");
           
  
  
  
  1.1                  
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCIncludeAspect.java
  
  Index: AbstractCIncludeAspect.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
      [EMAIL PROTECTED]
  
   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  <[EMAIL PROTECTED]>. 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.transformation.CIncludeTransformer;
  import org.apache.cocoon.xml.AttributesImpl;
  import org.xml.sax.ContentHandler;
  import org.xml.sax.SAXException;
  
  /**
   *
   * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
   * @author <a href="mailto:[EMAIL PROTECTED]">Volker Schmitt</a>
   * 
   * @version CVS $Id: AbstractCIncludeAspect.java,v 1.1 2003/05/07 20:24:02 
cziegeler Exp $
   */
  public abstract class AbstractCIncludeAspect 
      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; 
  
      /**
       * Create the cinclude statement
       */
      protected void createCInclude(String source, ContentHandler handler)
      throws SAXException {
          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.2       +3 -2      
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/RequestParameterEventAspect.java
  
  Index: RequestParameterEventAspect.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/event/aspect/impl/RequestParameterEventAspect.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RequestParameterEventAspect.java  7 May 2003 06:22:27 -0000       1.1
  +++ RequestParameterEventAspect.java  7 May 2003 20:24:03 -0000       1.2
  @@ -55,6 +55,7 @@
   import org.apache.avalon.framework.thread.ThreadSafe;
   import org.apache.cocoon.environment.ObjectModelHelper;
   import org.apache.cocoon.environment.Request;
  +import org.apache.cocoon.portal.LinkService;
   import org.apache.cocoon.portal.PortalService;
   import org.apache.cocoon.portal.event.Event;
   import org.apache.cocoon.portal.event.Publisher;
  @@ -78,7 +79,7 @@
        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 String requestParameterName = 
config.getParameter("parameter-name", 
LinkService.DEFAULT_REQUEST_EVENT_PARAMETER_NAME);
           final Request request = ObjectModelHelper.getRequest( 
context.getObjectModel() );
           String[] values = request.getParameterValues( requestParameterName );
           if ( values != null ) {
  
  
  
  1.2       +3 -2      
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/Renderer.java
  
  Index: Renderer.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/Renderer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Renderer.java     7 May 2003 06:22:28 -0000       1.1
  +++ Renderer.java     7 May 2003 20:24:03 -0000       1.2
  @@ -57,7 +57,8 @@
   import org.xml.sax.SAXException;
   
   /**
  - *
  + * A renderer is responsible for rendering a layout object.
  + * 
    * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Volker Schmitt</a>
    * 
  
  
  
  1.2       +4 -1      
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/RendererAspectContext.java
  
  Index: RendererAspectContext.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/RendererAspectContext.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RendererAspectContext.java        7 May 2003 06:22:28 -0000       1.1
  +++ RendererAspectContext.java        7 May 2003 20:24:03 -0000       1.2
  @@ -57,6 +57,9 @@
   import org.xml.sax.SAXException;
   
   /**
  + * The renderer aspect context is passed to every renderer aspect.
  + * Using this context, a renderer aspect can get it's configuration
  + * and it can invoke (if wanted) the next aspect in the aspect chain.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Volker Schmitt</a>
  
  
  
  1.2       +3 -2      
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/RendererAspect.java
  
  Index: RendererAspect.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/layout/renderer/aspect/RendererAspect.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RendererAspect.java       7 May 2003 06:22:28 -0000       1.1
  +++ RendererAspect.java       7 May 2003 20:24:03 -0000       1.2
  @@ -57,7 +57,8 @@
   import org.xml.sax.SAXException;
   
   /**
  - *
  + * A renderer aspect extends a renderer with a distinct functionality
  + * 
    * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Volker Schmitt</a>
    * 
  
  
  
  1.2       +4 -6      
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/impl/DefaultLinkService.java
  
  Index: DefaultLinkService.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/impl/DefaultLinkService.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultLinkService.java   7 May 2003 06:22:26 -0000       1.1
  +++ DefaultLinkService.java   7 May 2003 20:24:03 -0000       1.2
  @@ -79,8 +79,6 @@
       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();
  @@ -118,7 +116,7 @@
                           buffer.append('?');
                       }
                       hasParams = true;
  -                    String parameterName = REQUEST_EVENT_PARAMETER_NAME;
  +                    String parameterName = 
DEFAULT_REQUEST_EVENT_PARAMETER_NAME;
                       if (ce instanceof RequestEvent) {
                           parameterName = 
((RequestEvent)ce).getRequestParameterName();
                       }
  @@ -135,7 +133,7 @@
           } else {
               buffer.append('?');
           }
  -        String parameterName = REQUEST_EVENT_PARAMETER_NAME;
  +        String parameterName = DEFAULT_REQUEST_EVENT_PARAMETER_NAME;
           if (event instanceof RequestEvent) {
               parameterName = ((RequestEvent)event).getRequestParameterName();
           }
  @@ -160,7 +158,7 @@
                   buffer.append('?');
               }
               hasPars = true;
  -            String parameterName = REQUEST_EVENT_PARAMETER_NAME;
  +            String parameterName = DEFAULT_REQUEST_EVENT_PARAMETER_NAME;
               if (current instanceof RequestEvent) {
                   parameterName = 
((RequestEvent)current).getRequestParameterName();
               }
  
  
  

Reply via email to