java.lang.Object
ch.tocco.nice2.optional.cms.impl.publish.output.freemarker.loader.CmsTemplateLoader
All Implemented Interfaces:
CachingTemplateLoader, freemarker.cache.TemplateLoader

@Component public class CmsTemplateLoader extends Object implements CachingTemplateLoader
This template loader uses CmsTemplateService to find the requested template. Once loaded a template, it will be cached within this loader. If the template has changed, the cache of this loader has to be invalidated by calling invalidate(String) or invalidateAll().
  • Constructor Details

  • Method Details

    • invalidateAll

      public void invalidateAll()
      Description copied from interface: CachingTemplateLoader
      Invalidate all templates in the cache.
      Specified by:
      invalidateAll in interface CachingTemplateLoader
    • invalidate

      public void invalidate(String templateName)
      Description copied from interface: CachingTemplateLoader
      Invalidate the template with a specific name.
      Specified by:
      invalidate in interface CachingTemplateLoader
      Parameters:
      templateName - The name of the template to invalidate.
    • findTemplateSource

      public Object findTemplateSource(String name) 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