Scheduled Actions

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2673 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrew Hind
2006-04-20 13:57:06 +00:00
parent b2998a79fd
commit 05525aff09
19 changed files with 2769 additions and 1 deletions

View File

@@ -48,7 +48,7 @@ public class TemplateServiceImpl implements TemplateService, ApplicationContextA
private Map<String, String> templateEngines;
/** Threadlocal instance for template processor cache */
private static ThreadLocal<Map<String, TemplateProcessor>> processors = new ThreadLocal();
private static ThreadLocal<Map<String, TemplateProcessor>> processors = new ThreadLocal<Map<String, TemplateProcessor>>();
/**
* Set the application context
@@ -127,6 +127,36 @@ public class TemplateServiceImpl implements TemplateService, ApplicationContextA
return out.toString();
}
public void processTemplateString(String engine, String template, Object model, Writer out)
throws TemplateException
{
try
{
// execute template processor
TemplateProcessor processor = getTemplateProcessorImpl(engine);
processor.processString(template, model, out);
}
catch (TemplateException terr)
{
throw terr;
}
catch (Throwable err)
{
throw new TemplateException(err.getMessage(), err);
}
}
public String processTemplateString(String engine, String template, Object model)
throws TemplateException
{
Writer out = new StringWriter(1024);
processTemplateString(engine, template, model, out);
return out.toString();
}
/**
* Return the TemplateProcessor implementation for the named template engine
*