Top Description Fields Constructors Methods
javax.portlet.filter

public Class StateAwareResponseWrapper

extends PortletResponseWrapper
implements StateAwareResponse
Class Inheritance
All Implemented Interfaces
javax.portlet.StateAwareResponse, javax.portlet.MutableRenderState, javax.portlet.Mutable, javax.portlet.RenderState, javax.portlet.PortletResponse
Known Direct Subclasses
javax.portlet.filter.ActionResponseWrapper, javax.portlet.filter.EventResponseWrapper
Imports
java.io.Serializable, java.util.Map, javax.portlet.MutableRenderParameters, .PortletMode, .PortletModeException, .StateAwareResponse, .WindowState, .WindowStateException, javax.xml.namespace.QName

The StateAwareResponseWrapper provides a convenient implementation of the StateAwareResponse interface that can be subclassed by developers. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped Response object.
Since
3.0

Field Summary

Inherited from javax.portlet.filter.PortletResponseWrapper:
response

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public PortletMode
getPortletMode()

Implements javax.portlet.RenderState.getPortletMode.

Returns the current portlet mode of the portlet.
public Map<String, String[]>
getRenderParameterMap()

Implements javax.portlet.StateAwareResponse.getRenderParameterMap.

Deprecated
Returns a Map of the render parameters currently set on this response.
public MutableRenderParameters
getRenderParameters()

Implements javax.portlet.MutableRenderState.getRenderParameters.

Gets the mutable render parameters.
public StateAwareResponse

Returns:

the wrapped response
getResponse
()

Overrides javax.portlet.filter.PortletResponseWrapper.getResponse.

Return the wrapped response object.
public WindowState
getWindowState()

Implements javax.portlet.RenderState.getWindowState.

Returns the current window state of the portlet.
public void
removePublicRenderParameter(String
a String specifying the name of the public render parameter to be removed
name
)

Implements javax.portlet.StateAwareResponse.removePublicRenderParameter.

Deprecated
Removes the specified public render parameter.
public void
setEvent(QName
the event name to publish, must not be null
name
,
Serializable
the value of this event, must have a valid JAXB binding and be serializable, or null.
value
)

Implements javax.portlet.StateAwareResponse.setEvent.

Publishes an Event with the given payload.
public void
setEvent(String
the local part of the event name to publish, must not be null
name
,
Serializable
the value of this event, must have a valid JAXB binding and be serializable, or null.
value
)

Implements javax.portlet.StateAwareResponse.setEvent.

Publishes an Event with the given payload in the default namespace.
public void
setPortletMode(PortletMode
the new portlet mode
portletMode
)

Implements javax.portlet.MutableRenderState.setPortletMode.

Sets the portlet mode of a portlet to the given portlet mode.
public void
setRenderParameter(String
key of the render parameter
key
,
String
value of the render parameter
value
)

Implements javax.portlet.StateAwareResponse.setRenderParameter.

Deprecated
Sets a String parameter for the render request.
public void
setRenderParameter(String
key of the render parameter
key
,
String...
values of the render parameter
values
)

Implements javax.portlet.StateAwareResponse.setRenderParameter.

Deprecated
Sets a multi-valued String parameter for the render request.
public void
setRenderParameters(Map<String, String[]>
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.
parameters
)

Implements javax.portlet.StateAwareResponse.setRenderParameters.

Deprecated
Sets a parameter map for the render request.
public void
setResponse(StateAwareResponse
the response to set
response
)

Sets the response object being wrapped.

public void
setWindowState(WindowState
the new portlet window state
windowState
)

Implements javax.portlet.MutableRenderState.setWindowState.

Sets the window state of a portlet to the given window state.
Inherited from javax.portlet.filter.PortletResponseWrapper:
addPropertyaddPropertyaddPropertycreateElementencodeURLgetNamespacegetPropertygetPropertyNamesgetPropertyValuessetPropertysetResponse

Constructor Detail

StateAwareResponseWrapperback to summary
public StateAwareResponseWrapper(StateAwareResponse response)

Method Detail

getPortletModeback to summary
public PortletMode getPortletMode()

Implements javax.portlet.RenderState.getPortletMode.

Doc from javax.portlet.RenderState.getPortletMode.

Returns the current portlet mode of the portlet.
Returns:PortletMode

the portlet mode. If the portlet mode is not available, PortletMode#UNDEFINED is returned.

