Class ClassPathRepoTemplateLoader

java.lang.Object
org.alfresco.repo.template.ClassPathRepoTemplateLoader
All Implemented Interfaces:
freemarker.cache.TemplateLoader

public class ClassPathRepoTemplateLoader extends Object implements freemarker.cache.TemplateLoader
Custom FreeMarker template loader to locate templates stored either from the ClassPath or in a Alfresco Repository.

The template name should be supplied either as a NodeRef String or a ClassPath path String.

Author:
Kevin Roast
  • Constructor Details

  • Method Details

    • findTemplateSource

      public Object findTemplateSource(String name) throws IOException
      Return an object wrapping a source for a template
      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