|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.extensions.surf.support.BaseFactoryBean org.springframework.extensions.surf.support.ThreadLocalRequestContext org.springframework.extensions.surf.support.AbstractRequestContext
public abstract class AbstractRequestContext
Abstract base class for RequestContext implementations. This is provided as a convenience to developers who wish to build their own custom RequestContext variations. Implementations that inherit from this class will benefit from having automatic thread local bindings for their custom request context types.
ThreadLocalRequestContext
,
Serialized FormField Summary | |
---|---|
protected Map<String,Component> |
components
|
protected String |
currentFormatId
|
protected Page |
currentPage
|
protected Resource |
currentResource
|
protected TemplateInstance |
currentTemplate
|
protected String |
id
|
protected static int |
idCounter
|
protected LinkBuilder |
linkBuilder
|
protected Model |
model
|
protected Map<String,Serializable> |
parametersMap
|
protected javax.servlet.http.HttpServletRequest |
request
The request encapsulated by this context object |
protected Page |
rootPage
|
protected static String |
SESSION_CURRENT_THEME
|
protected static String |
SESSION_CURRENT_THEME_ID
|
protected Configuration |
siteConfiguration
|
protected String |
storeId
|
protected String |
uri
|
protected User |
user
|
static String |
VALUE_HEAD_TAGS
|
protected Map<String,Serializable> |
valuesMap
|
protected Map |
viewModel
|
Fields inherited from interface org.springframework.extensions.surf.RequestContext |
---|
ATTR_REQUEST_CONTEXT, DEBUG_MODE_VALUE_COMPONENTS, VALUE_CREDENTIAL_VAULT, VALUE_IDENTITY_VAULT |
Constructor Summary | |
---|---|
protected |
AbstractRequestContext(WebFrameworkServiceRegistry serviceRegistry,
javax.servlet.http.HttpServletRequest request)
Constructs a new Request Context. |
Method Summary | |
---|---|
CredentialVault |
getCredentialVault()
Returns the credential vault |
Resource |
getCurrentObject()
Returns the current object |
String |
getCurrentObjectId()
Returns the id of the current object If no object has been set, then the id will be null. |
String |
getFormatId()
Returns the current format id |
String |
getId()
Each request context instance is stamped with a unique id - generally only used for debugging |
LinkBuilder |
getLinkBuilder()
Returns the LinkBuilder to be used for the currently executing page. |
Model |
getModel()
Returns the model. |
Page |
getPage()
If a page instance is currently executing, it can be retrieved from the request context. |
String |
getPageId()
Returns the id of the currently executing page. |
String |
getPageTitle()
Returns the title of the current page. |
Serializable |
getParameter(String key)
Retrieves a parameter from the request context |
Map<String,Serializable> |
getParameters()
Returns a map of parameters |
Component[] |
getRenderingComponents()
Returns the components that were bound to this and any of its parent context during the rendering. |
javax.servlet.http.HttpServletRequest |
getRequest()
Returns the HTTP Servlet Request bound to this request |
Content |
getRequestContent()
Returns the body of the incoming POST content This is applicable for multipart form requests |
String |
getRequestContentType()
Returns the content type of the incoming request |
String |
getRequestMethod()
Returns the method of the incoming request |
Page |
getRootPage()
Returns the root page for a site. |
Configuration |
getSiteConfiguration()
Returns the site's configuration object |
TemplateInstance |
getTemplate()
Returns the current executing template. |
String |
getTemplateId()
Returns the id of the currently executing template. |
Theme |
getTheme()
Gets the current Theme object, or null if not set |
String |
getThemeId()
Returns the current Theme Id for the current user |
String |
getUri()
|
User |
getUser()
Returns the current user |
String |
getUserId()
Returns the current user id |
Serializable |
getValue(String key)
Retrieves a custom value from the request context |
Map<String,Serializable> |
getValuesMap()
Returns the underlying map of the custom key/values pairs stored on this RequestContext instance. |
Map |
getViewModel()
Returns the view model |
String |
getWebsiteTitle()
Returns the title of the web site. |
boolean |
hasParameter(String key)
Returns true if a parameter exists in the request context |
boolean |
hasValue(String key)
Returns true if a custom value exists in the request context |
void |
removeValue(String key)
Removes a custom value from the request context |
void |
setCurrentObject(Resource resource)
Sets the current object |
void |
setFormatId(String formatId)
Sets the current format id |
void |
setModel(Model model)
Sets the model |
void |
setPage(Page page)
Sets the currently executing page. |
void |
setRenderingComponent(Component component)
Indicates that the given component is being rendered as part of the rendering execution for this and any parent rendering context. |
void |
setTemplate(TemplateInstance currentTemplate)
Sets the current executing template. |
void |
setThemeId(String themeId)
Sets the current theme id |
void |
setUri(String uri)
Sets the currently executing uri. |
void |
setUser(User user)
Sets the current user for this request |
void |
setValue(String key,
Serializable value)
Sets a custom attribute onto the request context |
void |
setViewModel(Map viewModel)
Sets the view model |
String |
toString()
|
Methods inherited from class org.springframework.extensions.surf.support.ThreadLocalRequestContext |
---|
getRequestContext, release |
Methods inherited from class org.springframework.extensions.surf.support.BaseFactoryBean |
---|
getResourceService, getServiceRegistry, getWebFrameworkConfiguration, getWebFrameworkManager |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.extensions.surf.RequestContext |
---|
getServiceRegistry |
Field Detail |
---|
public static final String VALUE_HEAD_TAGS
protected static final String SESSION_CURRENT_THEME
protected static final String SESSION_CURRENT_THEME_ID
protected static int idCounter
protected Map<String,Serializable> valuesMap
protected Map<String,Serializable> parametersMap
protected Page rootPage
protected Configuration siteConfiguration
protected Page currentPage
protected TemplateInstance currentTemplate
protected Resource currentResource
protected String currentFormatId
protected String storeId
protected User user
protected String id
protected String uri
protected Model model
protected LinkBuilder linkBuilder
protected Map<String,Component> components
protected Map viewModel
protected javax.servlet.http.HttpServletRequest request
Constructor Detail |
---|
protected AbstractRequestContext(WebFrameworkServiceRegistry serviceRegistry, javax.servlet.http.HttpServletRequest request)
Method Detail |
---|
public String getId()
public Configuration getSiteConfiguration()
public String getWebsiteTitle()
public String getPageTitle()
public String getUri()
public void setUri(String uri)
public Page getPage()
public void setPage(Page page)
page
- public String getPageId()
public LinkBuilder getLinkBuilder()
public Page getRootPage()
public TemplateInstance getTemplate()
public void setTemplate(TemplateInstance currentTemplate)
public String getTemplateId()
public String getCurrentObjectId()
public void setCurrentObject(Resource resource)
content
- public Resource getCurrentObject()
public String getFormatId()
public void setFormatId(String formatId)
formatId
- public Model getModel()
public void setModel(Model model)
public void setUser(User user)
user
- public User getUser()
public String getUserId()
RequestContext
public CredentialVault getCredentialVault()
RequestContext
public void setValue(String key, Serializable value)
RequestContext
public Serializable getValue(String key)
RequestContext
public void removeValue(String key)
RequestContext
public boolean hasValue(String key)
RequestContext
public Map<String,Serializable> getValuesMap()
RequestContext
public Serializable getParameter(String key)
RequestContext
public boolean hasParameter(String key)
RequestContext
public Map<String,Serializable> getParameters()
RequestContext
public Component[] getRenderingComponents()
RequestContext
public void setRenderingComponent(Component component)
RequestContext
component
- The component that is being renderedpublic javax.servlet.http.HttpServletRequest getRequest()
public String getThemeId()
public void setThemeId(String themeId)
public Theme getTheme()
public void setViewModel(Map viewModel)
RequestContext
viewModel
- mappublic Map getViewModel()
RequestContext
public String getRequestContentType()
RequestContext
public String getRequestMethod()
RequestContext
public Content getRequestContent()
RequestContext
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |