Class 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 Detail

      • responseContentType

        protected final org.gatein.common.net.media.MediaType responseContentType
        .
    • Constructor Detail

      • 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 Detail

      • 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)