giacomo     00/07/22 17:04:14

  Modified:    .        Tag: xml-cocoon2 build.xml
               conf     Tag: xml-cocoon2 sitemap.xmap
               src/org/apache/cocoon Tag: xml-cocoon2 Cocoon.java
               src/org/apache/cocoon/components/language/markup/sitemap/java
                        Tag: xml-cocoon2 sitemap.xsl
               src/org/apache/cocoon/sitemap Tag: xml-cocoon2
                        SitemapHandler.java
               src/org/apache/cocoon/xml/util Tag: xml-cocoon2
                        DocumentHandlerWrapper.java
  Added:       src/org/apache/cocoon/sitemap Tag: xml-cocoon2
                        AbstractSitemap.java
  Log:
  First fixes to the sitemap generation engine
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.6.2.16  +1 -1      xml-cocoon/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/build.xml,v
  retrieving revision 1.6.2.15
  retrieving revision 1.6.2.16
  diff -u -r1.6.2.15 -r1.6.2.16
  --- build.xml 2000/07/22 20:41:27     1.6.2.15
  +++ build.xml 2000/07/23 00:04:07     1.6.2.16
  @@ -88,7 +88,7 @@
       <property name="build.compiler" value="classic"/>
       <property name="debug"          value="on"/>
       <property name="optimize"       value="on"/>
  -    <property name="deprecation"    value="off"/>
  +    <property name="deprecation"    value="on"/>
   
       <property name="src.dir"     value="./src"/>
       <property name="lib.dir"     value="./lib"/>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +40 -0     xml-cocoon/conf/Attic/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/conf/Attic/sitemap.xmap,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- sitemap.xmap      2000/07/22 20:43:36     1.1.2.1
  +++ sitemap.xmap      2000/07/23 00:04:08     1.1.2.2
  @@ -71,7 +71,47 @@
        <parameter name="contentType" value="text/html"/> 
       </map:serialize> 
      </map:match>
  +
  +   <map:match pattern="^java.apache.org$"> 
  +    <map:generate src="documents/java_apache_org.xml"/> 
  +    <map:transform src="stylesheets/java_apache_org-html.xsl"/> 
  +    <map:serialize> 
  +     <parameter name="contentType" value="text/html"/> 
  +    </map:serialize> 
  +   </map:match>
  +
  +   <map:match pattern="^jakarta.apache.org$"> 
  +    <map:generate src="documents/jakarta_apache_org.xml"/> 
  +    <map:transform src="stylesheets/jakarta_apache_org-html.xsl"/> 
  +    <map:serialize> 
  +     <parameter name="contentType" value="text/html"/> 
  +    </map:serialize> 
  +   </map:match>
  +
  +   <map:match pattern="^simple_dynamic_page$"> 
  +    <map:generate src="documents/simple-dynamic-page.xsp"/> 
  +    <map:transform src="stylesheets/dynamic-page2html.xsl"/> 
  +    <map:serialize> 
  +     <parameter name="contentType" value="text/html"/> 
  +    </map:serialize> 
  +   </map:match>
    
  +   <map:match pattern="^status$"> 
  +    <map:generate type="status" src="status"/> 
  +    <map:transform src="stylesheets/simple-status.xsl"/> 
  +    <map:serialize> 
  +     <parameter name="contentType" value="text/html"/> 
  +    </map:serialize> 
  +   </map:match>
  + 
  +   <map:match pattern="^(.*/)$"> 
  +    <map:generate type="directory" src="{1}"/> 
  +    <map:transform src="stylesheets/simple-directory2html.xsl"/> 
  +    <map:serialize> 
  +     <parameter name="contentType" value="text/html"/> 
  +    </map:serialize> 
  +   </map:match>
  +
     </map:pipeline>
    </map:pipelines>
       
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.13  +2 -1      xml-cocoon/src/org/apache/cocoon/Cocoon.java
  
  Index: Cocoon.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/Cocoon.java,v
  retrieving revision 1.4.2.12
  retrieving revision 1.4.2.13
  diff -u -r1.4.2.12 -r1.4.2.13
  --- Cocoon.java       2000/07/22 20:41:29     1.4.2.12
  +++ Cocoon.java       2000/07/23 00:04:09     1.4.2.13
  @@ -40,7 +40,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation, Exoffice Technologies)
  - * @version CVS $Revision: 1.4.2.12 $ $Date: 2000/07/22 20:41:29 $
  + * @version CVS $Revision: 1.4.2.13 $ $Date: 2000/07/23 00:04:09 $
    */
   public class Cocoon
   implements Component, Configurable, ComponentManager, Modifiable, Processor,
  @@ -198,6 +198,7 @@
        */
       public InputSource resolveEntity(String publicId, String systemId)
       throws SAXException, IOException {
  +        System.out.println 
("Cocoon.resolveEntity(\""+publicId+"\",\""+systemId+"\")");
           if (systemId==null) throw new SAXException("Invalid System ID");
   
           if (systemId.length()==0)
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.13  +4 -1      
xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/java/Attic/sitemap.xsl
  
  Index: sitemap.xsl
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/java/Attic/sitemap.xsl,v
  retrieving revision 1.1.2.12
  retrieving revision 1.1.2.13
  diff -u -r1.1.2.12 -r1.1.2.13
  --- sitemap.xsl       2000/07/22 20:41:35     1.1.2.12
  +++ sitemap.xsl       2000/07/23 00:04:10     1.1.2.13
  @@ -53,11 +53,14 @@
   /**
    *
    * @author &lt;a href="mailto:[EMAIL PROTECTED]"&gt;Giacomo Pati&lt;/a&gt;
  - * @version CVS $Revision: 1.1.2.12 $ $Date: 2000/07/22 20:41:35 $
  + * @version CVS $Revision: 1.1.2.13 $ $Date: 2000/07/23 00:04:10 $
    *
   /
   -->
   public class <xsl:value-of select="@file-name"/> extends AbstractSitemap {
  +    static { 
  +        dateCreated = <xsl:value-of select="@creation-date"/>L; 
  +    } 
       
       private Parameters emptyParam = new Parameters(); 
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +24 -7     
xml-cocoon/src/org/apache/cocoon/sitemap/Attic/SitemapHandler.java
  
  Index: SitemapHandler.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon/src/org/apache/cocoon/sitemap/Attic/SitemapHandler.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- SitemapHandler.java       2000/07/22 20:41:57     1.1.2.2
  +++ SitemapHandler.java       2000/07/23 00:04:12     1.1.2.3
  @@ -28,7 +28,7 @@
    * Handles the manageing and stating of one <code>Sitemap</code>
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
  - * @version CVS $Revision: 1.1.2.2 $ $Date: 2000/07/22 20:41:57 $
  + * @version CVS $Revision: 1.1.2.3 $ $Date: 2000/07/23 00:04:12 $
    */
   public class SitemapHandler implements Runnable, Configurable, Composer {
   
  @@ -50,6 +50,7 @@
    
       /** the regenerating thread */ 
       private Thread regeneration = null; 
  +    private boolean isRegenerationRunning = false;
    
       /** the sitemaps base path */ 
       private String basePath = null; 
  @@ -86,6 +87,7 @@
   
       protected void throwError () 
       throws ProcessingException, SAXException, IOException, 
InterruptedException {
  +        System.out.println("SitemapHandler.throwError()");
           Exception e = exception;
           exception = null;
           if (e instanceof ProcessingException) {
  @@ -100,27 +102,33 @@
               throw new ProcessingException ("Unknown Exception raised: "
                                            + exception.toString());
           }
  +        System.out.println("SitemapHandler.throwError() no Exception to 
throw");
       }
   
       protected boolean available () {
  +        System.out.println("SitemapHandler.available() = 
"+(sitemap!=null?"true":"false"));
           return (sitemap != null);
       }
   
       protected boolean hasChanged () {
  +        System.out.print("SitemapHandler.hasChanged() = ");
           if (sitemap != null) {
  +            
System.out.println((sitemap.modifiedSince(this.changeDate)?"true":"false"));
               return sitemap.modifiedSince(this.changeDate);
           }
  +        System.out.println("true");
           return true;
       }
   
       protected boolean isRegenerating () {
  -        if (regeneration == null)
  -            return false;
  -        return regeneration.isAlive();
  +        System.out.print("SitemapHandler.isRegenerating() = 
"+(isRegenerationRunning?"true":"false"));
  +        return isRegenerationRunning; 
       }
   
       protected void regenerateAsynchroniously () {
  -        if (!isRegenerating()) {
  +        System.out.println("SitemapHandler.regenerateAsynchroniously()");
  +        if (!this.isRegenerationRunning) {
  +            isRegenerationRunning = true;
               regeneration = new Thread (this);
               regeneration.start();
           }
  @@ -128,22 +136,29 @@
   
       protected void regenerate () 
       throws ProcessingException, SAXException, IOException, 
InterruptedException { 
  -        if (!isRegenerating()) {
  +        System.out.println("SitemapHandler.regenerate()");
  +        if (!this.isRegenerationRunning) {
  +            System.out.println("SitemapHandler.regenerate(): regenerating");
  +            isRegenerationRunning = true;
               regeneration = new Thread (this);
               regeneration.start();
               regeneration.join();
               throwError();
  -        }
  +        }
else {
  +            System.out.println("SitemapHandler.regenerate(): regenerating 
already in progress");
  +        }
       }
   
       public boolean process (Environment environment, OutputStream out) 
       throws ProcessingException, SAXException, IOException, 
InterruptedException {
  +        System.out.println("SitemapHandler.process()");
           this.throwError();
           return sitemap.process (environment, out);
       }
   
       /** Generate the Sitemap class */
       public void run() {
  +        System.out.println("SitemapHandler.run()");
   /*
       private void generateSitemap (String sitemapName) 
               throws java.net.MalformedURLException, IOException, 
  @@ -178,7 +193,9 @@
                   this.exception = e;
               }
           } finally {
  +            System.out.println("SitemapHandler.run(): finally");
               regeneration = null;
  +            isRegenerationRunning = false;
           }
       }
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +169 -0    
xml-cocoon/src/org/apache/cocoon/sitemap/Attic/AbstractSitemap.java
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.5   +2 -2      
xml-cocoon/src/org/apache/cocoon/xml/util/Attic/DocumentHandlerWrapper.java
  
  Index: DocumentHandlerWrapper.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon/src/org/apache/cocoon/xml/util/Attic/DocumentHandlerWrapper.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- DocumentHandlerWrapper.java       2000/07/22 20:42:05     1.1.2.4
  +++ DocumentHandlerWrapper.java       2000/07/23 00:04:13     1.1.2.5
  @@ -27,7 +27,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation, Exoffice Technologies)
  - * @version CVS $Revision: 1.1.2.4 $ $Date: 2000/07/22 20:42:05 $
  + * @version CVS $Revision: 1.1.2.5 $ $Date: 2000/07/23 00:04:13 $
    */
   public class DocumentHandlerWrapper extends AbstractXMLConsumer {
   
  @@ -62,7 +62,7 @@
        */
       public void setDocumentHandler(DocumentHandler document)
       throws IllegalStateException {
  -        if (this.documentHandler!=null) throw new IllegalStateException();
  +        //FIXME: why this line? -> if (this.documentHandler!=null) throw new 
IllegalStateException();
           this.documentHandler=document;
       }
   
  
  
  

Reply via email to