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 ListlocalParamKeyList-
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 StringgetActionURL(javax.servlet.http.HttpServletRequest request, com.sun.portal.container.ChannelMode portletWindowMode, com.sun.portal.container.ChannelState portletWindowState)protected ListgetAllowableWindowStates(javax.servlet.http.HttpServletRequest request, com.sun.portal.container.ChannelMode mode)abstract com.sun.portal.container.ContainergetContainer()protected com.sun.portal.container.ChannelModegetCurrentPortletWindowMode(javax.servlet.http.HttpServletRequest request)protected com.sun.portal.container.ChannelStategetCurrentWindowState(javax.servlet.http.HttpServletRequest request)abstract StringgetDefaultTitle()abstract com.sun.portal.container.EntityIDgetEntityID(javax.servlet.http.HttpServletRequest request)protected com.sun.portal.container.ErrorCodegetErrorCode(com.sun.portal.container.ContentException ex)URLgetErrorCodeURL(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 StringBuffergetErrorMessageContent(com.sun.portal.container.ErrorCode errorCode)protected javax.servlet.http.HttpServletRequestgetOriginalRequest()protected javax.servlet.http.HttpServletResponsegetOriginalResponse()com.sun.portal.container.PortletWindowContextgetPortletWindowContext()Gets thePortletWindowContextfor the PortletiIndow.com.sun.portal.container.ChannelModegetPortletWindowMode()StringgetPortletWindowName()com.sun.portal.container.ChannelStategetPortletWindowState()abstract com.sun.portal.container.ChannelURLFactorygetPortletWindowURLFactory(String desktopURLPrefix, javax.servlet.http.HttpServletRequest request)StringgetRenderURL(javax.servlet.http.HttpServletRequest request, com.sun.portal.container.ChannelMode portletWindowMode, com.sun.portal.container.ChannelState portletWindowState)ResourceBundlegetResourceBundle(String base)Gets a specified ResourceBundle file for the provider based on User's locale.voidgetResources(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Invokes the serveResource of the portlet.voidgetResourcesInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)ResponsePropertiesgetResponseProperties()Gets the response properties for the portletWindow.abstract ListgetRoleList(javax.servlet.http.HttpServletRequest request)protected javax.servlet.ServletContextgetServletContext()StringgetTitle()Gets the title for the portletWindow.abstract MapgetUserInfoMap(javax.servlet.http.HttpServletRequest request)abstract com.sun.portal.container.WindowRequestReadergetWindowRequestReader()voidinit(javax.servlet.ServletContext servletContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Initializes the WindowInvoker.booleanisEditable()abstract booleanisMarkupSupported(String contentType, String locale, com.sun.portal.container.ChannelMode mode, com.sun.portal.container.ChannelState state)static booleanisWindowInvokerKey(String key)Used by subclasses to find out if key in the request is reserved by the window invokerprotected voidpopulateContainerRequest(com.sun.portal.container.ContainerRequest containerRequest, javax.servlet.http.HttpServletRequest request, List allowableWindowStates, List allowablePortletWindowModes)Populates the ContainerRequest objectURLprocessAction(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Invokes the processAction of the portlet.URLprocessActionInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)protected URLprocessModeChange(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.ChannelStateprocessWindowStateChange(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.ErrorCodereadErrorCode(javax.servlet.http.HttpServletRequest request)StringBufferrender(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Gets the content for the portletWindow based on mode from the underlying container.voidsetPortletWindowMode(com.sun.portal.container.ChannelMode portletWindowMode)voidsetPortletWindowName(String portletWindowName)voidsetPortletWindowState(com.sun.portal.container.ChannelState portletWindowState)voidsetTitle(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 InvokerExceptionInitializes 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:
InvokerExceptionWindowException
-
getResources
public void getResources(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws InvokerExceptionInvokes 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:
InvokerExceptionWindowException
-
populateContainerRequest
protected void populateContainerRequest(com.sun.portal.container.ContainerRequest containerRequest, javax.servlet.http.HttpServletRequest request, List allowableWindowStates, List allowablePortletWindowModes) throws InvokerExceptionPopulates 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, WindowExceptionProcess window state changes.- Throws:
InvokerExceptionWindowException
-
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 thePortletWindowContextfor 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
ResourceBundleclass.- Parameters:
base- a specifiedResourceBundlename.- Returns:
ResourceBundle.- See Also:
ResourceBundle
-
-