org.codehaus.mojo.scmchangelog
Class ScmActivityReport

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.reporting.AbstractMavenReport
          extended by org.codehaus.mojo.scmchangelog.ScmActivityReport
All Implemented Interfaces:
ContextEnabled, Mojo, MavenReport

public class ScmActivityReport
extends AbstractMavenReport

Goal which produces a changelog report based on the Subversion logs.

Version:
$Id: ScmActivityReport.java 10686 2009-09-12 20:42:13Z ehsavoie $
Author:
ehsavoie
Is defined by the goal name:
report

Field Summary
 
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
ScmActivityReport()
           
 
Method Summary
 void checkResult(org.apache.maven.scm.ScmResult result)
          Manages the result of the SCM command.
protected  void doGenerateReport(List releases, org.apache.maven.doxia.sink.Sink sink)
          Generates the report for this mojo.
protected  String doLinkIssue(String issue)
          Computes the URL to the issue in the bug tracker.
protected  void executeReport(Locale locale)
          Build the report.
protected  String formatDate(Date date)
          Format a java.util.Date using the specified date format.
protected  String formatTimestamp(Date date)
          Format a java.util.Date using the specified timestamp format.
protected  BugTrackLinker getBugTrackLinker()
           
protected  ResourceBundle getBundle(Locale locale)
           
 String getConnectionUrl()
          Getter for the connection URL to the SCM.
 String getDescription(Locale locale)
           
 org.apache.maven.scm.ScmFileSet getFileSet(String fileName)
          Build a SCM file set for a file in the SCM.
 org.apache.maven.scm.ScmFileSet getFileSet(String includes, String excludes)
          Build a SCM file set for a file in the SCM.
 Log getLog()
          Returns the logger that has been injected into this mojo.
 String getName(Locale locale)
           
protected  String getOutputDirectory()
          Return the output directory
 String getOutputName()
           
protected  Pattern getPattern()
          Compile the filter into a pattern.
protected  MavenProject getProject()
          Returns the current Maven Project
 org.apache.maven.scm.manager.ScmManager getScmManager()
          Getter for the SCM Manager with our own SCM providers.
 org.apache.maven.scm.repository.ScmRepository getScmRepository()
          Getter for the ScmRepository.
protected  org.apache.maven.doxia.siterenderer.Renderer getSiteRenderer()
          Return the Maven Site renderer
protected  String getTrackerType()
          Getter for the bug tracker type.
 void setConnectionUrl(String connectionUrl)
          Setter for the connection URL to the SCM.
 void setLog(Log log)
           
 
Methods inherited from class org.apache.maven.reporting.AbstractMavenReport
canGenerateReport, closeReport, execute, generate, getCategoryName, getReportOutputDirectory, getSink, isExternalReport, setReportOutputDirectory
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getPluginContext, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScmActivityReport

public ScmActivityReport()
Method Detail

getProject

protected MavenProject getProject()
Returns the current Maven Project

Specified by:
getProject in class AbstractMavenReport
Returns:
the current Maven Project
See Also:
AbstractMavenReport.getProject()

getOutputDirectory

protected String getOutputDirectory()
Return the output directory

Specified by:
getOutputDirectory in class AbstractMavenReport
Returns:
the output directory
See Also:
AbstractMavenReport.getOutputDirectory()

getSiteRenderer

protected org.apache.maven.doxia.siterenderer.Renderer getSiteRenderer()
Return the Maven Site renderer

Specified by:
getSiteRenderer in class AbstractMavenReport
Returns:
the Maven Site renderer
See Also:
AbstractMavenReport.getSiteRenderer()

getDescription

public String getDescription(Locale locale)
Parameters:
locale - the current locale
Returns:
description of the report.
See Also:
MavenReport.getDescription(java.util.Locale)

getName

public String getName(Locale locale)
Parameters:
locale - the current locale
Returns:
the name of the report.
See Also:
MavenReport.getName(java.util.Locale)

getOutputName

public String getOutputName()
Returns:
the name of the report.
See Also:
MavenReport.getOutputName()

getBundle

