cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cross...@apache.org
Subject svn commit: r125046 - /cocoon/trunk/tools/src/anttasks/SitemapTask.java
Date Thu, 13 Jan 2005 06:21:52 GMT
Author: crossley
Date: Wed Jan 12 22:21:50 2005
New Revision: 125046

URL: http://svn.apache.org/viewcvs?view=rev&rev=125046
Log:
Merge changes from 2_1_X branch. Record the list of sitemap-components.

Modified:
   cocoon/trunk/tools/src/anttasks/SitemapTask.java

Modified: cocoon/trunk/tools/src/anttasks/SitemapTask.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/tools/src/anttasks/SitemapTask.java?view=diff&rev=125046&p1=cocoon/trunk/tools/src/anttasks/SitemapTask.java&r1=125045&p2=cocoon/trunk/tools/src/anttasks/SitemapTask.java&r2=125046
==============================================================================
--- cocoon/trunk/tools/src/anttasks/SitemapTask.java	(original)
+++ cocoon/trunk/tools/src/anttasks/SitemapTask.java	Wed Jan 12 22:21:50 2005
@@ -15,6 +15,7 @@
  */
 
 import java.io.File;
+import java.io.FileWriter;
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.util.ArrayList;
@@ -212,6 +213,7 @@
     private List collectInfo() {
         log("Collecting sitemap components info");
         final List components = new ArrayList();
+        final List allComponentNames = new ArrayList();
         
         final Iterator it = super.allClasses.iterator();
         
@@ -220,6 +222,17 @@
 
             final DocletTag tag = javaClass.getTagByName( NAME_TAG );
 
+            if ( javaClass.isA(ACTION)
+                || javaClass.isA(GENERATOR)
+                || javaClass.isA(MATCHER)
+                || javaClass.isA(PIPELINE)
+                || javaClass.isA(READER)
+                || javaClass.isA(SELECTOR)
+                || javaClass.isA(SERIALIZER)
+                || javaClass.isA(TRANSFORMER)) {
+                allComponentNames.add(javaClass.getFullyQualifiedName());
+            }
+
             if ( null != tag ) {
                 final SitemapComponent comp = new SitemapComponent( javaClass );
 
@@ -227,6 +240,28 @@
                 components.add(comp);
             }
         }
+
+        // Generate a list of all sitemap components
+        final String fileSeparator = System.getProperty("file.separator", "/");
+        final String matchString = "blocks" + fileSeparator;
+        final String outputFname = "build" + fileSeparator + "all-sitemap-components" +
+            (directory.endsWith(matchString) ? "-blocks" : "") + ".txt";
+        log("Listing all sitemap components to " + outputFname);
+        try {
+            File outputFile = new File(outputFname);
+            FileWriter out = new FileWriter(outputFile);
+            final String lineSeparator = System.getProperty("line.separator", "\n");
+            final Iterator iter = allComponentNames.iterator();
+            while ( iter.hasNext() ) {
+                out.write((String)iter.next());
+                out.write(lineSeparator);
+            }
+            out.close();
+        }
+        catch (IOException ioe) {
+            log("IOException: " + ioe);
+        }
+
         return components;
     }
 
@@ -417,7 +452,6 @@
             Document doc = parent.getOwnerDocument();
             Node node;
             
-            
             // first check: deprecated?
             if ( SitemapTask.this.deprecated || this.getTagValue("deprecated", null) != null
) {
                 indent(parent, 3);
@@ -746,7 +780,6 @@
                 throw new BuildException(e);
             }
         }
-
     }
     
     // Class Constants

Mime
View raw message