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 final org.gatein.common.net.media.MediaType
    .
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Create a context with the MediaType.TEXT_HTML response content type.
    protected
    AbstractPortletInvocationContext(org.gatein.common.net.media.MediaType responseContentType)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Validate the url and then delegate the encoding of the url to the client response.
    abstract javax.servlet.http.HttpServletRequest
    Return the client request.
    abstract javax.servlet.http.HttpServletResponse
    Return the client response.
    org.gatein.common.net.media.MediaType
     
    void
    renderURL(Writer writer, org.gatein.pc.api.ContainerURL containerURL, org.gatein.pc.api.URLFormat format)
    Delegates the URL rendition to the method PortletInvocationContext.renderURL(org.gatein.pc.api.ContainerURL, org.gatein.pc.api.URLFormat) and then invoke the Writer.write(String) method with the returned result.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods 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 the MediaType.TEXT_HTML response content type.
    • AbstractPortletInvocationContext

      protected AbstractPortletInvocationContext(org.gatein.common.net.media.MediaType responseContentType)
  • Method Details

    • getClientRequest

      public abstract javax.servlet.http.HttpServletRequest getClientRequest() throws IllegalStateException
      Return 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 IllegalStateException
      Return 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:
      encodeResourceURL in interface org.gatein.pc.api.spi.PortletInvocationContext
      Returns:
      the encoded url
      Throws:
      IllegalArgumentException
    • getResponseContentType

      public org.gatein.common.net.media.MediaType getResponseContentType()
      Specified by:
      getResponseContentType in interface org.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 method PortletInvocationContext.renderURL(org.gatein.pc.api.ContainerURL, org.gatein.pc.api.URLFormat) and then invoke the Writer.write(String) method with the returned result.
      Specified by:
      renderURL in interface org.gatein.pc.api.spi.PortletInvocationContext
      Throws:
      IOException
      See Also:
      • PortletInvocationContext.renderURL(org.gatein.pc.api.ContainerURL, org.gatein.pc.api.URLFormat)