Package org.gatein.pc.portlet.impl.spi
Class AbstractPortletInvocationContext
- java.lang.Object
-
- org.gatein.pc.portlet.impl.spi.AbstractPortletInvocationContext
-
- All Implemented Interfaces:
org.gatein.pc.api.spi.PortletInvocationContext
public abstract class AbstractPortletInvocationContext extends Object implements org.gatein.pc.api.spi.PortletInvocationContext
An abstract implementation that relies on the a request and response provided by the client (i.e the portal).- Version:
- $Revision: 5064 $
- Author:
- Julien Viet
-
-
Field Summary
Fields Modifier and Type Field Description protected org.gatein.common.net.media.MediaTyperesponseContentType.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPortletInvocationContext()Create a context with theMediaType.TEXT_HTMLresponse content type.protectedAbstractPortletInvocationContext(org.gatein.common.net.media.MediaType responseContentType)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringencodeResourceURL(String url)Validate the url and then delegate the encoding of the url to the client response.abstract javax.servlet.http.HttpServletRequestgetClientRequest()Return the client request.abstract javax.servlet.http.HttpServletResponsegetClientResponse()Return the client response.org.gatein.common.net.media.MediaTypegetResponseContentType()voidrenderURL(Writer writer, org.gatein.pc.api.ContainerURL containerURL, org.gatein.pc.api.URLFormat format)Delegates the URL rendition to the methodPortletInvocationContext.renderURL(org.gatein.pc.api.ContainerURL , org.gatein.pc.api.URLFormat)and then invoke theWriter.write(String)method with the returned result.
-
-
-
Constructor Detail
-
AbstractPortletInvocationContext
protected AbstractPortletInvocationContext()
Create a context with theMediaType.TEXT_HTMLresponse content type.
-
AbstractPortletInvocationContext
protected AbstractPortletInvocationContext(org.gatein.common.net.media.MediaType responseContentType)
-
-
Method Detail
-
getClientRequest
public abstract javax.servlet.http.HttpServletRequest getClientRequest() throws IllegalStateExceptionReturn the client request.- Returns:
- the client request
- Throws:
IllegalStateException- if the client response is not available
-
getClientResponse
public abstract javax.servlet.http.HttpServletResponse getClientResponse() throws IllegalStateExceptionReturn the client response.- Returns:
- the client response
- Throws:
IllegalStateException- if the client response is not available
-
encodeResourceURL
public String encodeResourceURL(String url) throws IllegalArgumentException
Validate the url and then delegate the encoding of the url to the client response.- Specified by:
encodeResourceURLin interfaceorg.gatein.pc.api.spi.PortletInvocationContext- Returns:
- the encoded url
- Throws:
IllegalArgumentException
-
getResponseContentType
public org.gatein.common.net.media.MediaType getResponseContentType()
- Specified by:
getResponseContentTypein interfaceorg.gatein.pc.api.spi.PortletInvocationContext
-
renderURL
public void renderURL(Writer writer, org.gatein.pc.api.ContainerURL containerURL, org.gatein.pc.api.URLFormat format) throws IOException
Delegates the URL rendition to the methodPortletInvocationContext.renderURL(org.gatein.pc.api.ContainerURL , org.gatein.pc.api.URLFormat)and then invoke theWriter.write(String)method with the returned result.- Specified by:
renderURLin interfaceorg.gatein.pc.api.spi.PortletInvocationContext- Throws:
IOException- See Also:
PortletInvocationContext.renderURL(org.gatein.pc.api.ContainerURL , org.gatein.pc.api.URLFormat)
-
-