Class FTLTemplateProcessor

All Implemented Interfaces:
EventListener, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener, Processor, TemplateProcessor

public class FTLTemplateProcessor extends AbstractTemplateProcessor
FTL Template Processor for Alfresco Web Framework
Author:
davidc, kevinr
  • Constructor Details

    • FTLTemplateProcessor

      public FTLTemplateProcessor()
  • Method Details

    • setConfigService

      public void setConfigService(org.springframework.extensions.config.ConfigService configService)
      Sets the config service.
      Parameters:
      configService - The ConfigService
    • setDefaultEncoding

      public void setDefaultEncoding(String defaultEncoding)
      Parameters:
      defaultEncoding - String
    • getDefaultEncoding

      public String getDefaultEncoding()
      Description copied from interface: TemplateProcessor
      Gets the default encoding
      Returns:
      default encoding
    • setUpdateDelay

      public void setUpdateDelay(int updateDelay)
      Parameters:
      updateDelay - the time in seconds between checks on the modified date for cached templates
    • setCacheSize

      public void setCacheSize(int cacheSize)
      Parameters:
      cacheSize - the size of the MRU template cache, default is 256
    • init

      public void init()
      Description copied from class: BaseRegisterableTemplateProcessor
      Inits the processor
      Overrides:
      init in class AbstractTemplateProcessor
    • getExtension

      public String getExtension()
      Description copied from interface: Processor
      The file extension that the processor is associated with, null if none.
      Returns:
      the extension
    • getName

      public String getName()
      Description copied from interface: Processor
      Get the name of the processor
      Returns:
      the name of the processor
    • process

      public void process(String template, Object model, Writer out)
      Description copied from interface: TemplateProcessor
      Process a template against the supplied data model and write to the out.
      Parameters:
      template - Template name/path
      model - Object model to process template against
      out - Writer object to send output too
    • processString

      public void processString(String template, Object model, Writer out)
      Description copied from interface: TemplateProcessor
      Process a string template against the supplied data model and write to the out.
      Parameters:
      template - Template string
      model - Object model to process template against
      out - Writer object to send output too
    • reset

      public void reset()
      Description copied from interface: TemplateProcessor
      Reset the Template Processor
    • hasTemplate

      public boolean hasTemplate(String templatePath)
      Description copied from interface: TemplateProcessor
      Determines if a template exists
      Parameters:
      templatePath - String
      Returns:
      true => exists
    • initConfig

      protected void initConfig()
      Initialise FreeMarker Configuration
    • isDebugMode

      protected boolean isDebugMode()