org.nuiton.jaxx.plugin
Class GenerateHelpFilesMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.nuiton.plugin.AbstractPlugin
          extended by org.nuiton.jaxx.plugin.AbstractJaxxMojo
              extended by org.nuiton.jaxx.plugin.AbstractGenerateHelpMojo
                  extended by org.nuiton.jaxx.plugin.GenerateHelpFilesMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.nuiton.plugin.Plugin

public class GenerateHelpFilesMojo
extends AbstractGenerateHelpMojo

Mojo to generate javax help files for your project.

Since:
2.0.0
Author:
chemit
Is defined to be executed in:
goal:
generate-help-ids
Is defined by the goal name:
generate-help-files
Is bound to the specified phase of the standard build lifecycle:
process-sources
Requires the dependencies in this specified scope:
compile
Requires a Maven project to run:
true

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin
org.nuiton.plugin.Plugin.Packaging
 
Field Summary
protected static java.lang.String AUTOREMOVE_LINE
           
protected  java.io.File contentTemplate
          The template used to generate helpset content file.
protected  java.util.Properties helpIds
          The help ids discovered.
protected  java.lang.String helpsetName
          The name of the helpset to generate.
protected  java.io.File helpsetTemplate
          The template used to generate helpset file.
protected  java.lang.String indexFileName
           
protected  java.io.File indexTemplate
          The template used to generate helpset index file.
protected  java.lang.String mapFileName
           
protected  java.io.File mapTemplate
          The template used to generate helpset map file.
protected  java.io.File outputHelp
          The directory where to create or update help files.
protected  java.lang.String tocFileName
           
protected  java.io.File tocTemplate
          The template used to generate helpset toc file.
protected  int touchedFiles
           
 
Fields inherited from class org.nuiton.jaxx.plugin.AbstractGenerateHelpMojo
generateSearch, locales
 
Fields inherited from class org.nuiton.jaxx.plugin.AbstractJaxxMojo
generateHelp
 
Fields inherited from class org.nuiton.plugin.AbstractPlugin
skipAfterInitMessage
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
GenerateHelpFilesMojo()
           
 
Method Summary
protected  void doActionForLocale(java.util.Locale locale, boolean isDefaultLocale, java.io.File localizedTarget, java.lang.String localePath)
          Do the action for the given locale.
protected  void doGen(java.io.File template, java.io.File f, java.util.Properties env)
           
protected  int generateContentFiles(java.io.File localizedTarget, java.util.Properties env, java.lang.String localePath)
           
protected  boolean generateHelpsetFile(java.io.File file, java.util.Properties env)
           
protected  NodeItem generateIndexFile(java.io.File file, java.util.Properties env)
           
protected  java.util.Properties generateMapFile(java.io.File file, java.util.Properties env)
           
protected  NodeItem generateTocFile(java.io.File file, java.util.Properties env)
           
 java.io.File getTargetDirectory()
           
 boolean init()
           
protected  void postDoAction()
          Call back after doing all stuff for all locales declared
protected  org.nuiton.plugin.VelocityTemplateGenerator prepareGenerator(java.io.File template)
           
 void setTargetDirectory(java.io.File targetDirectory)
           
protected  boolean skipAction()
           
 
Methods inherited from class org.nuiton.jaxx.plugin.AbstractGenerateHelpMojo
cleanHelpIdsStore, doAction, getHelpIdsFilename, getHelpIdsStoreFile, getMergeHelpIdsFilename, getMergeHelpIdsStoreFile, getOutputHelpIds, loadHelpIds, removeQuote, setHelpIdsFilename, setMergeHelpIdsFilename, setOutputHelpIds, storeHelpIds
 
Methods inherited from class org.nuiton.jaxx.plugin.AbstractJaxxMojo
addResourceDir, addResourceDir, addTestResourceDir, checkPackaging, createDirectoryIfNecessary, getEncoding, getLastModified, getProject, isForce, isVerbose, setEncoding, setForce, setProject, setVerbose
 
Methods inherited from class org.nuiton.plugin.AbstractPlugin
acceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addUrlToUrlsList, checkResource, checkRunOnceDone, copyFile, execute, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getTemplate, initClassLoader, isExecutionRoot, isFileNewerThanPomFile, rejectPackaging, removeCompileSourceRoots, removeTestCompileSourceRoots, writeFile
 
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
getLog, setLog
 

Field Detail

AUTOREMOVE_LINE

protected static final java.lang.String AUTOREMOVE_LINE
See Also:
Constant Field Values

outputHelp

protected java.io.File outputHelp
The directory where to create or update help files.

