@Singleton @Named public class DefaultSiteRenderer extends Object implements Renderer
DefaultSiteRenderer class.
| Constructor and Description |
|---|
DefaultSiteRenderer() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
copyDirectory(File source,
File destination)
Copy the directory
|
void |
copyResources(SiteRenderingContext siteRenderingContext,
File outputDirectory)
Copy resource files from skin, template, and site resources.
|
SiteRenderingContext |
createContextForSkin(org.apache.maven.artifact.Artifact skin,
Map<String,?> attributes,
SiteModel siteModel,
String defaultTitle,
Locale locale)
Create a Site Rendering Context for a site using a skin.
|
protected org.apache.velocity.context.Context |
createDocumentVelocityContext(DocumentRenderingContext docRenderingContext,
SiteRenderingContext siteRenderingContext)
Create a Velocity Context for a Doxia document, containing every information about rendered document.
|
protected org.apache.velocity.context.Context |
createSiteTemplateVelocityContext(DocumentContent content,
SiteRenderingContext siteRenderingContext)
Create a Velocity Context for the site template decorating the document.
|
protected org.apache.velocity.context.Context |
createToolManagedVelocityContext(SiteRenderingContext siteRenderingContext)
Creates a Velocity Context with all generic tools configured wit the site rendering context.
|
void |
generateDocument(Writer writer,
SiteRendererSink sink,
SiteRenderingContext siteRenderingContext) |
Map<String,DocumentRenderer> |
locateDocumentFiles(SiteRenderingContext siteRenderingContext) |
Map<String,DocumentRenderer> |
locateDocumentFiles(SiteRenderingContext siteRenderingContext,
boolean editable)
Locate Doxia document source files in the site source context.
|
void |
mergeDocumentIntoSite(Writer writer,
DocumentContent content,
SiteRenderingContext siteRenderingContext)
Generate a document output integrated in a site from a document content,
i.e.
|
void |
render(Collection<DocumentRenderer> documents,
SiteRenderingContext siteRenderingContext,
File outputDirectory)
Render a collection of documents into a site.
|
void |
renderDocument(Writer writer,
DocumentRenderingContext docRenderingContext,
SiteRenderingContext siteContext)
Render a document written in a Doxia markup language.
|
public Map<String,DocumentRenderer> locateDocumentFiles(SiteRenderingContext siteRenderingContext) throws IOException, RendererException
IOExceptionRendererExceptionpublic Map<String,DocumentRenderer> locateDocumentFiles(SiteRenderingContext siteRenderingContext, boolean editable) throws IOException, RendererException
locateDocumentFiles in interface SiteRenderersiteRenderingContext - the SiteRenderingContext to useeditable - Doxia document renderer as editable? (should not set editable if generated Doxia source)IOException - if it bombs.RendererException - if it bombs.public void render(Collection<DocumentRenderer> documents, SiteRenderingContext siteRenderingContext, File outputDirectory) throws RendererException, IOException
render in interface SiteRendererdocuments - the documents to render.siteRenderingContext - the SiteRenderingContext to use.outputDirectory - the output directory to write results.RendererException - if it bombs.IOException - if it bombs.public void renderDocument(Writer writer, DocumentRenderingContext docRenderingContext, SiteRenderingContext siteContext) throws RendererException
DoxiaDocumentRenderer.renderDocument in interface SiteRendererwriter - the writer to render the document to.docRenderingContext - the document's rendering context, which is expected to have a non-null parser id.siteContext - the site's rendering contextRendererException - if it bombs.protected org.apache.velocity.context.Context createToolManagedVelocityContext(SiteRenderingContext siteRenderingContext)
siteRenderingContext - the site rendering contextprotected org.apache.velocity.context.Context createDocumentVelocityContext(DocumentRenderingContext docRenderingContext, SiteRenderingContext siteRenderingContext)
docRenderingContext - the document's rendering contextsiteRenderingContext - the site rendering contextprotected org.apache.velocity.context.Context createSiteTemplateVelocityContext(DocumentContent content, SiteRenderingContext siteRenderingContext)
SiteRendererSink during document rendering.content - the document content to be merged into the templatesiteRenderingContext - the site rendering contextpublic void generateDocument(Writer writer, SiteRendererSink sink, SiteRenderingContext siteRenderingContext) throws RendererException
RendererExceptionpublic void mergeDocumentIntoSite(Writer writer, DocumentContent content, SiteRenderingContext siteRenderingContext) throws RendererException
mergeDocumentIntoSite in interface SiteRendererwriter - the Writer to use.content - the document content to be merged.siteRenderingContext - the SiteRenderingContext to use.RendererException - if it bombs.public SiteRenderingContext createContextForSkin(org.apache.maven.artifact.Artifact skin, Map<String,?> attributes, SiteModel siteModel, String defaultTitle, Locale locale) throws IOException, RendererException
createContextForSkin in interface SiteRendererskin - a skinattributes - attributes to usesiteModel - a site modeldefaultTitle - default titlelocale - locale to useIOException - if it bombs.RendererException - if it bombs.public void copyResources(SiteRenderingContext siteRenderingContext, File outputDirectory) throws IOException
copyResources in interface SiteRenderersiteRenderingContext - the SiteRenderingContext to use.outputDirectory - output directory as fileIOException - if it bombs.protected void copyDirectory(File source, File destination) throws IOException
source - source file to be copieddestination - destination fileIOException - if anyCopyright © 2005–2023 The Apache Software Foundation. All rights reserved.