Class GenerateHelpFilesMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.nuiton.plugin.AbstractPlugin
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

    Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin

    org.nuiton.plugin.Plugin.InitState, org.nuiton.plugin.Plugin.Packaging
  • Field Summary

    Fields
    Modifier and Type Field Description
    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.io.File idsFile  
    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 interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Constructor Description
    GenerateHelpFilesMojo()  
  • Method Summary

    Modifier and Type Method Description
    protected boolean checkSkip()  
    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()  
    void init()  
    protected void postDoAction()
    Call back after doing all stuff for all locales declared
    protected void preDoAction()
    Call back before doing all stuff for all locales declared
    protected org.nuiton.plugin.VelocityTemplateGenerator prepareGenerator​(java.io.File template)  
    void setTargetDirectory​(java.io.File targetDirectory)  

    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

    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 Details

    • AUTOREMOVE_LINE

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

      @Parameter(property="jaxx.outputHelp", defaultValue="${project.basedir}/src/main/help", required=true) protected java.io.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 java.lang.String helpsetName
      The name of the helpset to generate.
      Since:
      1.3
    • helpsetTemplate

      @Parameter(property="jaxx.helpsetTemplate", defaultValue="/defaultHelpSet.hs.vm", required=true) 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
    • mapTemplate

      @Parameter(property="jaxx.mapTemplate", defaultValue="/defaultMap.jhm.vm", required=true) 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
    • indexTemplate

      @Parameter(property="jaxx.indexTemplate", defaultValue="/defaultIndex.xml.vm", required=true) 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
    • tocTemplate

      @Parameter(property="jaxx.tocTemplate", defaultValue="/defaultToc.xml.vm", required=true) 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
    • contentTemplate

      @Parameter(property="jaxx.contentTemplate", defaultValue="/defaultContent.html.vm", required=true) 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
    • mapFileName

      protected java.lang.String mapFileName
    • indexFileName

      protected java.lang.String indexFileName
    • tocFileName

      protected java.lang.String tocFileName
    • touchedFiles

      protected int touchedFiles
    • idsFile

      protected java.io.File idsFile
    • helpIds

      protected java.util.Properties helpIds
      The help ids discovered.
  • Constructor Details

    • GenerateHelpFilesMojo

      public GenerateHelpFilesMojo()
  • Method Details

    • 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 void init() throws java.lang.Exception
      Overrides:
      init in class AbstractGenerateHelpMojo
      Throws:
      java.lang.Exception
    • checkSkip

      protected boolean checkSkip()
      Overrides:
      checkSkip in class AbstractGenerateHelpMojo
    • preDoAction

      protected void preDoAction() throws java.io.IOException
      Description copied from class: AbstractGenerateHelpMojo
      Call back before doing all stuff for all locales declared
      Specified by:
      preDoAction in class AbstractGenerateHelpMojo
      Throws:
      java.io.IOException
    • 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