org.codehaus.enunciate.modules
Class BasicAppModule

java.lang.Object
  extended by org.codehaus.enunciate.modules.BasicDeploymentModule
      extended by org.codehaus.enunciate.modules.FreemarkerDeploymentModule
          extended by org.codehaus.enunciate.modules.BasicAppModule
All Implemented Interfaces:
EnunciateModelAware, DeploymentModule

public class BasicAppModule
extends FreemarkerDeploymentModule

Basic App Module

The basic app deployment module produces the web app for hosting the API endpoints and documentation.

Steps

generate

The "generate" step generates the deployment descriptors and config files. Refer to user guide to learn how to customize the deployment descriptors and config files.

compile

The "compile" step compiles all API source files, including the source files that were generated from other modules (e.g. JAX-WS Support module, GWT module, AMF module, etc.).

build

The "build" step assembles all the generated artifacts, compiled classes, and deployment descriptors into a directory.

Refer to user guide to learn how to customize the deployment descriptors and config files.

package

The "package" step packages the expanded war and exports it.

Configuration

The configuration for the basic app deployment module is defined entirely in the core Enunciate configuration. Refer to user guide to learn how to customize the deployment descriptors and config files.

Artifacts

The spring app deployment module exports the following artifacts:

Author:
Ryan Heaton

Field Summary
 
Fields inherited from class org.codehaus.enunciate.modules.BasicDeploymentModule
enunciate
 
Constructor Summary
BasicAppModule()
           
 
Method Summary
protected  void copyPostBase()
          Copy the post base.
protected  void copyPreBase()
          Copy the pre base.
protected  void doBuild()
          Default implementation is a no-op.
protected  void doCompile()
          Default implementation is a no-op.
 void doFreemarkerGenerate()
          Generate using Freemarker.
protected  void doLibCopy()
          Copies the classpath elements to WEB-INF.
protected  void doPackage()
          Default implementation is a no-op.
protected  void generateWebXml()
          generates web.xml to WEB-INF.
 java.io.File getBuildDir()
          The build directory for this module.
 org.apache.commons.digester.RuleSet getConfigurationRules()
          Default implementation returns null.
protected  java.net.URL getMergeWebXmlTemplateURL()
           
 java.lang.String getName()
          The name of the deployment module.
 int getOrder()
          The order of execution for the deployment module.
 Validator getValidator()
          Get the validator for this module, or null if none.
 java.io.File getWarFile()
          The war file to create.
 WebAppConfig getWebAppConfig()
           
protected  java.net.URL getWebXmlTemplateURL()
           
 void init(Enunciate enunciate)
          Sets the enunciate mechanism.
 boolean isDisabled()
          Whether this deployment module has been disabled, e.g.
protected  boolean knownExclude(java.io.File file)
          Whether to exclude a file from copying to the WEB-INF/lib directory.
protected  org.w3c.dom.Document loadMergeXml(java.io.InputStream inputStream)
          Loads the node model for merging xml.
 
Methods inherited from class org.codehaus.enunciate.modules.FreemarkerDeploymentModule
close, doGenerate, getConfiguration, getModel, getModelInternal, getObjectWrapper, getTemplateExceptionHandler, getTemplateLoader, initModel, processTemplate, processTemplate, processTemplate, processTemplate
 
Methods inherited from class org.codehaus.enunciate.modules.BasicDeploymentModule
debug, getAliases, getCompileDir, getEnunciate, getGenerateDir, getPackageDir, info, setBuildDir, setCompileDir, setDisabled, setGenerateDir, setPackageDir, step, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicAppModule

public BasicAppModule()
Method Detail

getName

public java.lang.String getName()
Description copied from interface: DeploymentModule
The name of the deployment module. Identifies its section in the enunciate configuration.

Specified by:
getName in interface DeploymentModule
Overrides:
getName in class BasicDeploymentModule
Returns:
"basic-app"

getWebXmlTemplateURL

protected java.net.URL getWebXmlTemplateURL()
Returns:
The URL to "web.xml.fmt"

getMergeWebXmlTemplateURL

protected java.net.URL getMergeWebXmlTemplateURL()
Returns:
The URL to "web.xml.fmt"

init

public void init(Enunciate enunciate)
          throws EnunciateException
Description copied from class: BasicDeploymentModule
Sets the enunciate mechanism.

