Merge 1.4 to HEAD

svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4351 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4352 .
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4353 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4354 .
   svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4354 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4362 .


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4657 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-12-19 14:36:46 +00:00
parent 488450a988
commit 760cb0fe77
20 changed files with 332 additions and 148 deletions

View File

@@ -32,6 +32,8 @@ import org.alfresco.service.cmr.repository.TemplateNode;
import org.alfresco.service.cmr.repository.TemplateProcessor;
import org.apache.log4j.Logger;
import bsh.This;
import freemarker.cache.MruCacheStorage;
import freemarker.cache.StringTemplateLoader;
import freemarker.template.Configuration;
@@ -70,6 +72,9 @@ public class FreeMarkerProcessor implements TemplateProcessor
/** The Content Service to use */
private ContentService contentService;
/** Template encoding */
private String defaultEncoding;
/**
* Set the node service
*
@@ -90,6 +95,16 @@ public class FreeMarkerProcessor implements TemplateProcessor
this.contentService = contentService;
}
/**
* Set the default template encoding
*
* @param defaultEncoding the default encoding
*/
public void setDefaultEncoding(String defaultEncoding)
{
this.defaultEncoding = defaultEncoding;
}
/**
* Get the FreeMarker configuration for this instance
*
@@ -111,6 +126,12 @@ public class FreeMarkerProcessor implements TemplateProcessor
// rethrow any exception so we can deal with them
config.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
// set default template encoding
if (defaultEncoding != null)
{
config.setDefaultEncoding(defaultEncoding);
}
return config;
}
@@ -140,6 +161,12 @@ public class FreeMarkerProcessor implements TemplateProcessor
// rethrow any exception so we can deal with them
config.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
// set default template encoding
if (defaultEncoding != null)
{
config.setDefaultEncoding(defaultEncoding);
}
return config;
}