Class FreemarkerProcessingServiceImpl
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.services.freemarker.FreemarkerProcessingServiceImpl
-
- All Implemented Interfaces:
FreemarkerProcessingService
public class FreemarkerProcessingServiceImpl extends Object implements FreemarkerProcessingService
An implementation of the FreemarkerProcessingService.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface edu.cornell.mannlib.vitro.webapp.services.freemarker.FreemarkerProcessingService
FreemarkerProcessingService.TemplateParsingException, FreemarkerProcessingService.TemplateProcessingException
-
-
Constructor Summary
Constructors Constructor Description FreemarkerProcessingServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisTemplateAvailable(String templateName, javax.servlet.http.HttpServletRequest req)Is there an accessible template by this name? The question is asked in the context of the current request, which determines the theme directory.StringrenderTemplate(String templateName, Map<String,Object> map, javax.servlet.http.HttpServletRequest req)Process a Freemarker template with a data map, producing string of HTML.
-
-
-
Method Detail
-
isTemplateAvailable
public boolean isTemplateAvailable(String templateName, javax.servlet.http.HttpServletRequest req) throws FreemarkerProcessingService.TemplateProcessingException
Description copied from interface:FreemarkerProcessingServiceIs there an accessible template by this name? The question is asked in the context of the current request, which determines the theme directory.- Specified by:
isTemplateAvailablein interfaceFreemarkerProcessingService- Throws:
FreemarkerProcessingService.TemplateProcessingException- If the template is found, but cannot be parsed.
-
renderTemplate
public String renderTemplate(String templateName, Map<String,Object> map, javax.servlet.http.HttpServletRequest req) throws FreemarkerProcessingService.TemplateProcessingException
Description copied from interface:FreemarkerProcessingServiceProcess a Freemarker template with a data map, producing string of HTML. This is done in the context of the current HttpServletRequest, which provides a wide range of ancillary information, including (but not limited to) theme directory, context path, info on logged-in user, authorizations for the current user, etc., etc.- Specified by:
renderTemplatein interfaceFreemarkerProcessingService- Throws:
FreemarkerProcessingService.TemplateProcessingException
-
-