fr.paris.lutece.portal.service.template
Class AbstractFreeMarkerTemplateService

java.lang.Object
  extended by fr.paris.lutece.portal.service.template.AbstractFreeMarkerTemplateService
All Implemented Interfaces:
IFreeMarkerTemplateService

public abstract class AbstractFreeMarkerTemplateService
extends java.lang.Object
implements IFreeMarkerTemplateService

Template service based on the Freemarker template engine


Constructor Summary
AbstractFreeMarkerTemplateService()
           
 
Method Summary
 void addPluginMacros(java.lang.String strFileName)
          Adds a macro file (like the main commons.html) brought by a plugin.
 void init(java.lang.String strTemplatePath)
          Initializes the service with the templates's path
 HtmlTemplate loadTemplate(java.lang.String strTemplateData, java.util.Locale locale, java.lang.Object rootMap)
          Deprecated. 
 HtmlTemplate loadTemplate(java.lang.String strPath, java.lang.String strTemplate)
          Load a template
 HtmlTemplate loadTemplate(java.lang.String strPath, java.lang.String strTemplate, java.util.Locale locale, java.lang.Object rootMap)
          Load a template and process a model
 void resetCache()
          Reset the cache
 void resetConfiguration()
          Clears the configuration cache
 void setTemplateUpdateDelay(int nTemplateUpdateDelay)
          Set the template update delay
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface fr.paris.lutece.portal.service.template.IFreeMarkerTemplateService
getAbsolutePathFromRelativePath, getDefaultPattern
 

Constructor Detail

AbstractFreeMarkerTemplateService

public AbstractFreeMarkerTemplateService()
Method Detail

setTemplateUpdateDelay

public void setTemplateUpdateDelay(int nTemplateUpdateDelay)
Set the template update delay

Specified by:
setTemplateUpdateDelay in interface IFreeMarkerTemplateService
Parameters:
nTemplateUpdateDelay - the template update delay

addPluginMacros

public void addPluginMacros(java.lang.String strFileName)
Adds a macro file (like the main commons.html) brought by a plugin. This file will be included for every template (autoinclude).

Specified by:
addPluginMacros in interface IFreeMarkerTemplateService
Parameters:
strFileName - the filename

init

public void init(java.lang.String strTemplatePath)
Initializes the service with the templates's path

Specified by:
init in interface IFreeMarkerTemplateService
Parameters:
strTemplatePath - The template path

loadTemplate

public HtmlTemplate loadTemplate(java.lang.String strPath,
                                 java.lang.String strTemplate)
Load a template

Specified by:
loadTemplate in interface IFreeMarkerTemplateService
Parameters:
strPath - the root path
strTemplate - the path of the template from the root path
Returns:
the html template

loadTemplate

public HtmlTemplate loadTemplate(java.lang.String strPath,
                                 java.lang.String strTemplate,
                                 java.util.Locale locale,
                                 java.lang.Object rootMap)
Load a template and process a model

Specified by:
loadTemplate in interface IFreeMarkerTemplateService
Parameters:
strPath - the root path
strTemplate - the path of the template from the root path
locale - The locale
rootMap - the model root
Returns:
the processed html template

loadTemplate

@Deprecated
public HtmlTemplate loadTemplate(java.lang.String strTemplateData,
                                            java.util.Locale locale,
                                            java.lang.Object rootMap)
Deprecated. 

Load a template from a String and process a model WARNING : This method must not be used in front office (no cache management available).
Deprecated Using Freemarker without cache is huge CPU consuming

Specified by:
loadTemplate in interface IFreeMarkerTemplateService
Parameters:
strTemplateData - The template as a string
locale - The Locale
rootMap - the model root
Returns:
the processed html template

resetConfiguration

public void resetConfiguration()
Clears the configuration cache

Specified by:
resetConfiguration in interface IFreeMarkerTemplateService

resetCache

public void resetCache()
Reset the cache

Specified by:
resetCache in interface IFreeMarkerTemplateService


Copyright © 2012 Mairie de Paris. All Rights Reserved.