Package org.nuiton.jaxx.plugin
Class GenerateHelpFilesMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.nuiton.plugin.AbstractPlugin
-
- org.nuiton.jaxx.plugin.AbstractJaxxMojo
-
- org.nuiton.jaxx.plugin.AbstractGenerateHelpMojo
-
- 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
@Mojo(name="generate-help-files", defaultPhase=PROCESS_SOURCES, requiresProject=true, requiresDependencyResolution=COMPILE) @Execute(goal="generate-help-ids") public class GenerateHelpFilesMojo extends AbstractGenerateHelpMojo
Mojo to generate javax help files for your project.- Since:
- 2.0.0
- Author:
- Tony Chemit - chemit@codelutin.com
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.nuiton.jaxx.plugin.AbstractJaxxMojo
AbstractJaxxMojo.JaxxFileUpdater
-
-
Field Summary
Fields Modifier and Type Field Description 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
-
-
Constructor Summary
Constructors Constructor Description GenerateHelpFilesMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 declaredprotected void
preDoAction()
Call back before doing all stuff for all locales declaredprotected 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, needInvoke, needInvoke, rejectPackaging, removeCompileSourceRoots, removeTestCompileSourceRoots, renameFile, writeFile
-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
Field Detail
-
AUTOREMOVE_LINE
protected static final String AUTOREMOVE_LINE
- See Also:
- Constant Field Values
-
outputHelp
@Parameter(property="jaxx.outputHelp", defaultValue="${project.basedir}/src/main/help", required=true) protected File outputHelp
The directory where to create or update help files.- Since:
- 2.0.0
-
helpsetName
@Parameter(property="jaxx.helpsetName", defaultValue="${project.artifactId}", required=true) protected String helpsetName
The name of the helpset to generate.- Since:
- 1.3
-
helpsetTemplate
@Parameter(property="jaxx.helpsetTemplate", defaultValue="/defaultHelpSet.hs.vm", required=true) protected File helpsetTemplate
The template used to generate helpset file. Must be an existing file or a ressource in class-path- Since:
- 1.3
-
mapTemplate
@Parameter(property="jaxx.mapTemplate", defaultValue="/defaultMap.jhm.vm", required=true) 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
-
indexTemplate
@Parameter(property="jaxx.indexTemplate", defaultValue="/defaultIndex.xml.vm", required=true) 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
-
tocTemplate
@Parameter(property="jaxx.tocTemplate", defaultValue="/defaultToc.xml.vm", required=true) 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
-
contentTemplate
@Parameter(property="jaxx.contentTemplate", defaultValue="/defaultContent.html.vm", required=true) 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
-
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.
-
-
Method Detail
-
getTargetDirectory
public File getTargetDirectory()
- Specified by:
getTargetDirectory
in classAbstractJaxxMojo
-
setTargetDirectory
public void setTargetDirectory(File targetDirectory)
- Specified by:
setTargetDirectory
in classAbstractJaxxMojo
-
init
public void init() throws Exception
- Overrides:
init
in classAbstractGenerateHelpMojo
- Throws:
Exception
-
checkSkip
protected boolean checkSkip()
- Overrides:
checkSkip
in classAbstractGenerateHelpMojo
-
preDoAction
protected void preDoAction() throws IOException
Description copied from class:AbstractGenerateHelpMojo
Call back before doing all stuff for all locales declared- Specified by:
preDoAction
in classAbstractGenerateHelpMojo
- Throws:
IOException
-
postDoAction
protected void postDoAction()
Description copied from class:AbstractGenerateHelpMojo
Call back after doing all stuff for all locales declared- Specified by:
postDoAction
in classAbstractGenerateHelpMojo
-
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 classAbstractGenerateHelpMojo
- Parameters:
locale
- the locale to treateisDefaultLocale
-true
if given locale is de the default localelocalizedTarget
- where are stored help files for the given localelocalePath
- the locale path to use (isdefault
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
-
-