org.apache.maven.plugins.site
Class AbstractSiteRenderingMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugins.site.AbstractSiteMojo
          extended by org.apache.maven.plugins.site.AbstractSiteRenderingMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, Contextualizable
Direct Known Subclasses:
EffectiveSiteMojo, SiteMojo, SiteRunMojo

public abstract class AbstractSiteRenderingMojo
extends AbstractSiteMojo
implements Contextualizable

Base class for site rendering mojos.

Version:
$Id: AbstractSiteRenderingMojo.html 816568 2012-05-08 12:09:38Z hboutemy $
Author:
Brett Porter

Field Summary
protected  File generatedSiteDirectory
          Directory containing generated documentation.
protected  org.apache.maven.execution.MavenSession mavenSession
          The current Maven session.
protected  List<org.apache.maven.reporting.MavenReport> reports
          Reports (Maven 2).
protected  org.apache.maven.doxia.siterenderer.Renderer siteRenderer
          Site renderer.
 
Fields inherited from class org.apache.maven.plugins.site.AbstractSiteMojo
i18n, locales, localRepository, project, reactorProjects, siteDirectory, siteTool
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractSiteRenderingMojo()
           
 
Method Summary
protected  Map<String,List<org.apache.maven.reporting.MavenReport>> categoriseReports(Collection<org.apache.maven.reporting.MavenReport> reports)
          Go through the collection of reports and put each report into a list for the appropriate category.
 void contextualize(Context context)
          
protected  org.apache.maven.doxia.siterenderer.SiteRenderingContext createSiteRenderingContext(Locale locale)
           
protected  List<org.apache.maven.reporting.exec.MavenReportExecution> getReports()
           
protected  Map<String,org.apache.maven.doxia.siterenderer.DocumentRenderer> locateDocuments(org.apache.maven.doxia.siterenderer.SiteRenderingContext context, List<org.apache.maven.reporting.exec.MavenReportExecution> reports, Locale locale)
           
protected  Map<String,org.apache.maven.reporting.MavenReport> locateReports(List<org.apache.maven.reporting.exec.MavenReportExecution> reports, Map<String,org.apache.maven.doxia.siterenderer.DocumentRenderer> documents, Locale locale)
          Go through the list of reports and process each one like this: Add the report to a map of reports keyed by filename having the report itself as value If the report is not yet in the map of documents, add it together with a suitable renderer
protected  void populateReportItems(org.apache.maven.doxia.site.decoration.DecorationModel decorationModel, Locale locale, Map<String,org.apache.maven.reporting.MavenReport> reportsByOutputName)
           
 
Methods inherited from class org.apache.maven.plugins.site.AbstractSiteMojo
getInputEncoding, getMavenVersion, getOutputEncoding, isMaven3OrMore
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.maven.plugin.Mojo
execute
 

Field Detail

siteRenderer

protected org.apache.maven.doxia.siterenderer.Renderer siteRenderer
Site renderer.

Is a Plexus component defined by:

reports

protected List<org.apache.maven.reporting.MavenReport> reports
Reports (Maven 2).

Is defined by:
expression:
${reports}
Is readonly.
Is required.

generatedSiteDirectory

protected File generatedSiteDirectory
Directory containing generated documentation. This is used to pick up other source docs that might have been generated at build time.

Is defined by:
default-value:
${project.build.directory}/generated-site
alias:
workingDirectory

mavenSession

protected org.apache.maven.execution.MavenSession mavenSession
The current Maven session.

Is defined by:
expression:
${session}
Is readonly.
Is required.
Constructor Detail

AbstractSiteRenderingMojo

public AbstractSiteRenderingMojo()
Method Detail

contextualize

public void contextualize(Context context)
                   throws ContextException

Specified by:
contextualize in interface Contextualizable
Throws:
ContextException

getReports

protected List<org.apache.maven.reporting.exec.MavenReportExecution> getReports()
                                                                         throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

createSiteRenderingContext

protected org.apache.maven.doxia.siterenderer.SiteRenderingContext createSiteRenderingContext(Locale locale)
                                                                                       throws org.apache.maven.plugin.MojoExecutionException,
                                                                                              IOException,
                                                                                              org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException
IOException
org.apache.maven.plugin.MojoFailureException

locateReports

protected Map<String,org.apache.maven.reporting.MavenReport> locateReports(List<org.apache.maven.reporting.exec.MavenReportExecution> reports,
                                                                           Map<String,org.apache.maven.doxia.siterenderer.DocumentRenderer> documents,
                                                                           Locale locale)
Go through the list of reports and process each one like this:

Parameters:
reports - A List of MavenReports
documents - A Map of documents, keyed by filename
locale - the Locale the reports are processed for.
Returns:
A map with all reports keyed by filename having the report itself as value. The map will be used to populate a menu.

categoriseReports

protected Map<String,List<org.apache.maven.reporting.MavenReport>> categoriseReports(Collection<org.apache.maven.reporting.MavenReport> reports)
Go through the collection of reports and put each report into a list for the appropriate category. The list is put into a map keyed by the name of the category.

Parameters:
reports - A Collection of MavenReports
Returns:
A map keyed category having the report itself as value

locateDocuments

protected Map<String,org.apache.maven.doxia.siterenderer.DocumentRenderer> locateDocuments(org.apache.maven.doxia.siterenderer.SiteRenderingContext context,
                                                                                           List<org.apache.maven.reporting.exec.MavenReportExecution> reports,
                                                                                           Locale locale)
                                                                                    throws IOException,
                                                                                           org.apache.maven.doxia.siterenderer.RendererException
Throws:
IOException
org.apache.maven.doxia.siterenderer.RendererException

populateReportItems

protected void populateReportItems(org.apache.maven.doxia.site.decoration.DecorationModel decorationModel,
                                   Locale locale,
                                   Map<String,org.apache.maven.reporting.MavenReport> reportsByOutputName)


Copyright © 2002-2011 The Apache Software Foundation. All Rights Reserved.