public class ThymeleafProcessor extends AbstractRequestProcessor
RequestProcessor using Thymeleaf as a rendering engine.IWebContext, with some additional context variables:
SESSIONMap<String,Object> containing the current appNG session.
<div th:text="${#ctx.SESSION['subject'].name}"></div>
APPApplications properties as Properties
<div th:text="${#ctx.APP.getString('myProp')"></div>
SITESites properties as Properties. See SiteProperties for a list of available
properties.
<div th:text="${#ctx.SITE.getString('timeZone')"></div>
PLATFORMProperties. See Platform.Property for a list of available
properties.
<div th:text="${#ctx.PLATFORM.getBoolean('debugMode')"></div>
| Modifier and Type | Class and Description |
|---|---|
static class |
ThymeleafProcessor.AppNG
This is a helper class to make it easier for the thymeleaf template to interact with appNG's
Platform object. |
contentLength, contentType, env, INDEX_HTML, marshallService, navigationBuilder, outputFormat, outputType, pathInfo, PLATFORM_XML, redirect, servletRequest, servletResponse, STACKTRACE_TXT, templatePath| Constructor and Description |
|---|
ThymeleafProcessor(DocumentBuilderFactory dbf) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addTemplates(List<Template> templates) |
protected org.thymeleaf.templateresolver.ITemplateResolver |
getApplicationTemplateResolver(String application,
Charset charset,
Boolean devMode,
File tplFolder,
Set<String> patterns) |
protected org.thymeleaf.context.IWebContext |
getContext(Platform platform,
ApplicationProvider applicationProvider) |
protected org.thymeleaf.linkbuilder.ILinkBuilder |
getGlobalLinkBuilder(String templatePrefix) |
protected org.thymeleaf.templateresolver.ITemplateResolver |
getGlobalTemplateResolver(Charset charset,
Boolean devMode) |
protected org.thymeleaf.linkbuilder.ILinkBuilder |
getLinkBuilder(ApplicationProvider applicationProvider,
String templatePrefix,
File tplFolder) |
protected ThymeleafTemplateEngine |
prepareEngine(org.springframework.context.ConfigurableApplicationContext context,
Properties platformProperties,
Site site,
ApplicationProvider applicationProvider,
Charset charset) |
String |
processWithTemplate(Site applicationSite,
File debugRootFolder)
Processes the request, including the processing of the template.
|
protected void |
writeStackTrace(File outfolder,
Exception e) |
protected void |
writeTemplateFiles(File outfolder,
ThymeleafTemplateEngine templateEngine) |
determineActiveAuthentication, determineFormatAndType, getApplicationProvider, getContentLength, getContentType, getDebugFilePrefix, getMarshallService, getOutputFormat, getOutputType, getPlatform, getTemplatePath, init, initPlatform, isRedirect, processPlatform, setMarshallService, setRedirect, setTemplatePath, writeDebugFile, writeErrorPagepublic ThymeleafProcessor(@Autowired
DocumentBuilderFactory dbf)
public String processWithTemplate(Site applicationSite, File debugRootFolder) throws InvalidConfigurationException
RequestProcessorRequestProcessor.init(HttpServletRequest, HttpServletResponse, PathInfo, String) must have been called before.applicationSite - the Site for which the process the requestdebugRootFolder - the folder to write debug files toApplication and applying the Template. This should then be
written to the HttpServletResponseInvalidConfigurationException - if something goes wrong while processing the requestRequestProcessor.processPlatform(Site)protected void writeTemplateFiles(File outfolder, ThymeleafTemplateEngine templateEngine) throws IOException
IOExceptionprotected org.thymeleaf.templateresolver.ITemplateResolver getApplicationTemplateResolver(String application, Charset charset, Boolean devMode, File tplFolder, Set<String> patterns)
protected org.thymeleaf.context.IWebContext getContext(Platform platform, ApplicationProvider applicationProvider) throws InvalidConfigurationException
InvalidConfigurationExceptionprotected org.thymeleaf.linkbuilder.ILinkBuilder getGlobalLinkBuilder(String templatePrefix)
protected org.thymeleaf.linkbuilder.ILinkBuilder getLinkBuilder(ApplicationProvider applicationProvider, String templatePrefix, File tplFolder)
protected ThymeleafTemplateEngine prepareEngine(org.springframework.context.ConfigurableApplicationContext context, Properties platformProperties, Site site, ApplicationProvider applicationProvider, Charset charset)
protected org.thymeleaf.templateresolver.ITemplateResolver getGlobalTemplateResolver(Charset charset, Boolean devMode)
protected void addTemplates(List<Template> templates)
addTemplates in class AbstractRequestProcessorCopyright © 2011–2023 aiticon GmbH. All rights reserved.