maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From denn...@apache.org
Subject svn commit: r737608 - in /maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x: ./ doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/
Date Sun, 25 Jan 2009 23:38:30 GMT
Author: dennisl
Date: Sun Jan 25 23:38:30 2009
New Revision: 737608

URL: http://svn.apache.org/viewvc?rev=737608&view=rev
Log:
Merge r693844 from trunk.

Modified:
    maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/   (props changed)
    maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
    maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DocumentRenderer.java
    maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DoxiaDocumentRenderer.java
    maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/Renderer.java
    maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/RendererException.java
    maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java

Propchange: maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jan 25 23:38:30 2009
@@ -1 +1 @@
-/maven/doxia/doxia-sitetools/trunk:629097,641296,736602-736603,736628-736630
+/maven/doxia/doxia-sitetools/trunk:629097,641296,693844,736602-736603,736628-736630

Modified: maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java?rev=737608&r1=737607&r2=737608&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
(original)
+++ maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
Sun Jan 25 23:38:30 2009
@@ -19,6 +19,40 @@
  * under the License.
  */
 
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import java.text.DateFormat;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
 import org.apache.maven.doxia.Doxia;
 import org.apache.maven.doxia.module.xhtml.decoration.render.RenderingContext;
 import org.apache.maven.doxia.parser.ParseException;
@@ -29,23 +63,23 @@
 import org.apache.maven.doxia.module.site.manager.SiteModuleManager;
 import org.apache.maven.doxia.module.site.manager.SiteModuleNotFoundException;
 import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink;
+
 import org.apache.velocity.Template;
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.context.Context;
+
 import org.codehaus.plexus.i18n.I18N;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
-import org.codehaus.plexus.util.*;
+import org.codehaus.plexus.util.DirectoryScanner;
+import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.Os;
+import org.codehaus.plexus.util.PathTool;
+import org.codehaus.plexus.util.ReaderFactory;
+import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.velocity.SiteResourceLoader;
 import org.codehaus.plexus.velocity.VelocityComponent;
 
-import java.io.*;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.text.DateFormat;
-import java.util.*;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
 
 /**
  * @author <a href="mailto:evenisse@codehaus.org">Emmanuel Venisse</a>
@@ -565,7 +599,7 @@
         SiteRenderingContext context = new SiteRenderingContext();
 
         context.setTemplateName( templateFile.getName() );
-        context.setTemplateClassLoader( new URLClassLoader( new URL[]{templateFile.getParentFile().toURL()}
) );
+        context.setTemplateClassLoader( new URLClassLoader( new URL[]{templateFile.getParentFile().toURI().toURL()}
) );
 
         context.setTemplateProperties( attributes );
         context.setLocale( locale );
@@ -590,15 +624,15 @@
     }
 
     /** {@inheritDoc} */
