mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Web Scripts:
- Addition of reponse status code and template support - Appropriate status codes added to login & ticket web scripts - Web Script Index page also mapped to / url - Various fixes applied to url to web script mapping git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5846 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
*/
|
||||
package org.alfresco.web.scripts;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.alfresco.repo.template.FreeMarkerProcessor;
|
||||
import org.alfresco.repo.template.QNameAwareObjectWrapper;
|
||||
import org.alfresco.service.cmr.repository.ProcessorExtension;
|
||||
@@ -37,6 +39,7 @@ import org.springframework.context.ApplicationListener;
|
||||
import freemarker.cache.MruCacheStorage;
|
||||
import freemarker.cache.TemplateLoader;
|
||||
import freemarker.template.Configuration;
|
||||
import freemarker.template.Template;
|
||||
import freemarker.template.TemplateExceptionHandler;
|
||||
|
||||
|
||||
@@ -106,6 +109,26 @@ public class TemplateProcessor extends FreeMarkerProcessor implements Applicatio
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if a template exists
|
||||
*
|
||||
* @param template
|
||||
* @return true => exists
|
||||
*/
|
||||
public boolean hasTemplate(String templatePath)
|
||||
{
|
||||
boolean hasTemplate = false;
|
||||
try
|
||||
{
|
||||
Template template = templateConfig.getTemplate(templatePath);
|
||||
hasTemplate = (template != null);
|
||||
}
|
||||
catch(IOException e)
|
||||
{
|
||||
}
|
||||
return hasTemplate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialise FreeMarker Configuration
|
||||
*/
|
||||
|
Reference in New Issue
Block a user