Class TemplateVariationDefinitionBasedTemplateLoader

java.lang.Object
com.flowable.template.engine.impl.processor.TemplateVariationDefinitionBasedTemplateLoader
All Implemented Interfaces:
freemarker.cache.TemplateLoader

public class TemplateVariationDefinitionBasedTemplateLoader extends Object implements freemarker.cache.TemplateLoader
A freemarker based template loader loading template content based on a TemplateVariationModel which is loaded through the TemplateRepositoryService by its id which is passed in as the template name. However, FreeMarker adds the locale to the template name and we have to strip it away as variations are handled by the template engine rather than FreeMarker.
Author:
Micha Kiener
  • Field Details

  • Constructor Details

  • Method Details

    • findTemplateSource

      public Object findTemplateSource(String templateVariationId) throws IOException
      Specified by:
      findTemplateSource in interface freemarker.cache.TemplateLoader
      Throws:
      IOException
    • getLastModified

      public long getLastModified(Object templateSource)
      Specified by:
      getLastModified in interface freemarker.cache.TemplateLoader
    • getReader

      public Reader getReader(Object templateSource, String encoding) throws IOException
      Specified by:
      getReader in interface freemarker.cache.TemplateLoader
      Throws:
      IOException
    • closeTemplateSource

      public void closeTemplateSource(Object templateSource) throws IOException
      Specified by:
      closeTemplateSource in interface freemarker.cache.TemplateLoader
      Throws:
      IOException
    • getRepositoryService

      protected TemplateRepositoryService getRepositoryService()