cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon cocoon.roles
Date Fri, 05 Sep 2003 11:40:42 GMT
cziegeler    2003/09/05 04:40:42

  Modified:    src/java/org/apache/cocoon/sitemap SitemapRedirector.java
                        LinkGatherer.java NotifyingGenerator.java
                        SitemapModelComponent.java LinkTranslator.java
                        SitemapOutputComponent.java ContentAggregator.java
               src/java/org/apache/cocoon cocoon.roles
  Removed:     src/java/org/apache/cocoon/sitemap Sitemap.java
                        DefaultSitemapComponentSelector.java
  Log:
  Code cleanup and remove some leftovers from the 2.0.x era
  
  Revision  Changes    Path
  1.2       +2 -1      cocoon-2.1/src/java/org/apache/cocoon/sitemap/SitemapRedirector.java
  
  Index: SitemapRedirector.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/sitemap/SitemapRedirector.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SitemapRedirector.java	9 Mar 2003 00:09:38 -0000	1.1
  +++ SitemapRedirector.java	5 Sep 2003 11:40:41 -0000	1.2
  @@ -80,6 +80,7 @@
           e.redirect(sessionMode, url);
           this.hasRedirected = true;
       }
  +    
       public void globalRedirect(boolean sessionMode, String url) throws IOException {
           if (e instanceof EnvironmentWrapper) {
             ((EnvironmentWrapper)e).globalRedirect(sessionMode,url);
  
  
  
  1.5       +1 -2      cocoon-2.1/src/java/org/apache/cocoon/sitemap/LinkGatherer.java
  
  Index: LinkGatherer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/sitemap/LinkGatherer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LinkGatherer.java	30 Aug 2003 09:51:59 -0000	1.4
  +++ LinkGatherer.java	5 Sep 2003 11:40:41 -0000	1.5
  @@ -59,7 +59,6 @@
   import org.apache.cocoon.xml.xlink.ExtendedXLinkPipe;
   
   import org.apache.excalibur.source.SourceValidity;
  -import org.apache.excalibur.source.impl.validity.NOPValidity;
   
   import org.xml.sax.Attributes;
   import org.xml.sax.SAXException;
  
  
  
  1.2       +35 -36    cocoon-2.1/src/java/org/apache/cocoon/sitemap/NotifyingGenerator.java
  
  Index: NotifyingGenerator.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/sitemap/NotifyingGenerator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NotifyingGenerator.java	9 Mar 2003 00:09:38 -0000	1.1
  +++ NotifyingGenerator.java	5 Sep 2003 11:40:41 -0000	1.2
  @@ -53,11 +53,10 @@
   import java.util.Map;
   import java.io.IOException;
   
  -import org.apache.avalon.excalibur.pool.Recyclable;
   import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.cocoon.components.notification.Notifying;
   import org.apache.cocoon.components.notification.Notifier;
  -import org.apache.cocoon.generation.ComposerGenerator;
  +import org.apache.cocoon.generation.AbstractGenerator;
   import org.apache.cocoon.environment.SourceResolver;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.Constants;
  @@ -72,41 +71,41 @@
    * @author <a href="mailto:proyal@managingpartners.com">Peter Royal</a>
    * @version CVS $Id$
    */
  -public class NotifyingGenerator extends ComposerGenerator implements Recyclable {
  -  /**
  -   * The <code>Notification</code> to report.
  -   */
  -  private Notifying notification = null;
  -
  -  public void setup(SourceResolver resolver, Map objectModel, String src,
  -          Parameters par) throws ProcessingException, SAXException, IOException {
  -    super.setup(resolver, objectModel, src, par);
  -
  -    notification  = (Notifying)objectModel.get(Constants.NOTIFYING_OBJECT);
  -
  -    if ( notification  == null) {
  -      throw new ProcessingException("Expected Constants.NOTIFYING_OBJECT not found in object
model");
  +public class NotifyingGenerator extends AbstractGenerator {
  +    
  +    /**
  +     * The <code>Notification</code> to report.
  +     */
  +    private Notifying notification;
  +
  +    public void setup(SourceResolver resolver, Map objectModel, String src,
  +                      Parameters par) throws ProcessingException, SAXException, IOException
{
  +        super.setup(resolver, objectModel, src, par);
  +
  +        this.notification  = (Notifying)objectModel.get(Constants.NOTIFYING_OBJECT);
  +
  +        if ( this.notification  == null) {
  +            throw new ProcessingException("Expected Constants.NOTIFYING_OBJECT not found
in object model");
  +        }
       }
   
  -  }
  +    /**
  +     * Generate the notification information in XML format.
  +     *
  +     * @exception  SAXException  Description of problem there is creating the output SAX
events.
  +     * @throws SAXException when there is a problem creating the
  +     *      output SAX events.
  +     */
  +    public void generate() throws SAXException {
  +        Notifier.notify(notification, this.contentHandler, "text/xml");
  +    }
   
  -  /**
  -   * Generate the notification information in XML format.
  -   *
  -   * @exception  SAXException  Description of problem there is creating the output SAX
events.
  -   * @throws SAXException when there is a problem creating the
  -   *      output SAX events.
  -   */
  -  public void generate() throws SAXException {
  -    Notifier.notify(notification, this.contentHandler, "text/xml");
  -  }
  -
  -  /**
  -   * Recycle
  -   */
  -  public void recycle() {
  -    super.recycle();
  -    this.notification = null;
  -  }
  +    /**
  +     * Recycle
  +     */
  +    public void recycle() {
  +        super.recycle();
  +        this.notification = null;
  +    }
   }
   
  
  
  
  1.2       +7 -4      cocoon-2.1/src/java/org/apache/cocoon/sitemap/SitemapModelComponent.java
  
  Index: SitemapModelComponent.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/sitemap/SitemapModelComponent.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SitemapModelComponent.java	9 Mar 2003 00:09:38 -0000	1.1
  +++ SitemapModelComponent.java	5 Sep 2003 11:40:41 -0000	1.2
  @@ -60,7 +60,10 @@
   import java.util.Map;
   
   /**
  - *
  + * This interface marks a component as a sitemap component that is used
  + * in the processing phase, like a generator, a transformer, a serializer
  + * or a reader.
  + * 
    * @author <a href="mailto:pier@apache.org">Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation)
    * @version CVS $Id$
  @@ -70,6 +73,6 @@
        * Set the <code>SourceResolver</code>, objectModel <code>Map</code>,
        * the source and sitemap <code>Parameters</code> used to process the request.
        */
  -    void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws
ProcessingException,
  -        SAXException, IOException;
  +    void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) 
  +    throws ProcessingException, SAXException, IOException;
   }
  
  
  
  1.3       +17 -12    cocoon-2.1/src/java/org/apache/cocoon/sitemap/LinkTranslator.java
  
  Index: LinkTranslator.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/sitemap/LinkTranslator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LinkTranslator.java	17 Aug 2003 13:43:00 -0000	1.2
  +++ LinkTranslator.java	5 Sep 2003 11:40:41 -0000	1.3
  @@ -71,15 +71,16 @@
    * @version CVS $Id$
    */
   public class LinkTranslator extends ExtendedXLinkPipe implements Transformer, CacheableProcessingComponent
{
  +    
       private Map links;
   
       /**
        * Set the <code>SourceResolver</code>, objectModel <code>Map</code>,
        * the source and sitemap <code>Parameters</code> used to process the request.
        */
  -    public void setup(SourceResolver resolver, Map objectModel, String src, Parameters
par) throws ProcessingException,
  -        SAXException, IOException {
  -            this.links = (Map)objectModel.get(Constants.LINK_OBJECT);
  +    public void setup(SourceResolver resolver, Map objectModel, String src, Parameters
par) 
  +    throws ProcessingException, SAXException, IOException {
  +        this.links = (Map)objectModel.get(Constants.LINK_OBJECT);
       }
   
       /**
  @@ -102,15 +103,19 @@
           return NOPValidity.SHARED_INSTANCE;
       }
   
  -    public void simpleLink(String href, String role, String arcrole, String title, String
show, String actuate, String uri,
  -        String name, String raw, Attributes attr) throws SAXException {
  -            String newHref = (String)this.links.get(href);
  -            super.simpleLink((newHref != null) ? newHref : href, role, arcrole, title,
show, actuate, uri, name, raw, attr);
  +    public void simpleLink(String href, String role, String arcrole, 
  +                           String title, String show, String actuate, String uri,
  +                           String name, String raw, Attributes attr) 
  +    throws SAXException {
  +        final String newHref = (String)this.links.get(href);
  +        super.simpleLink((newHref != null) ? newHref : href, role, arcrole, title, show,
actuate, uri, name, raw, attr);
       }
   
  -    public void startLocator(String href, String role, String title, String label, String
uri, String name, String raw,
  -        Attributes attr) throws SAXException {
  -            String newHref = (String)this.links.get(href);
  -            super.startLocator((newHref != null) ? newHref : href, role, title, label,
uri, name, raw, attr);
  +    public void startLocator(String href, String role, String title, 
  +                             String label, String uri, String name, String raw,
  +                             Attributes attr) 
  +    throws SAXException {
  +        final String newHref = (String)this.links.get(href);
  +        super.startLocator((newHref != null) ? newHref : href, role, title, label, uri,
name, raw, attr);
       }
   }
  
  
  
  1.2       +4 -2      cocoon-2.1/src/java/org/apache/cocoon/sitemap/SitemapOutputComponent.java
  
  Index: SitemapOutputComponent.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/sitemap/SitemapOutputComponent.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SitemapOutputComponent.java	9 Mar 2003 00:09:38 -0000	1.1
  +++ SitemapOutputComponent.java	5 Sep 2003 11:40:41 -0000	1.2
  @@ -56,7 +56,9 @@
   import java.io.OutputStream;
   
   /**
  - *
  + * This interface marks a component as a sitemap component that produces
  + * a response, like a serializer or a reader.
  + * 
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
    * @version CVS $Id$
  
  
  
  1.4       +8 -9      cocoon-2.1/src/java/org/apache/cocoon/sitemap/ContentAggregator.java
  
  Index: ContentAggregator.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/sitemap/ContentAggregator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ContentAggregator.java	16 May 2003 07:04:56 -0000	1.3
  +++ ContentAggregator.java	5 Sep 2003 11:40:41 -0000	1.4
  @@ -50,11 +50,10 @@
   */
   package org.apache.cocoon.sitemap;
   
  -import org.apache.avalon.excalibur.pool.Recyclable;
  -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.parameters.Parameters;
  +import org.apache.avalon.framework.service.ServiceException;
  +import org.apache.avalon.framework.service.ServiceManager;
  +import org.apache.avalon.framework.service.Serviceable;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.caching.CacheableProcessingComponent;
   import org.apache.cocoon.components.source.SourceUtil;
  @@ -85,7 +84,7 @@
    */
   public class ContentAggregator
   extends ContentHandlerWrapper
  -implements Generator, CacheableProcessingComponent, Composable, Recyclable {
  +implements Generator, CacheableProcessingComponent, Serviceable {
   
       /** the root element of the aggregated content */
       protected Element rootElement;
  @@ -106,7 +105,7 @@
       protected SourceResolver resolver;
   
       /** The component manager */
  -    protected ComponentManager manager;
  +    protected ServiceManager manager;
       
       /** This object holds the part parts :) */
       protected final class Part {
  @@ -399,9 +398,9 @@
       }
       
       /* (non-Javadoc)
  -     * @see org.apache.avalon.framework.component.Composable#compose(org.apache.avalon.framework.component.ComponentManager)
  +     * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
        */
  -    public void compose(ComponentManager manager) throws ComponentException {
  +    public void service(ServiceManager manager) throws ServiceException {
           this.manager = manager;
       }
   
  
  
  
  1.10      +0 -33     cocoon-2.1/src/java/org/apache/cocoon/cocoon.roles
  
  Index: cocoon.roles
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/cocoon.roles,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- cocoon.roles	1 Sep 2003 14:45:08 -0000	1.9
  +++ cocoon.roles	5 Sep 2003 11:40:42 -0000	1.10
  @@ -144,39 +144,6 @@
           shorthand="cache"
           default-class="org.apache.cocoon.caching.impl.CacheImpl"/>
   
  -  <!-- Sitemap Roles -->
  -  <role name="org.apache.cocoon.acting.ActionSelector"
  -        shorthand="actions"
  -        default-class="org.apache.cocoon.sitemap.DefaultSitemapComponentSelector"/>
  -
  -  <role name="org.apache.cocoon.selection.SelectorSelector"
  -        shorthand="selectors"
  -        default-class="org.apache.cocoon.sitemap.DefaultSitemapComponentSelector"/>
  -
  -  <role name="org.apache.cocoon.matching.MatcherSelector"
  -        shorthand="matchers"
  -        default-class="org.apache.cocoon.sitemap.DefaultSitemapComponentSelector"/>
  -
  -  <role name="org.apache.cocoon.generation.GeneratorSelector"
  -        shorthand="generators"
  -        default-class="org.apache.cocoon.sitemap.DefaultSitemapComponentSelector"/>
  -
  -  <role name="org.apache.cocoon.transformation.TransformerSelector"
  -        shorthand="transformers"
  -        default-class="org.apache.cocoon.sitemap.DefaultSitemapComponentSelector"/>
  -
  -  <role name="org.apache.cocoon.serialization.SerializerSelector"
  -        shorthand="serializers"
  -        default-class="org.apache.cocoon.sitemap.DefaultSitemapComponentSelector"/>
  -
  -  <role name="org.apache.cocoon.reading.ReaderSelector"
  -        shorthand="readers"
  -        default-class="org.apache.cocoon.sitemap.DefaultSitemapComponentSelector"/>
  -
  -  <role name="org.apache.cocoon.components.pipeline.ProcessingPipelineSelector"
  -        shorthand="pipelines"
  -        default-class="org.apache.cocoon.sitemap.DefaultSitemapComponentSelector"/>
  -
     <!-- i18n components for resource bundle handling -->
     <role name="org.apache.cocoon.i18n.BundleFactory"
           shorthand="i18n-bundles"
  
  
  

Mime
View raw message