mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fix for ETHREEOH-100, cleanup to some webscripts as ETHREEOH-100 now fixed.
Basic "people" API for FreeMarker - just getPerson() and getGroup() currently. Template cache size and delay now configurable in RepositoryTemplateProcessor (like they already are in PresentationTemplateProcessor) - related default cache size tweaks. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13788 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -64,11 +64,14 @@ public class RepositoryTemplateProcessor extends FreeMarkerProcessor
|
||||
protected String defaultEncoding;
|
||||
protected Configuration templateConfig;
|
||||
protected FreeMarkerProcessor freeMarkerProcessor;
|
||||
private int updateDelay = 0;
|
||||
private int cacheSize = 512;
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.template.FreeMarkerProcessor#setDefaultEncoding(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void setDefaultEncoding(String defaultEncoding)
|
||||
{
|
||||
this.defaultEncoding = defaultEncoding;
|
||||
@@ -81,6 +84,25 @@ public class RepositoryTemplateProcessor extends FreeMarkerProcessor
|
||||
{
|
||||
return this.defaultEncoding;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param updateDelay the time in seconds between checks on the modified date for cached templates
|
||||
*/
|
||||
public void setUpdateDelay(int updateDelay)
|
||||
{
|
||||
this.updateDelay = updateDelay;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param cacheSize the size of the MRU template cache, default is 256
|
||||
*/
|
||||
public void setCacheSize(int cacheSize)
|
||||
{
|
||||
if (cacheSize >= 0)
|
||||
{
|
||||
this.cacheSize = cacheSize;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param searchPath
|
||||
@@ -151,9 +173,9 @@ public class RepositoryTemplateProcessor extends FreeMarkerProcessor
|
||||
Configuration config = new Configuration();
|
||||
|
||||
// setup template cache
|
||||
config.setCacheStorage(new MruCacheStorage(20, 100));
|
||||
config.setTemplateUpdateDelay(0);
|
||||
|
||||
config.setCacheStorage(new MruCacheStorage(this.cacheSize, this.cacheSize << 1));
|
||||
config.setTemplateUpdateDelay(updateDelay);
|
||||
|
||||
// setup template loaders
|
||||
List<TemplateLoader> loaders = new ArrayList<TemplateLoader>();
|
||||
for (Store apiStore : searchPath.getStores())
|
||||
|
Reference in New Issue
Block a user