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/sitemap ContentAggregator.java
Date Fri, 16 May 2003 07:04:57 GMT
cziegeler    2003/05/16 00:04:56

  Modified:    src/java/org/apache/cocoon/generation FileGenerator.java
               src/java/org/apache/cocoon/components/language/markup/xsp
                        XSPUtil.java XSPFormValidatorHelper.java
               src/java/org/apache/cocoon/environment
                        AbstractEnvironment.java SourceResolver.java
               src/java/org/apache/cocoon/components/source SourceUtil.java
               src/java/org/apache/cocoon/environment/wrapper
                        EnvironmentWrapper.java
               src/java/org/apache/cocoon/transformation
                        CIncludeTransformer.java
               src/java/org/apache/cocoon/environment/commandline
                        AbstractCommandLineEnvironment.java
               src/java/org/apache/cocoon/acting
                        AbstractComplementaryConfigurableAction.java
               src/java/org/apache/cocoon Cocoon.java
               src/java/org/apache/cocoon/components/source/impl
                        SitemapSource.java
               src/java/org/apache/cocoon/environment/http
                        HttpEnvironment.java
               src/java/org/apache/cocoon/sitemap ContentAggregator.java
  Log:
  Start removing automatic conversion
  
  Revision  Changes    Path
  1.3       +3 -2      cocoon-2.1/src/java/org/apache/cocoon/generation/FileGenerator.java
  
  Index: FileGenerator.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/generation/FileGenerator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FileGenerator.java	19 Mar 2003 15:42:13 -0000	1.2
  +++ FileGenerator.java	16 May 2003 07:04:54 -0000	1.3
  @@ -137,7 +137,8 @@
                   this.getLogger().debug("processing file " + super.source);
                   this.getLogger().debug("file resolved to " + this.inputSource.getURI());
               }
  -            this.resolver.toSAX(this.inputSource, super.xmlConsumer);
  +            SourceUtil.parse( this.manager, this.inputSource, super.xmlConsumer);
  +
           } catch (SAXException e) {
               final Exception cause = e.getException();
               if( cause != null ) {
  
  
  
  1.4       +3 -2      cocoon-2.1/src/java/org/apache/cocoon/components/language/markup/xsp/XSPUtil.java
  
  Index: XSPUtil.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/language/markup/xsp/XSPUtil.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XSPUtil.java	11 Mar 2003 03:00:19 -0000	1.3
  +++ XSPUtil.java	16 May 2003 07:04:55 -0000	1.4
  @@ -53,6 +53,7 @@
   import org.apache.avalon.framework.CascadingRuntimeException;
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.ComponentManager;
  +import org.apache.cocoon.components.source.SourceUtil;
   import org.apache.cocoon.environment.Context;
   import org.apache.cocoon.environment.ObjectModelHelper;
   import org.apache.cocoon.environment.Session;
  @@ -297,7 +298,7 @@
           Source source = null;
           try {
               source = resolver.resolveURI(uri, base, null);
  -            resolver.toSAX(source, new IncludeXMLConsumer(contentHandler));
  +            SourceUtil.toSAX(source, new IncludeXMLConsumer(contentHandler));
           } catch (Exception e) {
               throw new CascadingRuntimeException("Error including source " + base + " "
+ uri, e);
           } finally {
  
  
  
  1.2       +3 -2      cocoon-2.1/src/java/org/apache/cocoon/components/language/markup/xsp/XSPFormValidatorHelper.java
  
  Index: XSPFormValidatorHelper.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/language/markup/xsp/XSPFormValidatorHelper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XSPFormValidatorHelper.java	9 Mar 2003 00:08:55 -0000	1.1
  +++ XSPFormValidatorHelper.java	16 May 2003 07:04:55 -0000	1.2
  @@ -58,6 +58,7 @@
   import org.apache.cocoon.Constants;
   import org.apache.cocoon.acting.ConfigurationHelper;
   import org.apache.cocoon.acting.ValidatorActionResult;
  +import org.apache.cocoon.components.source.SourceUtil;
   import org.apache.cocoon.environment.ObjectModelHelper;
   import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.environment.SourceResolver;
  @@ -408,7 +409,7 @@
                       }
   
                       SAXConfigurationHandler builder = new SAXConfigurationHandler();
  -                    resolver.toSAX(source, builder);
  +                    SourceUtil.toSAX(source, builder);
   
                       conf.lastModified = source.getLastModified();
                       conf.configuration = builder.getConfiguration();
  
  
  
  1.12      +1 -67     cocoon-2.1/src/java/org/apache/cocoon/environment/AbstractEnvironment.java
  
  Index: AbstractEnvironment.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/environment/AbstractEnvironment.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- AbstractEnvironment.java	12 May 2003 13:26:17 -0000	1.11
  +++ AbstractEnvironment.java	16 May 2003 07:04:55 -0000	1.12
  @@ -60,7 +60,6 @@
   import java.util.Map;
   
   import org.apache.avalon.framework.CascadingRuntimeException;
  -import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  @@ -71,9 +70,6 @@
   import org.apache.cocoon.util.ClassUtils;
   import org.apache.commons.collections.iterators.IteratorEnumeration;
   import org.apache.excalibur.source.SourceException;
  -import org.apache.excalibur.xml.sax.XMLizable;
  -import org.apache.excalibur.xmlizer.XMLizer;
  -import org.xml.sax.ContentHandler;
   import org.xml.sax.SAXException;
   
   /**
  @@ -113,9 +109,6 @@
       /** The real source resolver */
       protected org.apache.excalibur.source.SourceResolver sourceResolver;
   
  -    /** The real xmlizer */
  -    protected org.apache.excalibur.xmlizer.XMLizer xmlizer;
  -
       /** The component manager */
       protected ComponentManager manager;
   
  @@ -518,62 +511,6 @@
       }
   
       /**
  -     * Generates SAX events from the given source
  -     * <b>NOTE</b> : if the implementation can produce lexical events, care
should be taken
  -     * that <code>handler</code> can actually
  -     * directly implement the LexicalHandler interface!
  -     * @param  source    the data
  -     * @throws ProcessingException if no suitable converter is found
  -     */
  -    public void toSAX( org.apache.excalibur.source.Source source,
  -                       ContentHandler handler )
  -    throws SAXException, IOException, ProcessingException {
  -        this.toSAX( source, null, handler);
  -    }
  -
  -    public void toSAX( org.apache.excalibur.source.Source source,
  -                String         mimeTypeHint,
  -                ContentHandler handler )
  -    throws SAXException, IOException, ProcessingException {
  -        if ( !this.initializedComponents) {
  -            this.initComponents();
  -        }
  -        String mimeType = source.getMimeType();
  -        if (null == mimeType) {
  -            mimeType = mimeTypeHint;
  -        }
  -
  -        try {
  -            if (source instanceof XMLizable) {
  -                ((XMLizable)source).toSAX( handler );
  -            } else {
  -                try {
  -                    xmlizer.toSAX( source.getInputStream(),
  -                                   mimeType,
  -                                   source.getURI(),
  -                                   handler );
  -                } catch (SourceException se) {
  -                    throw SourceUtil.handle(se);
  -                }
  -            }
  -        } catch (SAXException e) {
  -            final Exception cause = e.getException();
  -            if (cause != null) {
  -                if (cause instanceof ProcessingException) {
  -                    throw (ProcessingException)cause;
  -                }
  -                if (cause instanceof IOException) {
  -                    throw (IOException)cause;
  -                }
  -                if (cause instanceof SAXException) {
  -                    throw (SAXException)cause;
  -                }
  -            }
  -            throw e;
  -        }
  -    }
  -
  -    /**
        * Initialize the components for the environment
        * This gets the source resolver and the xmlizer component
        */
  @@ -581,7 +518,6 @@
           this.initializedComponents = true;
           try {
               this.manager = CocoonComponentManager.getSitemapComponentManager();
  -            this.xmlizer = (XMLizer)this.manager.lookup(XMLizer.ROLE);
               this.sourceResolver = (org.apache.excalibur.source.SourceResolver)this.manager.lookup(org.apache.excalibur.source.SourceResolver.ROLE);
   			if (this.tempInitContext != null) {
   				org.apache.excalibur.source.Source source = null;
  @@ -617,10 +553,8 @@
   	 */
   	public void finishingProcessing() {
   		if ( null != this.manager ) {
  -			this.manager.release( (Component)this.xmlizer );
   			this.manager.release( this.sourceResolver );
   			this.manager = null;
  -			this.xmlizer = null;
   			this.sourceResolver = null;
   		}
           this.initializedComponents = false;
  
  
  
  1.2       +3 -32     cocoon-2.1/src/java/org/apache/cocoon/environment/SourceResolver.java
  
  Index: SourceResolver.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/environment/SourceResolver.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SourceResolver.java	9 Mar 2003 00:09:28 -0000	1.1
  +++ SourceResolver.java	16 May 2003 07:04:55 -0000	1.2
  @@ -50,18 +50,16 @@
   */
   package org.apache.cocoon.environment;
   
  +import java.io.IOException;
  +
   import org.apache.cocoon.ProcessingException;
  -import org.xml.sax.ContentHandler;
   import org.xml.sax.SAXException;
  -import java.io.IOException;
   
   /**
    * Base interface for resolving a source by system identifiers. This 
    * component is a special extension of the Avalon Excalibur 
    * {@link org.apache.excalibur.source.SourceResolver} that is only
    * used for Cocoon sitemap components.
  - * It extends the source resolver with simple to use source to SAX
  - * conversion methods.
    *
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
    * @version CVS $Id$
  @@ -79,32 +77,5 @@
       Source resolve(String systemID)
       throws ProcessingException, SAXException, IOException;
   
  -    /**
  -     * Generates SAX events from the given source
  -     * <b>NOTE</b> : if the implementation can produce lexical events, care
should be taken
  -     * that <code>handler</code> can actually
  -     * directly implement the LexicalHandler interface!
  -     * @param  source    the data
  -     * @throws ProcessingException if no suitable converter is found
  -     */
  -    void toSAX( org.apache.excalibur.source.Source source,
  -                ContentHandler handler )
  -    throws SAXException, IOException, ProcessingException;
  -
  -
  -    /**
  -     * Generates SAX events from the given source
  -     * <b>NOTE</b> : if the implementation can produce lexical events, care
should be taken
  -     * that <code>handler</code> can actually
  -     * directly implement the LexicalHandler interface!
  -     * @param  source       the data
  -     * @param  mimeTypeHint A hint for the mime-type, if the source does not
  -     *                       provide  one
  -     * @throws ProcessingException if no suitable converter is found
  -     */
  -    void toSAX( org.apache.excalibur.source.Source source,
  -                String         mimeTypeHint,
  -                ContentHandler handler )
  -    throws SAXException, IOException, ProcessingException;
   }
   
  
  
  
  1.6       +32 -2     cocoon-2.1/src/java/org/apache/cocoon/components/source/SourceUtil.java
  
  Index: SourceUtil.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/source/SourceUtil.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SourceUtil.java	9 Apr 2003 12:17:20 -0000	1.5
  +++ SourceUtil.java	16 May 2003 07:04:55 -0000	1.6
  @@ -75,6 +75,7 @@
   import org.apache.excalibur.source.SourceNotFoundException;
   import org.apache.excalibur.source.SourceParameters;
   import org.apache.excalibur.source.SourceResolver;
  +import org.apache.excalibur.xml.sax.SAXParser;
   import org.apache.excalibur.xml.sax.XMLizable;
   import org.apache.excalibur.xmlizer.XMLizer;
   import org.apache.regexp.RE;
  @@ -152,7 +153,7 @@
        */
       static public void toSAX( ComponentManager manager, Source source,
                                   String mimeTypeHint,
  -                              ContentHandler handler)
  +                                ContentHandler handler)
       throws SAXException, IOException, ProcessingException {
           if ( source instanceof XMLizable ) {
               ((XMLizable)source).toSAX( handler );
  @@ -172,6 +173,35 @@
                   throw new ProcessingException("Exception during streaming source.", ce);
               } finally {
                   manager.release( (Component)xmlizer );
  +            }
  +        }
  +    }
  +
  +    /**
  +     * Generates SAX events from the given source by parsing it.
  +     * <b>NOTE</b> : if the implementation can produce lexical events, care
should be taken
  +     * that <code>handler</code> can actually
  +     * directly implement the LexicalHandler interface!
  +     * @param  source    the data
  +     * @throws ProcessingException if no suitable converter is found
  +     */
  +    static public void parse( ComponentManager manager, 
  +                                Source source,
  +                                ContentHandler handler)
  +    throws SAXException, IOException, ProcessingException {
  +        if ( source instanceof XMLizable ) {
  +            ((XMLizable)source).toSAX( handler );
  +        } else {
  +            SAXParser parser = null;
  +            try {
  +                parser = (SAXParser) manager.lookup( SAXParser.ROLE);
  +                parser.parse( getInputSource( source ), handler );
  +            } catch (SourceException se) {
  +                throw SourceUtil.handle(se);
  +            } catch (ComponentException ce) {
  +                throw new ProcessingException("Exception during parsing source.", ce);
  +            } finally {
  +                manager.release( (Component)parser );
               }
           }
       }
  
  
  
  1.6       +1 -18     cocoon-2.1/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
  
  Index: EnvironmentWrapper.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- EnvironmentWrapper.java	7 May 2003 11:19:13 -0000	1.5
  +++ EnvironmentWrapper.java	16 May 2003 07:04:55 -0000	1.6
  @@ -59,14 +59,11 @@
   
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.logger.Logger;
  -import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.environment.AbstractEnvironment;
   import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.environment.ObjectModelHelper;
   import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.util.BufferedOutputStream;
  -import org.xml.sax.ContentHandler;
  -import org.xml.sax.SAXException;
   
   
   /**
  @@ -337,20 +334,6 @@
           this.setContext(this.lastContext);
           this.setURIPrefix(this.lastPrefix);
           this.uris = this.lastURI;
  -    }
  -
  -    /**
  -     * Generates SAX events from the given source
  -     * <b>NOTE</b> : if the implementation can produce lexical events, care
should be taken
  -     * that <code>handler</code> can actually
  -     * directly implement the LexicalHandler interface!
  -     * @param  source    the data
  -     * @throws ProcessingException if no suitable converter is found
  -     */
  -    public void toSAX( org.apache.excalibur.source.Source source,
  -                       ContentHandler handler )
  -    throws SAXException, IOException, ProcessingException {
  -        this.environment.toSAX( source, handler );
       }
   
       /**
  
  
  
  1.3       +3 -3      cocoon-2.1/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java
  
  Index: CIncludeTransformer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CIncludeTransformer.java	19 Mar 2003 15:42:14 -0000	1.2
  +++ CIncludeTransformer.java	16 May 2003 07:04:55 -0000	1.3
  @@ -546,9 +546,9 @@
                       mimeType = this.configurationParameters.getParameter("mime-type", mimeType);
                   
                   }
                   if ( this.compiling ) {
  -                    this.resolver.toSAX(source, mimeType, new IncludeXMLConsumer(this.contentHandler,
this.lexicalHandler));
  +                    SourceUtil.toSAX(source, mimeType, new IncludeXMLConsumer(this.contentHandler,
this.lexicalHandler));
                   } else {
  -                    this.resolver.toSAX(source, mimeType, this.filter);
  +                    SourceUtil.toSAX(source, mimeType, this.filter);
                   }
               }
   
  
  
  
  1.2       +3 -2      cocoon-2.1/src/java/org/apache/cocoon/environment/commandline/AbstractCommandLineEnvironment.java
  
  Index: AbstractCommandLineEnvironment.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/environment/commandline/AbstractCommandLineEnvironment.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractCommandLineEnvironment.java	9 Mar 2003 00:09:29 -0000	1.1
  +++ AbstractCommandLineEnvironment.java	16 May 2003 07:04:55 -0000	1.2
  @@ -54,6 +54,7 @@
   import org.apache.cocoon.CascadingIOException;
   import org.apache.cocoon.Constants;
   import org.apache.cocoon.ProcessingException;
  +import org.apache.cocoon.components.source.SourceUtil;
   import org.apache.cocoon.environment.AbstractEnvironment;
   import org.apache.cocoon.environment.Redirector;
   import org.apache.excalibur.source.Source;
  @@ -131,7 +132,7 @@
               Source redirectSource = null;
               try {
                   redirectSource = this.resolveURI(newURL);
  -                this.toSAX(redirectSource, ls);
  +                SourceUtil.parse( this.manager, redirectSource, ls);
               } catch (SourceException se) {
                   throw new CascadingIOException("SourceException: " + se, se);
               } catch (SAXException se) {
  
  
  
  1.2       +3 -2      cocoon-2.1/src/java/org/apache/cocoon/acting/AbstractComplementaryConfigurableAction.java
  
  Index: AbstractComplementaryConfigurableAction.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/acting/AbstractComplementaryConfigurableAction.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractComplementaryConfigurableAction.java	9 Mar 2003 00:08:38 -0000	1.1
  +++ AbstractComplementaryConfigurableAction.java	16 May 2003 07:04:56 -0000	1.2
  @@ -54,6 +54,7 @@
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.configuration.SAXConfigurationHandler;
   import org.apache.cocoon.Constants;
  +import org.apache.cocoon.components.source.SourceUtil;
   import org.apache.cocoon.environment.SourceResolver;
   import org.apache.excalibur.source.Source;
   
  @@ -122,7 +123,7 @@
                       }
   
                       SAXConfigurationHandler builder = new SAXConfigurationHandler();
  -                    resolver.toSAX(resource, builder);
  +                    SourceUtil.parse(this.manager, resource, builder);
   
                       conf.lastModified = resource.getLastModified();
                       conf.configuration = builder.getConfiguration();
  
  
  
  1.6       +1 -13     cocoon-2.1/src/java/org/apache/cocoon/Cocoon.java
  
  Index: Cocoon.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/Cocoon.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Cocoon.java	20 Mar 2003 11:45:58 -0000	1.5
  +++ Cocoon.java	16 May 2003 07:04:56 -0000	1.6
  @@ -162,12 +162,6 @@
       /** the Processor if it is ThreadSafe */
       private Processor threadSafeProcessor = null;
   
  -    /** The Source Resolver */
  -    private org.apache.excalibur.source.SourceResolver sourceResolver;
  -
  -    /** The XMLizer */
  -    private org.apache.excalibur.xmlizer.XMLizer xmlizer;
  -
       /**
        * Creates a new <code>Cocoon</code> instance.
        *
  @@ -343,8 +337,6 @@
               this.componentManager.release(processor);
           }
   
  -        this.sourceResolver = (org.apache.excalibur.source.SourceResolver)this.componentManager.lookup(org.apache.excalibur.source.SourceResolver.ROLE);
  -        this.xmlizer = (org.apache.excalibur.xmlizer.XMLizer)this.componentManager.lookup(org.apache.excalibur.xmlizer.XMLizer.ROLE);
       }
   
       /** Dump System Properties */
  @@ -502,10 +494,6 @@
        */
       public void dispose() {
           this.componentManager.release(this.threadSafeProcessor);
  -        this.componentManager.release(this.sourceResolver);
  -        this.componentManager.release((Component)this.xmlizer);
  -        this.sourceResolver = null;
  -        this.xmlizer = null;
           ContainerUtil.dispose(threads);
           this.componentManager.dispose();
           this.disposed = true;
  
  
  
  1.3       +3 -2      cocoon-2.1/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
  
  Index: SitemapSource.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SitemapSource.java	12 Mar 2003 12:55:16 -0000	1.2
  +++ SitemapSource.java	16 May 2003 07:04:56 -0000	1.3
  @@ -59,6 +59,7 @@
   import org.apache.cocoon.components.CocoonComponentManager;
   import org.apache.cocoon.components.EnvironmentStack;
   import org.apache.cocoon.components.pipeline.ProcessingPipeline;
  +import org.apache.cocoon.components.source.SourceUtil;
   import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.environment.ObjectModelHelper;
   import org.apache.cocoon.environment.wrapper.EnvironmentWrapper;
  @@ -393,7 +394,7 @@
           }
           try {
               if (this.redirectSource != null) {
  -                this.environment.toSAX(this.redirectSource, contentHandler);
  +                SourceUtil.parse(this.manager, this.redirectSource, contentHandler);
               } else {
   	            XMLConsumer consumer;
   	            if (contentHandler instanceof XMLConsumer) {
  
  
  
  1.8       +1 -16     cocoon-2.1/src/java/org/apache/cocoon/environment/http/HttpEnvironment.java
  
  Index: HttpEnvironment.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/environment/http/HttpEnvironment.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- HttpEnvironment.java	7 May 2003 20:35:43 -0000	1.7
  +++ HttpEnvironment.java	16 May 2003 07:04:56 -0000	1.8
  @@ -60,15 +60,11 @@
   import javax.servlet.http.HttpServletResponse;
   
   import org.apache.cocoon.Constants;
  -import org.apache.cocoon.ProcessingException;
  -import org.apache.cocoon.components.source.SourceUtil;
   import org.apache.cocoon.environment.AbstractEnvironment;
   import org.apache.cocoon.environment.ObjectModelHelper;
   import org.apache.cocoon.environment.Redirector;
   import org.apache.cocoon.environment.Session;
   import org.apache.cocoon.util.NetUtils;
  -import org.xml.sax.ContentHandler;
  -import org.xml.sax.SAXException;
   
   /**
    * @author ?
  @@ -297,17 +293,6 @@
       }
   
   
  -    public void toSAX( org.apache.excalibur.source.Source source,
  -                String         mimeTypeHint,
  -                ContentHandler handler )
  -    throws SAXException, IOException, ProcessingException {
  -        // Allow to retrieve the mime-type from the context.
  -        if (mimeTypeHint==null)
  -          super.toSAX(source, webcontext.getMimeType(SourceUtil.getPath(source.getURI())),
handler);
  -        else
  -          super.toSAX(source, mimeTypeHint, handler);
  -    }    
  -    
       /**
        * Get the output stream where to write the generated resource.
        * The returned stream is buffered by the environment. If the
  
  
  
  1.3       +17 -3     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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ContentAggregator.java	19 Mar 2003 15:42:15 -0000	1.2
  +++ ContentAggregator.java	16 May 2003 07:04:56 -0000	1.3
  @@ -51,6 +51,9 @@
   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.cocoon.ProcessingException;
   import org.apache.cocoon.caching.CacheableProcessingComponent;
  @@ -82,7 +85,7 @@
    */
   public class ContentAggregator
   extends ContentHandlerWrapper
  -implements Generator, CacheableProcessingComponent, Recyclable {
  +implements Generator, CacheableProcessingComponent, Composable, Recyclable {
   
       /** the root element of the aggregated content */
       protected Element rootElement;
  @@ -102,6 +105,9 @@
       /** The SourceResolver */
       protected SourceResolver resolver;
   
  +    /** The component manager */
  +    protected ComponentManager manager;
  +    
       /** This object holds the part parts :) */
       protected final class Part {
           public String uri;
  @@ -151,7 +157,7 @@
                   }
   
                   try {
  -                    this.resolver.toSAX(part.source, this);
  +                    SourceUtil.parse(this.manager, part.source, this);
                   } finally {
                       if (part.element != null) {
                           this.endElem(part.element);
  @@ -391,4 +397,12 @@
               this.contentHandler.endElement(namespaceURI, localName, raw);
           }
       }
  +    
  +    /* (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;
  +    }
  +
   }
  
  
  

Mime
View raw message