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/blocks/chaperon/java/org/apache/cocoon/generation TextGenerator.java
Date Sat, 25 Oct 2003 17:37:42 GMT
cziegeler    2003/10/25 10:37:42

  Modified:    src/blocks/chaperon/java/org/apache/cocoon/transformation
                        LexicalTransformer.java PatternTransformer.java
                        ParserTransformer.java
               src/blocks/chaperon/java/org/apache/cocoon/generation
                        TextGenerator.java
  Log:
  Workaround for the chaperon samples - it seams that after you call getInputStream()
  on a SitemapSource, the environment is broken :(
  
  Revision  Changes    Path
  1.7       +3 -2      cocoon-2.1/src/blocks/chaperon/java/org/apache/cocoon/transformation/LexicalTransformer.java
  
  Index: LexicalTransformer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/chaperon/java/org/apache/cocoon/transformation/LexicalTransformer.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- LexicalTransformer.java	24 Oct 2003 23:44:26 -0000	1.6
  +++ LexicalTransformer.java	25 Oct 2003 17:37:42 -0000	1.7
  @@ -208,11 +208,12 @@
   
                   SAXConfigurationHandler confighandler = new SAXConfigurationHandler();
   
  +/*
                   if (this.lexiconSource.getInputStream()==null) {
                       throw new ProcessingException("Source '"+
                                                     this.lexiconSource.getURI()+
                                                     "' not found");
  -                }
  +                } */
                   SourceUtil.toSAX(this.manager, this.lexiconSource, null, confighandler);
   
                   Configuration config = confighandler.getConfiguration();
  
  
  
  1.6       +3 -3      cocoon-2.1/src/blocks/chaperon/java/org/apache/cocoon/transformation/PatternTransformer.java
  
  Index: PatternTransformer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/chaperon/java/org/apache/cocoon/transformation/PatternTransformer.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PatternTransformer.java	24 Oct 2003 23:44:26 -0000	1.5
  +++ PatternTransformer.java	25 Oct 2003 17:37:42 -0000	1.6
  @@ -203,11 +203,11 @@
   
                   SAXConfigurationHandler confighandler = new SAXConfigurationHandler();
   
  -                if (this.lexiconSource.getInputStream()==null) {
  +/*                if (this.lexiconSource.getInputStream()==null) {
                       throw new ProcessingException("Source '"+
                                                     this.lexiconSource.getURI()+
                                                     "' not found");
  -                }
  +                }*/
                   SourceUtil.toSAX(this.manager, this.lexiconSource, null, confighandler);
   
                   Configuration config = confighandler.getConfiguration();
  
  
  
  1.7       +3 -3      cocoon-2.1/src/blocks/chaperon/java/org/apache/cocoon/transformation/ParserTransformer.java
  
  Index: ParserTransformer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/chaperon/java/org/apache/cocoon/transformation/ParserTransformer.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ParserTransformer.java	24 Oct 2003 23:44:26 -0000	1.6
  +++ ParserTransformer.java	25 Oct 2003 17:37:42 -0000	1.7
  @@ -211,12 +211,12 @@
                                    this.grammarSource.getURI()+"'");
   
                   SAXConfigurationHandler confighandler = new SAXConfigurationHandler();
  -
  +/*
                   if (this.grammarSource.getInputStream()==null) {
                       throw new ProcessingException("Source '"+
                                                     this.grammarSource.getURI()+
                                                     "' not found");
  -                }
  +                }*/
                   SourceUtil.toSAX(this.manager, this.grammarSource, null, confighandler);
   
                   Configuration config = confighandler.getConfiguration();
  
  
  
  1.4       +8 -6      cocoon-2.1/src/blocks/chaperon/java/org/apache/cocoon/generation/TextGenerator.java
  
  Index: TextGenerator.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/chaperon/java/org/apache/cocoon/generation/TextGenerator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TextGenerator.java	4 Sep 2003 09:38:32 -0000	1.3
  +++ TextGenerator.java	25 Oct 2003 17:37:42 -0000	1.4
  @@ -52,6 +52,7 @@
   package org.apache.cocoon.generation;
   
   import java.io.IOException;
  +import java.io.InputStream;
   import java.io.InputStreamReader;
   import java.io.LineNumberReader;
   import java.io.Serializable;
  @@ -87,8 +88,8 @@
       public final static String URI = "http://chaperon.sourceforge.net/schema/text/1.0";
   
       /** The input source */
  -    private Source inputSource = null;
  -    private String encoding = null;
  +    private Source inputSource;
  +    private String encoding;
   
       /**
        * Recycle this component.
  @@ -163,17 +164,18 @@
           InputStreamReader in = null;
   
           try {
  -            if (this.inputSource.getInputStream()==null) {
  +            final InputStream sis = this.inputSource.getInputStream();
  +            if (sis == null) {
                   throw new ProcessingException("Source '"+
                                                 this.inputSource.getURI()+
                                                 "' not found");
               }
   
               if (encoding!=null) {
  -                in = new InputStreamReader(this.inputSource.getInputStream(),
  +                in = new InputStreamReader(sis,
                                              encoding);
               } else {
  -                in = new InputStreamReader(this.inputSource.getInputStream());
  +                in = new InputStreamReader(sis);
               }
           } catch (SourceException se) {
               throw new ProcessingException("Error during resolving of '"+
  
  
  

Mime
View raw message