cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/xml/dom DOMBuilder.java
Date Thu, 14 Feb 2002 08:52:45 GMT
cziegeler    02/02/14 00:52:45

  Modified:    src/java/org/apache/cocoon/components/deli DeliImpl.java
               src/java/org/apache/cocoon/components/search
                        SimpleLuceneXMLIndexerImpl.java
               src/java/org/apache/cocoon/components/xscript
                        XScriptObject.java
               src/java/org/apache/cocoon/generation JspGenerator.java
                        PhpGenerator.java ScriptGenerator.java
                        StreamGenerator.java VelocityGenerator.java
               src/java/org/apache/cocoon/sitemap SitemapManager.java
               src/java/org/apache/cocoon/transformation
                        FragmentExtractorTransformer.java
                        WriteDOMSessionTransformer.java
                        XIncludeTransformer.java
               src/java/org/apache/cocoon/xml/dom DOMBuilder.java
  Added:       lib/core avalon-scratchpad-20020212.jar
  Removed:     lib/core avalon-scratchpad-20020205.jar
  Log:
  Most components now use the avalon xml parser instead of the cococon one
  
  Revision  Changes    Path
  1.1                  xml-cocoon2/lib/core/avalon-scratchpad-20020212.jar
  
  	<<Binary file>>
  
  
  1.16      +29 -30    xml-cocoon2/src/java/org/apache/cocoon/components/deli/DeliImpl.java
  
  Index: DeliImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/deli/DeliImpl.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- DeliImpl.java	5 Feb 2002 15:30:14 -0000	1.15
  +++ DeliImpl.java	14 Feb 2002 08:52:44 -0000	1.16
  @@ -55,6 +55,7 @@
   
   package org.apache.cocoon.components.deli;
   
  +import org.apache.avalon.excalibur.xml.Parser;
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.component.Component;
  @@ -71,8 +72,6 @@
   import org.apache.cocoon.environment.http.HttpContext;
   import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.Constants;
  -import org.apache.cocoon.xml.dom.DOMFactory;
  -import org.apache.cocoon.components.parser.Parser;
   
   import java.util.Vector;
   import java.util.Iterator;
  @@ -114,7 +113,7 @@
    * A Delivery Context Library for CC/PP and UAProf</a>.
    *
    * @author <a href="mailto:marbut@hplb.hpl.hp.com">Mark H. Butler</a>
  - * @version CVS $ $ $Date: 2002/02/05 15:30:14 $
  + * @version CVS $ $ $Date: 2002/02/14 08:52:44 $
    */
   
   public final class DeliImpl
  @@ -140,7 +139,7 @@
       protected ComponentManager manager = null;
   
       /** Parser used to construct the DOM tree to import the profile to a stylesheet */
  -    Parser parser;
  +    protected Parser parser;
   
       /** A context, used to retrieve the path to the configuration file */
       protected CocoonServletContext servletContext;
  @@ -149,19 +148,19 @@
       public void contextualize(Context context)
       throws ContextException {
           org.apache.cocoon.environment.Context ctx = (org.apache.cocoon.environment.Context)
context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
  -	this.servletContext = new CocoonServletContext(ctx);
  +        this.servletContext = new CocoonServletContext(ctx);
       }
   
       /** Compose this class */
  -    public void compose(ComponentManager manager) 
  +    public void compose(ComponentManager manager)
       throws ComponentException {
           this.manager = manager;
  -	try {
  -        	this.parser = (Parser)this.manager.lookup(Parser.ROLE);
  -	} catch (ComponentException e) {
  -		getLogger().error("DELI Exception while creating parser: ", e);
  -		throw e;
  -	}	
  +        try {
  +            this.parser = (Parser)this.manager.lookup(Parser.ROLE);
  +        } catch (ComponentException e) {
  +            getLogger().error("DELI Exception while creating parser: ", e);
  +            throw e;
  +        }
       }
   
        /** Configure this class */
  @@ -172,14 +171,14 @@
       /**
        * Initialize
        */
  -    public void initialize() 
  +    public void initialize()
       throws Exception {
  -	try {
  +    try {
            this.workspace = new Workspace(this.servletContext, this.deliConfig);
  -	} catch (Exception e) {
  -		getLogger().error("DELI Exception while creating workspace: ", e);
  -		throw e;
  -	}
  +    } catch (Exception e) {
  +        getLogger().error("DELI Exception while creating workspace: ", e);
  +        throw e;
  +    }
       }
   
       /** Dispose of this class */
  @@ -202,14 +201,14 @@
        */
       public Profile getProfile(Request theRequest)
       throws IOException, ServletException, Exception {
  -	try {
  +    try {
            CocoonServletRequest servletRequest = new CocoonServletRequest(theRequest);
            Profile theProfile = new Profile(this.workspace, (HttpServletRequest) servletRequest);
            return theProfile;
  -	} catch (Exception e) {
  -		getLogger().error("DELI Exception while retrieving profile: ", e);
  -		throw e;
  -	}
  +    } catch (Exception e) {
  +        getLogger().error("DELI Exception while retrieving profile: ", e);
  +        throw e;
  +    }
       }
   
       /** Convert a profile stored as a vector of profile attributes
  @@ -218,16 +217,16 @@
        *@param	theProfile	The profile as a vector of profile attributes.
        *@return	The DOM tree.
        */
  -    public Document getUACapabilities(Profile theProfile) 
  +    public Document getUACapabilities(Profile theProfile)
       throws Exception {
  -	try {
  +    try {
           Document document;
           Element rootElement;
           Element attributeNode;
           Element complexAttributeNode;
           Text text;
   
  -        document = ((DOMFactory)parser).newDocument();
  +        document = parser.createDocument();
           rootElement = document.createElementNS(null, "browser");
           document.appendChild(rootElement);
   
  @@ -255,10 +254,10 @@
               }
           }
           return document;
  -	} catch (Exception e) {
  -		getLogger().error("DELI Exception while converting profile to DOM fragment: ", e);
  -		throw e;
  -	}
  +    } catch (Exception e) {
  +        getLogger().error("DELI Exception while converting profile to DOM fragment: ",
e);
  +        throw e;
  +    }
       }
   
       public Document getUACapabilities(Request theRequest)
  
  
  
  1.6       +3 -4      xml-cocoon2/src/java/org/apache/cocoon/components/search/SimpleLuceneXMLIndexerImpl.java
  
  Index: SimpleLuceneXMLIndexerImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/search/SimpleLuceneXMLIndexerImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SimpleLuceneXMLIndexerImpl.java	4 Feb 2002 12:31:09 -0000	1.5
  +++ SimpleLuceneXMLIndexerImpl.java	14 Feb 2002 08:52:44 -0000	1.6
  @@ -67,6 +67,7 @@
   
   import javax.xml.parsers.*;
   
  +import org.apache.avalon.excalibur.xml.Parser;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
  @@ -81,7 +82,6 @@
   import org.apache.avalon.framework.thread.ThreadSafe;
   import org.apache.cocoon.ProcessingException;
   
  -import org.apache.cocoon.components.parser.Parser;
   import org.apache.cocoon.environment.Source;
   import org.apache.cocoon.environment.SourceResolver;
   import org.apache.lucene.document.DateField;
  @@ -101,7 +101,7 @@
    * A simple class building lucene documents from xml content.
    *
    * @author     <a href="mailto:berni_huber@a1.net">Bernhard Huber</a>
  - * @version CVS $Id: SimpleLuceneXMLIndexerImpl.java,v 1.5 2002/02/04 12:31:09 cziegeler
