org.jboss.maven.plugins.jdocbook
Class AbstractDocBookMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.jboss.maven.plugins.jdocbook.AbstractDocBookMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
CleanPoMojo, CleanPotMojo, GenerationMojo, PackageMojo, ResourceMojo, TranslationMojo, UpdatePoMojo, UpdatePotMojo

public abstract class AbstractDocBookMojo
extends org.apache.maven.plugin.AbstractMojo

Basic support for the various DocBook mojos in this packaging plugin. Mainly, we are defining common configuration attributes of the packaging.

Author:
Steve Ebersole

Nested Class Summary
protected static interface AbstractDocBookMojo.ArtifactProcessor
           
protected static interface AbstractDocBookMojo.I18nSource
           
protected  class AbstractDocBookMojo.MasterTranslationDescriptor
           
protected static interface AbstractDocBookMojo.PublishingSource
           
protected  class AbstractDocBookMojo.TranslationDescriptor
           
 
Field Summary
protected  org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager
          INTERNAL : used to get reference to environemtn Archiver/UnArchiver.
protected  boolean attach
          Whether or not to perform the attching of the format outputs as classified attachments.
protected  org.apache.maven.model.Resource cssResource
          A Resource describing project-local css.
protected  java.io.File fontsDirectory
          The directory containing local fonts
protected  Format[] formats
          The formats in which to perform rendering.
protected  org.apache.maven.model.Resource imageResource
          A Resource describing project-local images.
protected  java.lang.String masterTranslation
          The locale of the master translation.
protected  Options options
          Configurable options
static java.lang.String PLUGIN_NAME
           
protected  java.util.List pluginArtifacts
          INTERNAL : The artifacts associated to the dependencies defined as part of our configuration within the project to which we are being attached.
protected  java.io.File potDirectory
          The directory for POT translations files.
protected  org.apache.maven.project.MavenProject project
          INTERNAL : The project being built
protected  java.util.Set projectArtifacts
          INTERNAL : The artifacts associated with the dependencies defined as part of the project to which we are being attached.
protected  org.apache.maven.project.MavenProjectHelper projectHelper
          INTERNAL : used during packaging to attach produced artifacts
protected  java.io.File publishDirectory
          The directory where the output will be written.
protected  java.lang.String relativeMasterTranslationPath
          The path (relative to the sourceDirectory) to the directory containing the master sources.
protected  org.apache.maven.execution.MavenSession session
          INTERNAL : The representation of the maven execution.
protected  java.io.File sourceDirectory
          The directory where the sources are located.
protected  java.lang.String sourceDocumentName
          The name of the document (relative to sourceDirectory) which is the document to be rendered.
protected  java.io.File stagingDirectory
          The directory where we can perform some staging staging occurs.
protected  java.io.File translationBaseDirectory
          The directory which contains the translations.
protected  java.lang.String[] translations
          The locales of all non-master translations.
protected  java.io.File workDirectory
          A directory used for general transient work.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractDocBookMojo()
           
 
Method Summary
protected  void doExecute()
           
 void execute()
           
protected  java.util.List<AbstractDocBookMojo.I18nSource> getI18nSources()
           
protected  AbstractDocBookMojo.MasterTranslationDescriptor getMasterTranslationDescriptor()
           
protected  java.util.List<AbstractDocBookMojo.PublishingSource> getPublishingSources()
           
protected  java.lang.String getRequestedFormat()
           
protected  java.util.Locale getRequestedLocale()
           
protected  java.util.Locale parseLocale(java.lang.String locale)
           
protected  void process(FormatPlan[] formatPlans)
          The override method to perform the actual processing of the mojo.
protected  void processArtifacts(AbstractDocBookMojo.ArtifactProcessor processor)
           
protected  void processPluginArtifacts(AbstractDocBookMojo.ArtifactProcessor processor)
           
protected  void processProjectArtifacts(AbstractDocBookMojo.ArtifactProcessor processor)
           
protected  java.lang.String stringify(java.util.Locale locale)
           
 
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

PLUGIN_NAME

public static final java.lang.String PLUGIN_NAME
See Also:
Constant Field Values

project