-    public void copyResources( SiteRenderingContext siteContext,
+    public void copyResources( SiteRenderingContext siteRenderingContext,
                                File resourcesDirectory,
-                               File outputDirectory )
+                               File outputDirectory  )
             throws IOException
     {
-        if ( siteContext.getSkinJarFile() != null )
+        if ( siteRenderingContext.getSkinJarFile() != null )
         {
             // TODO: plexus-archiver, if it could do the excludes
-            ZipFile file = new ZipFile( siteContext.getSkinJarFile() );
+            ZipFile file = new ZipFile( siteRenderingContext.getSkinJarFile() );
             try
             {
                 for ( Enumeration e = file.entries(); e.hasMoreElements(); )
@@ -627,7 +661,7 @@
             }
         }
 
-        if ( siteContext.isUsingDefaultTemplate() )
+        if ( siteRenderingContext.isUsingDefaultTemplate() )
         {
             InputStream resourceList = getClass().getClassLoader()
                     .getResourceAsStream( RESOURCE_DIR + "/resources.txt" );

Modified: maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DocumentRenderer.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DocumentRenderer.java?rev=737608&r1=737607&r2=737608&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DocumentRenderer.java
(original)
+++ maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DocumentRenderer.java
Sun Jan 25 23:38:30 2009
@@ -19,12 +19,12 @@
  * under the License.
  */
 
-import org.apache.maven.doxia.module.xhtml.decoration.render.RenderingContext;
-
 import java.io.FileNotFoundException;
 import java.io.UnsupportedEncodingException;
 import java.io.Writer;
 
+import org.apache.maven.doxia.module.xhtml.decoration.render.RenderingContext;
+
 /**
  * Renders a page.
  *
@@ -32,11 +32,30 @@
  */
 public interface DocumentRenderer
 {
+    /**
+     * Render a document.
+     *
+     * @param writer
+     * @param renderer
+     * @param siteRenderingContext
+     * @throws org.apache.maven.doxia.siterenderer.RendererException if it bombs.
+     * @throws java.io.FileNotFoundException if it bombs.
+     * @throws java.io.UnsupportedEncodingException if it bombs.
+     */
     void renderDocument( Writer writer, Renderer renderer, SiteRenderingContext siteRenderingContext
)
         throws RendererException, FileNotFoundException, UnsupportedEncodingException;
 
+    /**
+     * The name of the output document.
+     *
+     * @return the name of the output document.
+     */
     String getOutputName();
 
+    /**
+     * Return the RenderingContext.
+     * @return RenderingContext.
+     */
     RenderingContext getRenderingContext();
 
     /**

Modified: maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DoxiaDocumentRenderer.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DoxiaDocumentRenderer.java?rev=737608&r1=737607&r2=737608&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DoxiaDocumentRenderer.java
(original)
+++ maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DoxiaDocumentRenderer.java
Sun Jan 25 23:38:30 2009
@@ -19,12 +19,12 @@
  * under the License.
  */
 
-import org.apache.maven.doxia.module.xhtml.decoration.render.RenderingContext;
-
 import java.io.FileNotFoundException;
 import java.io.UnsupportedEncodingException;
 import java.io.Writer;
 
+import org.apache.maven.doxia.module.xhtml.decoration.render.RenderingContext;
+
 /**
  * Renders a page with Doxia.
  *
@@ -35,27 +35,36 @@
 {
     private RenderingContext renderingContext;
 
+    /**
+     * Constructor.
+     *
+     * @param renderingContext the RenderingContext to use.
+     */
     public DoxiaDocumentRenderer( RenderingContext renderingContext )
     {
         this.renderingContext = renderingContext;
     }
 
+    /** {@inheritDoc} */
     public void renderDocument( Writer writer, Renderer renderer, SiteRenderingContext siteRenderingContext
)
         throws RendererException, FileNotFoundException, UnsupportedEncodingException
     {
         renderer.renderDocument( writer, renderingContext, siteRenderingContext );
     }
 
+    /** {@inheritDoc} */
     public String getOutputName()
     {
         return renderingContext.getOutputName();
     }
 
+    /** {@inheritDoc} */
     public RenderingContext getRenderingContext()
     {
         return renderingContext;
     }
 
+    /** {@inheritDoc} */
     public boolean isOverwrite()
     {
         return false;

Modified: maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/Renderer.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/Renderer.java?rev=737608&r1=737607&r2=737608&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/Renderer.java
(original)
+++ maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/Renderer.java
Sun Jan 25 23:38:30 2009
@@ -19,10 +19,6 @@
  * under the License.
  */
 
-import org.apache.maven.doxia.module.xhtml.decoration.render.RenderingContext;
-import org.apache.maven.doxia.site.decoration.DecorationModel;
-import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink;
-
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
@@ -33,35 +29,108 @@
 import java.util.Locale;
 import java.util.Map;
 
+import org.apache.maven.doxia.module.xhtml.decoration.render.RenderingContext;
+import org.apache.maven.doxia.site.decoration.DecorationModel;
+import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink;
+
 /**
  * @author <a href="mailto:evenisse@codehaus.org>Emmanuel Venisse</a>
  * @version $Id:Renderer.java 348612 2005-11-24 12:54:19 +1100 (Thu, 24 Nov 2005) brett $
  */
 public interface Renderer
 {
+    /**
+     * Plexus lookup role.
+     */
     String ROLE = Renderer.class.getName();
 
+    /**
+     * Render a collection of documents.
+     *
+     * @param documents the documents to render.
+     * @param siteRenderingContext the SiteRenderingContext to use.
+     * @param outputDirectory the output directory to write results.
+     * @throws org.apache.maven.doxia.siterenderer.RendererException if it bombs.
+     * @throws java.io.IOException if it bombs.
+     */
     void render( Collection documents, SiteRenderingContext siteRenderingContext, File outputDirectory
)
         throws RendererException, IOException;
 
+    /**
+     * Generate a document.
+     *
+     * @param writer the Writer to use.
+     * @param sink the Sink to receive the events.
+     * @param siteRenderingContext the SiteRenderingContext to use.
+     * @throws org.apache.maven.doxia.siterenderer.RendererException if it bombs.
+     */
     void generateDocument( Writer writer, SiteRendererSink sink, SiteRenderingContext siteRenderingContext
)
         throws RendererException;
 
+    /**
+     * Return a SiteRenderingContext.
+     *
+     * @param skinFile
+     * @param attributes
+     * @param decoration
+     * @param defaultWindowTitle
+     * @param locale
+     * @return a SiteRenderingContext.
+     * @throws java.io.IOException if it bombs.
+     */
     SiteRenderingContext createContextForSkin( File skinFile, Map attributes, DecorationModel
decoration,
                                                String defaultWindowTitle, Locale locale )
         throws IOException;
 
+    /**
+     * Return a SiteRenderingContext.
+     *
+     * @param templateFile
+     * @param skinFile
+     * @param attributes
+     * @param decoration
+     * @param defaultWindowTitle
+     * @param locale
+     * @return a SiteRenderingContext.
+     * @throws java.net.MalformedURLException if it bombs.
+     */
     SiteRenderingContext createContextForTemplate( File templateFile, File skinFile, Map
attributes,
                                                    DecorationModel decoration, String defaultWindowTitle,
                                                    Locale locale )
         throws MalformedURLException;
 
+    /**
+     * Copy resource files.
+     *
+     * @param siteRenderingContext
+     * @param resourcesDirectory
+     * @param outputDirectory
+     * @throws java.io.IOException if it bombs.
+     */
     void copyResources( SiteRenderingContext siteRenderingContext, File resourcesDirectory,
File outputDirectory )
         throws IOException;
 
+    /**
+     * Return the document files in a Map.
+     *
+     * @param siteRenderingContext
+     * @return the document files in a Map.
+     * @throws java.io.IOException if it bombs.
+     * @throws org.apache.maven.doxia.siterenderer.RendererException if it bombs.
+     */
     Map locateDocumentFiles( SiteRenderingContext siteRenderingContext )
         throws IOException, RendererException;
 
+    /**
+     * Render a document.
+     *
+     * @param writer
+     * @param renderingContext
+     * @param context
+     * @throws org.apache.maven.doxia.siterenderer.RendererException if it bombs.
+     * @throws java.io.FileNotFoundException if it bombs.
+     * @throws java.io.UnsupportedEncodingException if it bombs.
+     */
     void renderDocument( Writer writer, RenderingContext renderingContext, SiteRenderingContext
context )
         throws RendererException, FileNotFoundException, UnsupportedEncodingException;
 }

Modified: maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/RendererException.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/RendererException.java?rev=737608&r1=737607&r2=737608&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/RendererException.java
(original)
+++ maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/RendererException.java
Sun Jan 25 23:38:30 2009
@@ -25,11 +25,25 @@
 public class RendererException
     extends Exception
 {
+
+    private static final long serialVersionUID = 3141592653589793238L;
+
+    /**
+     * Construct a RendererException with a message.
+     *
+     * @param message a custom message.
+     */
     public RendererException( String message )
     {
         super( message );
     }
 
+    /**
+     * Construct a RendererException with a message and a cause.
+     *
+     * @param message a custom message.
+     * @param t the cause.
+     */
     public RendererException( String message, Throwable t )
     {
         super( message, t );

Modified: maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java?rev=737608&r1=737607&r2=737608&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java
(original)
+++ maven/doxia/doxia-sitetools/branches/doxia-sitetools-1.0.x/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java
Sun Jan 25 23:38:30 2009
@@ -19,8 +19,6 @@
  * under the License.
  */
 
-import org.apache.maven.doxia.site.decoration.DecorationModel;
-
 import java.io.File;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -28,6 +26,8 @@
 import java.util.Locale;
 import java.util.Map;
 
+import org.apache.maven.doxia.site.decoration.DecorationModel;
+
 /**
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  * @version $Id:DefaultSiteRenderer.java 348612 2005-11-24 12:54:19 +1100 (Thu, 24 Nov 2005)
brett $



Mime
View raw message