org.apache.maven.plugin.changelog
Class ChangeLogReport

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.reporting.AbstractMavenReport
          extended by org.apache.maven.plugin.changelog.ChangeLogReport
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.apache.maven.reporting.MavenReport
Direct Known Subclasses:
DeveloperActivityReport, FileActivityReport

public class ChangeLogReport
extends org.apache.maven.reporting.AbstractMavenReport

Generate a changelog report.


Field Summary
protected  java.lang.String displayFileDetailUrl
          A template string that is used to create the URL to the file details.
protected  java.lang.String scmUrl
          The URL to view the scm.
 
Fields inherited from interface org.apache.maven.reporting.MavenReport
CATEGORY_PROJECT_INFORMATION, CATEGORY_PROJECT_REPORTS, ROLE
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
ChangeLogReport()
           
 
Method Summary
 boolean canGenerateReport()
           
 void checkResult(org.apache.maven.scm.ScmResult result)
           
protected  long countFilesChanged(java.util.Collection entries)
          counts the number of files that were changed in the specified SCM
protected  void doChangeSetTitle(org.apache.maven.scm.command.changelog.ChangeLogSet set, java.util.ResourceBundle bundle, org.apache.maven.doxia.sink.Sink sink)
          Generate the title for the report.
protected  void doGenerateEmptyReport(java.util.ResourceBundle bundle, org.apache.maven.doxia.sink.Sink sink)
          generates an empty report in case there are no sources to generate a report with
protected  void doGenerateReport(java.util.List changeLogSets, java.util.ResourceBundle bundle, org.apache.maven.doxia.sink.Sink sink)
          method that generates the report for this mojo.
protected  void doSummary(org.apache.maven.scm.command.changelog.ChangeLogSet set, java.util.ResourceBundle bundle, org.apache.maven.doxia.sink.Sink sink)
          Generate the summary section of the report.
 void executeReport(java.util.Locale locale)
           
protected  java.util.List generateChangeSetsFromSCM()
          creates a ChangeLog object and then connects to the SCM to generate the changed sets
protected  void generateLinks(java.lang.String connection, java.lang.String name, org.apache.maven.doxia.sink.Sink sink)
          attaches the http links from the changed files
protected  void generateLinks(java.lang.String connection, java.lang.String name, java.lang.String revision, org.apache.maven.doxia.sink.Sink sink)
          attaches the http links from the changed files
protected  java.util.ResourceBundle getBundle(java.util.Locale locale)
           
protected  java.util.List getChangedSets()
          populates the changedSets field by either connecting to the SCM or using an existing XML generated in a previous run of the report
protected  java.lang.String getConnection()
          used to retrieve the SCM connection string
 java.lang.String getDescription(java.util.Locale locale)
           
 java.lang.String getName(java.util.Locale locale)
           
protected  java.lang.String getOutputDirectory()
           
 java.lang.String getOutputName()
           
protected  org.apache.maven.project.MavenProject getProject()
           
 org.apache.maven.scm.repository.ScmRepository getScmRepository()
           
protected  org.apache.maven.doxia.siterenderer.Renderer getSiteRenderer()
           
protected  void initReportUrls()
          populates the report url used to create links from certain elements of the report
 
Methods inherited from class org.apache.maven.reporting.AbstractMavenReport
closeReport, execute, generate, generate, generate, getCategoryName, getReportOutputDirectory, getSink, getSinkFactory, isExternalReport, setReportOutputDirectory
 
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
 

Field Detail

scmUrl

protected java.lang.String scmUrl
The URL to view the scm. Basis for external links from the generated report.


displayFileDetailUrl

protected java.lang.String displayFileDetailUrl
A template string that is used to create the URL to the file details. There is a special token that you can use in your template:

Example: http://checkstyle.cvs.sourceforge.net/checkstyle%FILE%?view=markup

Note: If you don't supply the token in your template, the path of the file will simply be appended to your template URL.

Constructor Detail

ChangeLogReport

public ChangeLogReport()
Method Detail

executeReport

public void executeReport(java.util.Locale locale)
                   throws org.apache.maven.reporting.MavenReportException
Specified by:
executeReport in class org.apache.maven.reporting.AbstractMavenReport
Throws:
org.apache.maven.reporting.MavenReportException
See Also:
AbstractMavenReport.executeReport(java.util.Locale)

getChangedSets

protected java.util.List getChangedSets()
                                 throws org.apache.maven.reporting.MavenReportException
populates the changedSets field by either connecting to the SCM or using an existing XML generated in a previous run of the report

Throws:
org.apache.maven.reporting.MavenReportException

generateChangeSetsFromSCM

