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
FieldsModifier and TypeFieldDescriptionprotected final org.gatein.common.net.media.MediaType. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreate a context with theMediaType.TEXT_HTMLresponse content type.protectedAbstractPortletInvocationContext(org.gatein.common.net.media.MediaType responseContentType) -
Method Summary
Modifier and TypeMethodDescriptionencodeResourceURL(String url) Validate the url and then delegate the encoding of the url to the client response.abstract jakarta.servlet.http.HttpServletRequestReturn the client request.abstract jakarta.servlet.http.HttpServletResponseReturn the client response.org.gatein.common.net.media.MediaTypevoidrenderURL(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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gatein.pc.api.spi.PortletInvocationContext
renderURL
-
Field Details
-
responseContentType
protected final org.gatein.common.net.media.MediaType responseContentType.
-
-
Constructor Details
-
AbstractPortletInvocationContext
protected AbstractPortletInvocationContext()Create a context with theMediaType.TEXT_HTMLresponse content type. -
AbstractPortletInvocationContext
protected AbstractPortletInvocationContext(org.gatein.common.net.media.MediaType responseContentType)
-
-
Method Details
-
getClientRequest
public abstract jakarta.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 jakarta.servlet.http.HttpServletResponse getClientResponse() throws IllegalStateExceptionReturn the client response.- Returns:
- the client response
- Throws:
IllegalStateException- if the client response is not available
-
encodeResourceURL
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)
-