|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.ServletResponseWrapper
javax.servlet.http.HttpServletResponseWrapper
org.apache.pluto.wrappers.PortletResponseWrapper
org.apache.pluto.wrappers.ActionResponseWrapper
public class ActionResponseWrapper
Field Summary |
---|
Fields inherited from interface javax.servlet.http.HttpServletResponse |
---|
SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_EXPECTATION_FAILED, SC_FORBIDDEN, SC_FOUND, SC_GATEWAY_TIMEOUT, SC_GONE, SC_HTTP_VERSION_NOT_SUPPORTED, SC_INTERNAL_SERVER_ERROR, SC_LENGTH_REQUIRED, SC_METHOD_NOT_ALLOWED, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_MULTIPLE_CHOICES, SC_NO_CONTENT, SC_NON_AUTHORITATIVE_INFORMATION, SC_NOT_ACCEPTABLE, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_PARTIAL_CONTENT, SC_PAYMENT_REQUIRED, SC_PRECONDITION_FAILED, SC_PROXY_AUTHENTICATION_REQUIRED, SC_REQUEST_ENTITY_TOO_LARGE, SC_REQUEST_TIMEOUT, SC_REQUEST_URI_TOO_LONG, SC_REQUESTED_RANGE_NOT_SATISFIABLE, SC_RESET_CONTENT, SC_SEE_OTHER, SC_SERVICE_UNAVAILABLE, SC_SWITCHING_PROTOCOLS, SC_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY |
Constructor Summary | |
---|---|
ActionResponseWrapper(ActionResponse actionResponse)
Creates a ServletResponse adaptor wrapping the given response object. |
Method Summary | |
---|---|
ActionResponse |
getActionResponse()
Return the wrapped ServletResponse object. |
PortletMode |
getPortletMode()
Returns the currently set portlet mode on this reponse. |
java.util.Map |
getRenderParameterMap()
Returns a Map of the render parameters currently set on
this response. |
StateAwareResponse |
getStateAwareResponse()
|
WindowState |
getWindowState()
Returns the currently set window state on this response. |
void |
removePublicRenderParameter(java.lang.String name)
Removes the specified public render parameter. |
void |
sendRedirect(java.lang.String location)
Instructs the portlet container to send a redirect response to the client using the specified redirect location URL. |
void |
sendRedirect(java.lang.String location,
java.lang.String renderUrlParamName)
Instructs the portlet container to send a redirect response to the client using the specified redirect location URL and encode a render URL as parameter on the redirect URL. |
void |
setEvent(javax.xml.namespace.QName qname,
java.io.Serializable value)
Publishes an Event with the given payload. |
void |
setEvent(java.lang.String name,
java.io.Serializable value)
Publishes an Event with the given payload in the default namespace. |
void |
setPortletMode(PortletMode portletMode)
Sets the portlet mode of a portlet to the given portlet mode. |
void |
setRenderParameter(java.lang.String key,
java.lang.String value)
Sets a String parameter for the render request. |
void |
setRenderParameter(java.lang.String key,
java.lang.String[] values)
Sets a String array parameter for the render request. |
void |
setRenderParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)
Sets a parameter map for the render request. |
void |
setWindowState(WindowState windowState)
Sets the window state of a portlet to the given window state. |
Methods inherited from class org.apache.pluto.wrappers.PortletResponseWrapper |
---|
addProperty, addProperty, createActionURL, createElement, createRenderURL, createResourceURL, encodeURL, getNamespace, getPortletResponse, setProperty, setResponse |
Methods inherited from class javax.servlet.http.HttpServletResponseWrapper |
---|
addCookie, addDateHeader, addHeader, addIntHeader, containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, sendError, sendError, setDateHeader, setHeader, setIntHeader, setStatus, setStatus |
Methods inherited from class javax.servlet.ServletResponseWrapper |
---|
flushBuffer, getBufferSize, getCharacterEncoding, getContentType, getLocale, getOutputStream, getResponse, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setContentLength, setContentType, setLocale, setResponse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.portlet.PortletResponse |
---|
addProperty, addProperty, createElement, encodeURL, getNamespace, setProperty |
Methods inherited from interface javax.servlet.ServletResponse |
---|
flushBuffer, getBufferSize, getCharacterEncoding, getContentType, getLocale, getOutputStream, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setContentLength, setContentType, setLocale |
Constructor Detail |
---|
public ActionResponseWrapper(ActionResponse actionResponse)
java.lang.IllegalArgumentException
- if the response is null.Method Detail |
---|
public void setWindowState(WindowState windowState) throws WindowStateException
StateAwareResponse
Possible values are the standard window states and any custom window states supported by the portal and the portlet. Standard window states are:
setWindowState
in interface StateAwareResponse
windowState
- the new portlet window state
WindowStateException
- if the portlet cannot switch to the specified window
state. To avoid this exception the portlet can check the
allowed window states with
Request.isWindowStateAllowed()
.WindowState
public void setPortletMode(PortletMode portletMode) throws PortletModeException
StateAwareResponse
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:
Note: The portlet may still be called in a different window state in the next render call, depending on the portlet container / portal.
setPortletMode
in interface StateAwareResponse
portletMode
- the new portlet mode
PortletModeException
- if the portlet cannot switch to this portlet mode, because
the portlet or portal does not support it for this markup,
or the current user is not allowed to switch to this
portlet mode. To avoid this exception the portlet can
check the allowed portlet modes with
Request.isPortletModeAllowed()
.public void sendRedirect(java.lang.String location) throws java.io.IOException
ActionResponse
This method only accepts an absolute URL (e.g.
http://my.co/myportal/mywebap/myfolder/myresource.gif
)
or a full path URI (e.g. /myportal/mywebap/myfolder/myresource.gif
).
If required,
the portlet container may encode the given URL before the
redirection is issued to the client.
The sendRedirect method can not be invoked after any of the following methods of the ActionResponse interface has been called:
sendRedirect
in interface ActionResponse
sendRedirect
in interface javax.servlet.http.HttpServletResponse
sendRedirect
in class javax.servlet.http.HttpServletResponseWrapper
location
- the redirect location URL
java.io.IOException
- if an input or output exception occurs.public void setRenderParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)
StateAwareResponse
All previously set render parameters are cleared.
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.
setRenderParameters
in interface StateAwareResponse
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. The values in the parameter map
must be of type String array (String[]
).public void setRenderParameter(java.lang.String key, java.lang.String value)
StateAwareResponse
These parameters will be accessible in all sub-sequent render calls via
the PortletRequest.getParameter
call until a 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.
setRenderParameter
in interface StateAwareResponse
key
- key of the render parametervalue
- value of the render parameterpublic void setRenderParameter(java.lang.String key, java.lang.String[] values)
StateAwareResponse
These parameters will be accessible in all sub-sequent render calls via
the PortletRequest.getParameter
call until a 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.
setRenderParameter
in interface StateAwareResponse
key
- key of the render parametervalues
- values of the render parameterpublic ActionResponse getActionResponse()
public StateAwareResponse getStateAwareResponse()
public void setEvent(javax.xml.namespace.QName qname, java.io.Serializable value)
StateAwareResponse
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.
setEvent
in interface StateAwareResponse
qname
- 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
.public PortletMode getPortletMode()
StateAwareResponse
getPortletMode
in interface StateAwareResponse
null
if none is setpublic java.util.Map getRenderParameterMap()
StateAwareResponse
Map
of the render parameters currently set on
this response.
The values in the returned Map
are from type String array (String[]
).
If no parameters exist this method returns an empty Map
.
getRenderParameterMap
in interface StateAwareResponse
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[]
).public WindowState getWindowState()
StateAwareResponse
getWindowState
in interface StateAwareResponse
null
if none is setpublic void setEvent(java.lang.String name, java.io.Serializable value)
StateAwareResponse
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.
setEvent
in interface StateAwareResponse
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
.public void sendRedirect(java.lang.String location, java.lang.String renderUrlParamName) throws java.io.IOException
ActionResponse
This method only accepts an absolute URL (e.g.
http://my.co/myportal/mywebap/myfolder/myresource.gif
)
or a full path URI (e.g. /myportal/mywebap/myfolder/myresource.gif
).
If required,
the portlet container may encode the given URL before the
redirection is issued to the client.
The portlet container will attach a render URL with the currently set portlet mode, window state
and render parameters on the ActionResponse
and the current public render parameters.
The attached URL will be available as query parameter value under the key provided with the
renderUrlParamName
parameter.
New values for
sendRedirect
in interface ActionResponse
location
- the redirect location URLrenderUrlParamName
- name of the query parameter under which the portlet container should
store a render URL to this portlet
java.io.IOException
- if an input or output exception occurs.public void removePublicRenderParameter(java.lang.String name)
StateAwareResponse
public-render-parameter
element with the
identifier
mapping to the parameter name.
removePublicRenderParameter
in interface StateAwareResponse
name
- a String
specifying
the name of the public render parameter to be removed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |