Class SiteRenderingContext

java.lang.Object
org.apache.maven.doxia.siterenderer.SiteRenderingContext

public class SiteRenderingContext extends Object
Context for a site rendering.
Author:
Brett Porter
  • 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

      public String getTemplateName()

      Getter for the field templateName.

      Returns:
      a String object.
    • getTemplateClassLoader

      public ClassLoader getTemplateClassLoader()

      Getter for the field templateClassLoader.

      Returns:
      a ClassLoader object.
    • setTemplateClassLoader

      public void setTemplateClassLoader(ClassLoader templateClassLoader)

      Setter for the field templateClassLoader.

      Parameters:
      templateClassLoader - a ClassLoader object.
    • getTemplateProperties

      public Map<String,?> getTemplateProperties()

      Getter for the field templateProperties.

      Returns:
      a Map object.
    • setTemplateProperties

      public void setTemplateProperties(Map<String,?> templateProperties)

      Setter for the field templateProperties.

      Parameters:
      templateProperties - a Map object.
    • getLocale

      public Locale getLocale()

      Getter for the field locale.

      Returns:
      a Locale object.
    • setLocale

      public void setLocale(Locale locale)

      Setter for the field locale.

      Parameters:
      locale - a Locale object.
    • getSiteLocales

      public List<Locale> getSiteLocales()

      Getter for the field siteLocales - a list of locales available for this site context.

      Returns:
      a List object with Locale objects.
    • addSiteLocales

      public void addSiteLocales(List<Locale> locales)

      Adds passed locales to the list of site locales.

      Parameters:
      locales - List of Locale objects to add to the site locales list.
    • getSiteModel

      public SiteModel getSiteModel()

      Getter for the field siteModel.

      Returns:
      a SiteModel object.
    • setSiteModel

      public void setSiteModel(SiteModel siteModel)

      Setter for the field siteModel.

      Parameters:
      siteModel - a SiteModel object.
    • setDefaultTitle

      public void setDefaultTitle(String defaultTitle)

      Setter for the field defaultTitle.

      Parameters:
      defaultTitle - a String object.
    • getDefaultTitle

      public String getDefaultTitle()

      Getter for the field defaultTitle.

      Returns:
      a String object.
    • getSkin

      public org.apache.maven.artifact.Artifact getSkin()

      Getter for the field skin.

      Returns:
      a Artifact object.
    • setSkin

      public void setSkin(org.apache.maven.artifact.Artifact skin)

      Setter for the field skinJarFile.

      Parameters:
      skin - an Artifact object.
    • getSkinModel

      public SkinModel getSkinModel()

      Getter for the field skinModel.

      Returns:
      a SkinModel object.
    • setSkinModel

      public void setSkinModel(SkinModel skinModel)

      Setter for the field skinModel.

      Parameters:
      skinModel - a SkinModel object.
    • setTemplateName

      public void setTemplateName(String templateName)

      Setter for the field templateName.

      Parameters:
      templateName - a String object.
    • addSiteDirectory

      @Deprecated public void addSiteDirectory(File siteDirectory)
    • addSiteDirectory

      public void addSiteDirectory(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. Typical values are src/site or target/generated-site.
      Parameters:
      siteDirectory - a SiteRenderingContext.SiteDirectory object.
      Since:
      2.0.0
    • getSiteDirectories

      public List<SiteRenderingContext.SiteDirectory> getSiteDirectories()

      Getter for the field siteDirectories.

      Returns:
      List of site directories.
    • getModuleExcludes

      public Map<String,String> getModuleExcludes()

      Getter for the field moduleExcludes.

      Returns:
      a map defining exclude patterns (comma separated) by parser id.
    • setModuleExcludes

      public void setModuleExcludes(Map<String,String> moduleExcludes)

      Setter for the field moduleExcludes.

      Parameters:
      moduleExcludes - a Map object.
    • getInputEncoding

      public String getInputEncoding()

      Getter for the field inputEncoding.

      Returns:
      a String object.
    • setInputEncoding

      public void setInputEncoding(String inputEncoding)

      Setter for the field inputEncoding.

      Parameters:
      inputEncoding - a String object.
    • getOutputEncoding

      public String getOutputEncoding()

      Getter for the field outputEncoding.

      Returns:
      a String object.
    • setOutputEncoding

      public void setOutputEncoding(String outputEncoding)

      Setter for the field outputEncoding.

      Parameters:
      outputEncoding - a String object.
    • getPublishDate

      public Date getPublishDate()

      If you want to specify a specific publish date instead of the current date.

      Returns:
      the publish date, can be null
    • setPublishDate

      public void setPublishDate(Date publishDate)

      Specify a specific publish date instead of the current date.

      Parameters:
      publishDate - the publish date
    • getProcessedContentOutput

      public File 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

      public void setProcessedContentOutput(File processedContentOutput)
      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

      public File getRootDirectory()
      Root directory, to calculate relative path to every site directories. Corresponds to the pom.xml directory for Maven build.
      Returns:
      the root directory
      Since:
      1.8
    • setRootDirectory

      public void setRootDirectory(File rootDirectory)
      Set the root directory.
      Parameters:
      rootDirectory - the root directory
      Since:
      1.8
    • getParserConfigurator

      public ParserConfigurator getParserConfigurator()
      Return the configurator for parsers.
      Returns:
      the parser configurator (may be null in which case the default configuration is applied)
      Since:
      2.0.0
    • setParserConfigurator

      public void setParserConfigurator(ParserConfigurator parserConfigurator)
      Set the configurator to use for parsers.
      Parameters:
      parserConfigurator - the configurator
      Since:
      2.0.0
    • getAttributes

      public Map<String,Object> 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 the ContextCustomizer to 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

      public Object putAttribute(String key, Object value)
      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, or null if there was no mapping for the key or if the map previously associated null with the key.
      Parameters:
      key - the key with which the specified value is to be associated
      value - 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

      public Object removeAttribute(String key)
      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 null if there was no mapping for key or if the map previously associated null with the key.
      Since:
      2.1.0
      See Also: