Package org.jbake.app

Class Renderer


  • public class Renderer
    extends java.lang.Object
    Render output to a file.
    • Constructor Detail

      • Renderer

        @Deprecated
        public Renderer​(ContentStore db,
                        java.io.File destination,
                        java.io.File templatesPath,
                        org.apache.commons.configuration2.CompositeConfiguration config)
        Deprecated.
        Use Renderer(ContentStore, JBakeConfiguration) instead. Creates a new instance of Renderer with supplied references to folders.
        Parameters:
        db - The database holding the content
        destination - The destination folder
        templatesPath - The templates folder
        config - 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.
        Use Renderer(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 content
        destination - The destination folder
        templatesPath - The templates folder
        config - Project configuration
        renderingEngine - 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 content
        config - 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 content
        config - The application specific configuration
        renderingEngine - 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.Exception
        Render 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.Exception
        Render 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.Exception
        Render 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.Exception
        Render 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.Exception
        Render 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.Exception
        Render 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