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:
ContextEnabled, Mojo, org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
Direct Known Subclasses:
EffectiveSiteMojo, SiteMojo, SiteRunMojo

public abstract class AbstractSiteRenderingMojo
extends AbstractSiteMojo
implements org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable

Base class for site rendering mojos.

Version:
$Id: AbstractSiteRenderingMojo.html 861484 2013-05-09 23:10:16Z hboutemy $
Author:
Brett Porter

Field Summary
protected  File generatedSiteDirectory
          Directory containing generated documentation.
protected  MavenSession mavenSession
          The current Maven session.
protected  List<MavenReport> reports
          Reports (Maven 2).
protected  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<MavenReport>> categoriseReports(Collection<MavenReport> reports)
          Go through the collection of reports and put each report into a list for the appropriate category.
 void contextualize(org.codehaus.plexus.context.Context context)
          
protected  SiteRenderingContext createSiteRenderingContext(Locale locale)
           
protected  List<MavenReportExecution> getReports()
           
protected  Map<String,DocumentRenderer> locateDocuments(SiteRenderingContext context, List<MavenReportExecution> reports, Locale locale)
           
protected  Map<String,MavenReport> locateReports(List<MavenReportExecution> reports, Map<String,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(DecorationModel decorationModel, Locale locale, Map<String,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

@Component
protected Renderer siteRenderer
Site renderer.


reports

@Parameter(defaultValue="${reports}",
           required=true,
           readonly=true)
protected List<MavenReport> reports
Reports (Maven 2).


generatedSiteDirectory

@Parameter(alias="workingDirectory",
           defaultValue="${project.build.directory}/generated-site")
protected File generatedSiteDirectory
Directory containing generated documentation. This is used to pick up other source docs that might have been generated at build time.


mavenSession

@Component
protected MavenSession mavenSession
The current Maven session.

Constructor Detail

AbstractSiteRenderingMojo

public AbstractSiteRenderingMojo()
Method Detail

contextualize

public void contextualize(org.codehaus.plexus.context.Context context)
                   throws org.codehaus.plexus.context.ContextException

Specified by:
contextualize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
Throws:
org.codehaus.plexus.context.ContextException

getReports

protected List<MavenReportExecution> getReports()
                                         throws MojoExecutionException
Throws:
MojoExecutionException

createSiteRenderingContext

protected SiteRenderingContext createSiteRenderingContext(Locale locale)
                                                   throws MojoExecutionException,
                                                          IOException,
                                                          MojoFailureException
Throws:
MojoExecutionException
IOException
MojoFailureException

locateReports

protected Map<String,MavenReport> locateReports(List<MavenReportExecution> reports,
                                                Map<String,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<MavenReport>> categoriseReports(Collection<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,DocumentRenderer> locateDocuments(SiteRenderingContext context,
                                                       List<MavenReportExecution> reports,
                                                       Locale locale)
                                                throws IOException,
                                                       RendererException
Throws:
IOException
RendererException

populateReportItems

protected void populateReportItems(DecorationModel decorationModel,
                                   Locale locale,
                                   Map<String,MavenReport> reportsByOutputName)


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