Package org.jbake.app
Class Renderer
- java.lang.Object
-
- org.jbake.app.Renderer
-
public class Renderer extends java.lang.ObjectRender output to a file.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classRenderer.ModelRenderingConfig
-
Constructor Summary
Constructors Constructor Description Renderer(ContentStore db, java.io.File destination, java.io.File templatesPath, org.apache.commons.configuration2.CompositeConfiguration config)Deprecated.UseRenderer(ContentStore, JBakeConfiguration)instead.Renderer(ContentStore db, java.io.File destination, java.io.File templatesPath, org.apache.commons.configuration2.CompositeConfiguration config, DelegatingTemplateEngine renderingEngine)Deprecated.Renderer(ContentStore db, JBakeConfiguration config)Creates a new instance of Renderer with supplied references to folders.Renderer(ContentStore db, JBakeConfiguration config, DelegatingTemplateEngine renderingEngine)Creates a new instance of Renderer with supplied references to folders and the instance of DelegatingTemplateEngine to use.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrender(DocumentModel content)Render the supplied content to a file.voidrenderArchive(java.lang.String archiveFile)Render an archive file using the supplied content.voidrenderError404(java.lang.String errorFile)Render an 404 file using the predefined template.voidrenderFeed(java.lang.String feedFile)Render an XML feed file using the supplied content.voidrenderIndex(java.lang.String indexFile)Render an index file using the supplied content.voidrenderIndexPaging(java.lang.String indexFile)voidrenderSitemap(java.lang.String sitemapFile)Render an XML sitemap file using the supplied content.intrenderTags(java.lang.String tagPath)Render tag files using the supplied content.
-
-
-
Constructor Detail
-
Renderer
@Deprecated public Renderer(ContentStore db, java.io.File destination, java.io.File templatesPath, org.apache.commons.configuration2.CompositeConfiguration config)
Deprecated.UseRenderer(ContentStore, JBakeConfiguration)instead. Creates a new instance of Renderer with supplied references to folders.- Parameters:
db- The database holding the contentdestination- The destination foldertemplatesPath- The templates folderconfig- Project configuration
-
Renderer
@Deprecated public Renderer(ContentStore db, java.io.File destination, java.io.File templatesPath, org.apache.commons.configuration2.CompositeConfiguration config, DelegatingTemplateEngine renderingEngine)
Deprecated.UseRenderer(ContentStore, JBakeConfiguration, DelegatingTemplateEngine)instead. Creates a new instance of Renderer with supplied references to folders and the instance of DelegatingTemplateEngine to use.- Parameters:
db- The database holding the contentdestination- The destination foldertemplatesPath- The templates folderconfig- Project configurationrenderingEngine- The instance of DelegatingTemplateEngine to use
-
Renderer
public Renderer(ContentStore db, JBakeConfiguration config)
Creates a new instance of Renderer with supplied references to folders.- Parameters:
db- The database holding the contentconfig- Project configuration
-
Renderer
public Renderer(ContentStore db, JBakeConfiguration config, DelegatingTemplateEngine renderingEngine)
Creates a new instance of Renderer with supplied references to folders and the instance of DelegatingTemplateEngine to use.- Parameters:
db- The database holding the contentconfig- The application specific configurationrenderingEngine- The instance of DelegatingTemplateEngine to use
-
-
Method Detail
-
render
public void render(DocumentModel content) throws java.lang.Exception
Render the supplied content to a file.- Parameters:
content- The content to renderDocument- Throws:
java.lang.Exception- if IOException or SecurityException are raised
-
renderIndex
public void renderIndex(java.lang.String indexFile) throws java.lang.ExceptionRender an index file using the supplied content.- Parameters:
indexFile- The name of the output file- Throws:
java.lang.Exception- if IOException or SecurityException are raised
-
renderIndexPaging
public void renderIndexPaging(java.lang.String indexFile) throws java.lang.Exception- Throws:
java.lang.Exception
-
renderSitemap
public void renderSitemap(java.lang.String sitemapFile) throws java.lang.ExceptionRender an XML sitemap file using the supplied content.- Parameters:
sitemapFile- configuration for site map- Throws:
java.lang.Exception- if can't create correct default rendering config- See Also:
- About Sitemaps, Sitemap protocol
-
renderFeed
public void renderFeed(java.lang.String feedFile) throws java.lang.ExceptionRender an XML feed file using the supplied content.- Parameters:
feedFile- The name of the output file- Throws:
java.lang.Exception- if default rendering configuration is not loaded correctly
-
renderArchive
public void renderArchive(java.lang.String archiveFile) throws java.lang.ExceptionRender an archive file using the supplied content.- Parameters:
archiveFile- The name of the output file- Throws:
java.lang.Exception- if default rendering configuration is not loaded correctly
-
renderError404
public void renderError404(java.lang.String errorFile) throws java.lang.ExceptionRender an 404 file using the predefined template.- Parameters:
errorFile- The name of the output file- Throws:
java.lang.Exception- if default rendering configuration is not loaded correctly
-
renderTags
public int renderTags(java.lang.String tagPath) throws java.lang.ExceptionRender tag files using the supplied content.- Parameters:
tagPath- The output path- Returns:
- Number of rendered tags
- Throws:
java.lang.Exception- if cannot render tags correctly
-
-