Class 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 Detail

      • localParamKeyList

        public static final List localParamKeyList
    • Constructor Detail

      • WindowInvoker

        public WindowInvoker()
    • Method Detail

      • 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
      • 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.
      • 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.
      • 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)
      • 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 the PortletWindowContext 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 specified ResourceBundle name.
        Returns:
        ResourceBundle.
        See Also:
        ResourceBundle