protected java.util.List generateChangeSetsFromSCM()
                                            throws org.apache.maven.reporting.MavenReportException
creates a ChangeLog object and then connects to the SCM to generate the changed sets

Returns:
changedlogsets generated from the SCM
Throws:
org.apache.maven.reporting.MavenReportException

getScmRepository

public org.apache.maven.scm.repository.ScmRepository getScmRepository()
                                                               throws org.apache.maven.scm.ScmException
Throws:
org.apache.maven.scm.ScmException

checkResult

public void checkResult(org.apache.maven.scm.ScmResult result)
                 throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getConnection

protected java.lang.String getConnection()
                                  throws org.apache.maven.reporting.MavenReportException
used to retrieve the SCM connection string

Returns:
the url string used to connect to the SCM
Throws:
org.apache.maven.reporting.MavenReportException - when there is insufficient information to retrieve the SCM connection string

doGenerateEmptyReport

protected void doGenerateEmptyReport(java.util.ResourceBundle bundle,
                                     org.apache.maven.doxia.sink.Sink sink)
generates an empty report in case there are no sources to generate a report with

Parameters:
bundle - the resource bundle to retrieve report phrases from
sink - the report formatting tool

doGenerateReport

protected void doGenerateReport(java.util.List changeLogSets,
                                java.util.ResourceBundle bundle,
                                org.apache.maven.doxia.sink.Sink sink)
method that generates the report for this mojo. This method is overridden by dev-activity and file-activity mojo

Parameters:
changeLogSets - changed sets to generate the report from
bundle - the resource bundle to retrieve report phrases from
sink - the report formatting tool

doChangeSetTitle

protected void doChangeSetTitle(org.apache.maven.scm.command.changelog.ChangeLogSet set,
                                java.util.ResourceBundle bundle,
                                org.apache.maven.doxia.sink.Sink sink)
Generate the title for the report.

Parameters:
set - change set to generate the report from
bundle - the resource bundle to retrieve report phrases from
sink - the report formatting tool

doSummary

protected void doSummary(org.apache.maven.scm.command.changelog.ChangeLogSet set,
                         java.util.ResourceBundle bundle,
                         org.apache.maven.doxia.sink.Sink sink)
Generate the summary section of the report.

Parameters:
set - change set to generate the report from
bundle - the resource bundle to retrieve report phrases from
sink - the report formatting tool

countFilesChanged

protected long countFilesChanged(java.util.Collection entries)
counts the number of files that were changed in the specified SCM

Parameters:
entries - a collection of SCM changes
Returns:
number of files changed for the changedsets

initReportUrls

protected void initReportUrls()
populates the report url used to create links from certain elements of the report


generateLinks

protected void generateLinks(java.lang.String connection,
                             java.lang.String name,
                             org.apache.maven.doxia.sink.Sink sink)
attaches the http links from the changed files

Parameters:
connection - the string used to connect to the SCM
name - filename of the file that was changed
sink - the report formatting tool

generateLinks

protected void generateLinks(java.lang.String connection,
                             java.lang.String name,
                             java.lang.String revision,
                             org.apache.maven.doxia.sink.Sink sink)
attaches the http links from the changed files

Parameters:
connection - the string used to connect to the SCM
name - filename of the file that was changed
revision - the revision code
sink - the report formatting tool

getProject

protected org.apache.maven.project.MavenProject getProject()
Specified by:
getProject in class org.apache.maven.reporting.AbstractMavenReport
See Also:
AbstractMavenReport.getProject()

getOutputDirectory

protected java.lang.String getOutputDirectory()
Specified by:
getOutputDirectory in class org.apache.maven.reporting.AbstractMavenReport
See Also:
AbstractMavenReport.getOutputDirectory()

getSiteRenderer

protected org.apache.maven.doxia.siterenderer.Renderer getSiteRenderer()
Specified by:
getSiteRenderer in class org.apache.maven.reporting.AbstractMavenReport
See Also:
AbstractMavenReport.getSiteRenderer()

getDescription

public java.lang.String getDescription(java.util.Locale locale)
See Also:
MavenReport.getDescription(java.util.Locale)

getName

public java.lang.String getName(java.util.Locale locale)
See Also:
MavenReport.getName(java.util.Locale)

getOutputName

public java.lang.String getOutputName()
See Also:
MavenReport.getOutputName()

getBundle

protected java.util.ResourceBundle getBundle(java.util.Locale locale)
See Also:
MavenReport.getOutputName()

canGenerateReport

public boolean canGenerateReport()
Specified by:
canGenerateReport in interface org.apache.maven.reporting.MavenReport
Overrides:
canGenerateReport in class org.apache.maven.reporting.AbstractMavenReport


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