Class WindowInvoker
- java.lang.Object
-
- com.sun.portal.portletcontainer.invoker.WindowInvoker
-
- All Implemented Interfaces:
WindowInvokerConstants
- Direct Known Subclasses:
PortletWindowInvoker
public abstract class WindowInvoker extends Object implements WindowInvokerConstants
This class is responsible for rendering the portlet markup fragments. It retrieves the portlet markup fragments by delegating the portlet execution to the a container implementation.
-
-
Field Summary
Fields Modifier and Type Field Description static List
localParamKeyList
-
Fields inherited from interface com.sun.portal.portletcontainer.invoker.WindowInvokerConstants
ACTION, DRIVER_ACTION, DRIVER_PARAM_PREFIX, DRIVER_ROLE, DRIVER_SPACEID, KEYWORD_PREFIX, NEW_PORTLET_WINDOW_MODE_KEY, NEW_PORTLET_WINDOW_STATE_KEY, PORTLET_ACTION, PORTLET_PARAM_MAP, PORTLET_REMOVE_KEY, PORTLET_WINDOW_KEY, PORTLET_WINDOW_MODE_KEY, PORTLET_WINDOW_STATE_KEY, RENDER, RESOURCE, RESOURCE_ID_KEY, RESOURCE_URL_CACHE_LEVEL_KEY
-
-
Constructor Summary
Constructors Constructor Description WindowInvoker()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
getActionURL(javax.servlet.http.HttpServletRequest request, com.sun.portal.container.ChannelMode portletWindowMode, com.sun.portal.container.ChannelState portletWindowState)
protected List
getAllowableWindowStates(javax.servlet.http.HttpServletRequest request, com.sun.portal.container.ChannelMode mode)
abstract com.sun.portal.container.Container
getContainer()
protected com.sun.portal.container.ChannelMode
getCurrentPortletWindowMode(javax.servlet.http.HttpServletRequest request)
protected com.sun.portal.container.ChannelState
getCurrentWindowState(javax.servlet.http.HttpServletRequest request)
abstract String
getDefaultTitle()
abstract com.sun.portal.container.EntityID
getEntityID(javax.servlet.http.HttpServletRequest request)
protected com.sun.portal.container.ErrorCode
getErrorCode(com.sun.portal.container.ContentException ex)
URL
getErrorCodeURL(com.sun.portal.container.ErrorCode errorCode, javax.servlet.http.HttpServletRequest request)
Derived implementations can use this method to generate a error url if needed We return the URL based on the current modeprotected StringBuffer
getErrorMessageContent(com.sun.portal.container.ErrorCode errorCode)
protected javax.servlet.http.HttpServletRequest
getOriginalRequest()
protected javax.servlet.http.HttpServletResponse
getOriginalResponse()
com.sun.portal.container.PortletWindowContext
getPortletWindowContext()
Gets thePortletWindowContext
for the PortletiIndow.com.sun.portal.container.ChannelMode
getPortletWindowMode()
String
getPortletWindowName()
com.sun.portal.container.ChannelState
getPortletWindowState()
abstract com.sun.portal.container.ChannelURLFactory
getPortletWindowURLFactory(String desktopURLPrefix, javax.servlet.http.HttpServletRequest request)
String
getRenderURL(javax.servlet.http.HttpServletRequest request, com.sun.portal.container.ChannelMode portletWindowMode, com.sun.portal.container.ChannelState portletWindowState)
ResourceBundle
getResourceBundle(String base)
Gets a specified ResourceBundle file for the provider based on User's locale.void
getResources(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Invokes the serveResource of the portlet.void
getResourcesInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
ResponseProperties
getResponseProperties()
Gets the response properties for the portletWindow.abstract List
getRoleList(javax.servlet.http.HttpServletRequest request)
protected javax.servlet.ServletContext
getServletContext()
String
getTitle()
Gets the title for the portletWindow.abstract Map
getUserInfoMap(javax.servlet.http.HttpServletRequest request)
abstract com.sun.portal.container.WindowRequestReader
getWindowRequestReader()
void
init(javax.servlet.ServletContext servletContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Initializes the WindowInvoker.boolean
isEditable()
abstract boolean
isMarkupSupported(String contentType, String locale, com.sun.portal.container.ChannelMode mode, com.sun.portal.container.ChannelState state)
static boolean
isWindowInvokerKey(String key)
Used by subclasses to find out if key in the request is reserved by the window invokerprotected void
populateContainerRequest(com.sun.portal.container.ContainerRequest containerRequest, javax.servlet.http.HttpServletRequest request, List allowableWindowStates, List allowablePortletWindowModes)
Populates the ContainerRequest objectURL
processAction(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Invokes the processAction of the portlet.URL
processActionInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected URL
processModeChange(javax.servlet.http.HttpServletRequest request, com.sun.portal.container.ChannelMode portletWindowMode, com.sun.portal.container.ChannelState portletWindowState)
Assemble the URL to cause the desktop to be rendered with the new mode and window stateprotected com.sun.portal.container.ChannelState
processWindowStateChange(javax.servlet.http.HttpServletRequest request, com.sun.portal.container.ChannelState newWindowState, com.sun.portal.container.ChannelMode portletWindowMode, boolean authless)
Process window state changes.protected com.sun.portal.container.ErrorCode
readErrorCode(javax.servlet.http.HttpServletRequest request)
StringBuffer
render(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Gets the content for the portletWindow based on mode from the underlying container.void
setPortletWindowMode(com.sun.portal.container.ChannelMode portletWindowMode)
void
setPortletWindowName(String portletWindowName)
void
setPortletWindowState(com.sun.portal.container.ChannelState portletWindowState)
void
setTitle(String title)
-
-
-
Field Detail
-
localParamKeyList
public static final List localParamKeyList
-
-
Method Detail
-
getRoleList
public abstract List getRoleList(javax.servlet.http.HttpServletRequest request) throws InvokerException
- Throws:
InvokerException
-
getUserInfoMap
public abstract Map getUserInfoMap(javax.servlet.http.HttpServletRequest request) throws InvokerException
- Throws:
InvokerException
-
getEntityID
public abstract com.sun.portal.container.EntityID getEntityID(javax.servlet.http.HttpServletRequest request) throws InvokerException
- Throws:
InvokerException
-
getWindowRequestReader
public abstract com.sun.portal.container.WindowRequestReader getWindowRequestReader() throws InvokerException
- Throws:
InvokerException
-
getContainer
public abstract com.sun.portal.container.Container getContainer()
-
getPortletWindowURLFactory
public abstract com.sun.portal.container.ChannelURLFactory getPortletWindowURLFactory(String desktopURLPrefix, javax.servlet.http.HttpServletRequest request) throws InvokerException
- Throws:
InvokerException
-
isMarkupSupported
public abstract boolean isMarkupSupported(String contentType, String locale, com.sun.portal.container.ChannelMode mode, com.sun.portal.container.ChannelState state) throws InvokerException
- Throws:
InvokerException
-
getDefaultTitle
public abstract String getDefaultTitle() throws InvokerException
- Throws:
InvokerException
-
init
public void init(javax.servlet.ServletContext servletContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws InvokerException
Initializes the WindowInvoker.- Parameters:
servletContext
- The ServletContext object.request
- The HTTP request object.response
- The HTTP response object.- Throws:
InvokerException
-
getPortletWindowName
public String getPortletWindowName()
-
setPortletWindowName
public void setPortletWindowName(String portletWindowName)
-
getOriginalRequest
protected javax.servlet.http.HttpServletRequest getOriginalRequest()
-
getOriginalResponse
protected javax.servlet.http.HttpServletResponse getOriginalResponse()
-
getServletContext
protected javax.servlet.ServletContext getServletContext()
-
getPortletWindowMode
public com.sun.portal.container.ChannelMode getPortletWindowMode()
-
setPortletWindowMode
public void setPortletWindowMode(com.sun.portal.container.ChannelMode portletWindowMode)
-
getPortletWindowState
public com.sun.portal.container.ChannelState getPortletWindowState()
-
setPortletWindowState
public void setPortletWindowState(com.sun.portal.container.ChannelState portletWindowState)
-
render
public StringBuffer render(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws InvokerException
Gets the content for the portletWindow based on mode from the underlying container. This method is called to get content for VIEW, EDIT and and HELP mode . This method sets all the necessary attributes in the ContainerRequest and Container Response and calls the configured container to get the content for the portlet.- Parameters:
request
- An HttpServletRequest that contains information related to this request for content.response
- An HttpServletResponse that allows the portlet window context to influence the overall response for the page (besides generating the content).- Returns:
- StringBuffer holding the content.
- Throws:
InvokerException
- If there was an error generating the content.
-
processAction
public URL processAction(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws InvokerException
Invokes the processAction of the portlet. This method sets all the necessary attributes in the ContainerRequest and Container Response and calls the configured container to invoke the processAction of the portlet.- Parameters:
request
- An HttpServletRequest that contains information related to this request for content.response
- An HttpServletResponse that allows the portlet window context to influence the overall response for the page (besides generating the content).- Returns:
- URL redirect URL
- Throws:
InvokerException
- If there was an error generating the content.
-
processActionInternal
public URL processActionInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws InvokerException, WindowException
- Throws:
InvokerException
WindowException
-
getResources
public void getResources(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws InvokerException
Invokes the serveResource of the portlet. This method sets all the necessary attributes in the ContainerRequest and Container Response and calls the configured container to invoke the serveResource of the portlet.- Parameters:
request
- An HttpServletRequest that contains information related to this request for content.response
- An HttpServletResponse that allows the portlet window context to influence the overall response for the page (besides generating the content).- Throws:
InvokerException
- If there was an error generating the content.
-
getResourcesInternal
public void getResourcesInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws InvokerException, WindowException
- Throws:
InvokerException
WindowException
-
populateContainerRequest
protected void populateContainerRequest(com.sun.portal.container.ContainerRequest containerRequest, javax.servlet.http.HttpServletRequest request, List allowableWindowStates, List allowablePortletWindowModes) throws InvokerException
Populates the ContainerRequest object- Throws:
InvokerException
-
getTitle
public String getTitle() throws InvokerException
Gets the title for the portletWindow. This method returns the title from the portlet. Portlet uses javax.portlet.title namespace for its title.- Returns:
- A string title.
- Throws:
InvokerException
- if error occurs when getting the title for the portletWindow.
-
getResponseProperties
public ResponseProperties getResponseProperties()
Gets the response properties for the portletWindow. This method returns the cookies, headers that were set by the portlet.- Returns:
- ResponseProperties
-
setTitle
public void setTitle(String title)
-
isEditable
public boolean isEditable() throws InvokerException
- Throws:
InvokerException
-
processWindowStateChange
protected com.sun.portal.container.ChannelState processWindowStateChange(javax.servlet.http.HttpServletRequest request, com.sun.portal.container.ChannelState newWindowState, com.sun.portal.container.ChannelMode portletWindowMode, boolean authless) throws InvokerException, WindowException
Process window state changes.- Throws:
InvokerException
WindowException
-
processModeChange
protected URL processModeChange(javax.servlet.http.HttpServletRequest request, com.sun.portal.container.ChannelMode portletWindowMode, com.sun.portal.container.ChannelState portletWindowState) throws InvokerException
Assemble the URL to cause the desktop to be rendered with the new mode and window state- Throws:
InvokerException
-
isWindowInvokerKey
public static boolean isWindowInvokerKey(String key)
Used by subclasses to find out if key in the request is reserved by the window invoker
-
getErrorCodeURL
public URL getErrorCodeURL(com.sun.portal.container.ErrorCode errorCode, javax.servlet.http.HttpServletRequest request) throws InvokerException
Derived implementations can use this method to generate a error url if needed We return the URL based on the current mode- Throws:
InvokerException
-
getErrorMessageContent
protected StringBuffer getErrorMessageContent(com.sun.portal.container.ErrorCode errorCode)
-
getErrorCode
protected com.sun.portal.container.ErrorCode getErrorCode(com.sun.portal.container.ContentException ex)
-
readErrorCode
protected com.sun.portal.container.ErrorCode readErrorCode(javax.servlet.http.HttpServletRequest request)
-
getCurrentPortletWindowMode
protected com.sun.portal.container.ChannelMode getCurrentPortletWindowMode(javax.servlet.http.HttpServletRequest request)
-
getCurrentWindowState
protected com.sun.portal.container.ChannelState getCurrentWindowState(javax.servlet.http.HttpServletRequest request) throws InvokerException
- Throws:
InvokerException
-
getAllowableWindowStates
protected List getAllowableWindowStates(javax.servlet.http.HttpServletRequest request, com.sun.portal.container.ChannelMode mode)
-
getActionURL
public String getActionURL(javax.servlet.http.HttpServletRequest request, com.sun.portal.container.ChannelMode portletWindowMode, com.sun.portal.container.ChannelState portletWindowState)
-
getRenderURL
public String getRenderURL(javax.servlet.http.HttpServletRequest request, com.sun.portal.container.ChannelMode portletWindowMode, com.sun.portal.container.ChannelState portletWindowState)
-
getPortletWindowContext
public com.sun.portal.container.PortletWindowContext getPortletWindowContext()
Gets thePortletWindowContext
for the PortletiIndow.- Returns:
PortletWindowContext
.
-
getResourceBundle
public ResourceBundle getResourceBundle(String base)
Gets a specified ResourceBundle file for the provider based on User's locale.A provider can specify on-screen strings to be localized in a resource bundle file, as described in the Java
ResourceBundle
class.- Parameters:
base
- a specifiedResourceBundle
name.- Returns:
ResourceBundle
.- See Also:
ResourceBundle
-
-