|
||||||||||
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.RenderResponseWrapper
public class RenderResponseWrapper
Field Summary |
---|
Fields inherited from interface javax.portlet.MimeResponse |
---|
CACHE_SCOPE, ETAG, EXPIRATION_CACHE, MARKUP_HEAD_ELEMENT, NAMESPACED_RESPONSE, PRIVATE_SCOPE, PUBLIC_SCOPE, USE_CACHED_CONTENT |
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 | |
---|---|
RenderResponseWrapper(RenderResponse renderResponse)
Creates a ServletResponse adaptor wrapping the given response object. |
Method Summary | |
---|---|
void |
addProperty(javax.servlet.http.Cookie cookie)
Adds a HTTP Cookie property to the response. The portlet should note that the cookie may not make it to the client, but may be stored at the portal. |
PortletURL |
createActionURL()
Creates a portlet URL targeting the portlet. |
PortletURL |
createRenderURL()
Creates a portlet URL targeting the portlet. |
void |
flushBuffer()
Forces any content in the buffer to be written to the underlying output stream. |
int |
getBufferSize()
Returns the actual buffer size used for the response. |
CacheControl |
getCacheControl()
Returns an implementation of JSR-286 CacheContol . |
String |
getCharacterEncoding()
Returns the name of the charset used for the MIME body sent in this response. |
String |
getContentType()
Returns the MIME type that can be used to contribute markup to the render response. |
Locale |
getLocale()
Returns the locale assigned to the response. |
String |
getNamespace()
The value returned by this method should be prefixed or appended to elements, such as JavaScript variables or function names, to ensure they are unique in the context of the portal page. |
OutputStream |
getPortletOutputStream()
Returns a OutputStream suitable for writing binary data in
the response. |
RenderResponse |
getRenderResponse()
Return the wrapped ServletResponse object. |
PrintWriter |
getWriter()
Returns a PrintWriter object that can send character text to the portal. |
boolean |
isCommitted()
Returns a boolean indicating if the response has been committed. |
void |
reset()
Clears any data that exists in the buffer as well as the properties set. |
void |
resetBuffer()
Clears the content of the underlying buffer in the response without clearing properties set. |
void |
setBufferSize(int size)
Sets the preferred buffer size for the body of the response. |
void |
setContentType(String type)
Sets the MIME type for the render response. |
void |
setNextPossiblePortletModes(Collection<PortletMode> portletModes)
This method allows the portlet to tell the portal the next possible portlet modes that the make sense from the portlet point of view. |
void |
setTitle(String title)
This method sets the title of the portlet. |
Methods inherited from class org.apache.pluto.wrappers.PortletResponseWrapper |
---|
addProperty, addProperty, createElement, createResourceURL, encodeURL, getPortletResponse, setProperty, setResponse |
Methods inherited from class javax.servlet.http.HttpServletResponseWrapper |
---|
addCookie, addDateHeader, addHeader, addIntHeader, containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, sendError, sendError, sendRedirect, setDateHeader, setHeader, setIntHeader, setStatus, setStatus |
Methods inherited from class javax.servlet.ServletResponseWrapper |
---|
getOutputStream, getResponse, setCharacterEncoding, setContentLength, 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.MimeResponse |
---|
createResourceURL |
Methods inherited from interface javax.portlet.PortletResponse |
---|
addProperty, addProperty, createElement, encodeURL, setProperty |
Methods inherited from interface javax.servlet.ServletResponse |
---|
getOutputStream, setCharacterEncoding, setContentLength, setLocale |
Constructor Detail |
---|
public RenderResponseWrapper(RenderResponse renderResponse)
IllegalArgumentException
- if the response is null.Method Detail |
---|
public String getContentType()
MimeResponse
If no content type was set previously using the MimeResponse.setContentType(java.lang.String)
method this method returns null
.
getContentType
in interface MimeResponse
getContentType
in interface javax.servlet.ServletResponse
getContentType
in class javax.servlet.ServletResponseWrapper
null
if no
content type is setMimeResponse.setContentType(java.lang.String)
public PortletURL createRenderURL()
MimeResponse
The returned URL can be further extended by adding portlet-specific parameters and portlet modes and window states.
The created URL will per default not contain any parameters of the current render request.
createRenderURL
in interface MimeResponse
createRenderURL
in class PortletResponseWrapper
public PortletURL createActionURL()
MimeResponse
The returned URL can be further extended by adding portlet-specific parameters and portlet modes and window states.
The created URL will per default not contain any parameters of the current render request.
createActionURL
in interface MimeResponse
createActionURL
in class PortletResponseWrapper
public String getNamespace()
PortletResponse
The namespace value must be constant for the lifetime of the portlet window.
getNamespace
in interface PortletResponse
getNamespace
in class PortletResponseWrapper
public void setTitle(String title)
RenderResponse
The value can be a text String
setTitle
in interface RenderResponse
title
- portlet title as text String or resource URIpublic void setContentType(String type)
MimeResponse
MimeResponse.getWriter()
or
MimeResponse.getPortletOutputStream()
.
Calling setContentType
after getWriter
or
getOutputStream
does not change the content type.
The portlet container will ignore any character encoding
specified as part of the content type for render
calls.
setContentType
in interface MimeResponse
setContentType
in interface javax.servlet.ServletResponse
setContentType
in class javax.servlet.ServletResponseWrapper
type
- the content MIME typePortletRequest.getResponseContentTypes()
,
MimeResponse.getContentType()
public String getCharacterEncoding()
MimeResponse
See RFC 2047 for more information about character encoding and MIME.
getCharacterEncoding
in interface MimeResponse
getCharacterEncoding
in interface javax.servlet.ServletResponse
getCharacterEncoding
in class javax.servlet.ServletResponseWrapper
String
specifying the name of the charset, for
example, ISO-8859-1
public PrintWriter getWriter() throws IOException
MimeResponse
Before calling this method the content type of the render response must
be set using the MimeResponse.setContentType(java.lang.String)
method.
Either this method or MimeResponse.getPortletOutputStream()
may be called to
write the body, not both.
getWriter
in interface MimeResponse
getWriter
in interface javax.servlet.ServletResponse
getWriter
in class javax.servlet.ServletResponseWrapper
PrintWriter
object that can return character
data to the portal
IOException
- if an input or output exception occurredMimeResponse.setContentType(java.lang.String)
,
MimeResponse.getPortletOutputStream()
public Locale getLocale()
MimeResponse
getLocale
in interface MimeResponse
getLocale
in interface javax.servlet.ServletResponse
getLocale
in class javax.servlet.ServletResponseWrapper
public void setBufferSize(int size)
MimeResponse
This method must be called before any response body content is written;
if content has been written, or the portlet container does not support
buffering, this method may throw an IllegalStateException
.
setBufferSize
in interface MimeResponse
setBufferSize
in interface javax.servlet.ServletResponse
setBufferSize
in class javax.servlet.ServletResponseWrapper
size
- the preferred buffer sizeMimeResponse.getBufferSize()
,
MimeResponse.flushBuffer()
,
MimeResponse.isCommitted()
,
MimeResponse.reset()
public int getBufferSize()
MimeResponse
getBufferSize
in interface MimeResponse
getBufferSize
in interface javax.servlet.ServletResponse
getBufferSize
in class javax.servlet.ServletResponseWrapper
MimeResponse.setBufferSize(int)
,
MimeResponse.flushBuffer()
,
MimeResponse.isCommitted()
,
MimeResponse.reset()
public void flushBuffer() throws IOException
MimeResponse
flushBuffer
in interface MimeResponse
flushBuffer
in interface javax.servlet.ServletResponse
flushBuffer
in class javax.servlet.ServletResponseWrapper
IOException
- if an error occurred when writing the outputMimeResponse.setBufferSize(int)
,
MimeResponse.getBufferSize()
,
MimeResponse.isCommitted()
,
MimeResponse.reset()
public void resetBuffer()
MimeResponse
IllegalStateException
.
resetBuffer
in interface MimeResponse
resetBuffer
in interface javax.servlet.ServletResponse
resetBuffer
in class javax.servlet.ServletResponseWrapper
MimeResponse.setBufferSize(int)
,
MimeResponse.getBufferSize()
,
MimeResponse.isCommitted()
,
MimeResponse.reset()
public boolean isCommitted()
MimeResponse
isCommitted
in interface MimeResponse
isCommitted
in interface javax.servlet.ServletResponse
isCommitted
in class javax.servlet.ServletResponseWrapper
MimeResponse.setBufferSize(int)
,
MimeResponse.getBufferSize()
,
MimeResponse.flushBuffer()
,
MimeResponse.reset()
public void reset()
MimeResponse
IllegalStateException
.
reset
in interface MimeResponse
reset
in interface javax.servlet.ServletResponse
reset
in class javax.servlet.ServletResponseWrapper
MimeResponse.setBufferSize(int)
,
MimeResponse.getBufferSize()
,
MimeResponse.flushBuffer()
,
MimeResponse.isCommitted()
public OutputStream getPortletOutputStream() throws IOException
MimeResponse
OutputStream
suitable for writing binary data in
the response. The portlet container does not encode the binary data.
Before calling this method the content type of the render response must
be set using the MimeResponse.setContentType(java.lang.String)
method.
Calling flush()
on the OutputStream commits the response.
Either this method or MimeResponse.getWriter()
may be called to write the body,
not both.
getPortletOutputStream
in interface MimeResponse
OutputStream
for writing binary data
IOException
- if an input or output exception occurredMimeResponse.setContentType(java.lang.String)
,
MimeResponse.getWriter()
public CacheControl getCacheControl()
CacheContol
.
getCacheControl
in interface MimeResponse
public RenderResponse getRenderResponse()
public void addProperty(javax.servlet.http.Cookie cookie)
MimeResponse
This method allows response properties to have multiple cookies.
addProperty
in interface MimeResponse
cookie
- the cookie to be added to the responsepublic void setNextPossiblePortletModes(Collection<PortletMode> portletModes)
RenderResponse
If set, the portal should honor these enumeration of portlet modes and only provide the end user with choices to the provided portlet modes or a subset of these modes based on access control considerations.
If the portlet does not set any next possible portlet modes the default is that all portlet modes that the portlet has defined supporting in the portlet deployment descriptor are meaningful new portlet modes.
setNextPossiblePortletModes
in interface RenderResponse
portletModes
- Enumeration
of PortletMode
objects with the
next possible portlet modes that the make sense from the
portlet point of view, must not be null
or an
empty enumeration.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |