Package org.appng.core.model
Interface RequestProcessor
-
- All Known Implementing Classes:
AbstractRequestProcessor,PlatformProcessor,ThymeleafProcessor
public interface RequestProcessorProcesses a request to the appNG GUI.
This includes:- checking whether or not the user is logged in (and redirect to the login if this is not the case)
- calling the right
Applicationof the requestedSite - building the
Platform-object - applying the
Templateof theSiteto that object
- Author:
- Matthias Müller
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IntegergetContentLength()Returns the content-length of the responseStringgetContentType()Returns the content-type of the responsevoidinit(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse, PathInfo pathInfo, String templateDir)Initializes theRequestProcessor.booleanisRedirect()Returnstrueif a redirect has been send while processing the request,falseotherwise.PlatformprocessPlatform(Site site)Processes the request, but without applying the template.StringprocessWithTemplate(Site site, File debugRootFolder)Processes the request, including the processing of the template.
-
-
-
Method Detail
-
processPlatform
Platform processPlatform(Site site) throws InvalidConfigurationException
Processes the request, but without applying the template. Note thatinit(HttpServletRequest, HttpServletResponse, PathInfo, String)must have been called before.- Parameters:
site- theSitefor which the process the request- Returns:
- the
Platformrepresenting the result of calling theSite'sApplication - Throws:
InvalidConfigurationException- if something goes wrong while processing the request- See Also:
processWithTemplate(Site, File)
-
processWithTemplate
String processWithTemplate(Site site, File debugRootFolder) throws InvalidConfigurationException
Processes the request, including the processing of the template. Note thatinit(HttpServletRequest, HttpServletResponse, PathInfo, String)must have been called before.- Parameters:
site- theSitefor which the process the requestdebugRootFolder- the folder to write debug files to- Returns:
- the result of calling the
Applicationand applying theTemplate. This should then be written to theHttpServletResponse - Throws:
InvalidConfigurationException- if something goes wrong while processing the request- See Also:
processPlatform(Site)
-
getContentType
String getContentType()
Returns the content-type of the response
-
getContentLength
Integer getContentLength()
Returns the content-length of the response
-
init
void init(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse, PathInfo pathInfo, String templateDir)Initializes theRequestProcessor.
-
isRedirect
boolean isRedirect()
Returnstrueif a redirect has been send while processing the request,falseotherwise.
-
-