Class StateAwareResponseWrapper

    • Constructor Detail

      • StateAwareResponseWrapper

        public StateAwareResponseWrapper​(StateAwareResponse response)
        Parameters:
        response - the wrapped response
    • Method Detail

      • setResponse

        public void setResponse​(StateAwareResponse response)
        Sets the response object being wrapped.
        Parameters:
        response - the response to set
        Throws:
        IllegalArgumentException - if the response is null.
      • setWindowState

        public void setWindowState​(WindowState windowState)
                            throws WindowStateException
        Description copied from interface: MutableRenderState
        Sets the window state of a portlet to the given window state.

        Possible values are the standard window states and any custom window states supported by the portal and the portlet. Standard window states are:

        • MINIMIZED
        • NORMAL
        • MAXIMIZED

        Not more than one window state can be set. If more than one window state is set, only the last one set is valid.

        Specified by:
        setWindowState in interface MutableRenderState
        Parameters:
        windowState - the new portlet window state
        Throws:
        WindowStateException - if the portlet cannot switch to this state, because the portal does not support this state, the portlet has not declared in its deployment descriptor that it supports this state, or the current user is not allowed to switch to this state. The PortletRequest.isWindowStateAllowed() method can be used to check if the portlet can set a given window state.
      • setPortletMode

        public void setPortletMode​(PortletMode portletMode)
                            throws PortletModeException
        Description copied from interface: MutableRenderState
        Sets the portlet mode of a portlet to the given portlet mode.

        Possible values are the standard portlet modes and any custom portlet modes supported by the portal and the portlet. Portlets must declare in the deployment descriptor the portlet modes they support for each markup type. Standard portlet modes are:

        • EDIT
        • HELP
        • VIEW

        Not more than one portlet mode can be set. If more than one portlet mode is set, only the last one set is valid.

        Note: The portlet may still be called in a different portlet mode in the next render call, depending on the portlet container / portal.

        Specified by:
        setPortletMode in interface MutableRenderState
        Parameters:
        portletMode - the new portlet mode
        Throws:
        PortletModeException - if the portlet cannot switch to this mode, because the portal does not support this mode, the portlet has not declared in its deployment descriptor that it supports this mode for the current markup, or the current user is not allowed to switch to this mode. The PortletRequest.isPortletModeAllowed() method can be used to check if the portlet can set a given portlet mode.
      • setRenderParameters

        @Deprecated
        public void setRenderParameters​(Map<String,​String[]> parameters)
        Deprecated.
        Description copied from interface: StateAwareResponse
        Sets a parameter map for the render request.

        These parameters will be accessible in all sub-sequent render calls via the PortletRequest.getParameter call until a new request is targeted to the portlet.

        The given parameters do not need to be encoded prior to calling this method.

        The portlet should not modify the map any further after calling this method.

        This method can be used to set both public and private render parameters.

        These parameters will be accessible in all subsequent render calls via the PortletRequest.getParameter call until a new request is targeted to the portlet.

        Any previously set private render parameter that is not contained in the new map is removed. However, public render parameters cannot be removed by excluding them from the map. Public render parameters that are not included in the map remain unchanged.

        The given parameters do not need to be encoded prior to calling this method.

        The portlet should not modify the map any further after calling this method.

        Specified by:
        setRenderParameters in interface StateAwareResponse
        Parameters:
        parameters - the render parameters Map containing parameter names for the render phase as keys and parameter values as map values. The keys in the parameter map must be of type String and may not be null or the empty string (""). The values in the parameter map must be of type String array (String[]). The values array may not be null; however, the values array elements may be null.
      • setRenderParameter

        @Deprecated
        public void setRenderParameter​(String key,
                                       String value)
        Deprecated.
        Description copied from interface: StateAwareResponse
        Sets a String parameter for the render request.

        These parameters will be accessible in all subsequent render calls until an action or render request is targeted to the portlet.

        This method replaces all parameters with the given key.

        The given parameter do not need to be encoded prior to calling this method.

        A parameter value of null indicates that this parameter should be removed. However, an empty string value ("") is allowed.

        Specified by:
        setRenderParameter in interface StateAwareResponse
        Parameters:
        key - key of the render parameter
        value - value of the render parameter
      • setRenderParameter

        @Deprecated
        public void setRenderParameter​(String key,
                                       String... values)
        Deprecated.
        Description copied from interface: StateAwareResponse
        Sets a multi-valued String parameter for the render request.

        These parameters will be accessible in all subsequent render calls until an action or render request is targeted to the portlet.

        This method replaces all parameter values with the given key.

        The given parameter do not need to be encoded prior to calling this method.

        A values parameter of null indicates that this parameter should be removed.

        If the values parameter is not null, elements of the array may be null.

        Specified by:
        setRenderParameter in interface StateAwareResponse
        Parameters:
        key - key of the render parameter
        values - values of the render parameter
      • setEvent

        public void setEvent​(QName name,
                             Serializable value)
        Description copied from interface: StateAwareResponse
        Publishes an Event with the given payload.

        The object type of the value must be compliant with the specified event type in the portlet deployment descriptor.

        The value must have a valid JAXB binding and be serializable.

        Specified by:
        setEvent in interface StateAwareResponse
        Parameters:
        name - the event name to publish, must not be null
        value - the value of this event, must have a valid JAXB binding and be serializable, or null.
      • setEvent

        public void setEvent​(String name,
                             Serializable value)
        Description copied from interface: StateAwareResponse
        Publishes an Event with the given payload in the default namespace.

        The name is treated as local part of the event QName and the namespace is either taken from the default-event-namespace element in the portlet deployment descriptor, or if this element is not provided the XML default namespace XMLConstants.NULL_NS_URI is used.

        The object type of the value must be compliant with the specified event type in the portlet deployment descriptor.

        The value must have a valid JAXB binding and be serializable.

        Specified by:
        setEvent in interface StateAwareResponse
        Parameters:
        name - the local part of the event name to publish, must not be null
        value - the value of this event, must have a valid JAXB binding and be serializable, or null.
      • getRenderParameterMap

        @Deprecated
        public Map<String,​String[]> getRenderParameterMap()
        Deprecated.
        Description copied from interface: StateAwareResponse
        Returns a Map of the render parameters currently set on this response.

        The values in the returned Map are of type String array (String[]).

        The contents of the returned map are immutable in the sense that modifying the map does not directly affect the render parameters. In order to set the parameters using the modified map, the StateAwareResponse.setRenderParameters(Map) method must be used.

        If no parameters exist this method returns an empty Map.

        Specified by:
        getRenderParameterMap in interface StateAwareResponse
        Returns:
        Map containing render parameter names as keys and parameter values as map values, or an empty Map if no parameters exist. The keys in the parameter map are of type String. The values in the parameter map are of type String array (String[]).
      • removePublicRenderParameter

        @Deprecated
        public void removePublicRenderParameter​(String name)
        Deprecated.
        Description copied from interface: StateAwareResponse
        Removes the specified public render parameter. The name must reference a public render parameter defined in the portlet deployment descriptor under the public-render-parameter element with the identifier mapping to the parameter name.
        Specified by:
        removePublicRenderParameter in interface StateAwareResponse
        Parameters:
        name - a String specifying the name of the public render parameter to be removed