org.apache.maven.doxia.siterenderer
Class DefaultSiteRenderer

java.lang.Object
  extended byorg.codehaus.plexus.logging.AbstractLogEnabled
      extended byorg.apache.maven.doxia.siterenderer.DefaultSiteRenderer
All Implemented Interfaces:
org.codehaus.plexus.logging.LogEnabled, Renderer

public class DefaultSiteRenderer
extends org.codehaus.plexus.logging.AbstractLogEnabled
implements Renderer

Since:
1.0
Version:
$Id: DefaultSiteRenderer.java 746600 2009-02-21 23:07:32Z brianf $
Author:
Emmanuel Venisse, Vincent Siveton

Field Summary
 
Fields inherited from interface org.apache.maven.doxia.siterenderer.Renderer
ROLE
 
Constructor Summary
DefaultSiteRenderer()
           
 
Method Summary
protected  void copyDirectory(java.io.File source, java.io.File destination)
          Copy the directory
 void copyResources(SiteRenderingContext siteRenderingContext, java.io.File resourcesDirectory, java.io.File outputDirectory)
          Copy resource files.
 SiteRenderingContext createContextForSkin(java.io.File skinFile, java.util.Map attributes, DecorationModel decoration, java.lang.String defaultWindowTitle, java.util.Locale locale)
          Return a SiteRenderingContext.
 SiteRenderingContext createContextForTemplate(java.io.File templateFile, java.io.File skinFile, java.util.Map attributes, DecorationModel decoration, java.lang.String defaultWindowTitle, java.util.Locale locale)
          Return a SiteRenderingContext.
 void generateDocument(java.io.Writer writer, SiteRendererSink sink, SiteRenderingContext siteRenderingContext)
          Generate a document.
 java.util.Map locateDocumentFiles(SiteRenderingContext siteRenderingContext)
          Return the document files in a Map.
 void render(java.util.Collection documents, SiteRenderingContext siteRenderingContext, java.io.File outputDirectory)
          Render a collection of documents.
 void renderDocument(java.io.Writer writer, org.apache.maven.doxia.module.xhtml.decoration.render.RenderingContext renderingContext, SiteRenderingContext context)
          Render a document.
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSiteRenderer

public DefaultSiteRenderer()
Method Detail

render

public void render(java.util.Collection documents,
                   SiteRenderingContext siteRenderingContext,
                   java.io.File outputDirectory)
            throws RendererException,
                   java.io.IOException
Render a collection of documents.

Specified by:
render in interface Renderer
Parameters:
documents - the documents to render.
siteRenderingContext - the SiteRenderingContext to use.
outputDirectory - the output directory to write results.
Throws:
java.io.IOException - if it bombs.
RendererException - if it bombs.

locateDocumentFiles

public java.util.Map locateDocumentFiles(SiteRenderingContext siteRenderingContext)
                                  throws java.io.IOException,
                                         RendererException
Return the document files in a Map.

Specified by:
locateDocumentFiles in interface Renderer
Parameters:
siteRenderingContext -
Returns:
the document files in a Map.
Throws:
java.io.IOException - if it bombs.
RendererException - if it bombs.

renderDocument

public void renderDocument(java.io.Writer writer,
                           org.apache.maven.doxia.module.xhtml.decoration.render.RenderingContext renderingContext,
                           SiteRenderingContext context)
                    throws RendererException,
                           java.io.FileNotFoundException,
                           java.io.UnsupportedEncodingException
Render a document.

Specified by:
renderDocument in interface Renderer
Parameters:
writer -
renderingContext -
context -
Throws:
java.io.FileNotFoundException - if it bombs.
java.io.UnsupportedEncodingException - if it bombs.
RendererException - if it bombs.

generateDocument

public void generateDocument(java.io.Writer writer,
                             SiteRendererSink sink,
                             SiteRenderingContext siteRenderingContext)
                      throws RendererException
Generate a document.

Specified by:
generateDocument in interface Renderer
Parameters:
writer - the Writer to use.
sink - the Sink to receive the events.
siteRenderingContext - the SiteRenderingContext to use.
Throws:
RendererException - if it bombs.

createContextForSkin

public SiteRenderingContext createContextForSkin(java.io.File skinFile,
                                                 java.util.Map attributes,
                                                 DecorationModel decoration,
                                                 java.lang.String defaultWindowTitle,
                                                 java.util.Locale locale)
                                          throws java.io.IOException
Return a SiteRenderingContext.

Specified by:
createContextForSkin in interface Renderer
Parameters:
skinFile -
attributes -
decoration -
defaultWindowTitle -
locale -
Returns:
a SiteRenderingContext.
Throws:
java.io.IOException - if it bombs.

createContextForTemplate

public SiteRenderingContext createContextForTemplate(java.io.File templateFile,
                                                     java.io.File skinFile,
                                                     java.util.Map attributes,
                                                     DecorationModel decoration,
                                                     java.lang.String defaultWindowTitle,
                                                     java.util.Locale locale)
                                              throws java.net.MalformedURLException
Return a SiteRenderingContext.

Specified by:
createContextForTemplate in interface Renderer
Parameters:
templateFile -
skinFile -
attributes -
decoration -
defaultWindowTitle -
locale -
Returns:
a SiteRenderingContext.
Throws:
java.net.MalformedURLException - if it bombs.

copyResources

public void copyResources(SiteRenderingContext siteRenderingContext,
                          java.io.File resourcesDirectory,
                          java.io.File outputDirectory)
                   throws java.io.IOException
Copy resource files.

Specified by:
copyResources in interface Renderer
Parameters:
siteRenderingContext -
resourcesDirectory -
outputDirectory -
Throws:
java.io.IOException - if it bombs.

copyDirectory

protected void copyDirectory(java.io.File source,
                             java.io.File destination)
                      throws java.io.IOException
Copy the directory

Parameters:
source - source file to be copied
destination - destination file
Throws:
java.io.IOException - if any


Copyright © 2005-2009 The Apache Software Foundation. All Rights Reserved.