Specified by:
init in interface DeploymentModule
Overrides:
init in class BasicDeploymentModule
Parameters:
enunciate - The enunciate mechanism.
Throws:
EnunciateException

doFreemarkerGenerate

public void doFreemarkerGenerate()
                          throws EnunciateException,
                                 java.io.IOException,
                                 freemarker.template.TemplateException
Description copied from class: FreemarkerDeploymentModule
Generate using Freemarker. Same as FreemarkerDeploymentModule.doGenerate() but can throw a TemplateException.

Specified by:
doFreemarkerGenerate in class FreemarkerDeploymentModule
Throws:
EnunciateException
java.io.IOException
freemarker.template.TemplateException

doCompile

protected void doCompile()
                  throws EnunciateException,
                         java.io.IOException
Description copied from class: BasicDeploymentModule
Default implementation is a no-op.

Overrides:
doCompile in class BasicDeploymentModule
Throws:
EnunciateException
java.io.IOException

doBuild

protected void doBuild()
                throws java.io.IOException,
                       EnunciateException
Description copied from class: BasicDeploymentModule
Default implementation is a no-op.

Overrides:
doBuild in class BasicDeploymentModule
Throws:
java.io.IOException
EnunciateException

copyPostBase

protected void copyPostBase()
                     throws java.io.IOException
Copy the post base.

Throws:
java.io.IOException

copyPreBase

protected void copyPreBase()
                    throws java.io.IOException
Copy the pre base.

Throws:
java.io.IOException

generateWebXml

protected void generateWebXml()
                       throws java.io.IOException,
                              EnunciateException
generates web.xml to WEB-INF. Pass it through a stylesheet, if specified.

Throws:
java.io.IOException
EnunciateException

loadMergeXml

protected org.w3c.dom.Document loadMergeXml(java.io.InputStream inputStream)
                                     throws EnunciateException
Loads the node model for merging xml.

Parameters:
inputStream - The input stream of the xml.
Returns:
The node model.
Throws:
EnunciateException

doLibCopy

protected void doLibCopy()
                  throws java.io.IOException
Copies the classpath elements to WEB-INF.

Throws:
java.io.IOException

doPackage

protected void doPackage()
                  throws EnunciateException,
                         java.io.IOException
Description copied from class: BasicDeploymentModule
Default implementation is a no-op.

Overrides:
doPackage in class BasicDeploymentModule
Throws:
EnunciateException
java.io.IOException

getWarFile

public java.io.File getWarFile()
The war file to create.

Returns:
The war file to create.

knownExclude

protected boolean knownExclude(java.io.File file)
                        throws java.io.IOException
Whether to exclude a file from copying to the WEB-INF/lib directory.

Parameters:
file - The file to exclude.
Returns:
Whether to exclude a file from copying to the lib directory.
Throws:
java.io.IOException

getOrder

public int getOrder()
Description copied from interface: DeploymentModule
The order of execution for the deployment module.

Specified by:
getOrder in interface DeploymentModule
Overrides:
getOrder in class BasicDeploymentModule
Returns:
300

getConfigurationRules

public org.apache.commons.digester.RuleSet getConfigurationRules()
Description copied from class: BasicDeploymentModule
Default implementation returns null.

Specified by:
getConfigurationRules in interface DeploymentModule
Overrides:
getConfigurationRules in class BasicDeploymentModule
Returns:
null.

getValidator

public Validator getValidator()
Description copied from interface: DeploymentModule
Get the validator for this module, or null if none.

Specified by:
getValidator in interface DeploymentModule
Overrides:
getValidator in class BasicDeploymentModule
Returns:
null

getWebAppConfig

public WebAppConfig getWebAppConfig()

isDisabled

public boolean isDisabled()
Description copied from interface: DeploymentModule
Whether this deployment module has been disabled, e.g. in the config file. Since the discovery mechanism is used to discover the modules on the classpath, it may be necessary to be able to disable a module.

Specified by:
isDisabled in interface DeploymentModule
Overrides:
isDisabled in class BasicDeploymentModule
Returns:
Whether this deployment module has been disabled.

getBuildDir

public java.io.File getBuildDir()
Description copied from class: BasicDeploymentModule
The build directory for this module. Defaults to <enunciate build dir>/<module name>

Overrides:
getBuildDir in class BasicDeploymentModule
Returns:
The build directory for this module.