public class PageView extends AbstractWebFrameworkView
Default view implementation for Surf pages.
MIMETYPE_HTML| Constructor and Description |
|---|
PageView(WebFrameworkConfigElement webFrameworkConfiguration,
ModelObjectService modelObjectService,
ResourceService resourceService,
RenderService renderService,
TemplatesContainer templatesContainer)
This is the preferred constructor to use for instantiating a new
PageView because it allows
complete flexibility when rendering the view. |
PageView(WebFrameworkServiceRegistry serviceRegistry)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
buildLoginRedirectURL(javax.servlet.http.HttpServletRequest request) |
protected static void |
debug(RequestContext context,
String value)
Debug logger helper function.
|
void |
dispatchPage(RequestContext context,
String pageId,
String formatId)
Dispatches a given page in a given format.
|
protected boolean |
loginRequiredForPage(RequestContext context,
javax.servlet.http.HttpServletRequest request,
Page page)
Return if login page should be display for the given page.
|
protected void |
prepareResponse(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected void |
renderView(RequestContext context)
To be implemented by view classes to provide render dispatch
|
void |
setPage(Page page)
Set the
Page to be rendered by this view. |
protected void |
setupRequestContext(Map<String,Object> mvcModel,
javax.servlet.http.HttpServletRequest request)
Initial setup of the request context.
|
protected void |
validateRequestContext(RequestContext context,
javax.servlet.http.HttpServletRequest request)
Extension point for performing any validation of the request context state
If the request context state is invalid, it can either be adjusted or an exception
can be raised.
|
exposeForwardRequestAttributes, getObjectService, getRenderService, getResourceService, getTemplatesContainer, getUriTokens, getUrlHelperFactory, getWebFrameworkConfiguration, lookupPage, populateRequestContext, renderMergedOutputModel, setUriTokens, setUrlHelperFactoryafterPropertiesSet, checkResource, getUrl, isUrlRequired, setUrl, toStringaddStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, isExposePathVariables, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposePathVariables, setRequestContextAttribute, setResponseContentType, writeToResponsegetServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextpublic PageView(WebFrameworkConfigElement webFrameworkConfiguration, ModelObjectService modelObjectService, ResourceService resourceService, RenderService renderService, TemplatesContainer templatesContainer)
This is the preferred constructor to use for instantiating a new PageView because it allows
complete flexibility when rendering the view. An AbstractWebFrameworkView is typically instantiated from
within a AbstractWebFrameworkViewResolver and all the arguments in the constructor signature should be
supplied to the AbstractWebFrameworkViewResolver as beans via the Spring configuration.
webFrameworkConfiguration - WebFrameworkConfigElementmodelObjectService - ModelObjectServiceresourceService - ResourceServicerenderService - RenderServicetemplatesContainer - TemplatesContainerpublic PageView(WebFrameworkServiceRegistry serviceRegistry)
This constructor should be avoided if possible because it relies on the supplied WebFrameworkServiceRegistry
argument to provide all the other Spring beans required to render the view. This means that there is no flexibility via
configuration to adapt different views to use different beans.
serviceRegistry - WebFrameworkServiceRegistrypublic void setPage(Page page)
Page to be rendered by this view.page - Pageprotected void setupRequestContext(Map<String,Object> mvcModel, javax.servlet.http.HttpServletRequest request) throws Exception
setupRequestContext in class AbstractWebFrameworkViewmvcModel - Maprequest - HttpServletRequestExceptionprotected void validateRequestContext(RequestContext context, javax.servlet.http.HttpServletRequest request) throws Exception
AbstractWebFrameworkViewvalidateRequestContext in class AbstractWebFrameworkViewcontext - RequestContextrequest - HttpServletRequestExceptionprotected String buildLoginRedirectURL(javax.servlet.http.HttpServletRequest request)
protected void renderView(RequestContext context) throws Exception
AbstractWebFrameworkViewrenderView in class AbstractWebFrameworkViewcontext - the render contextExceptionprotected boolean loginRequiredForPage(RequestContext context, javax.servlet.http.HttpServletRequest request, Page page)
Default implementation of this method will retrieve the current User and test to see if a guest, non-guest or admin user id is present as appropriate for the authentication level specified on the supplied page object.
context - RequestContextrequest - HttpServletRequestpage - Page to test authentication forpublic void dispatchPage(RequestContext context, String pageId, String formatId) throws RequestDispatchException
context - RequestContextpageId - StringformatId - StringRequestDispatchExceptionprotected void prepareResponse(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
prepareResponse in class org.springframework.web.servlet.view.AbstractViewprotected static void debug(RequestContext context, String value)
context - RequestContextvalue - StringCopyright © 2005–2016 Alfresco Software. All rights reserved.