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 AbstractGenerateHelpMojoMojo to generate javax help files for your project.- Since:
- 2.0.0
- Author:
- Tony Chemit - dev@tchemit.fr
-
-
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 StringAUTOREMOVE_LINEprotected FilecontentTemplateThe template used to generate helpset content file.protected PropertieshelpIdsThe help ids discovered.protected StringhelpsetNameThe name of the helpset to generate.protected FilehelpsetTemplateThe template used to generate helpset file.protected FileidsFileprotected StringindexFileNameprotected FileindexTemplateThe template used to generate helpset index file.protected StringmapFileNameprotected FilemapTemplateThe template used to generate helpset map file.protected FileoutputHelpThe directory where to create or update help files.protected StringtocFileNameprotected FiletocTemplateThe template used to generate helpset toc file.protected inttouchedFiles-
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 booleancheckSkip()protected voiddoActionForLocale(Locale locale, boolean isDefaultLocale, File localizedTarget, String localePath)Do the action for the given locale.protected voiddoGen(File template, File f, Properties env)protected intgenerateContentFiles(File localizedTarget, Properties env, String localePath)protected booleangenerateHelpsetFile(File file, Properties env)protected NodeItemgenerateIndexFile(File file, Properties env)protected PropertiesgenerateMapFile(File file, Properties env)protected NodeItemgenerateTocFile(File file, Properties env)FilegetTargetDirectory()voidinit()protected voidpostDoAction()Call back after doing all stuff for all locales declaredprotected voidpreDoAction()Call back before doing all stuff for all locales declaredprotected org.nuiton.plugin.VelocityTemplateGeneratorprepareGenerator(File template)voidsetTargetDirectory(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.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
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
-
-
-
-
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 outputHelpThe directory where to create or update help files.- Since:
- 2.0.0
-
helpsetName
@Parameter(property="jaxx.helpsetName", defaultValue="${project.artifactId}", required=true) protected String helpsetNameThe name of the helpset to generate.- Since:
- 1.3
-
helpsetTemplate
@Parameter(property="jaxx.helpsetTemplate", defaultValue="/defaultHelpSet.hs.vm", required=true) protected File helpsetTemplateThe 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 mapTemplateThe 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 indexTemplateThe 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 tocTemplateThe 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 contentTemplateThe 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:
getTargetDirectoryin classAbstractJaxxMojo
-
setTargetDirectory
public void setTargetDirectory(File targetDirectory)
- Specified by:
setTargetDirectoryin classAbstractJaxxMojo
-
init
public void init() throws Exception- Overrides:
initin classAbstractGenerateHelpMojo- Throws:
Exception
-
checkSkip
protected boolean checkSkip()
- Overrides:
checkSkipin classAbstractGenerateHelpMojo
-
preDoAction
protected void preDoAction()
Description copied from class:AbstractGenerateHelpMojoCall back before doing all stuff for all locales declared- Specified by:
preDoActionin classAbstractGenerateHelpMojo
-
postDoAction
protected void postDoAction()
Description copied from class:AbstractGenerateHelpMojoCall back after doing all stuff for all locales declared- Specified by:
postDoActionin classAbstractGenerateHelpMojo
-
doActionForLocale
protected void doActionForLocale(Locale locale, boolean isDefaultLocale, File localizedTarget, String localePath) throws Exception
Description copied from class:AbstractGenerateHelpMojoDo the action for the given locale.- Specified by:
doActionForLocalein classAbstractGenerateHelpMojo- Parameters:
locale- the locale to treateisDefaultLocale-trueif given locale is de the default localelocalizedTarget- where are stored help files for the given localelocalePath- the locale path to use (isdefaultif 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
-
-