|
||||||||||
| 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.internal.impl.PortletResponseImpl
org.apache.pluto.internal.impl.StateAwareResponseImpl
public class StateAwareResponseImpl
Implementation of JSR-286 StateAwareResponse.
| Field Summary | |
|---|---|
protected PortalCallbackService |
callback
|
protected boolean |
redirected
|
| 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 | |
|---|---|
StateAwareResponseImpl(PortletContainer container,
InternalPortletWindow internalPortletWindow,
javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse servletResponse)
|
|
| Method Summary | |
|---|---|
void |
addDateHeader(java.lang.String arg0,
long arg1)
|
void |
addHeader(java.lang.String arg0,
java.lang.String arg1)
|
void |
addIntHeader(java.lang.String arg0,
int arg1)
|
void |
flushBuffer()
|
int |
getBufferSize()
|
PortletMode |
getChangedPortletMode()
|
WindowState |
getChangedWindowState()
|
java.lang.String |
getCharacterEncoding()
|
java.lang.String |
getContentType()
|
java.util.Locale |
getLocale()
|
javax.servlet.ServletOutputStream |
getOutputStream()
TODO: javadoc about why we are using a wrapped writer here. |
PortletMode |
getPortletMode()
Returns the currently set portlet mode on this reponse. |
java.util.Map<java.lang.String,java.lang.String[]> |
getPublicRenderParameter()
|
java.lang.String |
getRedirectLocation()
|
java.util.Map<java.lang.String,java.lang.String[]> |
getRenderParameterMap()
Returns a Map of the render parameters currently set on
this response. |
java.util.Map |
getRenderParameters()
|
WindowState |
getWindowState()
Returns the currently set window state on this response. |
java.io.PrintWriter |
getWriter()
|
boolean |
isCommitted()
|
protected boolean |
isPortletModeAllowed(PortletMode mode)
|
protected boolean |
isPortletModeAllowedByPortal(PortletMode mode)
|
protected boolean |
isPortletModeAllowedByPortlet(PortletMode mode)
|
protected boolean |
isWindowStateAllowed(WindowState state)
|
void |
removePublicRenderParameter(java.lang.String name)
Removes the specified public render parameter. |
void |
reset()
|
void |
resetBuffer()
|
void |
sendRedirect(java.lang.String location)
|
void |
setBufferSize(int arg0)
|
void |
setCharacterEncoding(java.lang.String arg0)
|
void |
setContentLength(int arg0)
|
void |
setContentType(java.lang.String arg0)
|
void |
setDateHeader(java.lang.String arg0,
long arg1)
|
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 |
setHeader(java.lang.String arg0,
java.lang.String arg1)
|
void |
setIntHeader(java.lang.String arg0,
int arg1)
|
void |
setLocale(java.util.Locale arg0)
|
void |
setNextPossiblePortletModes(java.util.Enumeration portletModes)
|
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 |
setStatus(int arg0)
|
void |
setStatus(int arg0,
java.lang.String arg1)
|
void |
setWindowState(WindowState windowState)
Sets the window state of a portlet to the given window state. |
| Methods inherited from class org.apache.pluto.internal.impl.PortletResponseImpl |
|---|
addCookie, addProperty, addProperty, addProperty, addProperty, containsHeader, createActionURL, createElement, createRenderURL, createResourceURL, createResourceURL, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, getContainer, getHttpServletRequest, getHttpServletResponse, getInternalPortletWindow, getNamespace, isForwarded, isIncluded, sendError, sendError, setForwarded, setIncluded, setProperty |
| Methods inherited from class javax.servlet.ServletResponseWrapper |
|---|
getResponse, 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 |
| Field Detail |
|---|
protected boolean redirected
protected PortalCallbackService callback
| Constructor Detail |
|---|
public StateAwareResponseImpl(PortletContainer container,
InternalPortletWindow internalPortletWindow,
javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse servletResponse)
| Method Detail |
|---|
public void setEvent(javax.xml.namespace.QName qname,
java.io.Serializable value)
throws java.lang.IllegalArgumentException
StateAwareResponseThe 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 StateAwareResponseqname - the event name to publish, must not be nullvalue - the value of this event, must have a valid JAXB binding and
be serializable, or null.
java.lang.IllegalArgumentException - if name is null, the value is not
serializable, the value does not have a valid JAXB binding, the
object type of the value is not the same as specified in
the portlet deployment descriptor for this event name.
public 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 StateAwareResponsename - the local part of the event name to publish, must not be nullvalue - the value of this event, must have a valid JAXB binding and
be serializable, or null.
public void sendRedirect(java.lang.String location)
throws java.io.IOException
sendRedirect in interface javax.servlet.http.HttpServletResponsesendRedirect in class javax.servlet.http.HttpServletResponseWrapperjava.io.IOExceptionpublic java.lang.String getRedirectLocation()
public void setWindowState(WindowState windowState)
throws WindowStateException
StateAwareResponsePossible 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 StateAwareResponsewindowState - 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
StateAwareResponsePossible 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 StateAwareResponseportletMode - 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 setRenderParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)
StateAwareResponseAll 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 StateAwareResponseparameters - 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 StateAwareResponsekey - key of the render parametervalue - value of the render parameter
public 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 StateAwareResponsekey - key of the render parametervalues - values of the render parameterpublic java.util.Map getRenderParameters()
public java.util.Map<java.lang.String,java.lang.String[]> getRenderParameterMap()
StateAwareResponseMap 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 StateAwareResponseMap 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 java.util.Map<java.lang.String,java.lang.String[]> getPublicRenderParameter()
public PortletMode getChangedPortletMode()
public PortletMode getPortletMode()
StateAwareResponse
getPortletMode in interface StateAwareResponsenull if none is setpublic WindowState getChangedWindowState()
public WindowState getWindowState()
StateAwareResponse
getWindowState in interface StateAwareResponsenull if none is setprotected boolean isPortletModeAllowed(PortletMode mode)
protected boolean isPortletModeAllowedByPortlet(PortletMode mode)
protected boolean isPortletModeAllowedByPortal(PortletMode mode)
protected boolean isWindowStateAllowed(WindowState state)
public void setNextPossiblePortletModes(java.util.Enumeration portletModes)
public void reset()
reset in interface javax.servlet.ServletResponsereset in class javax.servlet.ServletResponseWrapperpublic void resetBuffer()
resetBuffer in interface javax.servlet.ServletResponseresetBuffer in class javax.servlet.ServletResponseWrapperpublic void setBufferSize(int arg0)
setBufferSize in interface javax.servlet.ServletResponsesetBufferSize in class javax.servlet.ServletResponseWrapperpublic void setCharacterEncoding(java.lang.String arg0)
setCharacterEncoding in interface javax.servlet.ServletResponsesetCharacterEncoding in class javax.servlet.ServletResponseWrapperpublic void setContentLength(int arg0)
setContentLength in interface javax.servlet.ServletResponsesetContentLength in class javax.servlet.ServletResponseWrapperpublic void setContentType(java.lang.String arg0)
setContentType in interface javax.servlet.ServletResponsesetContentType in class javax.servlet.ServletResponseWrapperpublic void setLocale(java.util.Locale arg0)
setLocale in interface javax.servlet.ServletResponsesetLocale in class javax.servlet.ServletResponseWrapper
public javax.servlet.ServletOutputStream getOutputStream()
throws java.lang.IllegalStateException,
java.io.IOException
PortletResponseImpl
getOutputStream in interface javax.servlet.ServletResponsegetOutputStream in class PortletResponseImpljava.lang.IllegalStateException
java.io.IOExceptionPrintWriterServletOutputStream
public java.io.PrintWriter getWriter()
throws java.lang.IllegalStateException,
java.io.IOException
getWriter in interface javax.servlet.ServletResponsegetWriter in class PortletResponseImpljava.lang.IllegalStateException
java.io.IOException
public void addDateHeader(java.lang.String arg0,
long arg1)
addDateHeader in interface javax.servlet.http.HttpServletResponseaddDateHeader in class javax.servlet.http.HttpServletResponseWrapper
public void addHeader(java.lang.String arg0,
java.lang.String arg1)
addHeader in interface javax.servlet.http.HttpServletResponseaddHeader in class javax.servlet.http.HttpServletResponseWrapper
public void addIntHeader(java.lang.String arg0,
int arg1)
addIntHeader in interface javax.servlet.http.HttpServletResponseaddIntHeader in class javax.servlet.http.HttpServletResponseWrapper
public void setStatus(int arg0,
java.lang.String arg1)
setStatus in interface javax.servlet.http.HttpServletResponsesetStatus in class javax.servlet.http.HttpServletResponseWrapper
public void setDateHeader(java.lang.String arg0,
long arg1)
setDateHeader in interface javax.servlet.http.HttpServletResponsesetDateHeader in class javax.servlet.http.HttpServletResponseWrapper
public void setHeader(java.lang.String arg0,
java.lang.String arg1)
setHeader in interface javax.servlet.http.HttpServletResponsesetHeader in class javax.servlet.http.HttpServletResponseWrapper
public void setIntHeader(java.lang.String arg0,
int arg1)
setIntHeader in interface javax.servlet.http.HttpServletResponsesetIntHeader in class javax.servlet.http.HttpServletResponseWrapperpublic void setStatus(int arg0)
setStatus in interface javax.servlet.http.HttpServletResponsesetStatus in class javax.servlet.http.HttpServletResponseWrapper
public void flushBuffer()
throws java.io.IOException
flushBuffer in interface javax.servlet.ServletResponseflushBuffer in class javax.servlet.ServletResponseWrapperjava.io.IOExceptionpublic int getBufferSize()
getBufferSize in interface javax.servlet.ServletResponsegetBufferSize in class javax.servlet.ServletResponseWrapperpublic java.lang.String getCharacterEncoding()
getCharacterEncoding in interface javax.servlet.ServletResponsegetCharacterEncoding in class javax.servlet.ServletResponseWrapperpublic java.lang.String getContentType()
getContentType in interface javax.servlet.ServletResponsegetContentType in class javax.servlet.ServletResponseWrapperpublic java.util.Locale getLocale()
getLocale in interface javax.servlet.ServletResponsegetLocale in class javax.servlet.ServletResponseWrapperpublic boolean isCommitted()
isCommitted in interface javax.servlet.ServletResponseisCommitted in class javax.servlet.ServletResponseWrapperpublic void removePublicRenderParameter(java.lang.String name)
StateAwareResponsepublic-render-parameter element with the
identifier mapping to the parameter name.
removePublicRenderParameter in interface StateAwareResponsename - 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 | |||||||||