org.apache.jetspeed.request
Interface RequestContext

All Known Implementing Classes:
MockRequestContext

public interface RequestContext

Portal Request Context is associated with each request

Version:
$Id: RequestContext.java,v 1.14 2005/04/29 14:00:48 weaver Exp $
Author:
David Sean Taylor

Field Summary
static String REQUEST_PORTALENV
           
 
Method Summary
 org.apache.pluto.om.window.PortletWindow getActionWindow()
          Get the target Action Window
 Object getAttribute(String key)
          Get a request attribute associated with this single request.
 CapabilityMap getCapabilityMap()
          Get the Capability Map
 String getCharacterEncoding()
          get the character encoding
 javax.servlet.ServletConfig getConfig()
          Gets the HTTP Servlet Config
 ContentDispatcher getContentDispatcher()
          Gets the content dispatcher for this request
 Locale getLocale()
          Gets the locale associated with this request.
 String getMediaType()
          get the Media Type
 String getMimeType()
          Get the mimeType for the request
 ContentPage getPage()
          Gets the target page for this request
 Map getParameterMap()
          Use this method to get a map of request parameters on the generalized request, decoupling request parameter manipulation from servlet API.
 String getPath()
           Returns any extra path information associated with the URL the client sent when it made this request.
 PortalURL getPortalURL()
          Gets the Portal URL for the current request.
 org.apache.pluto.om.common.Language getPreferedLanguage(org.apache.pluto.om.portlet.PortletDefinition portlet)
           getPreferedLanguage
 Map getProfileLocators()
          Gets the profile locators for this request
 javax.servlet.http.HttpServletRequest getRequest()
          Gets the HTTP Servlet Request.
 javax.servlet.http.HttpServletRequest getRequestForWindow(org.apache.pluto.om.window.PortletWindow window)
           getRequestForWindow
 String getRequestParameter(String key)
          Use this method to get a request parameter on the generalized request, decoupling request parameter manipulation from servlet API.
 javax.servlet.http.HttpServletResponse getResponse()
          Gets the HTTP Servlet Response.
 javax.servlet.http.HttpServletResponse getResponseForWindow(org.apache.pluto.om.window.PortletWindow window)
           getResponseForWindow
 Object getSessionAttribute(String key)
          Gets an attribute from the session.
 Subject getSubject()
          Gets the subject associated with the authorized entity.
 Map getUserInfoMap(org.apache.pluto.om.common.ObjectID oid)
          Returns the user info map of user attributes for a given portlet application.
 Throwable popActionFailure(org.apache.pluto.om.window.PortletWindow window)
           
 void setActionFailure(org.apache.pluto.om.window.PortletWindow window, Throwable actionFailure)
           
 void setActionWindow(org.apache.pluto.om.window.PortletWindow window)
          Sets the target Portlet Window
 void setAttribute(String key, Object value)
          Sets an attribute into the request.
 void setCapabilityMap(CapabilityMap map)
          Set the capabilityMap.
 void setCharacterEncoding(String enc)
          set character encoding
 void setContentDispatcher(ContentDispatcher dispatcher)
          Sets the content dispatcher for this request
 void setLocale(Locale locale)
          Sets the locale associated with this request.
 void setMediaType(String mediaType)
          Set the mediaType.
 void setMimeType(String mimeType)
          Set the Mimetype.
 void setPage(ContentPage page)
          Sets the target page for this request
 void setPath(String path)
           setPath
 void setPortalURL(PortalURL portalUrl)
          Sets the Portal URL for the current request.
 void setProfileLocators(Map locators)
          Sets the target page profile locators for this request
 void setSessionAttribute(String key, Object value)
          Sets an attribute into the session.
 void setSubject(Subject subject)
          Sets the subject associated with the authorized entity.
 

Field Detail

REQUEST_PORTALENV

public static final String REQUEST_PORTALENV
See Also:
Constant Field Values
Method Detail

getRequest

public javax.servlet.http.HttpServletRequest getRequest()
Gets the HTTP Servlet Request. This is the Servlet containers raw request object. This request should be wrapped using getPortletRequestForWindow() before being processed by the portlet container.

Returns:
HttpServletRequest

getResponse

public javax.servlet.http.HttpServletResponse getResponse()
Gets the HTTP Servlet Response. This is the Servlet containers raw response object. This response should be wrapped using getPortletResponseForWindow() before being processed by the portlet container.

Returns:
HttpServletResponse

getConfig

public javax.servlet.ServletConfig getConfig()
Gets the HTTP Servlet Config

Returns:
ServletConfig

getProfileLocators

public Map getProfileLocators()
Gets the profile locators for this request

Returns:
Profile locators by locator name

setProfileLocators

public void setProfileLocators(Map locators)
Sets the target page profile locators for this request

Parameters:
locators - The target profile locators by locator name

getPage

public ContentPage getPage()
Gets the target page for this request

Returns:
Page

setPage

public void setPage(ContentPage page)
Sets the target page for this request

Parameters:
page - The target page

getContentDispatcher

public ContentDispatcher getContentDispatcher()
Gets the content dispatcher for this request

Returns:
ContentDispatcher

setContentDispatcher

public void setContentDispatcher(ContentDispatcher dispatcher)
Sets the content dispatcher for this request

Parameters:
dispatcher - The ContentDispatcher to use for this request

setCapabilityMap

public void setCapabilityMap(CapabilityMap map)
Set the capabilityMap. Used by the CapabilityValve


getCapabilityMap

public CapabilityMap getCapabilityMap()
Get the Capability Map


setMimeType

