Class SiteRenderingContext
java.lang.Object
org.apache.maven.doxia.siterenderer.SiteRenderingContext
Context for a site rendering.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate Stringprivate Localeprivate Stringprivate ParserConfiguratorprivate Fileprivate Dateprivate Fileprivate List<SiteRenderingContext.SiteDirectory> private SiteModelprivate org.apache.maven.artifact.Artifactprivate SkinModelprivate ClassLoaderprivate Stringprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSiteDirectory(File siteDirectory) Deprecated.voidaddSiteDirectory(SiteRenderingContext.SiteDirectory siteDirectory) Add a site directory, expected to have a Doxia Site layout, ie one directory per Doxia parser module containing files with parser extension.voidaddSiteLocales(List<Locale> locales) Adds passed locales to the list of site locales.Gets the map of attributes that can be used to cache items per site rendering context.Getter for the fielddefaultTitle.Getter for the fieldinputEncoding.Getter for the fieldlocale.Getter for the fieldmoduleExcludes.Getter for the fieldoutputEncoding.Return the configurator forparsers.Directory where to save content after Velocity processing (*.vm), but before parsing it with Doxia.If you want to specify a specific publish date instead of the current date.Root directory, to calculate relative path to every site directories.Getter for the fieldsiteDirectories.Getter for the fieldsiteLocales- a list of locales available for this site context.Getter for the fieldsiteModel.org.apache.maven.artifact.ArtifactgetSkin()Getter for the fieldskin.Getter for the fieldskinModel.Getter for the fieldtemplateClassLoader.Getter for the fieldtemplateName.Getter for the fieldtemplateProperties.booleanIf input documents should be validated before parsing.putAttribute(String key, Object value) Puts an attribute in the context attributes map, this can be used to cache items per site rendering context.removeAttribute(String key) Removes the mapping for a key from this attributes map if it is present.voidsetDefaultTitle(String defaultTitle) Setter for the fielddefaultTitle.voidsetInputEncoding(String inputEncoding) Setter for the fieldinputEncoding.voidSetter for the fieldlocale.voidsetModuleExcludes(Map<String, String> moduleExcludes) Setter for the fieldmoduleExcludes.voidsetOutputEncoding(String outputEncoding) Setter for the fieldoutputEncoding.voidsetParserConfigurator(ParserConfigurator parserConfigurator) Set the configurator to use forparsers.voidsetProcessedContentOutput(File processedContentOutput) Where to (eventually) save content after Velocity processing (*.vm), but before parsing it with Doxia?voidsetPublishDate(Date publishDate) Specify a specific publish date instead of the current date.voidsetRootDirectory(File rootDirectory) Set the root directory.voidsetSiteModel(SiteModel siteModel) Setter for the fieldsiteModel.voidsetSkin(org.apache.maven.artifact.Artifact skin) Setter for the fieldskinJarFile.voidsetSkinModel(SkinModel skinModel) Setter for the fieldskinModel.voidsetTemplateClassLoader(ClassLoader templateClassLoader) Setter for the fieldtemplateClassLoader.voidsetTemplateName(String templateName) Setter for the fieldtemplateName.voidsetTemplateProperties(Map<String, ?> templateProperties) Setter for the fieldtemplateProperties.voidsetValidate(boolean validate) Switch on/off validation.
-
Field Details
-
inputEncoding
-
outputEncoding
-
templateName
-
templateClassLoader
-
templateProperties
-
locale
-
siteLocales
-
siteModel
-
defaultTitle
-
skin
private org.apache.maven.artifact.Artifact skin -
skinModel
-
rootDirectory
-
siteDirectories
-
moduleExcludes
-
validate
private boolean validate -
publishDate
-
processedContentOutput
-
parserConfigurator
-
attributes
-
-
Constructor Details
-
SiteRenderingContext
public SiteRenderingContext()
-
-
Method Details
-
isValidate
public boolean isValidate()If input documents should be validated before parsing. By default no validation is performed.- Returns:
- true if validation is switched on.
- Since:
- 1.1.3
-
setValidate
public void setValidate(boolean validate) Switch on/off validation.- Parameters:
validate- true to switch on validation.- Since:
- 1.1.3
-
getTemplateName
-
getTemplateClassLoader
Getter for the field
templateClassLoader.- Returns:
- a
ClassLoaderobject.
-
setTemplateClassLoader
Setter for the field
templateClassLoader.- Parameters:
templateClassLoader- aClassLoaderobject.
-
getTemplateProperties
-
setTemplateProperties
-
getLocale
-
setLocale
-
getSiteLocales
-
addSiteLocales
-
getSiteModel
-
setSiteModel
-
setDefaultTitle
-
getDefaultTitle
-
getSkin
public org.apache.maven.artifact.Artifact getSkin()Getter for the field
skin.- Returns:
- a
Artifactobject.
-
setSkin
public void setSkin(org.apache.maven.artifact.Artifact skin) Setter for the field
skinJarFile.- Parameters:
skin- anArtifactobject.
-
getSkinModel
-
setSkinModel
-
setTemplateName
-
addSiteDirectory
Deprecated. -
addSiteDirectory
Add a site directory, expected to have a Doxia Site layout, ie one directory per Doxia parser module containing files with parser extension. Typical values aresrc/siteortarget/generated-site.- Parameters:
siteDirectory- aSiteRenderingContext.SiteDirectoryobject.- Since:
- 2.0.0
-
getSiteDirectories
Getter for the field
siteDirectories.- Returns:
- List of site directories.
-
getModuleExcludes
-
setModuleExcludes
-
getInputEncoding
-
setInputEncoding
-
getOutputEncoding
-
setOutputEncoding
-
getPublishDate
If you want to specify a specific publish date instead of the current date.
- Returns:
- the publish date, can be
null
-
setPublishDate
Specify a specific publish date instead of the current date.
- Parameters:
publishDate- the publish date
-
getProcessedContentOutput
Directory where to save content after Velocity processing (*.vm), but before parsing it with Doxia.- Returns:
- not null if the documents are to be saved
- Since:
- 1.7
-
setProcessedContentOutput
Where to (eventually) save content after Velocity processing (*.vm), but before parsing it with Doxia?- Parameters:
processedContentOutput- not null if the documents are to be saved- Since:
- 1.7
-
getRootDirectory
Root directory, to calculate relative path to every site directories. Corresponds to thepom.xmldirectory for Maven build.- Returns:
- the root directory
- Since:
- 1.8
-
setRootDirectory
Set the root directory.- Parameters:
rootDirectory- the root directory- Since:
- 1.8
-
getParserConfigurator
Return the configurator forparsers.- Returns:
- the parser configurator (may be
nullin which case the default configuration is applied) - Since:
- 2.0.0
-
setParserConfigurator
Set the configurator to use forparsers.- Parameters:
parserConfigurator- the configurator- Since:
- 2.0.0
-
getAttributes
Gets the map of attributes that can be used to cache items per site rendering context. This is a free-form map that can be used for example from theContextCustomizerto cache items that can be reused among different documents of the same site.- Returns:
- a map of attributes, the returned map is immutable.
- Since:
- 2.1.0
- See Also:
-
putAttribute
Puts an attribute in the context attributes map, this can be used to cache items per site rendering context. It overrides any existing value for the same key and returns the previous value associated with the key, ornullif there was no mapping for the key or if the map previously associatednullwith the key.- Parameters:
key- the key with which the specified value is to be associatedvalue- the value to be associated with the specified key- Returns:
- the previous value associated with the key, or
null - Since:
- 2.1.0
- See Also:
-
removeAttribute
Removes the mapping for a key from this attributes map if it is present.- Parameters:
key- key whose mapping is to be removed from the map- Returns:
- the previous value associated with key, or
nullif there was no mapping for key or if the map previously associatednullwith the key. - Since:
- 2.1.0
- See Also:
-
addSiteDirectory(SiteDirectory)