Author: brett
Date: Wed Apr  5 17:00:02 2006
New Revision: 391859

URL: http://svn.apache.org/viewcvs?rev=391859&view=rev
Log:
[MSITE-98] allow files to be excluded form site generation
Submitted by: Jesse McConnell

Modified:
    
maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
    
maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java

Modified: 
maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
URL: 
http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java?rev=391859&r1=391858&r2=391859&view=diff
==============================================================================
--- 
maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
 (original)
+++ 
maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
 Wed Apr  5 17:00:02 2006
@@ -133,6 +133,7 @@
         throws IOException, RendererException
     {
         Map files = new LinkedHashMap();
+        Map moduleExcludes = siteRenderingContext.getModuleExcludes();
 
         for ( Iterator i = 
siteRenderingContext.getSiteDirectories().iterator(); i.hasNext(); )
         {
@@ -145,7 +146,14 @@
 
                     File moduleBasedir = new File( siteDirectory, 
module.getSourceDirectory() );
 
-                    addModuleFiles( moduleBasedir, module, files );
+                    if ( moduleExcludes != null && moduleExcludes.containsKey( 
module.getParserId() ) )
+                    {
+                        addModuleFiles( moduleBasedir, module, 
(String)moduleExcludes.get( module.getParserId() ), files );
+                    }
+                    else
+                    {
+                        addModuleFiles( moduleBasedir, module, null, files );
+                    }
                 }
             }
         }
@@ -156,7 +164,14 @@
 
             try
             {
-                addModuleFiles( module.getBasedir(), 
siteModuleManager.getSiteModule( module.getParserId() ), files );
+                if ( moduleExcludes != null && moduleExcludes.containsKey( 
module.getParserId() ) )
+                {
+                    addModuleFiles( module.getBasedir(), 
siteModuleManager.getSiteModule( module.getParserId() ), 
(String)moduleExcludes.get( module.getParserId() ), files );
+                }
+                else
+                {
+                    addModuleFiles( module.getBasedir(), 
siteModuleManager.getSiteModule( module.getParserId() ), null, files );
+                }
             }
             catch ( SiteModuleNotFoundException e )
             {
@@ -166,12 +181,12 @@
         return files;
     }
 
-    private void addModuleFiles( File moduleBasedir, SiteModule module, Map 
files )
+    private void addModuleFiles( File moduleBasedir, SiteModule module, String 
excludes, Map files )
         throws IOException, RendererException
     {
         if ( moduleBasedir.exists() )
         {
-            List docs = FileUtils.getFileNames( moduleBasedir, "**/*." + 
module.getExtension(), null, false );
+            List docs = FileUtils.getFileNames( moduleBasedir, "**/*." + 
module.getExtension(), excludes, false );
 
             for ( Iterator k = docs.iterator(); k.hasNext(); )
             {

Modified: 
maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java
URL: 
http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java?rev=391859&r1=391858&r2=391859&view=diff
==============================================================================
--- 
maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java
 (original)
+++ 
maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java
 Wed Apr  5 17:00:02 2006
@@ -49,6 +49,8 @@
 
     private List siteDirectories = new ArrayList();
 
+    private Map moduleExcludes;
+
     private List modules = new ArrayList();
 
     public String getTemplateName()
@@ -151,4 +153,13 @@
         return modules;
     }
 
+    public Map getModuleExcludes()
+    {
+        return moduleExcludes;
+    }
+
+    public void setModuleExcludes( Map moduleExcludes )
+    {
+        this.moduleExcludes = moduleExcludes;
+    }
 }


Reply via email to