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, org.nuiton.plugin.PluginWithEncoding

public class GenerateHelpFilesMojo
extends AbstractGenerateHelpMojo

Mojo to generate javax help files for your project.

Since:
2.0.0
Author:
tchemit
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 class org.nuiton.jaxx.plugin.AbstractJaxxMojo
AbstractJaxxMojo.JaxxFileUpdater
 
Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin
org.nuiton.plugin.Plugin.InitState, org.nuiton.plugin.Plugin.Packaging
 
Field Summary
protected static String AUTOREMOVE_LINE
           
protected  File contentTemplate
          The template used to generate helpset content file.
protected  Properties helpIds
          The help ids discovered.
protected  String helpsetName
          The name of the helpset to generate.
protected  File helpsetTemplate
          The template used to generate helpset file.
protected  File idsFile
           
protected  String indexFileName
           
protected  File indexTemplate
          The template used to generate helpset index file.
protected  String mapFileName
           
protected  File mapTemplate
          The template used to generate helpset map file.
protected  File outputHelp
          The directory where to create or update help files.
protected  String tocFileName
           
protected  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 interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
GenerateHelpFilesMojo()
           
 
Method Summary
protected  boolean checkSkip()
           
protected  void doActionForLocale(Locale locale, boolean isDefaultLocale, File localizedTarget, String localePath)
          Do the action for the given locale.
protected  void doGen(File template, File f, Properties env)
           
protected  int generateContentFiles(File localizedTarget, Properties env, String localePath)
           
protected  boolean generateHelpsetFile(File file, Properties env)
           
protected  NodeItem generateIndexFile(File file, Properties env)
           
protected  Properties generateMapFile(File file, Properties env)
           
protected  NodeItem generateTocFile(File file, Properties env)
           
 File getTargetDirectory()
           
 void init()
           
protected  void postDoAction()
          Call back after doing all stuff for all locales declared
protected  org.nuiton.plugin.VelocityTemplateGenerator prepareGenerator(File template)
           
 void setTargetDirectory(File targetDirectory)
           
 
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
checkPackaging, getEncoding, getLastModified, getProject, isForce, isVerbose, setEncoding, setForce, setProject, setVerbose
 
Methods inherited from class org.nuiton.plugin.AbstractPlugin
acceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addUrlToUrlsList, afterExecute, backupFile, checkEncoding, checkResource, checkRunOnceDone, copyFile, createDirectoryIfNecessary, createNewFile, deleteFile, execute, getBackupFile, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getRootProject, getTemplate, hasClassPath, initClassLoader, isExecutionRoot, isFileNewerThanPomFile, rejectPackaging, removeCompileSourceRoots, removeTestCompileSourceRoots, renameFile, 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
execute, getLog, setLog
 

Field Detail

AUTOREMOVE_LINE

protected static final String AUTOREMOVE_LINE
See Also:
Constant Field Values

outputHelp

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

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

helpsetName

protected 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 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 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 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 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 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 String mapFileName

indexFileName

protected String indexFileName

tocFileName

protected String tocFileName

touchedFiles

protected int touchedFiles

idsFile

protected File idsFile

helpIds

protected Properties helpIds
The help ids discovered.

Constructor Detail

GenerateHelpFilesMojo

public GenerateHelpFilesMojo()
Method Detail

getTargetDirectory

public File getTargetDirectory()
Specified by:
getTargetDirectory in class AbstractJaxxMojo

setTargetDirectory

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

init

public void init()
          throws Exception
Overrides:
init in class AbstractGenerateHelpMojo
Throws:
Exception

checkSkip

protected boolean checkSkip()
Overrides:
checkSkip 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(Locale locale,
                                 boolean isDefaultLocale,
                                 File localizedTarget,
                                 String localePath)
                          throws 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:
Exception - if any pb

generateContentFiles

protected int generateContentFiles(File localizedTarget,
                                   Properties env,
                                   String localePath)
                            throws Exception
Throws:
Exception

generateHelpsetFile

protected boolean generateHelpsetFile(File file,
                                      Properties env)
                               throws Exception
Throws:
Exception

generateMapFile

protected Properties generateMapFile(File file,
                                     Properties env)
                              throws Exception
Throws:
Exception

generateIndexFile

protected NodeItem generateIndexFile(File file,
                                     Properties env)
                              throws Exception
Throws:
Exception

generateTocFile

protected NodeItem generateTocFile(File file,
                                   Properties env)
                            throws Exception
Throws:
Exception

doGen

protected void doGen(File template,
                     File f,
                     Properties env)
              throws Exception
Throws:
Exception

prepareGenerator

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


Copyright © 2008-2011 CodeLutin. All Rights Reserved.