Exp $
  + * @version CVS $Id: SimpleLuceneXMLIndexerImpl.java,v 1.6 2002/02/14 08:52:44 cziegeler
Exp $
    */
   public class SimpleLuceneXMLIndexerImpl extends AbstractLoggable
            implements LuceneXMLIndexer, Configurable, Composable, ThreadSafe
  @@ -237,8 +237,7 @@
               // get an XML parser
               parser = (Parser) this.manager.lookup(Parser.ROLE);
               //reader.setErrorHandler(new CocoonErrorHandler());
  -            parser.setContentHandler(luceneIndexContentHandler);
  -            parser.parse(in);
  +            parser.parse(in, luceneIndexContentHandler);
               //
               // document is parsed
               //
  
  
  
  1.6       +3 -4      xml-cocoon2/src/java/org/apache/cocoon/components/xscript/XScriptObject.java
  
  Index: XScriptObject.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/xscript/XScriptObject.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XScriptObject.java	4 Feb 2002 12:36:28 -0000	1.5
  +++ XScriptObject.java	14 Feb 2002 08:52:44 -0000	1.6
  @@ -65,8 +65,8 @@
   import org.apache.cocoon.xml.EmbeddedXMLPipe;
   import org.apache.cocoon.environment.Source;
   import org.apache.cocoon.components.xslt.XSLTProcessor;
  -import org.apache.cocoon.components.parser.Parser;
   import org.apache.cocoon.ProcessingException;
  +import org.apache.avalon.excalibur.xml.Parser;
   import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.ComponentException;
  @@ -79,7 +79,7 @@
    * Source object.
    *
    * @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
  - * @version CVS $Id: XScriptObject.java,v 1.5 2002/02/04 12:36:28 cziegeler Exp $
  + * @version CVS $Id: XScriptObject.java,v 1.6 2002/02/14 08:52:44 cziegeler Exp $
    * @since August  4, 2001
    */
   public abstract class XScriptObject implements Source, Composable
  @@ -158,9 +158,8 @@
   
         parser = (Parser)componentManager.lookup(Parser.ROLE);
   
  -      parser.setContentHandler(newHandler);
         InputSource source = getInputSource();
  -      parser.parse(source);
  +      parser.parse(source, newHandler);
   
       } catch (Exception ex) {
         throw new SAXException(ex);
  
  
  
  1.5       +5 -6      xml-cocoon2/src/java/org/apache/cocoon/generation/JspGenerator.java
  
  Index: JspGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/JspGenerator.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JspGenerator.java	7 Feb 2002 08:17:52 -0000	1.4
  +++ JspGenerator.java	14 Feb 2002 08:52:44 -0000	1.5
  @@ -54,12 +54,12 @@
    */
   package org.apache.cocoon.generation;
   
  +import org.apache.avalon.excalibur.xml.Parser;
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.components.jsp.JSPEngine;
  -import org.apache.cocoon.components.parser.Parser;
   import org.apache.cocoon.environment.Source;
   import org.apache.cocoon.environment.http.HttpEnvironment;
   import org.xml.sax.InputSource;
  @@ -78,7 +78,7 @@
    * results into SAX events.
    *
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
  - * @version CVS $Id: JspGenerator.java,v 1.4 2002/02/07 08:17:52 cziegeler Exp $
  + * @version CVS $Id: JspGenerator.java,v 1.5 2002/02/14 08:52:44 cziegeler Exp $
    */
   public class JspGenerator extends ServletGenerator implements Configurable {
   
  @@ -125,8 +125,7 @@
   
               // pipe the results into the parser
               parser = (Parser)this.manager.lookup(Parser.ROLE);
  -            parser.setConsumer(this.xmlConsumer);
  -            parser.parse(input);
  +            parser.parse(input, this.xmlConsumer);
           } catch (ServletException e) {
               getLogger().debug("ServletException in JspGenerator.generate()", e);
               getLogger().debug("Embedded ServletException JspGenerator.generate()", e.getRootCause());
  @@ -145,8 +144,8 @@
               throw new ProcessingException("Exception JspGenerator.generate()",e);
           } finally {
               if (src != null) src.recycle();
  -            if (parser != null) this.manager.release(parser);
  -            if (engine != null) this.manager.release(engine);
  +            this.manager.release(parser);
  +            this.manager.release(engine);
           }
       }
   }
  
  
  
  1.5       +4 -5      xml-cocoon2/src/java/org/apache/cocoon/generation/PhpGenerator.java
  
  Index: PhpGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/PhpGenerator.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PhpGenerator.java	7 Feb 2002 08:17:52 -0000	1.4
  +++ PhpGenerator.java	14 Feb 2002 08:52:44 -0000	1.5
  @@ -54,8 +54,8 @@
    */
   package org.apache.cocoon.generation;
   
  +import org.apache.avalon.excalibur.xml.Parser;
   import org.apache.cocoon.ProcessingException;
  -import org.apache.cocoon.components.parser.Parser;
   import org.apache.cocoon.environment.Source;
   import org.apache.cocoon.environment.http.HttpEnvironment;
   import org.xml.sax.InputSource;
  @@ -78,7 +78,7 @@
    * results into SAX events.
    *
    * @author <a href="mailto:rubys@us.ibm.com">Sam Ruby</a>
  - * @version CVS $Id: PhpGenerator.java,v 1.4 2002/02/07 08:17:52 cziegeler Exp $
  + * @version CVS $Id: PhpGenerator.java,v 1.5 2002/02/14 08:52:44 cziegeler Exp $
    */
   public class PhpGenerator extends ServletGenerator  {
   
  @@ -192,8 +192,7 @@
   
               // pipe the results into the parser
               parser = (Parser)this.manager.lookup(Parser.ROLE);
  -            parser.setConsumer(this.xmlConsumer);
  -            parser.parse(new InputSource(input));
  +            parser.parse(new InputSource(input), this.xmlConsumer);
   
               // clean up
               php.destroy();
  @@ -205,7 +204,7 @@
               throw new IOException(e.toString());
           } finally {
               if (inputSource != null) inputSource.recycle();
  -            if (parser != null) this.manager.release(parser);
  +            this.manager.release(parser);
           }
       }
   }
  
  
  
  1.7       +4 -5      xml-cocoon2/src/java/org/apache/cocoon/generation/ScriptGenerator.java
  
  Index: ScriptGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/ScriptGenerator.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ScriptGenerator.java	7 Feb 2002 08:17:52 -0000	1.6
  +++ ScriptGenerator.java	14 Feb 2002 08:52:44 -0000	1.7
  @@ -58,12 +58,12 @@
   import com.ibm.bsf.BSFException;
   import com.ibm.bsf.BSFManager;
   import com.ibm.bsf.util.IOUtils;
  +import org.apache.avalon.excalibur.xml.Parser;
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.ResourceNotFoundException;
  -import org.apache.cocoon.components.parser.Parser;
   import org.apache.cocoon.environment.Source;
   import org.xml.sax.InputSource;
   
  @@ -91,7 +91,7 @@
    * </pre>
    *
    * @author <a href="mailto:jafoster@engmail.uwaterloo.ca">Jason Foster</a>
  - * @version CVS $Id: ScriptGenerator.java,v 1.6 2002/02/07 08:17:52 cziegeler Exp $
  + * @version CVS $Id: ScriptGenerator.java,v 1.7 2002/02/14 08:52:44 cziegeler Exp $
    */
   public class ScriptGenerator extends ComposerGenerator implements Configurable {
   
  @@ -206,8 +206,7 @@
               InputSource xmlInput =
                       new InputSource(new StringReader(output.toString()));
               parser = (Parser)(this.manager.lookup(Parser.ROLE));
  -            parser.setConsumer(this.xmlConsumer);
  -            parser.parse(xmlInput);
  +            parser.parse(xmlInput, this.xmlConsumer);
           } catch (ProcessingException e) {
               throw e;
           } catch (FileNotFoundException e) {
  @@ -220,7 +219,7 @@
               throw new ProcessingException(
                       "Exception in ScriptGenerator.generate()", e);
           } finally {
  -            if (parser != null) this.manager.release(parser);
  +            this.manager.release(parser);
           }
       }
   }
  
  
  
  1.6       +3 -5      xml-cocoon2/src/java/org/apache/cocoon/generation/StreamGenerator.java
  
  Index: StreamGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/StreamGenerator.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- StreamGenerator.java	7 Feb 2002 08:17:52 -0000	1.5
  +++ StreamGenerator.java	14 Feb 2002 08:52:44 -0000	1.6
  @@ -55,11 +55,11 @@
   
   package org.apache.cocoon.generation;
   
  +import org.apache.avalon.excalibur.xml.Parser;
   import org.apache.avalon.framework.component.Component;
   import org.apache.cocoon.Constants;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.ResourceNotFoundException;
  -import org.apache.cocoon.components.parser.Parser;
   import org.apache.cocoon.environment.http.HttpEnvironment;
   import javax.servlet.http.HttpServletRequest;
   import org.apache.cocoon.util.PostInputStream;
  @@ -90,7 +90,7 @@
    * number of bytes read is equal to the getContentLength() value.
    *
    * @author <a href="mailto:Kinga_Dziembowski@hp.com">Kinga Dziembowski</a>
  - * @version CVS $Id: StreamGenerator.java,v 1.5 2002/02/07 08:17:52 cziegeler Exp $
  + * @version CVS $Id: StreamGenerator.java,v 1.6 2002/02/14 08:52:44 cziegeler Exp $
    */
   public class StreamGenerator extends ComposerGenerator
   {
  @@ -155,9 +155,7 @@
                   this.inputSource.setEncoding(charset);
               }
               parser = (Parser)this.manager.lookup(Parser.ROLE);
  -            parser.setContentHandler(super.contentHandler);
  -            parser.setLexicalHandler(super.lexicalHandler);
  -            parser.parse(this.inputSource);
  +            parser.parse(this.inputSource, super.xmlConsumer);
           } catch (IOException e) {
               getLogger().error("StreamGenerator.generate()", e);
               throw new ResourceNotFoundException("StreamGenerator could not find resource",
e);
  
  
  
  1.7       +4 -7      xml-cocoon2/src/java/org/apache/cocoon/generation/VelocityGenerator.java
  
  Index: VelocityGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/VelocityGenerator.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- VelocityGenerator.java	7 Feb 2002 08:17:52 -0000	1.6
  +++ VelocityGenerator.java	14 Feb 2002 08:52:44 -0000	1.7
  @@ -54,6 +54,7 @@
    */
   package org.apache.cocoon.generation;
   
  +import org.apache.avalon.excalibur.xml.Parser;
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.configuration.Configurable;
  @@ -67,7 +68,6 @@
   import org.apache.log.Logger;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.ResourceNotFoundException;
  -import org.apache.cocoon.components.parser.Parser;
   import org.apache.cocoon.environment.ObjectModelHelper;
   import org.apache.cocoon.environment.Source;
   import org.apache.cocoon.environment.SourceResolver;
  @@ -171,7 +171,7 @@
    *
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
    * @author <a href="mailto:mike@hihat.net">Michael McKibben</a>
  - * @version CVS $Id: VelocityGenerator.java,v 1.6 2002/02/07 08:17:52 cziegeler Exp $
  + * @version CVS $Id: VelocityGenerator.java,v 1.7 2002/02/14 08:52:44 cziegeler Exp $
    */
   public class VelocityGenerator extends ComposerGenerator
       implements Initializable, Configurable, LogSystem
  @@ -529,8 +529,7 @@
   
               InputSource xmlInput =
               new InputSource(new StringReader(w.toString()));
  -            parser.setConsumer(this.xmlConsumer);
  -            parser.parse(xmlInput);
  +            parser.parse(xmlInput, this.xmlConsumer);
           } catch (IOException e) {
               getLogger().warn("VelocityGenerator.generate()", e);
               throw new ResourceNotFoundException("Could not get Resource for VelocityGenerator",
e);
  @@ -546,9 +545,7 @@
               getLogger().error("Could not get parser", e);
               throw new ProcessingException("Exception in VelocityGenerator.generate()",
e);
           } finally {
  -            if (parser != null) {
  -                this.manager.release(parser);
  -            }
  +            this.manager.release(parser);
           }
       }
   
  
  
  
  1.9       +5 -6      xml-cocoon2/src/java/org/apache/cocoon/sitemap/SitemapManager.java
  
  Index: SitemapManager.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/sitemap/SitemapManager.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- SitemapManager.java	7 Feb 2002 04:37:42 -0000	1.8
  +++ SitemapManager.java	14 Feb 2002 08:52:45 -0000	1.9
  @@ -55,9 +55,10 @@
   
   package org.apache.cocoon.sitemap;
   
  +import org.apache.avalon.excalibur.component.DefaultRoleManager;
   import org.apache.avalon.excalibur.component.RoleManager;
   import org.apache.avalon.excalibur.logger.LogKitManager;
  -import org.apache.avalon.excalibur.component.DefaultRoleManager;
  +import org.apache.avalon.excalibur.xml.Parser;
   
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.configuration.Configurable;
  @@ -68,7 +69,6 @@
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.Processor;
   import org.apache.cocoon.components.language.generator.CompiledComponent;
  -import org.apache.cocoon.components.parser.Parser;
   import org.apache.cocoon.components.pipeline.EventPipeline;
   import org.apache.cocoon.components.pipeline.StreamPipeline;
   import org.apache.cocoon.components.source.SourceHandler;
  @@ -84,7 +84,7 @@
    *
    * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
    * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
  - * @version CVS $Id: SitemapManager.java,v 1.8 2002/02/07 04:37:42 vgritsenko Exp $
  + * @version CVS $Id: SitemapManager.java,v 1.9 2002/02/14 08:52:45 cziegeler Exp $
    */
   public class SitemapManager extends Manager implements Processor, Configurable {
   
  @@ -128,14 +128,13 @@
               InputStream inputStream = ClassUtils.getResource("org/apache/cocoon/sitemap/sitemap.roles").openStream();
               InputSource is = new InputSource(inputStream);
               is.setSystemId("org/apache/cocoon/sitemap/sitemap.roles");
  -            p.setContentHandler(b);
  -            p.parse(is);
  +            p.parse(is, b);
               rolesConfig = b.getConfiguration();
           } catch (Exception e) {
               getLogger().error("Could not configure Cocoon environment", e);
               throw new ConfigurationException("Error trying to load configurations", e);
           } finally {
  -            if (p != null) this.manager.release(p);
  +            this.manager.release(p);
           }
   
           DefaultRoleManager sitemapRoleManager = new DefaultRoleManager();
  
  
  
  1.12      +3 -29     xml-cocoon2/src/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java
  
  Index: FragmentExtractorTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- FragmentExtractorTransformer.java	7 Feb 2002 07:41:24 -0000	1.11
  +++ FragmentExtractorTransformer.java	14 Feb 2002 08:52:45 -0000	1.12
  @@ -54,11 +54,6 @@
    */
   package org.apache.cocoon.transformation;
   
  -import org.apache.avalon.framework.activity.Disposable;
  -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;
  @@ -68,11 +63,9 @@
   import org.apache.cocoon.caching.CacheValidity;
   import org.apache.cocoon.caching.Cacheable;
   import org.apache.cocoon.caching.NOPCacheValidity;
  -import org.apache.cocoon.components.parser.Parser;
   import org.apache.cocoon.environment.SourceResolver;
   import org.apache.cocoon.generation.FragmentExtractorGenerator;
   import org.apache.cocoon.xml.dom.DOMBuilder;
  -import org.apache.cocoon.xml.dom.DOMFactory;
   
   import org.w3c.dom.Document;
   import org.xml.sax.Attributes;
  @@ -102,10 +95,10 @@
    * and the associated generator are very likely to fail on a clustered server.</b>
    *
    * @author <a href="mailto:paul@luminas.co.uk">Paul Russell</a>
  - * @version CVS $Id: FragmentExtractorTransformer.java,v 1.11 2002/02/07 07:41:24 cziegeler
