public class ThymeleafProcessor extends AbstractRequestProcessor
RequestProcessor
using Thymeleaf as a rendering engine.IWebContext
, with some additional context variables:
SESSION
Map<String,Object>
containing the current appNG session.<div th:text="${#ctx.SESSION['subject'].name}"></div>
APP
Application
s properties as Properties
<div th:text="${#ctx.APP.getString('myProp')"></div>
SITE
Site
s properties as Properties
. See SiteProperties
for a list of available
properties.<div th:text="${#ctx.SITE.getString('timeZone')"></div>
PLATFORM
Properties
. 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, writeErrorPage
public ThymeleafProcessor(@Autowired DocumentBuilderFactory dbf)
public String processWithTemplate(Site applicationSite, File debugRootFolder) throws InvalidConfigurationException
RequestProcessor
RequestProcessor.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 HttpServletResponse
InvalidConfigurationException
- if something goes wrong while processing the requestRequestProcessor.processPlatform(Site)
protected void writeTemplateFiles(File outfolder, ThymeleafTemplateEngine templateEngine) throws IOException
IOException
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) throws InvalidConfigurationException
InvalidConfigurationException
protected 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 AbstractRequestProcessor
Copyright © 2011–2023 aiticon GmbH. All rights reserved.