protected ResourceBundle getBundle(Locale locale)
Parameters:
locale - the current locale
Returns:
the resource bundle.
See Also:
MavenReport.getOutputName()

executeReport

protected void executeReport(Locale locale)
                      throws MavenReportException
Build the report.

Specified by:
executeReport in class AbstractMavenReport
Parameters:
locale - the current locale.
Throws:
MavenReportException - in case of an error generating the report.

doGenerateReport

protected void doGenerateReport(List releases,
                                org.apache.maven.doxia.sink.Sink sink)
Generates the report for this mojo.

Parameters:
releases - releases to generate the report from.
sink - the report formatting tool.

formatDate

protected String formatDate(Date date)
Format a java.util.Date using the specified date format.

Parameters:
date - the date to be formatted.
Returns:
the formatted date as a String.

formatTimestamp

protected String formatTimestamp(Date date)
Format a java.util.Date using the specified timestamp format.

Parameters:
date - the date to be formatted.
Returns:
the formatted date as a String.

getBugTrackLinker

protected BugTrackLinker getBugTrackLinker()
Returns:
the implementation of the BugTrackLinker.

doLinkIssue

protected String doLinkIssue(String issue)
Computes the URL to the issue in the bug tracker.

Parameters:
issue - ghe id of the issue.
Returns:
the URL to the issue in the bug tracker.

getTrackerType

protected String getTrackerType()
Getter for the bug tracker type.

Returns:
the bug tracker type.

getConnectionUrl

public String getConnectionUrl()
Getter for the connection URL to the SCM.

Returns:
the connection URL to the SCM.

setConnectionUrl

public void setConnectionUrl(String connectionUrl)
Setter for the connection URL to the SCM.

Parameters:
connectionUrl - the connection URL to the SCM.

getScmManager

public org.apache.maven.scm.manager.ScmManager getScmManager()
Getter for the SCM Manager with our own SCM providers.

Returns:
a SCM Manager with our own SCM providers.

getPattern

protected Pattern getPattern()
Compile the filter into a pattern. If the filter is null or empty returns null.

Returns:
thefilter compiled as a pattern. If the filter is null or empty returns null.

getFileSet

public org.apache.maven.scm.ScmFileSet getFileSet(String fileName)
                                           throws IOException
Build a SCM file set for a file in the SCM.

Parameters:
fileName - the file/dir in the SCM.
Returns:
the corresponding fileset.
Throws:
IOException - in case of an I/O error.

getFileSet

public org.apache.maven.scm.ScmFileSet getFileSet(String includes,
                                                  String excludes)
                                           throws IOException
Build a SCM file set for a file in the SCM.

Parameters:
includes - include filters.
excludes - exclude filters.
Returns:
the corresponding fileset.
Throws:
IOException - in case of an I/O error.

getScmRepository

public org.apache.maven.scm.repository.ScmRepository getScmRepository()
                                                               throws org.apache.maven.scm.ScmException
Getter for the ScmRepository.

Returns:
the ScmRepository.
Throws:
org.apache.maven.scm.ScmException - in case of an error in creating the ScmRepository.

checkResult

public void checkResult(org.apache.maven.scm.ScmResult result)
                 throws MojoExecutionException
Manages the result of the SCM command.

Parameters:
result - the result of the SCM command.
Throws:
MojoExecutionException - in case of an error executing the Mojo.

setLog

public void setLog(Log log)
Specified by:
setLog in interface Mojo
Overrides:
setLog in class AbstractMojo
See Also:
Mojo.setLog(org.apache.maven.plugin.logging.Log)

getLog

public Log getLog()
Returns the logger that has been injected into this mojo. If no logger has been setup yet, a SystemStreamLog logger will be created and returned.

Note: The logger returned by this method must not be cached in an instance field during the construction of the mojo. This would cause the mojo to use a wrongly configured default logger when being run by Maven. The proper logger gets injected by the Plexus container after the mojo has been constructed. Therefore, simply call this method directly whenever you need the logger, it is fast enough and needs no caching.

Specified by:
getLog in interface Mojo
Overrides:
getLog in class AbstractMojo
See Also:
Mojo.getLog()


Copyright © 2008-2009 Codehaus. All Rights Reserved.