Class DefaultSiteRenderer

    • Constructor Detail

      • DefaultSiteRenderer

        public DefaultSiteRenderer()
    • Method Detail

      • locateDocumentFiles

        public java.util.Map<java.lang.String,​DocumentRenderer> locateDocumentFiles​(SiteRenderingContext siteRenderingContext)
                                                                                   throws java.io.IOException,
                                                                                          RendererException
        Locate Doxia document source files in the site source context.
        Specified by:
        locateDocumentFiles in interface SiteRenderer
        Parameters:
        siteRenderingContext - the SiteRenderingContext to use
        Returns:
        the Doxia document renderers in a Map keyed by output file path.
        Throws:
        java.io.IOException - if it bombs.
        RendererException - if it bombs.
      • render

        public void render​(java.util.Collection<DocumentRenderer> documents,
                           SiteRenderingContext siteRenderingContext,
                           java.io.File outputDirectory)
                    throws RendererException,
                           java.io.IOException
        Render a collection of documents into a site.
        Specified by:
        render in interface SiteRenderer
        Parameters:
        documents - the documents to render.
        siteRenderingContext - the SiteRenderingContext to use.
        outputDirectory - the output directory to write results.
        Throws:
        RendererException - if it bombs.
        java.io.IOException - if it bombs.
      • createToolManagedVelocityContext

        protected org.apache.velocity.context.Context createToolManagedVelocityContext​(SiteRenderingContext siteRenderingContext)
        Creates a Velocity Context with all generic tools configured wit the site rendering context.
        Parameters:
        siteRenderingContext - the site rendering context
        Returns:
        a Velocity tools managed context
      • createDocumentVelocityContext

        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.
        Parameters:
        docRenderingContext - the document's rendering context
        siteRenderingContext - the site rendering context
        Returns:
        a Velocity tools managed context
      • createSiteTemplateVelocityContext

        protected org.apache.velocity.context.Context createSiteTemplateVelocityContext​(DocumentContent content,
                                                                                        SiteRenderingContext siteRenderingContext)
        Create a Velocity Context for the site template decorating the document. In addition to all the informations from the document, this context contains data gathered in SiteRendererSink during document rendering.
        Parameters:
        content - the document content to be merged into the template
        siteRenderingContext - the site rendering context
        Returns:
        a Velocity tools managed context
      • mergeDocumentIntoSite

        public void mergeDocumentIntoSite​(java.io.Writer writer,
                                          DocumentContent content,
                                          SiteRenderingContext siteRenderingContext)
                                   throws RendererException
        Generate a document output integrated in a site from a document content, i.e. merge the document content into the site template.
        Specified by:
        mergeDocumentIntoSite in interface SiteRenderer
        Parameters:
        writer - the Writer to use.
        content - the document content to be merged.
        siteRenderingContext - the SiteRenderingContext to use.
        Throws:
        RendererException - if it bombs.
      • createContextForSkin

        public SiteRenderingContext createContextForSkin​(org.apache.maven.artifact.Artifact skin,
                                                         java.util.Map<java.lang.String,​?> attributes,
                                                         org.apache.maven.doxia.site.SiteModel siteModel,
                                                         java.lang.String defaultTitle,
                                                         java.util.Locale locale)
                                                  throws java.io.IOException,
                                                         RendererException
        Create a Site Rendering Context for a site using a skin.
        Specified by:
        createContextForSkin in interface SiteRenderer
        Parameters:
        skin - a skin
        attributes - attributes to use
        siteModel - a site model
        defaultTitle - default title
        locale - locale to use
        Returns:
        a SiteRenderingContext.
        Throws:
        java.io.IOException - if it bombs.
        RendererException - if it bombs.
      • copyResources

        public void copyResources​(SiteRenderingContext siteRenderingContext,
                                  java.io.File outputDirectory)
                           throws java.io.IOException
        Copy resource files from skin, template, and site resources.
        Specified by:
        copyResources in interface SiteRenderer
        Parameters:
        siteRenderingContext - the SiteRenderingContext to use.
        outputDirectory - output directory as file
        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