Author: brett
Date: Mon Sep 12 05:45:06 2005
New Revision: 280330

URL: http://svn.apache.org/viewcvs?rev=280330&view=rev
Log:
reorganise but leave commented out

Modified:
    
maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/DoxiaMojo.java

Modified: 
maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/DoxiaMojo.java
URL: 
http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/DoxiaMojo.java?rev=280330&r1=280329&r2=280330&view=diff
==============================================================================
--- 
maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/DoxiaMojo.java
 (original)
+++ 
maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/DoxiaMojo.java
 Mon Sep 12 05:45:06 2005
@@ -276,8 +276,8 @@
                 if ( generatedSiteFile.exists() )
                 {
                     InputStream siteDescriptor = getSiteDescriptor( reports, 
locale );
-                    siteRenderer.render( generatedSiteFile, 
localeOutputDirectory, siteDescriptor, template,
-                                         attributes, locale );
+                    siteRenderer.render( generatedSiteFile, 
localeOutputDirectory, siteDescriptor, template, attributes,
+                                         locale );
                 }
 
                 // Generate static site
@@ -339,15 +339,16 @@
                     }
                     catch ( Exception e )
                     {
-                        throw new MojoExecutionException( "An error is 
occurred in project reports page generation.", e );
+                        throw new MojoExecutionException( "An error is 
occurred in project reports page generation.",
+                                                          e );
                     }
                 }
 
                 // Try to generate the index.html
                 if ( duplicate.get( "index" ) != null )
                 {
-                    getLog().info( "Ignoring the index file generation for the 
\"" + getDisplayLanguage( locale )
-                                       + "\" version." );
+                    getLog().info( "Ignoring the index file generation for the 
\"" + getDisplayLanguage( locale ) +
+                        "\" version." );
                 }
                 else
                 {
@@ -362,8 +363,8 @@
 
                     if ( duplicate.get( reportFileName ) != null )
                     {
-                        getLog().info( "Override the generated file \"" + 
reportFileName + "\" for the \""
-                                           + getDisplayLanguage( locale ) + 
"\" version." );
+                        getLog().info( "Override the generated file \"" + 
reportFileName + "\" for the \"" +
+                            getDisplayLanguage( locale ) + "\" version." );
                     }
                 }
 
@@ -397,21 +398,26 @@
                     MavenProject parentProject = project.getParent();
                     if ( parentProject != null )
                     {
-/* Not working: 1) parentProject.getBasedir() returns the current basedir for 
some reason, so it copies inside itself
-which loops forever, and 2) this might be better working as a top-level 
aggregation rather than pushing from the
-subprojects...
                         // TODO Handle user plugin configuration
-                        File parentSiteDir = new File( 
parentProject.getBasedir(),
-                                                       
parentProject.getBuild().getDirectory() + File.separator +
-                                                           "site" + 
File.separator + project.getArtifactId() );
+/* TODO: Not working, and would be better working as a top-level aggregation 
rather than pushing from the subprojects...
+                        File basedir = parentProject.getBasedir();
+                        if ( basedir != null )
+                        {
+                            String path = 
parentProject.getBuild().getDirectory() + "/site/" + project.getArtifactId();
+                            File parentSiteDir = new File( basedir, path );
+
+                            if ( !parentSiteDir.exists() )
+                            {
+                                parentSiteDir.mkdirs();
+                            }
 
-                        if ( !parentSiteDir.exists() )
+                            File siteDir = new File( outputDirectory );
+                            FileUtils.copyDirectoryStructure( siteDir, 
parentSiteDir );
+                        }
+                        else
                         {
-                            parentSiteDir.mkdirs();
+                            getLog().info( "Not using parent as it was not 
located on the filesystem" );
                         }
-
-                        File siteDir = new File( outputDirectory );
-                        FileUtils.copyDirectoryStructure( siteDir, 
parentSiteDir );
 */
                     }
                 }
@@ -447,8 +453,8 @@
             }
             else
             {
-                throw new MojoExecutionException( "'" + 
report.getCategoryName() + "' category define for "
-                    + report.getName( defaultLocale ) + " mojo isn't valid." );
+                throw new MojoExecutionException( "'" + 
report.getCategoryName() + "' category define for " +
+                    report.getName( defaultLocale ) + " mojo isn't valid." );
             }
         }
     }
@@ -535,7 +541,8 @@
         return buffer.toString();
     }
 
-    private void writeReportSubMenu( List reports, StringBuffer buffer, Locale 
locale, String key, String indexFilename )
+    private void writeReportSubMenu( List reports, StringBuffer buffer, Locale 
locale, String key,
+                                     String indexFilename )
     {
         if ( reports.size() > 0 )
         {
@@ -802,9 +809,9 @@
                     outputFile.getParentFile().mkdirs();
                 }
 
-                siteRenderer.generateDocument( new OutputStreamWriter( new 
FileOutputStream( outputFile ),
-                                                                       
outputEncoding ), template, attributes, sink,
-                                               locale );
+                siteRenderer.generateDocument(
+                    new OutputStreamWriter( new FileOutputStream( outputFile 
), outputEncoding ), template, attributes,
+                    sink, locale );
             }
         }
     }
@@ -982,8 +989,8 @@
 
                 if ( is == null )
                 {
-                    throw new IOException( "The resource " + line + " doesn't 
exists in " + DEFAULT_TEMPLATE
-                        + " template." );
+                    throw new IOException(
+                        "The resource " + line + " doesn't exists in " + 
DEFAULT_TEMPLATE + " template." );
                 }
 
                 File outputFile = new File( outputDir, line );
@@ -1017,7 +1024,7 @@
         {
             DirectoryScanner scanner = new DirectoryScanner();
 
-            String[] includedResources = { "**/**" };
+            String[] includedResources = {"**/**"};
 
             scanner.setIncludes( includedResources );
 
@@ -1066,7 +1073,8 @@
 
         if ( project.getModel().getReports() != null )
         {
-            getLog().error( "DEPRECATED: Plugin contains a <reports/> section: 
this is IGNORED - please use <reporting/> instead." );
+            getLog().error(
+                "DEPRECATED: Plugin contains a <reports/> section: this is 
IGNORED - please use <reporting/> instead." );
         }
 
         List reports = new ArrayList();
@@ -1184,10 +1192,11 @@
                 {
                     if ( sb == null )
                     {
-                        sb = new StringBuffer( "Some files are duplicates in 
the site directory or in the generated-site directory. " );
+                        sb = new StringBuffer(
+                            "Some files are duplicates in the site directory 
or in the generated-site directory. " );
                         sb.append( "\n" );
-                        sb.append( "Review the following files for the \"" + 
getDisplayLanguage( locale )
-                            + "\" version:" );
+                        sb.append(
+                            "Review the following files for the \"" + 
getDisplayLanguage( locale ) + "\" version:" );
                     }
 
                     sb.append( "\n" );



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to