cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cross...@apache.org
Subject svn commit: r111786 - /cocoon/branches/BRANCH_2_1_X/tools/src/anttasks/SitemapTask.java
Date Tue, 14 Dec 2004 05:06:10 GMT
Author: crossley
Date: Mon Dec 13 21:06:07 2004
New Revision: 111786

URL: http://svn.apache.org/viewcvs?view=rev&rev=111786
Log:
Generate a list of all possible sitemap components.

Modified:
   cocoon/branches/BRANCH_2_1_X/tools/src/anttasks/SitemapTask.java

Modified: cocoon/branches/BRANCH_2_1_X/tools/src/anttasks/SitemapTask.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/tools/src/anttasks/SitemapTask.java?view=diff&rev=111786&p1=cocoon/branches/BRANCH_2_1_X/tools/src/anttasks/SitemapTask.java&r1=111785&p2=cocoon/branches/BRANCH_2_1_X/tools/src/anttasks/SitemapTask.java&r2=111786
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/tools/src/anttasks/SitemapTask.java	(original)
+++ cocoon/branches/BRANCH_2_1_X/tools/src/anttasks/SitemapTask.java	Mon Dec 13 21:06:07 2004
@@ -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;
     }
 

Mime
View raw message