Proposed Changes to the DocRenderer

  1. Remove signature render( File, File ), it can by default just call render( File, File, null )
  2. Replace render( File, File, File ) by render( File, File, DocumentModel ). Reason: we have to be able to generate some output without a physical documentDescriptor File. Eg for a maven pdf plugin, we could construct the information from site.xml and pom settings.
  3. Remove throws IOException; ? DocRendererException should be enough.
  4. What's the relation with org.apache.maven.doxia.siterenderer.DocumentRenderer and org.apache.maven.doxia.siterenderer.DoxiaDocumentRenderer?

 Interface changes

ad 1) and 2): I propose to replace DocRenderer by DocumentRenderer:

public interface DocumentRenderer
{
    /** Plexus lookup role. */
    String ROLE = DocumentRenderer.class.getName();

    /**
     * Render a document from a set of files, depending on a rendering context.
     *
     * @param files the files (absolute path names) to include in the document generation.
     * @param outputDirectory the output directory where the document should be generated.
     * @param model the document model, containing all the metadata, etc.
     * @throws DocRendererException if any.
     * @throws IOException if any.
     */
    void render( Collection files, File outputDirectory, DocumentModel model )
        throws DocRendererException, IOException;

    /**
     * Render a document from the files found in a source directory, depending on a rendering context.
     *
     * @param siteDirectory the directory containing the source files.
     *          This should follow the standart Maven convention, ie containing all the site modules.
     * @param outputDirectory the output directory where the document should be generated.
     * @param model the document model, containing all the metadata, etc.
     * @throws DocRendererException if any
     * @throws IOException if any
     */
    void render( File siteDirectory, File outputDirectory, DocumentModel model )
        throws DocRendererException, IOException;

    /**
     * Get the output extension associated with this DocRenderer.
     *
     * @return the ouput extension.
     */
    String getOutputExtension();
}

Votes

+1: ltheussl, vsiveton
+0:
-1:

Directory structure

Layout like:

+---o.a.m.d.docrenderer
		 DocumentRenderer.java
		...
+---o.a.m.d.docrenderer.pdf
		 PdfRenderer.java
 +---o.a.m.d.docrenderer.pdf.fo
		 	FoPdfRenderer.java
 +---o.a.m.d.docrenderer.pdf.itext
		 	ITextPdfRenderer.java
 +---o.a.m.d.docrenderer.rtf

 +1: ltheussl, vsiveton
+0:
-1:

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Sep 12, 2007

    Vincent Siveton says:

    For 3, Renderer interface (site-renderer) also throws IOException so we need to ...

    For 3, Renderer interface (site-renderer) also throws IOException so we need to be constant.

    For 4, I am not sure what you mean: DoxiaDocumentRenderer is the impl of  DocumentRenderer.
    Maybe you ask you about org.apache.maven.doxia.docrenderer.DocRenderer and org.apache.maven.doxia.siterenderer.DocumentRenderer?

  2. Sep 12, 2007

    Lukas Theussl says:

    I meant: what is the relation/difference between org.apache.maven.doxia.siterend...

    I meant: what is the relation/difference between org.apache.maven.doxia.siterenderer.DocumentRenderer and org.apache.maven.doxia.docrenderer.DocRenderer? They seem to be meant for doing quite the same thing...