Class FTLTemplateProcessor

  • All Implemented Interfaces:
    java.util.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 Detail

      • FTLTemplateProcessor

        public FTLTemplateProcessor()
    • Method Detail

      • setConfigService

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

        public void setDefaultEncoding​(java.lang.String defaultEncoding)
        Parameters:
        defaultEncoding - String
      • getDefaultEncoding

        public java.lang.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
      • getExtension

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

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

        public void process​(java.lang.String template,
                            java.lang.Object model,
                            java.io.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​(java.lang.String template,
                                  java.lang.Object model,
                                  java.io.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​(java.lang.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()