Since:
2.0.0
Is defined by:
expression:
${jaxx.outuptHelp}
default-value:
${project.basedir}/src/main/help
Is required.

helpsetName

protected java.lang.String helpsetName
The name of the helpset to generate.

Since:
1.3
Is defined by:
expression:
${jaxx.helpsetName}
default-value:
${project.artifactId}
Is required.

helpsetTemplate

protected java.io.File helpsetTemplate
The template used to generate helpset file.

Must be an existing file or a ressource in class-path

Since:
1.3
Is defined by:
expression:
${jaxx.helpsetTemplate}
default-value:
/defaultHelpSet.hs.vm
Is required.

mapTemplate

protected java.io.File mapTemplate
The template used to generate helpset map file.

Must be an existing file or a ressource in class-path

Since:
1.3
Is defined by:
expression:
${jaxx.mapTemplate}
default-value:
/defaultMap.jhm.vm
Is required.

indexTemplate

protected java.io.File indexTemplate
The template used to generate helpset index file.

Must be an existing file or a ressource in class-path

Since:
1.3
Is defined by:
expression:
${jaxx.indexTemplate}
default-value:
/defaultIndex.xml.vm
Is required.

tocTemplate

protected java.io.File tocTemplate
The template used to generate helpset toc file.

Must be an existing file or a ressource in class-path

Since:
1.3
Is defined by:
expression:
${jaxx.tocTemplate}
default-value:
/defaultToc.xml.vm
Is required.

contentTemplate

protected java.io.File contentTemplate
The template used to generate helpset content file.

Must be an existing file or a ressource in class-path

Since:
1.3
Is defined by:
expression:
${jaxx.contentTemplate}
default-value:
/defaultContent.html.vm
Is required.

mapFileName

protected java.lang.String mapFileName

indexFileName

protected java.lang.String indexFileName

tocFileName

protected java.lang.String tocFileName

touchedFiles

protected int touchedFiles

helpIds

protected java.util.Properties helpIds
The help ids discovered.

Constructor Detail

GenerateHelpFilesMojo

public GenerateHelpFilesMojo()
Method Detail

getTargetDirectory

public java.io.File getTargetDirectory()
Specified by:
getTargetDirectory in class AbstractJaxxMojo

setTargetDirectory

public void setTargetDirectory(java.io.File targetDirectory)
Specified by:
setTargetDirectory in class AbstractJaxxMojo

init

public boolean init()
             throws java.lang.Exception
Overrides:
init in class AbstractGenerateHelpMojo
Throws:
java.lang.Exception

skipAction

protected boolean skipAction()
Overrides:
skipAction in class AbstractGenerateHelpMojo

postDoAction

protected void postDoAction()
Description copied from class: AbstractGenerateHelpMojo
Call back after doing all stuff for all locales declared

Specified by:
postDoAction in class AbstractGenerateHelpMojo

doActionForLocale

protected void doActionForLocale(java.util.Locale locale,
                                 boolean isDefaultLocale,
                                 java.io.File localizedTarget,
                                 java.lang.String localePath)
                          throws java.lang.Exception
Description copied from class: AbstractGenerateHelpMojo
Do the action for the given locale.

Specified by:
doActionForLocale in class AbstractGenerateHelpMojo
Parameters:
locale - the locale to treate
isDefaultLocale - true if given locale is de the default locale
localizedTarget - where are stored help files for the given locale
localePath - the locale path to use (is default if given locale is default).
Throws:
java.lang.Exception - if any pb

generateContentFiles

protected int generateContentFiles(java.io.File localizedTarget,
                                   java.util.Properties env,
                                   java.lang.String localePath)
                            throws java.lang.Exception
Throws:
java.lang.Exception

generateHelpsetFile

protected boolean generateHelpsetFile(java.io.File file,
                                      java.util.Properties env)
                               throws java.lang.Exception
Throws:
java.lang.Exception

generateMapFile

protected java.util.Properties generateMapFile(java.io.File file,
                                               java.util.Properties env)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

generateIndexFile

protected NodeItem generateIndexFile(java.io.File file,
                                     java.util.Properties env)
                              throws java.lang.Exception
Throws:
java.lang.Exception

generateTocFile

protected NodeItem generateTocFile(java.io.File file,
                                   java.util.Properties env)
                            throws java.lang.Exception
Throws:
java.lang.Exception

doGen

protected void doGen(java.io.File template,
                     java.io.File f,
                     java.util.Properties env)
              throws java.lang.Exception
Throws:
java.lang.Exception

prepareGenerator

protected org.nuiton.plugin.VelocityTemplateGenerator prepareGenerator(java.io.File template)
                                                                throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2008-2009 CodeLutin. All Rights Reserved.