protected org.apache.maven.project.MavenProject project
INTERNAL : The project being built


session

protected org.apache.maven.execution.MavenSession session
INTERNAL : The representation of the maven execution.


projectArtifacts

protected java.util.Set projectArtifacts
INTERNAL : The artifacts associated with the dependencies defined as part of the project to which we are being attached.


pluginArtifacts

protected java.util.List pluginArtifacts
INTERNAL : The artifacts associated to the dependencies defined as part of our configuration within the project to which we are being attached.


archiverManager

protected org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager
INTERNAL : used to get reference to environemtn Archiver/UnArchiver.


projectHelper

protected org.apache.maven.project.MavenProjectHelper projectHelper
INTERNAL : used during packaging to attach produced artifacts


sourceDocumentName

protected java.lang.String sourceDocumentName
The name of the document (relative to sourceDirectory) which is the document to be rendered.


sourceDirectory

protected java.io.File sourceDirectory
The directory where the sources are located.


imageResource

protected org.apache.maven.model.Resource imageResource
A Resource describing project-local images.


cssResource

protected org.apache.maven.model.Resource cssResource
A Resource describing project-local css.


fontsDirectory

protected java.io.File fontsDirectory
The directory containing local fonts


publishDirectory

protected java.io.File publishDirectory
The directory where the output will be written.


stagingDirectory

protected java.io.File stagingDirectory
The directory where we can perform some staging staging occurs. Mainly this is used for (1) image/css staging; (2) font staging.


workDirectory

protected java.io.File workDirectory
A directory used for general transient work.


formats

protected Format[] formats
The formats in which to perform rendering.


attach

protected boolean attach
Whether or not to perform the attching of the format outputs as classified attachments.


options

protected Options options
Configurable options


masterTranslation

protected java.lang.String masterTranslation
The locale of the master translation.


relativeMasterTranslationPath

protected java.lang.String relativeMasterTranslationPath
The path (relative to the sourceDirectory) to the directory containing the master sources. By default the master-translation's locale (en-US) will be used if such a directory exists if translations are specified. Users can explicitly specify such a relative path here.


potDirectory

protected java.io.File potDirectory
The directory for POT translations files.


translations

protected java.lang.String[] translations
The locales of all non-master translations.


translationBaseDirectory

protected java.io.File translationBaseDirectory
The directory which contains the translations. The assumed strategy here is that each translation would have a directory under the directory named here which would contain the PO sources for that particular language translation. The default here is to use sourceDirectory itself.

Constructor Detail

AbstractDocBookMojo

public AbstractDocBookMojo()
Method Detail

process

protected void process(FormatPlan[] formatPlans)
                throws JDocBookProcessException
The override method to perform the actual processing of the mojo.

Parameters:
formatPlans - The format plans
Throws:
RenderingException - Indicates problem performing rendering
XSLTException - Indicates problem building or executing XSLT transformer
JDocBookProcessException

doExecute

protected void doExecute()
                  throws JDocBookProcessException
Throws:
JDocBookProcessException

execute

public final void execute()
                   throws org.apache.maven.plugin.MojoExecutionException,
                          org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

getRequestedFormat

protected java.lang.String getRequestedFormat()

getRequestedLocale

protected java.util.Locale getRequestedLocale()

getMasterTranslationDescriptor

protected AbstractDocBookMojo.MasterTranslationDescriptor getMasterTranslationDescriptor()

getPublishingSources

protected java.util.List<AbstractDocBookMojo.PublishingSource> getPublishingSources()

getI18nSources

protected java.util.List<AbstractDocBookMojo.I18nSource> getI18nSources()

processArtifacts

protected void processArtifacts(AbstractDocBookMojo.ArtifactProcessor processor)

processProjectArtifacts

protected void processProjectArtifacts(AbstractDocBookMojo.ArtifactProcessor processor)

processPluginArtifacts

protected void processPluginArtifacts(AbstractDocBookMojo.ArtifactProcessor processor)

parseLocale

protected java.util.Locale parseLocale(java.lang.String locale)

stringify

protected java.lang.String stringify(java.util.Locale locale)


Copyright © 2007-2011 JBoss, a division of Red Hat, Inc. All Rights Reserved.