|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.enunciate.modules.BasicDeploymentModule
org.codehaus.enunciate.modules.FreemarkerDeploymentModule
org.codehaus.enunciate.modules.docs.DocumentationDeploymentModule
public class DocumentationDeploymentModule
The documentation deployment module is responsible for generating the documentation for the API. This includes both the HTML pages and any other static content, e.g. client libraries.
The order of the documentation module is 100, essentially putting it after the generation of any static documents (e.g. WSDL, schemas) or static downloads (e.g. client libraries), but before the assembly of the war (see the spring-app module, order 200).
The only significant steps in the documentation module are the "generate" step and the "build" step.
During the generate step, the documentation deployment module generates an XML file that conforms to this schema containing all the documentation for the entire API in a structured form.
The build step is where all the documentation files are generated as needed and assembled into a single directory. The first step is to copy the static files (the "base") to the build directory. The documentation base can be specified in the configuration, or you can use the default base.
Then, the documentation module generates another XML file conforming to this schema that contains the information for the files available for download in a structured form. By default, all named artifacts are included as a download (see the architecture guide for details). Other downloads can also be specified in the configuration.
Finally, the XML generated in the generate phase and the XML generated for the download files is processed together to create the static documentation elements. By default, a Freemarker Processing Template is applied to process the XML. You can supply your own Freemarker processing template in the configuration, or you can supply a custom an XML Stylesheet Transformation to generate your site documentation. Click here to see the default Freemarker XML Processing Template used by Enunciate, which might be helpful as a starter for you to create your own custom one. Click here for an example XSLT file.
The configuration for the documentation deployment module is specified by the "docs" element under the "modules" element in the Enunciate configuration file.
There can be any number of "download" elements specified. This element is used to indicate another file or Enunciate artifact that is to be included in the "downloads" page. The download element supports the following attributes:
You can apply additinoal css files to the generated documentation. Use the "file" attribute to specify the additional css file to apply.
The "facets" element is applicable to the documentation module to configure which facets are to be included/excluded from the documentation artifacts. For more information, see API Facets
The documentation deployment module exports only one artifact: the build directory for the documentation. The artifact id is "docs", and it is exported during the "build" step.
| Field Summary |
|---|
| Fields inherited from class org.codehaus.enunciate.modules.BasicDeploymentModule |
|---|
enunciate |
| Constructor Summary | |
|---|---|
DocumentationDeploymentModule()
|
|
| Method Summary | |
|---|---|
void |
addAdditionalCss(String additionalCss)
Adds an additional css file to the generated documentation. |
void |
addDownload(DownloadConfig download)
Adds a download to the documentation. |
void |
addFacetExclude(String name)
Add a facet exclude. |
void |
addFacetInclude(String name)
Add a facet include. |
protected void |
buildBase()
Builds the base output directory. |
protected void |
doBuild()
|
void |
doFreemarkerGenerate()
The generate logic builds the XML documentation structure for the enunciated API. |
protected void |
doFreemarkerXMLProcessing(URL freemarkerXMLProcessingTemplateURL)
|
protected void |
doXmlTransform()
Do the XSLT tranformation to generate the documentation. |
protected void |
doXSLT(URL xsltURL)
|
protected void |
generateDownloadsXML()
Generates the downloads xml indicating the available downloads. |
List<String> |
getAdditionalCss()
The additional css files. |
String |
getBase()
The documentation "base". |
org.apache.commons.digester.RuleSet |
getConfigurationRules()
|
String |
getCopyright()
The copyright (posted on the website). |
String |
getCss()
The cascading stylesheet to use instead of the default. |
String |
getDefaultNamespace()
The default namespace for the purposes of generating documentation. |
File |
getDocsBuildDir()
The directory into which the documentation is put. |
String |
getDocsDir()
The subdirectory in the web application where the documentation will be put. |
protected URL |
getDocsTemplateURL()
The URL to the Freemarker template for processing the base documentation xml file. |
Collection<DownloadConfig> |
getDownloads()
The configured list of downloads to add to the documentation. |
protected URL |
getDownloadsTemplateURL()
The URL to the Freemarker template for processing the downloads xml file. |
Set<String> |
getFacetExcludes()
The set of facets to exclude. |
Set<String> |
getFacetIncludes()
The set of facets to include. |
String |
getFreemarkerDocsXMLTemplate()
|
URL |
getFreemarkerDocsXMLTemplateURL()
|
URL |
getFreemarkerXMLProcessingTemplateURL()
The url to the freemarker XML processing template that will be used to transforms the docs.xml to the site documentation. |
String |
getGroupRestResources()
How to group the REST resources together. |
String |
getIndexPageName()
The name of the index page. |
String |
getJavadocTagHandling()
JavaDoc tag handing. |
String |
getName()
|
protected freemarker.template.ObjectWrapper |
getObjectWrapper()
|
int |
getOrder()
|
protected String |
getRelativePathToRootDir()
Get the relative path to the root directory from the docs directory. |
String |
getSplashPackage()
The package that contains the splash page documentation for the API. |
String |
getTitle()
The title of the documentation. |
void |
init(Enunciate enunciate)
|
void |
initModel(EnunciateFreemarkerModel model)
|
boolean |
isApplyWadlFilter()
Whether to apply a filter for the WADL files that will attempt to resolve the paths dynamically. |
boolean |
isApplyWsdlFilter()
Whether to apply a filter for the WSDL files that will attempt to resolve the soap paths dynamically. |
boolean |
isDisableRestMountpoint()
Whether to disable the REST mountpoint documentation. |
boolean |
isForceExampleJson()
Whether to force example JSON. |
boolean |
isIncludeDefaultDownloads()
Whether to include the default downloads (named artifacts) in the downloads section. |
boolean |
isIncludeDeprecatedFieldsInExample()
Whether to include deprecated fields in example JSON and example XML. |
boolean |
isIncludeExampleJson()
Whether to include example JSON in the documentation. |
boolean |
isIncludeExampleXml()
Whether to include example XML in the documentation. |
protected InputStream |
loadDefaultBase()
Loads the default base for the documentation. |
void |
onClassesFound(Set<String> classes)
|
void |
setApplyWadlFilter(boolean applyWadlFilter)
Whether to apply a filter for the WADL files that will attempt to resolve the paths dynamically. |
void |
setApplyWsdlFilter(boolean applyWsdlFilter)
Whether to apply a filter for the WSDL files that will attempt to resolve the soap paths dynamically. |
void |
setBase(String base)
The documentation "base". |
void |
setCopyright(String copyRight)
The copyright (posted on the website). |
void |
setCss(String css)
The cascading stylesheet to use instead of the default. |
void |
setDefaultNamespace(String defaultNamespace)
The default namespace for the purposes of generating documentation. |
void |
setDisableRestMountpoint(boolean disableRestMountpoint)
Whether to disable the REST mountpoint documentation. |
void |
setDocsDir(String docsDir)
The subdirectory in the web application where the documentation will be put. |
void |
setForceExampleJson(boolean forceExampleJson)
Whether to force example JSON. |
void |
setFreemarkerDocsXMLTemplate(String freemarkerXmlTemplate)
|
void |
setFreemarkerDocsXMLTemplateURL(URL freemarkerDOCSXmlTemplateURL)
|
void |
setFreemarkerXMLProcessingTemplate(String freemarkerProcessingTemplate)
The Freemarker XML processing template file that will be used to transforms the docs.xml to the site documentation. |
void |
setFreemarkerXMLProcessingTemplateURL(URL freemarkerXMLProcessingTemplateURL)
The url to the freemarker XML processing template that will be used to transforms the docs.xml to the site documentation. |
void |
setGroupRestResources(String groupRestResources)
How to group the REST resources together. |
void |
setIncludeDefaultDownloads(boolean includeDefaultDownloads)
Whether to include the default downloads (named artifacts) in the downloads section. |
void |
setIncludeDeprecatedFieldsInExample(boolean includeDeprecatedFieldsInExample)
Whether to include deprecated fields in example JSON and example XML. |
void |
setIncludeExampleJson(boolean includeExampleJson)
Whether to include example JSON in the documentation. |
void |
setIncludeExampleXml(boolean includeExampleXml)
Whether to include example XML in the documentation. |
void |
setIndexPageName(String indexPageName)
The name of the index page. |
void |
setJavadocTagHandling(String javadocTagHandling)
The javadoc tag handling. |
void |
setSplashPackage(String splashPackage)
The package that contains the splash page documentation for the API. |
void |
setTitle(String title)
The title of the documentation. |
void |
setTitleConditionally(String title)
Set the title for this project iff it hasn't already been set. |
void |
setXslt(String xslt)
The stylesheet to use to generate the documentation. |
void |
setXsltURL(URL xslt)
Set the url to the xslt to use to generate the documentation. |
| Methods inherited from class org.codehaus.enunciate.modules.FreemarkerDeploymentModule |
|---|
close, doGenerate, getConfiguration, getModel, getModelInternal, getTemplateExceptionHandler, getTemplateLoader, processTemplate, processTemplate, processTemplate, processTemplate |
| Methods inherited from class org.codehaus.enunciate.modules.BasicDeploymentModule |
|---|
debug, doCompile, doPackage, getAliases, getBuildDir, getCompileDir, getEnunciate, getGenerateDir, getPackageDir, getValidator, info, isDisabled, 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 |
| Methods inherited from interface org.codehaus.enunciate.modules.DeploymentModule |
|---|
close, getAliases, getValidator, isDisabled, step |
| Constructor Detail |
|---|
public DocumentationDeploymentModule()
| Method Detail |
|---|
public String getName()
getName in interface DeploymentModulegetName in class BasicDeploymentModulepublic int getOrder()
getOrder in interface DeploymentModulegetOrder in class BasicDeploymentModulepublic void onClassesFound(Set<String> classes)
onClassesFound in interface EnunciateClasspathListenerpublic String getSplashPackage()
public void setSplashPackage(String splashPackage)
splashPackage - The package that contains the splash page documentation for the API.public String getCopyright()
public void setCopyright(String copyRight)
copyRight - The copyright (posted on the website).public String getTitle()
getTitle in interface DocumentationAwareModulepublic void setTitle(String title)
setTitle in interface DocumentationAwareModuletitle - The title of the documentation.public void setTitleConditionally(String title)
setTitleConditionally in interface ProjectTitleAwaretitle - The title.public String getJavadocTagHandling()
public void setJavadocTagHandling(String javadocTagHandling)
javadocTagHandling - The javadoc tag handling.public void addDownload(DownloadConfig download)
download - The download to add.public Collection<DownloadConfig> getDownloads()
public void addAdditionalCss(String additionalCss)
additionalCss - The additional css.public List<String> getAdditionalCss()
public boolean isIncludeDefaultDownloads()
public void setIncludeDefaultDownloads(boolean includeDefaultDownloads)
includeDefaultDownloads - Whether to include the default downloads (named artifacts) in the downloads section.public boolean isIncludeExampleXml()
public void setIncludeExampleXml(boolean includeExampleXml)
includeExampleXml - Whether to include example XML in the documentation.public boolean isIncludeExampleJson()
public void setIncludeExampleJson(boolean includeExampleJson)
includeExampleJson - Whether to include example JSON in the documentation.public boolean isIncludeDeprecatedFieldsInExample()
public void setIncludeDeprecatedFieldsInExample(boolean includeDeprecatedFieldsInExample)
includeDeprecatedFieldsInExample - Whether to include deprecated fields in example JSON and example XML.public boolean isForceExampleJson()
public void setForceExampleJson(boolean forceExampleJson)
forceExampleJson - Whether to force example JSON.
public void setXslt(String xslt)
throws MalformedURLException
xslt - The stylesheet to use to generate the documentation.
MalformedURLExceptionpublic void setXsltURL(URL xslt)
xslt - The xslt.
public void setFreemarkerXMLProcessingTemplate(String freemarkerProcessingTemplate)
throws MalformedURLException
freemarkerProcessingTemplate - The Freemarker XML processing template file that will be used to transforms the docs.xml to the site documentation.
MalformedURLExceptionpublic URL getFreemarkerXMLProcessingTemplateURL()
public void setFreemarkerXMLProcessingTemplateURL(URL freemarkerXMLProcessingTemplateURL)
freemarkerXMLProcessingTemplateURL - The url to the freemarker XML processing template.public String getFreemarkerDocsXMLTemplate()
public void setFreemarkerDocsXMLTemplate(String freemarkerXmlTemplate)
throws MalformedURLException
MalformedURLExceptionpublic URL getFreemarkerDocsXMLTemplateURL()
public void setFreemarkerDocsXMLTemplateURL(URL freemarkerDOCSXmlTemplateURL)
public String getCss()
public void setCss(String css)
css - The cascading stylesheet to use instead of the default.public String getBase()
public void setBase(String base)
base - The documentation "base".
protected URL getDocsTemplateURL()
throws MalformedURLException
MalformedURLExceptionprotected URL getDownloadsTemplateURL()
public String getDocsDir()
getDocsDir in interface DocumentationAwareModulepublic void setDocsDir(String docsDir)
setDocsDir in interface DocumentationAwareModuledocsDir - The subdirectory in the web application where the documentation will be put.public boolean isApplyWsdlFilter()
public void setApplyWsdlFilter(boolean applyWsdlFilter)
applyWsdlFilter - Whether to apply a filter for the WSDL files that will attempt to resolve the soap paths dynamically.public boolean isApplyWadlFilter()
public void setApplyWadlFilter(boolean applyWadlFilter)
applyWadlFilter - Whether to apply a filter for the WADL files that will attempt to resolve the paths dynamically.public String getIndexPageName()
getIndexPageName in interface DocumentationAwareModulepublic void setIndexPageName(String indexPageName)
setIndexPageName in interface DocumentationAwareModuleindexPageName - The name of the index page.public boolean isDisableRestMountpoint()
public void setDisableRestMountpoint(boolean disableRestMountpoint)
disableRestMountpoint - Whether to disable the REST mountpoint documentation.public String getDefaultNamespace()
public void setDefaultNamespace(String defaultNamespace)
defaultNamespace - The default namespace for the purposes of generating documentation.public String getGroupRestResources()
public void setGroupRestResources(String groupRestResources)
groupRestResources - How to group the REST resources together.public File getDocsBuildDir()
public void init(Enunciate enunciate)
throws EnunciateException
init in interface DeploymentModuleinit in class BasicDeploymentModuleEnunciateExceptionpublic void initModel(EnunciateFreemarkerModel model)
initModel in interface EnunciateModelAwareinitModel in class FreemarkerDeploymentModule
public void doFreemarkerGenerate()
throws EnunciateException,
IOException,
freemarker.template.TemplateException
doFreemarkerGenerate in class FreemarkerDeploymentModuleEnunciateException
IOException
freemarker.template.TemplateException
protected void doBuild()
throws EnunciateException,
IOException
doBuild in class BasicDeploymentModuleEnunciateException
IOException
protected void generateDownloadsXML()
throws IOException,
EnunciateException
IOException
EnunciateException
protected void buildBase()
throws IOException
IOException
protected void doXmlTransform()
throws IOException,
EnunciateException
IOException
EnunciateException
protected void doFreemarkerXMLProcessing(URL freemarkerXMLProcessingTemplateURL)
throws IOException,
EnunciateException
IOException
EnunciateException
protected void doXSLT(URL xsltURL)
throws IOException,
EnunciateException
IOException
EnunciateExceptionprotected String getRelativePathToRootDir()
public Set<String> getFacetIncludes()
getFacetIncludes in interface FacetAwarepublic void addFacetInclude(String name)
name - The name.public Set<String> getFacetExcludes()
getFacetExcludes in interface FacetAwarepublic void addFacetExclude(String name)
name - The name.protected InputStream loadDefaultBase()
protected freemarker.template.ObjectWrapper getObjectWrapper()
getObjectWrapper in class FreemarkerDeploymentModulepublic org.apache.commons.digester.RuleSet getConfigurationRules()
getConfigurationRules in interface DeploymentModulegetConfigurationRules in class BasicDeploymentModule
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||