Package org.appng.core.model
Class PlatformProcessor
- java.lang.Object
-
- org.appng.core.model.AbstractRequestProcessor
-
- org.appng.core.model.PlatformProcessor
-
- All Implemented Interfaces:
RequestProcessor
public class PlatformProcessor extends AbstractRequestProcessor
DefaultRequestProcessor
-implementation, using an XSLT based template.- Author:
- Matthias Herlitzius, Matthias Müller
-
-
Field Summary
-
Fields inherited from class org.appng.core.model.AbstractRequestProcessor
contentLength, contentType, env, INDEX_HTML, marshallService, navigationBuilder, outputFormat, outputType, pathInfo, PLATFORM_XML, redirect, servletRequest, servletResponse, STACKTRACE_TXT, templatePath
-
-
Constructor Summary
Constructors Constructor Description PlatformProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addTemplates(List<Template> templates)
Platform
getPlatform(MarshallService marshallService, Path path)
Returns thePlatform
-object unmarshalled from the template's "conf/platform.xml"-file.PlatformTransformer
getPlatformTransformer()
void
init(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse, PathInfo pathInfo, String templateDir)
Initializes theRequestProcessor
.String
processWithTemplate(Site applicationSite, File debugRootFolder)
Processes the request, including the processing of the template.void
setPlatformTransformer(PlatformTransformer platformTransformer)
protected void
writeTemplateToErrorPage(Properties platformProperties, File debugFolder, Exception templateException, Object executionContext, StringWriter errorPage)
-
Methods inherited from class org.appng.core.model.AbstractRequestProcessor
determineActiveAuthentication, determineFormatAndType, getApplicationProvider, getContentLength, getContentType, getDebugFilePrefix, getMarshallService, getOutputFormat, getOutputType, getTemplatePath, initPlatform, isRedirect, processPlatform, setMarshallService, setRedirect, setTemplatePath, writeDebugFile, writeErrorPage
-
-
-
-
Method Detail
-
init
public void init(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse, PathInfo pathInfo, String templateDir)
Description copied from interface:RequestProcessor
Initializes theRequestProcessor
.- Specified by:
init
in interfaceRequestProcessor
- Overrides:
init
in classAbstractRequestProcessor
- Parameters:
servletRequest
- the currentHttpServletRequest
servletResponse
- the currentHttpServletResponse
pathInfo
- the currentPathInfo
templateDir
- the absolute path to the directory where the active template of theSite
resides
-
getPlatform
public Platform getPlatform(MarshallService marshallService, Path path) throws InvalidConfigurationException
Description copied from class:AbstractRequestProcessor
Returns thePlatform
-object unmarshalled from the template's "conf/platform.xml"-file. Also determines theOutputType
andOutputFormat
for the upcoming transformation.- Overrides:
getPlatform
in classAbstractRequestProcessor
- Parameters:
marshallService
- theMarshallService
to use for unmarshallingpath
- the currentPath
-object- Returns:
- the
Platform
-object - Throws:
InvalidConfigurationException
- if the "conf/platform.xml"-file could net be found or unmarshalled.- See Also:
AbstractRequestProcessor.getOutputFormat()
,AbstractRequestProcessor.getOutputType()
-
processWithTemplate
public String processWithTemplate(Site applicationSite, File debugRootFolder) throws InvalidConfigurationException
Description copied from interface:RequestProcessor
Processes the request, including the processing of the template. Note thatRequestProcessor.init(HttpServletRequest, HttpServletResponse, PathInfo, String)
must have been called before.- Parameters:
applicationSite
- theSite
for which the process the requestdebugRootFolder
- the folder to write debug files to- Returns:
- the result of calling the
Application
and applying theTemplate
. This should then be written to theHttpServletResponse
- Throws:
InvalidConfigurationException
- if something goes wrong while processing the request- See Also:
RequestProcessor.processPlatform(Site)
-
writeTemplateToErrorPage
protected void writeTemplateToErrorPage(Properties platformProperties, File debugFolder, Exception templateException, Object executionContext, StringWriter errorPage)
-
getPlatformTransformer
public PlatformTransformer getPlatformTransformer()
-
setPlatformTransformer
public void setPlatformTransformer(PlatformTransformer platformTransformer)
-
addTemplates
protected void addTemplates(List<Template> templates)
- Specified by:
addTemplates
in classAbstractRequestProcessor
-
-