Class PortletResponseWrapper

    • Constructor Detail

      • PortletResponseWrapper

        public PortletResponseWrapper​(PortletResponse response)
        Creates an ActionResponse adaptor wrapping the given response object.
        Parameters:
        response - the action response to wrap
        Throws:
        IllegalArgumentException - if the response is null
    • Method Detail

      • addProperty

        public void addProperty​(String key,
                                String value)
        The default behavior of this method is to call addProperty(key, value) on the wrapped response object.
        Specified by:
        addProperty in interface PortletResponse
        Parameters:
        key - the key of the property to be returned to the portal
        value - the value of the property to be returned to the portal
      • encodeURL

        public String encodeURL​(String path)
        The default behavior of this method is to call encodeURL(path) on the wrapped response object.
        Specified by:
        encodeURL in interface PortletResponse
        Parameters:
        path - the URI path to the resource. This must be either an absolute URL (e.g. http://my.co/myportal/mywebap/myfolder/myresource.gif) or a full path URI (e.g. /myportal/mywebap/myfolder/myresource.gif).
        Returns:
        the encoded resource URL as string, may not be a valid URL
      • getNamespace

        public String getNamespace()
        The default behavior of this method is to call getNamespace() on the wrapped response object.
        Specified by:
        getNamespace in interface PortletResponse
        Returns:
        the namespace
      • setProperty

        public void setProperty​(String key,
                                String value)
        The default behavior of this method is to call setProperty(key, value) on the wrapped response object.
        Specified by:
        setProperty in interface PortletResponse
        Parameters:
        key - the key of the property to be returned to the portal
        value - the value of the property to be returned to the portal
      • getResponse

        public PortletResponse getResponse()
        Return the wrapped response object.
        Returns:
        the wrapped response
      • setResponse

        public void setResponse​(PortletResponse response)
        Sets the response object being wrapped.
        Parameters:
        response - the response to set
        Throws:
        IllegalArgumentException - if the response is null.
      • addProperty

        public void addProperty​(String key,
                                Element element)
        The default behavior of this method is to call addProperty() on the wrapped response object.
        Specified by:
        addProperty in interface PortletResponse
        Parameters:
        key - the key of the property to be returned to the portal
        element - the XML DOM element to be added to the response
      • createElement

        public Element createElement​(String tagName)
        The default behavior of this method is to call createElement() on the wrapped response object.
        Specified by:
        createElement in interface PortletResponse
        Parameters:
        tagName - name of the element type to instantiate
        Returns:
        A new Element object with the nodeName attribute set to tagName, and localName, prefix, and namespaceURI set to null.
      • addProperty

        public void addProperty​(javax.servlet.http.Cookie cookie)
        The default behavior of this method is to call addProperty() on the wrapped response object.
        Specified by:
        addProperty in interface PortletResponse
        Parameters:
        cookie - the cookie to be added to the response