Annotations
@Override
getRenderParameterMapback to summary
public Map<String, String[]> getRenderParameterMap()

Implements javax.portlet.StateAwareResponse.getRenderParameterMap.

Doc from javax.portlet.StateAwareResponse.getRenderParameterMap.

Deprecated

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.

Returns:Map<String, String[]>

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[]).

Annotations
@Deprecated
@Override
getRenderParametersback to summary
public MutableRenderParameters getRenderParameters()

Implements javax.portlet.MutableRenderState.getRenderParameters.

Doc from javax.portlet.MutableRenderState.getRenderParameters.

Gets the mutable render parameters.
Returns:MutableRenderParameters

a MutableRenderParameters object representing the private and public render parameters

Annotations
@Override
getResponseback to summary
public StateAwareResponse getResponse()

Overrides javax.portlet.filter.PortletResponseWrapper.getResponse.

Return the wrapped response object.

Returns:StateAwareResponse

the wrapped response

getWindowStateback to summary
public WindowState getWindowState()

Implements javax.portlet.RenderState.getWindowState.

Doc from javax.portlet.RenderState.getWindowState.

Returns the current window state of the portlet.
Returns:WindowState

the window state. If the window state is not available, WindowState#UNDEFINED is returned.

Annotations
@Override
removePublicRenderParameterback to summary
public void removePublicRenderParameter(String name)

Implements javax.portlet.StateAwareResponse.removePublicRenderParameter.

Doc from javax.portlet.StateAwareResponse.removePublicRenderParameter.

Deprecated

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.

Parameters
name:String

a String specifying the name of the public render parameter to be removed

Annotations
@Deprecated
@Override
setEventback to summary
public void setEvent(QName name, Serializable value)

Implements javax.portlet.StateAwareResponse.setEvent.

Doc from javax.portlet.StateAwareResponse.setEvent.

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.

Parameters
name:QName

the event name to publish, must not be null

value:Serializable

the value of this event, must have a valid JAXB binding and be serializable, or null.

Annotations
@Override
setEventback to summary
public void setEvent(String name, Serializable value)

Implements javax.portlet.StateAwareResponse.setEvent.

Doc from javax.portlet.StateAwareResponse.setEvent.

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.

Parameters
name:String

the local part of the event name to publish, must not be null

value:Serializable

the value of this event, must have a valid JAXB binding and be serializable, or null.

Annotations
@Override
setPortletModeback to summary
public void setPortletMode(PortletMode portletMode) throws PortletModeException

Implements javax.portlet.MutableRenderState.setPortletMode.

Doc from javax.portlet.MutableRenderState.setPortletMode.

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.

Parameters
portletMode:PortletMode

the new portlet mode

Annotations
@Override
Exceptions
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.
setRenderParameterback to summary
public void setRenderParameter(String key, String value)

Implements javax.portlet.StateAwareResponse.setRenderParameter.

Doc from javax.portlet.StateAwareResponse.setRenderParameter.

Deprecated

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.

Parameters
key:String

key of the render parameter

value:String

value of the render parameter

Annotations
@Deprecated
@Override
setRenderParameterback to summary
public void setRenderParameter(String key, String... values)

Implements javax.portlet.StateAwareResponse.setRenderParameter.

Doc from javax.portlet.StateAwareResponse.setRenderParameter.

Deprecated

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.

Parameters
key:String

key of the render parameter

values:String[]

values of the render parameter

Annotations
@Deprecated
@Override
setRenderParametersback to summary
public void setRenderParameters(Map<String, String[]> parameters)

Implements javax.portlet.StateAwareResponse.setRenderParameters.

Doc from javax.portlet.StateAwareResponse.setRenderParameters.

Deprecated

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.

Parameters
parameters:Map<String, String[]>

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.

Annotations
@Deprecated
@Override
setResponseback to summary
public void setResponse(StateAwareResponse response)

Sets the response object being wrapped.

Parameters
response:StateAwareResponse

the response to set

Exceptions
IllegalArgumentException:
if the response is null.
setWindowStateback to summary
public void setWindowState(WindowState windowState) throws WindowStateException

Implements javax.portlet.MutableRenderState.setWindowState.

Doc from javax.portlet.MutableRenderState.setWindowState.

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.

Parameters
windowState:WindowState

the new portlet window state

Annotations
@Override
Exceptions
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.