Class CrafterFreeMarkerConfigurer

java.lang.Object
org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer
org.craftercms.engine.freemarker.CrafterFreeMarkerConfigurer
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.view.freemarker.FreeMarkerConfig

public class CrafterFreeMarkerConfigurer extends org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer
Extends FreeMarkerConfigurer to:
  • Macro-resolve the template loader paths before a template loader is created for the path
Author:
Alfonso Vásquez
  • Field Summary

    Fields inherited from class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected freemarker.cache.TemplateLoader
    getTemplateLoaderForPath(String templateLoaderPath)
     
    protected freemarker.template.Configuration
     
    protected void
    postProcessConfiguration(freemarker.template.Configuration config)
     
    protected void
    postProcessTemplateLoaders(List<freemarker.cache.TemplateLoader> templateLoaders)
     
    void
    setCacheTemplates(boolean cacheTemplates)
     
    void
     
    void
    setTemplateExceptionHandler(freemarker.template.TemplateExceptionHandler templateExceptionHandler)
     

    Methods inherited from class org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer

    afterPropertiesSet, getConfiguration, getTaglibFactory, setConfiguration, setServletContext

    Methods inherited from class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory

    createConfiguration, getAggregateTemplateLoader, getResourceLoader, isPreferFileSystemAccess, setConfigLocation, setDefaultEncoding, setFreemarkerSettings, setFreemarkerVariables, setPostTemplateLoaders, setPreferFileSystemAccess, setPreTemplateLoaders, setResourceLoader, setTemplateLoaderPath, setTemplateLoaderPaths

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.context.ResourceLoaderAware

    setResourceLoader
  • Constructor Details

    • CrafterFreeMarkerConfigurer

      public CrafterFreeMarkerConfigurer()
  • Method Details

    • setMacroResolver

      public void setMacroResolver(MacroResolver macroResolver)
    • setTemplateExceptionHandler

      public void setTemplateExceptionHandler(freemarker.template.TemplateExceptionHandler templateExceptionHandler)
    • setCacheTemplates

      public void setCacheTemplates(boolean cacheTemplates)
    • postProcessConfiguration

      protected void postProcessConfiguration(freemarker.template.Configuration config) throws IOException, freemarker.template.TemplateException
      Overrides:
      postProcessConfiguration in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
      Throws:
      IOException
      freemarker.template.TemplateException
    • getTemplateLoaderForPath

      protected freemarker.cache.TemplateLoader getTemplateLoaderForPath(String templateLoaderPath)
      Overrides:
      getTemplateLoaderForPath in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory
    • postProcessTemplateLoaders

      protected void postProcessTemplateLoaders(List<freemarker.cache.TemplateLoader> templateLoaders)
      Overrides:
      postProcessTemplateLoaders in class org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer
    • newConfiguration

      protected freemarker.template.Configuration newConfiguration()
      Overrides:
      newConfiguration in class org.springframework.ui.freemarker.FreeMarkerConfigurationFactory