Class FTLTemplateProcessor
java.lang.Object
org.springframework.extensions.webscripts.processor.BaseProcessor
org.springframework.extensions.webscripts.processor.BaseRegisterableTemplateProcessor
org.springframework.extensions.webscripts.processor.AbstractTemplateProcessor
org.springframework.extensions.webscripts.processor.FTLTemplateProcessor
- All Implemented Interfaces:
EventListener,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener,Processor,TemplateProcessor
FTL Template Processor for Alfresco Web Framework
- Author:
- davidc, kevinr
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classImplements the FreeMarker ObjectWrapper cache as a ThreadLocal to avoid blocking when interogating or populating the bean cache. -
Field Summary
Fields inherited from class org.springframework.extensions.webscripts.processor.BaseProcessor
processorExtensions -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the default encodingThe file extension that the processor is associated with, null if none.getName()Get the name of the processorbooleanhasTemplate(String templatePath) Determines if a template existsvoidinit()Inits the processorprotected voidInitialise FreeMarker Configurationprotected booleanvoidProcess a template against the supplied data model and write to the out.voidprocessString(String template, Object model, Writer out) Process a string template against the supplied data model and write to the out.voidreset()Reset the Template ProcessorvoidsetCacheSize(int cacheSize) voidsetConfigService(org.springframework.extensions.config.ConfigService configService) Sets the config service.voidsetDefaultEncoding(String defaultEncoding) voidsetUpdateDelay(int updateDelay) Methods inherited from class org.springframework.extensions.webscripts.processor.AbstractTemplateProcessor
addProcessorModelExtensions, getSearchPath, getTemplateLoader, initLoaders, onApplicationEvent, register, setApplicationContext, setSearchPathMethods inherited from class org.springframework.extensions.webscripts.processor.BaseRegisterableTemplateProcessor
getTemplateProcessorRegistry, setTemplateProcessorRegistryMethods inherited from class org.springframework.extensions.webscripts.processor.BaseProcessor
registerProcessorExtensionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
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
- Parameters:
defaultEncoding- String
-
getDefaultEncoding
Description copied from interface:TemplateProcessorGets 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:BaseRegisterableTemplateProcessorInits the processor- Overrides:
initin classAbstractTemplateProcessor
-
getExtension
Description copied from interface:ProcessorThe file extension that the processor is associated with, null if none.- Returns:
- the extension
-
getName
Description copied from interface:ProcessorGet the name of the processor- Returns:
- the name of the processor
-
process
Description copied from interface:TemplateProcessorProcess a template against the supplied data model and write to the out.- Parameters:
template- Template name/pathmodel- Object model to process template againstout- Writer object to send output too
-
processString
Description copied from interface:TemplateProcessorProcess a string template against the supplied data model and write to the out.- Parameters:
template- Template stringmodel- Object model to process template againstout- Writer object to send output too
-
reset
public void reset()Description copied from interface:TemplateProcessorReset the Template Processor -
hasTemplate
Description copied from interface:TemplateProcessorDetermines if a template exists- Parameters:
templatePath- String- Returns:
- true => exists
-
initConfig
protected void initConfig()Initialise FreeMarker Configuration -
isDebugMode
protected boolean isDebugMode()
-