public void setMimeType(String mimeType)
Set the Mimetype. Set by the CapabilityValve

Parameters:
mimeType -

getMimeType

public String getMimeType()
Get the mimeType for the request


setMediaType

public void setMediaType(String mediaType)
Set the mediaType. Set by the CapabilityValve

Parameters:
mediaType -

getMediaType

public String getMediaType()
get the Media Type


getPortalURL

public PortalURL getPortalURL()
Gets the Portal URL for the current request.

Returns:
The Portal URL object for the current request. This method will never return a null value.
Throws:
IllegalStateException - if portalUrl if has not been set.

setPortalURL

public void setPortalURL(PortalURL portalUrl)
Sets the Portal URL for the current request.

Throws:
IllegalStateException - if portalUrl has been set already.
IllegalArgumentException - if a null value is passed in.

getActionWindow

public org.apache.pluto.om.window.PortletWindow getActionWindow()
Get the target Action Window

Returns:
PortletWindow The target portlet action window

setActionWindow

public void setActionWindow(org.apache.pluto.om.window.PortletWindow window)
Sets the target Portlet Window

Parameters:
window -

getCharacterEncoding

public String getCharacterEncoding()
get the character encoding


setCharacterEncoding

public void setCharacterEncoding(String enc)
set character encoding

Parameters:
enc -

getRequestForWindow

public javax.servlet.http.HttpServletRequest getRequestForWindow(org.apache.pluto.om.window.PortletWindow window)

getRequestForWindow

Takes a PortletWindow and generates a HttpServletRequest that accurately represents that PortletWindow's request parameters

Parameters:
window - PortletWindow that we are build a request for
Returns:
HttpServletRequest that wraps the existing servlet container's request that can interpret encoded portlet information for this PortletWindow

getResponseForWindow

public javax.servlet.http.HttpServletResponse getResponseForWindow(org.apache.pluto.om.window.PortletWindow window)

getResponseForWindow

Takes a PortletWindow and generates a HttpServletResponse that accurately represents that PortletWindow's request parameters.

Parameters:
window - PortletWindow that we are build a response for
Returns:
HttpServletRequest that wraps the existing servlet container's request that can interpret encoded portlet information for this PortletWindow

getSubject

public Subject getSubject()
Gets the subject associated with the authorized entity. This subject can be used to provide credentials and principals.

Returns:
The JAAS subject on this request.

setSubject

public void setSubject(Subject subject)
Sets the subject associated with the authorized entity. This subject can be used to provide credentials and principals.

Parameters:
subject - The JAAS subject on this request.

getLocale

public Locale getLocale()
Gets the locale associated with this request.

Returns:
The locale associated with this request.

setLocale

public void setLocale(Locale locale)
Sets the locale associated with this request.


getRequestParameter

public String getRequestParameter(String key)
Use this method to get a request parameter on the generalized request, decoupling request parameter manipulation from servlet API. This parameter could be on the Http Servlet request, in that case it simply passes through to the servlet request.

Parameters:
key - The parameter unique key
Returns:
The object associated with the uniqu

getParameterMap

public Map getParameterMap()
Use this method to get a map of request parameters on the generalized request, decoupling request parameter manipulation from servlet API. The parameters returned could be on the Http Servlet request, in that case it simply passes through to the servlet request.

Returns:

getSessionAttribute

public Object getSessionAttribute(String key)
Gets an attribute from the session. This method is decoupled from the servlet api request to facilitate abstractions for testing and other programs not connected to a servlet application.

Parameters:
key - The key of the attribute
Returns:
The value of the attribute

setSessionAttribute

public void setSessionAttribute(String key,
                                Object value)
Sets an attribute into the session. This method is decoupled from the servlet api request to facilitate abstractions for testing and other programs not connected to a servlet application.

Parameters:
key - The key of the session attribute
value - The value of the session attribute

getAttribute

public Object getAttribute(String key)
Get a request attribute associated with this single request.

Parameters:
key - The key of the request attribute
Returns:
The value of the request attribute

setAttribute

public void setAttribute(String key,
                         Object value)
Sets an attribute into the request. This method is decoupled from the servlet api request to facilitate abstractions for testing and other programs not connected to a servlet application.

Parameters:
key - The key of the request attribute
value - The value of the request attribute

getPath

public String getPath()

Returns any extra path information associated with the URL the client sent when it made this request. The extra path information follows the servlet path but precedes the query string. This method returns null if there was no extra path information.

This method should function identically to HttpServletRequest.getPathInfo() except for that it removes ALL portal/portlet navigational state information from the path info string.

Returns:
the path

setPath

public void setPath(String path)

setPath

Allows the manual overriding of path Jetspeed 2 will look to resolves pages and folders.

Parameters:
path -

getUserInfoMap

public Map getUserInfoMap(org.apache.pluto.om.common.ObjectID oid)
Returns the user info map of user attributes for a given portlet application.

Parameters:
oid - The portlet application object id.
Returns:
The PortletRequest.USER_INFO map.

getPreferedLanguage

public org.apache.pluto.om.common.Language getPreferedLanguage(org.apache.pluto.om.portlet.PortletDefinition portlet)

getPreferedLanguage

Returns the Language object for the portlet which most closely matches the prefences of the currently requesting client.

Parameters:
portlet -
Returns:
Language that matches, as closely as possible, that of the requesting client.

popActionFailure

public Throwable popActionFailure(org.apache.pluto.om.window.PortletWindow window)
Returns:

setActionFailure

public void setActionFailure(org.apache.pluto.om.window.PortletWindow window,
                             Throwable actionFailure)


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.