Class 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
    • Method Detail

      • 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
      • closeTemplateSource

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