public abstract class AbstractWebFrameworkViewResolver
extends org.springframework.extensions.webscripts.servlet.mvc.AbstractWebScriptViewResolver
implements org.springframework.beans.factory.BeanNameAware
Abstract Spring MVC implementation of a view resolver for Surf.
Developers who wish to implement custom Spring view resolvers may wish to extend their own view implementations from this class so as to gain access to member convenience functions for working with Surf services.
useNullSentinelFORWARD_URL_PREFIX, REDIRECT_URL_PREFIX| Constructor and Description |
|---|
AbstractWebFrameworkViewResolver()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPrefix(String prefix) |
void |
addReqParm(String reqParm) |
protected boolean |
canHandle(String viewName,
Locale locale)
Determines whether or not this view resolver can handle the requested view.
|
UriTemplateListIndex |
generateUriTemplateListIndexFromConfig(WebFrameworkServiceRegistry serviceRegistry,
String targetElement)
Creates a
UriTemplateListIndex populated with configuration data found in config elements
matching the target provided. |
String |
getBeanName()
Returns the id given to this class when it is defined as a Spring bean.
|
ModelObjectService |
getModelObjectService() |
WebFrameworkServiceRegistry |
getServiceRegistry()
Deprecated.
This method only persists as it is used by DynamicPageViewResolver in the Web Quick Start application.
|
TemplatesContainer |
getTemplatesContainer() |
UriTemplateListIndex |
getUriTemplateListIndex()
Gets the
UriTemplateListIndex for the view resolver |
URLHelperFactory |
getUrlHelperFactory() |
WebFrameworkConfigElement |
getWebframeworkConfigElement() |
RenderService |
getWebFrameworkRenderService() |
ResourceService |
getWebFrameworkResourceService() |
WebFrameworkServiceRegistry |
getWebFrameworkServiceRegistry()
Deprecated.
|
protected Page |
lookupPage(String pageId)
Retrieves the page object with the given page id.
|
Map<String,String> |
matchUriTemplate(String uri)
Performs a match of the given URI to a template.
|
String |
processView(String viewName)
Processes the supplied raw view String to return a value that does not include any prefixes.
|
void |
setBeanName(String name)
This method is required to implement the the
BeanNameAware interface and will be
invoked by the Spring framework to set the configured name of this class when defined as a Spring
bean. |
void |
setModelObjectService(ModelObjectService modelObjectService) |
void |
setServiceRegistry(WebFrameworkServiceRegistry webFrameworkServiceRegistry) |
void |
setTemplatesContainer(TemplatesContainer templatesContainer) |
void |
setUriTemplateIndex(UriTemplateListIndex uriTemplateIndex)
Sets the
UriTemplateListIndex |
void |
setUrlHelperFactory(URLHelperFactory urlHelperFactory) |
void |
setWebframeworkConfigElement(WebFrameworkConfigElement webframeworkConfigElement) |
void |
setWebFrameworkRenderService(RenderService webFrameworkRenderService) |
void |
setWebFrameworkResourceService(ResourceService webFrameworkResourceService) |
clearCache, removeFromCache, resolveViewNamebuildView, createView, getAttributesMap, getCacheKey, getContentType, getExposePathVariables, getOrder, getPrefix, getRequestContextAttribute, getSuffix, getViewClass, getViewNames, initApplicationContext, isRedirectContextRelative, isRedirectHttp10Compatible, loadView, requiredViewClass, setAttributes, setAttributesMap, setContentType, setExposePathVariables, setOrder, setPrefix, setRedirectContextRelative, setRedirectHttp10Compatible, setRequestContextAttribute, setSuffix, setViewClass, setViewNamesgetCacheLimit, isCache, isCacheUnresolved, setCache, setCacheLimit, setCacheUnresolvedgetServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextpublic AbstractWebFrameworkViewResolver()
public UriTemplateListIndex getUriTemplateListIndex()
Gets the UriTemplateListIndex for the view resolver
UriTemplateListIndex for the view resolverpublic void setUriTemplateIndex(UriTemplateListIndex uriTemplateIndex)
Sets the UriTemplateListIndex
uriTemplateIndex - The UriTemplateListIndex to set.public void addPrefix(String prefix)
public void addReqParm(String reqParm)
public String processView(String viewName)
Processes the supplied raw view String to return a value that does not include any prefixes. Each
extending view resolver can populate the prefixes list of prefixes that indicate that it can handle a view that
contains them. If the raw view begins with a specified prefix then the prefix is removed and the "processed"
String is returned to the caller.
Some view resolvers can also handle views when the view name is defined as a request parameter. The names
of these request parameters are added to the reqParms and if found in the URL then their value is returned
as the processed view
If no matching prefixes or request parameters are found then null is returned
viewName - The name of the requested view.protected Page lookupPage(String pageId)
pageId - Stringpublic Map<String,String> matchUriTemplate(String uri)
uri - The URI to compare against the template.public UriTemplateListIndex generateUriTemplateListIndexFromConfig(WebFrameworkServiceRegistry serviceRegistry, String targetElement)
Creates a UriTemplateListIndex populated with configuration data found in config elements
matching the target provided.
serviceRegistry - service registrytargetElement - The type of UriTemplate configurations to look for.protected boolean canHandle(String viewName, Locale locale)
canHandle in class org.springframework.web.servlet.view.UrlBasedViewResolverpublic TemplatesContainer getTemplatesContainer()
public void setTemplatesContainer(TemplatesContainer templatesContainer)
public WebFrameworkConfigElement getWebframeworkConfigElement()
public void setWebframeworkConfigElement(WebFrameworkConfigElement webframeworkConfigElement)
public WebFrameworkServiceRegistry getWebFrameworkServiceRegistry()
public WebFrameworkServiceRegistry getServiceRegistry()
public void setServiceRegistry(WebFrameworkServiceRegistry webFrameworkServiceRegistry)
public ModelObjectService getModelObjectService()
public void setModelObjectService(ModelObjectService modelObjectService)
public RenderService getWebFrameworkRenderService()
public void setWebFrameworkRenderService(RenderService webFrameworkRenderService)
public ResourceService getWebFrameworkResourceService()
public void setWebFrameworkResourceService(ResourceService webFrameworkResourceService)
public void setBeanName(String name)
This method is required to implement the the BeanNameAware interface and will be
invoked by the Spring framework to set the configured name of this class when defined as a Spring
bean.
setBeanName in interface org.springframework.beans.factory.BeanNameAwarepublic String getBeanName()
Returns the id given to this class when it is defined as a Spring bean. If this class has not bean instantiated by the Spring framework then this will return null.
public URLHelperFactory getUrlHelperFactory()
public void setUrlHelperFactory(URLHelperFactory urlHelperFactory)
Copyright © 2005–2016 Alfresco Software. All rights reserved.