You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by bl...@apache.org on 2001/02/08 15:25:33 UTC

cvs commit: xml-cocoon/src/org/apache/cocoon/sitemap Handler.java

bloritsch    01/02/08 06:25:33

  Modified:    src/org/apache/cocoon/components/language/markup/sitemap
                        Tag: xml-cocoon2 SitemapMarkupLanguage.java
               src/org/apache/cocoon/sitemap Tag: xml-cocoon2 Handler.java
  Log:
  Minor Formatting chagnes
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.13  +20 -19    xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/Attic/SitemapMarkupLanguage.java
  
  Index: SitemapMarkupLanguage.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/Attic/SitemapMarkupLanguage.java,v
  retrieving revision 1.1.2.12
  retrieving revision 1.1.2.13
  diff -u -r1.1.2.12 -r1.1.2.13
  --- SitemapMarkupLanguage.java	2001/02/01 21:12:41	1.1.2.12
  +++ SitemapMarkupLanguage.java	2001/02/08 14:25:31	1.1.2.13
  @@ -39,7 +39,7 @@
    * <a href="http://xml.apache.org/cocoon/sitemap.html">Sitemap</a>.
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Revision: 1.1.2.12 $ $Date: 2001/02/01 21:12:41 $
  + * @version CVS $Revision: 1.1.2.13 $ $Date: 2001/02/08 14:25:31 $
    */
   public class SitemapMarkupLanguage extends AbstractMarkupLanguage {
   
  @@ -169,16 +169,16 @@
               this.language = language;
           }
   
  -    public void setParent(XMLReader reader) {
  -        reader.setContentHandler(this);
  -        super.setParent(reader);
  -    }
  +        public void setParent(XMLReader reader) {
  +            reader.setContentHandler(this);
  +            super.setParent(reader);
  +        }
   
  -  public void setLogger(Logger logger) {
  -      if (this.log == null) {
  -          this.log = logger;
  -      }
  -  }
  +        public void setLogger(Logger logger) {
  +          if (this.log == null) {
  +              this.log = logger;
  +          }
  +        }
   
           public void startDocument() throws SAXException {
               super.startDocument();
  @@ -203,11 +203,12 @@
                       this.filename.substring(0, pos).replace(File.separatorChar, '/');
                   // update the attributes
                   AttributesImpl newAtts = new AttributesImpl();
  -        // FIXME (SSA) workaround a bug in SAX2 that goes in infinite loop
  -        // when atts.getLength() == 0
  -        if (atts.getLength()>0)
  -            newAtts.setAttributes(atts);
   
  +                // FIXME (SSA) workaround a bug in SAX2 that goes in infinite loop
  +                // when atts.getLength() == 0
  +                if (atts.getLength()>0)
  +                    newAtts.setAttributes(atts);
  +
                   newAtts.addAttribute("", "file-name", "file-name", "CDATA", name);
                   newAtts.addAttribute("", "file-path", "file-path", "CDATA", path);
                   newAtts.addAttribute("", "creation-date", "creation-date",
  @@ -249,11 +250,11 @@
   
           private boolean finished;
   
  -  public void setLogger(Logger logger) {
  -      if (this.log == null) {
  -          this.log = logger;
  -      }
  -  }
  +        public void setLogger(Logger logger) {
  +          if (this.log == null) {
  +              this.log = logger;
  +          }
  +        }
   
           /**
            * default constructor
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.12  +8 -5      xml-cocoon/src/org/apache/cocoon/sitemap/Attic/Handler.java
  
  Index: Handler.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/sitemap/Attic/Handler.java,v
  retrieving revision 1.1.2.11
  retrieving revision 1.1.2.12
  diff -u -r1.1.2.11 -r1.1.2.12
  --- Handler.java	2001/01/22 21:56:48	1.1.2.11
  +++ Handler.java	2001/02/08 14:25:32	1.1.2.12
  @@ -35,7 +35,7 @@
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.1.2.11 $ $Date: 2001/01/22 21:56:48 $
  + * @version CVS $Revision: 1.1.2.12 $ $Date: 2001/02/08 14:25:32 $
    */
   public class Handler implements Runnable, Configurable, Composer, Processor, Loggable {
       protected Logger log;
  @@ -135,7 +135,6 @@
           regenerateAsynchronously(environment);
           if (regeneration != null)
               regeneration.join();
  -        log.debug("Sitemap regeneration complete");
       }
   
       public boolean process (Environment environment)
  @@ -170,17 +169,21 @@
               if (smap instanceof Loggable) ((Loggable) smap).setLogger(this.log);
               if (smap instanceof Composer) smap.compose(this.manager);
               if (smap instanceof Configurable) smap.configure(this.conf);
  +
               this.sitemap = smap;
  +            log.debug("Sitemap regeneration complete");
  +
               if (this.sitemap != null) {
                   log.debug("The sitemap has been successfully compiled!");
               } else {
                   log.debug("No errors, but the sitemap has not been set.");
               }
  -        } catch (Exception e) {
  -            log.error("Error compiling sitemap", e);
  -            this.exception = e;
           } catch (Throwable t) {
               log.error("Error compiling sitemap", t);
  +
  +            if (t instanceof Exception) {
  +              this.exception = (Exception) t;
  +            }
           } finally {
               this.regeneration = null;
               this.environment = null;