Exp $
  + * @version CVS $Id: FragmentExtractorTransformer.java,v 1.12 2002/02/14 08:52:45 cziegeler
Exp $
    */
   public class FragmentExtractorTransformer extends AbstractTransformer
  -    implements Composable, Disposable, Cacheable, Configurable {
  +    implements Cacheable, Configurable {
   
       private static final String EXTRACT_URI_NAME = "extract-uri";
       private static final String EXTRACT_ELEMENT_NAME = "extract-element";
  @@ -129,16 +122,6 @@
   
       private int fragmentID;
   
  -    protected ComponentManager manager;
  -
  -    private DOMFactory documentFactory;
  -
  -    public void compose(ComponentManager manager)
  -        throws ComponentException{
  -        this.manager = manager;
  -        this.documentFactory = (DOMFactory) this.manager.lookup(Parser.ROLE);
  -    }
  -
       /**
        * Configure this transformer.
        */
  @@ -247,7 +230,7 @@
               getLogger().debug("FragmentExtractorTransformer extractLevel now " + extractLevel
+ ".");
   
               // Start the DOM document
  -            this.currentBuilder = new DOMBuilder(documentFactory);
  +            this.currentBuilder = new DOMBuilder();
               this.currentBuilder.startDocument();
               Iterator itt = prefixMap.entrySet().iterator();
               while (itt.hasNext()) {
  @@ -481,13 +464,4 @@
           }
       }
   
  -    /**
  -     * dispose
  -     */
  -    public void dispose() {
  -        this.manager.release((Component)this.documentFactory);
  -        this.documentFactory = null;
  -
  -        this.manager = null;
  -    }
   }
  
  
  
  1.8       +16 -23    xml-cocoon2/src/java/org/apache/cocoon/transformation/WriteDOMSessionTransformer.java
  
  Index: WriteDOMSessionTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/WriteDOMSessionTransformer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WriteDOMSessionTransformer.java	7 Feb 2002 07:41:24 -0000	1.7
  +++ WriteDOMSessionTransformer.java	14 Feb 2002 08:52:45 -0000	1.8
  @@ -55,15 +55,9 @@
   
   package org.apache.cocoon.transformation;
   
  -import org.apache.avalon.framework.activity.Disposable;
  -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.parameters.Parameters;
   import org.apache.cocoon.Constants;
   import org.apache.cocoon.ProcessingException;
  -import org.apache.cocoon.components.parser.Parser;
   import org.apache.cocoon.environment.ObjectModelHelper;
   import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.environment.Session;
  @@ -92,11 +86,11 @@
    *   dom-root-element is the trigger that will be the root element of the DOM
    *
    * @author <a href="mailto:sven.beauprez@the-ecorp.com">Sven Beauprez</a>
  - * @version CVS $Id: WriteDOMSessionTransformer.java,v 1.7 2002/02/07 07:41:24 cziegeler
Exp $
  + * @version CVS $Id: WriteDOMSessionTransformer.java,v 1.8 2002/02/14 08:52:45 cziegeler
Exp $
    */
   
  -public class WriteDOMSessionTransformer extends AbstractTransformer implements
  -  Composable, Disposable {
  +public class WriteDOMSessionTransformer
  +  extends AbstractTransformer {
   
       public static final String DOM_NAME = "dom-name";
       public static final String DOM_ROOT_ELEMENT = "dom-root-element";
  @@ -108,13 +102,22 @@
       private Parameters parameters;
       private DOMBuilder builder;
   
  -    private ComponentManager manager;
  -    private Parser parser;
  -
       private String DOMName;
       private String rootElement;
       private Map storedPrefixMap;
   
  +    /**
  +     * Recyclable
  +     */
  +    public void recycle() {
  +        super.recycle();
  +        this.session = null;
  +        this.parameters = null;
  +        this.builder = null;
  +        this.buildDom = false;
  +        this.sessionAvailable = false;
  +    }
  +
       /** BEGIN SitemapComponent methods **/
   
       public void setup(SourceResolver resolver, Map objectModel,
  @@ -144,16 +147,6 @@
   
       /** END SitemapComponent methods **/
   
  -    public void compose(ComponentManager manager) throws ComponentException {
  -        this.manager = manager;
  -        this.parser = (Parser)this.manager.lookup(Parser.ROLE);
  -    }
  -
  -    public void dispose() {
  -        this.manager.release(this.parser);
  -    }
  -
  -
       /** BEGIN SAX ContentHandler handlers **/
   
       public void startPrefixMapping(String prefix, String uri)
  @@ -172,7 +165,7 @@
           if (name.equalsIgnoreCase(rootElement) && sessionAvailable)  {
             getLogger().debug("WriteSessionTransformer: start building DOM tree");
             buildDom = true;
  -          builder = new DOMBuilder(parser);
  +          builder = new DOMBuilder();
             builder.startDocument();
                       launchStoredMappings();
             builder.startElement(uri,name,raw,attributes);
  
  
  
  1.8       +4 -5      xml-cocoon2/src/java/org/apache/cocoon/transformation/XIncludeTransformer.java
  
  Index: XIncludeTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/XIncludeTransformer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XIncludeTransformer.java	7 Feb 2002 07:41:24 -0000	1.7
  +++ XIncludeTransformer.java	14 Feb 2002 08:52:45 -0000	1.8
  @@ -54,6 +54,7 @@
    */
   package org.apache.cocoon.transformation;
   
  +import org.apache.avalon.excalibur.xml.Parser;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.ComponentException;
  @@ -61,7 +62,6 @@
   import org.apache.avalon.framework.component.Composable;
   import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.cocoon.ProcessingException;
  -import org.apache.cocoon.components.parser.Parser;
   import org.apache.cocoon.components.xpath.XPathProcessor;
   import org.apache.cocoon.environment.Source;
   import org.apache.cocoon.environment.SourceResolver;
  @@ -87,7 +87,7 @@
    * by the SAX event FSM yet.
    *
    * @author <a href="mailto:balld@webslingerZ.com">Donald Ball</a>
  - * @version CVS $Id: XIncludeTransformer.java,v 1.7 2002/02/07 07:41:24 cziegeler Exp $
  + * @version CVS $Id: XIncludeTransformer.java,v 1.8 2002/02/14 08:52:45 cziegeler Exp $
    */
   public class XIncludeTransformer extends AbstractTransformer implements Composable, Disposable
{
   
  @@ -312,8 +312,7 @@
                       } else {
                           IncludeXMLConsumer xinclude_handler = new IncludeXMLConsumer(super.contentHandler,super.lexicalHandler);
                           xinclude_handler.setLogger(getLogger());
  -                        parser.setConsumer(xinclude_handler);
  -                        parser.parse(input);
  +                        parser.parse(input, xinclude_handler);
                       }
                   } catch(SAXException e) {
                       getLogger().error("Error in processXIncludeElement", e);
  @@ -331,7 +330,7 @@
                       getLogger().error("Error in processXIncludeElement", e);
                       throw new SAXException(e);
                   } finally {
  -                    if(parser != null) this.manager.release(parser);
  +                    this.manager.release(parser);
                   }
               }
           } finally {
  
  
  
  1.5       +2 -2      xml-cocoon2/src/java/org/apache/cocoon/xml/dom/DOMBuilder.java
  
  Index: DOMBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/xml/dom/DOMBuilder.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DOMBuilder.java	4 Feb 2002 14:18:00 -0000	1.4
  +++ DOMBuilder.java	14 Feb 2002 08:52:45 -0000	1.5
  @@ -68,7 +68,7 @@
    * DOM Document from SAX events.
    *
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Id: DOMBuilder.java,v 1.4 2002/02/04 14:18:00 cziegeler Exp $
  + * @version CVS $Id: DOMBuilder.java,v 1.5 2002/02/14 08:52:45 cziegeler Exp $
    */
   public class DOMBuilder
   extends AbstractXMLPipe {
  @@ -134,7 +134,7 @@
                   this.result = new DOMResult( parentNode );
               } else {
                   this.result = new DOMResult();
  -                }
  +            }
               handler.setResult(this.result);
           } catch (javax.xml.transform.TransformerException local) {
               throw new RuntimeException("Fatal-Error: Unable to get transformer handler");
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message