You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2002/06/04 13:22:59 UTC

cvs commit: xml-cocoon2/src/java/org/apache/cocoon/generation HTMLGenerator.java ScriptGenerator.java ServerPagesGenerator.java

cziegeler    2002/06/04 04:22:59

  Modified:    src/java/org/apache/cocoon/generation HTMLGenerator.java
                        ScriptGenerator.java ServerPagesGenerator.java
  Log:
  More updates
  
  Revision  Changes    Path
  1.17      +2 -2      xml-cocoon2/src/java/org/apache/cocoon/generation/HTMLGenerator.java
  
  Index: HTMLGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/HTMLGenerator.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- HTMLGenerator.java	4 Jun 2002 07:31:52 -0000	1.16
  +++ HTMLGenerator.java	4 Jun 2002 11:22:59 -0000	1.17
  @@ -87,7 +87,7 @@
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
    * @author <a href="mailto:barozzi@nicolaken.com">Nicola Ken Barozzi</a>
  - * @version CVS $Id: HTMLGenerator.java,v 1.16 2002/06/04 07:31:52 cziegeler Exp $
  + * @version CVS $Id: HTMLGenerator.java,v 1.17 2002/06/04 11:22:59 cziegeler Exp $
    */
   public class HTMLGenerator extends ComposerGenerator
   implements CacheableProcessingComponent, Disposable {
  @@ -116,12 +116,12 @@
        * All instance variables are set to <code>null</code>.
        */
       public void recycle() {
  -        super.recycle();
           if (this.inputSource != null) {
               this.resolver.release( this.inputSource );
               this.inputSource = null;
           }
           this.xpath = null;
  +        super.recycle();
       }
   
       /**
  
  
  
  1.10      +9 -7      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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ScriptGenerator.java	16 Apr 2002 01:16:26 -0000	1.9
  +++ ScriptGenerator.java	4 Jun 2002 11:22:59 -0000	1.10
  @@ -59,7 +59,9 @@
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.ResourceNotFoundException;
  -import org.apache.cocoon.environment.Source;
  +import org.apache.cocoon.components.source.SourceUtil;
  +import org.apache.excalibur.source.Source;
  +import org.apache.excalibur.source.SourceException;
   import org.xml.sax.InputSource;
   
   import java.io.FileNotFoundException;
  @@ -86,7 +88,7 @@
    * </pre>
    *
    * @author <a href="mailto:jafoster@engmail.uwaterloo.ca">Jason Foster</a>
  - * @version CVS $Id: ScriptGenerator.java,v 1.9 2002/04/16 01:16:26 vgritsenko Exp $
  + * @version CVS $Id: ScriptGenerator.java,v 1.10 2002/06/04 11:22:59 cziegeler Exp $
    */
   public class ScriptGenerator extends ComposerGenerator implements Configurable {
   
  @@ -140,11 +142,11 @@
       }
   
       public void recycle() {
  -        super.recycle();
           if (this.inputSource != null) {
  -            this.inputSource.recycle();
  +            this.resolver.release(this.inputSource);
               this.inputSource = null;
           }
  +        super.recycle();
       }
   
       public void generate() throws ProcessingException {
  @@ -152,7 +154,7 @@
           try {
               // Figure out what file to open and do so
               getLogger().debug("processing file [" + super.source + "]");
  -            this.inputSource = this.resolver.resolve(super.source);
  +            this.inputSource = this.resolver.resolveURI(super.source);
   
               getLogger().debug("file resolved to [" + this.inputSource.getSystemId() + "]");
   
  @@ -202,8 +204,8 @@
                       new InputSource(new StringReader(output.toString()));
               parser = (Parser)(this.manager.lookup(Parser.ROLE));
               parser.parse(xmlInput, this.xmlConsumer);
  -        } catch (ProcessingException e) {
  -            throw e;
  +        } catch (SourceException se) {
  +            throw SourceUtil.handle(se);
           } catch (FileNotFoundException e) {
               throw new ResourceNotFoundException(
                   "Could not load script " + this.inputSource.getSystemId(), e);
  
  
  
  1.15      +11 -5     xml-cocoon2/src/java/org/apache/cocoon/generation/ServerPagesGenerator.java
  
  Index: ServerPagesGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/ServerPagesGenerator.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ServerPagesGenerator.java	20 Apr 2002 04:02:18 -0000	1.14
  +++ ServerPagesGenerator.java	4 Jun 2002 11:22:59 -0000	1.15
  @@ -68,10 +68,12 @@
   import org.apache.cocoon.caching.CompositeCacheValidity;
   import org.apache.cocoon.caching.ParametersCacheValidity;
   import org.apache.cocoon.components.language.generator.ProgramGenerator;
  -import org.apache.cocoon.environment.Source;
  +import org.apache.cocoon.components.source.SourceUtil;
   import org.apache.cocoon.environment.SourceResolver;
   import org.apache.cocoon.util.HashUtil;
   import org.apache.cocoon.xml.AbstractXMLPipe;
  +import org.apache.excalibur.source.Source;
  +import org.apache.excalibur.source.SourceException;
   
   import org.xml.sax.Attributes;
   import org.xml.sax.SAXException;
  @@ -96,7 +98,7 @@
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
    * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
  - * @version CVS $Id: ServerPagesGenerator.java,v 1.14 2002/04/20 04:02:18 vgritsenko Exp $
  + * @version CVS $Id: ServerPagesGenerator.java,v 1.15 2002/06/04 11:22:59 cziegeler Exp $
    */
   public class ServerPagesGenerator extends ServletGenerator
           implements Disposable, Cacheable, Configurable {
  @@ -193,7 +195,11 @@
           String programmingLanguage = this.parameters.getParameter(
                   "programming-language", this.programmingLanguage);
   
  -        this.inputSource = this.resolver.resolve(super.source);
  +        try {
  +            this.inputSource = this.resolver.resolveURI(super.source);
  +        } catch (SourceException se) {
  +            throw SourceUtil.handle(se);
  +        }
           try {
               generator = (AbstractServerPage) programGenerator.load(super.manager,
                       super.source, markupLanguage, programmingLanguage, super.resolver);
  @@ -283,19 +289,19 @@
        * Recycle the generator by removing references
        */
       public void recycle() {
  -        super.recycle();
           if (this.generator != null) {
               programGenerator.release(this.generator);
               this.generator = null;
           }
           if (this.inputSource != null) {
  -            this.inputSource.recycle();
  +            this.resolver.release( this.inputSource );
               this.inputSource = null;
           }
           if (this.completionPipe != null) {
               this.completionPipe.recycle();
               this.completionPipe = null;
           }
  +        super.recycle();
       }
   
       /**
  
  
  

----------------------------------------------------------------------
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