Interface TemplateModel

All Known Implementing Classes:
BaseTemplateModel

public interface TemplateModel
A template definition can be used for any sort of template (e.g. a document-, message- or email-template, etc). It contains the meta information about a single template and is classified using getType() and getSubType() where the type will later be used to lookup a renderer able to render or further process this template. A template might contain one or more variations (e.g. for multiple languages) represented with TemplateVariationDefinition. Each one of the variations has its own content mapped to a single VariationDefinition (e.g. for a single language in a country, etc).
Author:
Micha Kiener
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getDescription()
    Returns the optional description of this template definition, describing where and how it might be used.
    java.lang.String getFormKey()
    Returns the optional form key for this template definition which might be used to collect information whenever such a template instance is created.
    java.lang.String getKey()
    Returns the business key usually used to reference or lookup a template definition regardless of its version.
    java.lang.String getName()
    Returns the name of this template definition.
    java.lang.String getSubType()
    Returns the sub type of this template definition which can be freely chosen.
    java.lang.String getType()
    Returns the type of this template definition which is used to lookup a renderer or processor being able to render and process this template.
    java.lang.String getVariationContentType()
    The type of the variation content.
    java.util.List<VariationDefinition> getVariationDefinitions()
    Returns the optional list of variations this template needs to lookup the correct TemplateVariationDefinition to be used when rendering a single template for a certain variation.
    java.lang.String getVersionTimestamp()
    Returns the version timestamp for this template definition that is used to check if a new template needs to be deployed.
    boolean hasVariations()
    Returns true if this template definition has variations or just has a single variation.
  • Method Details

    • getKey

      java.lang.String getKey()
      Returns the business key usually used to reference or lookup a template definition regardless of its version.
    • getName

      java.lang.String getName()
      Returns the name of this template definition.
    • getDescription

      java.lang.String getDescription()
      Returns the optional description of this template definition, describing where and how it might be used.
    • getType

      java.lang.String getType()
      Returns the type of this template definition which is used to lookup a renderer or processor being able to render and process this template.
      See Also:
      for a set of predefined template types
    • getSubType

      java.lang.String getSubType()
      Returns the sub type of this template definition which can be freely chosen.
    • getVariationContentType

      java.lang.String getVariationContentType()
      The type of the variation content. This is used by the TemplateProcessor(s) to decide whether they can render certain template or not.
      Returns:
      the type of the variation content
    • getFormKey

      java.lang.String getFormKey()
      Returns the optional form key for this template definition which might be used to collect information whenever such a template instance is created. For instance, this form might ask for necessary categorization information when creating a new document based on a template or request parameter values if a message template should be rendered, etc.
    • getVersionTimestamp

      java.lang.String getVersionTimestamp()
      Returns the version timestamp for this template definition that is used to check if a new template needs to be deployed. The timestamp should have a format of 'yyyy-MM-dd' (2018-02-01) or 'yyyy-MM-dd HH:mm:ss' (2018-02-01 14:00:00)
    • hasVariations

      boolean hasVariations()
      Returns true if this template definition has variations or just has a single variation. If true is returned, the method getVariationDefinitions() needs to return at least one variation definition, otherwise it must return an empty list or even null.
      Returns:
      true if this template has variations, false if it has one only
    • getVariationDefinitions

      java.util.List<VariationDefinition> getVariationDefinitions()
      Returns the optional list of variations this template needs to lookup the correct TemplateVariationDefinition to be used when rendering a single template for a certain variation. If any values are returned, the order must not be random, but exactly defined as it is used to compose the variation key with all variations later on to lookup the variation using TemplateVariationDefinition.getVariationKey().