|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PortletResponse
The PortletResponse
defines the base interface to assist a
portlet in creating and sending a response to the client. The portlet
container uses specialized versions of this interface when invoking a
portlet.
The portlet container creates these objects and passes them as arguments to
the portlet's processAction, processEvent, serveResource
and render
methods.
ActionResponse
,
RenderResponse
,
EventResponse
,
ResourceResponse
Method Summary | |
---|---|
void |
addProperty(String key,
Element element)
Adds an XML DOM element property to the response. |
void |
addProperty(String key,
String value)
Adds a String property to an existing key to be returned to the portal. |
Element |
createElement(String tagName)
Creates an element of the type specified to be used in the addProperty method. |
String |
encodeURL(String path)
Returns the encoded URL of the resource, like servlets, JSPs, images and other static files, at the given path. |
String |
getNamespace()
The value returned by this method should be prefixed or appended to elements, such as JavaScript variables or function names, to ensure they are unique in the context of the portal page. |
void |
setProperty(String key,
String value)
Sets a String property to be returned to the portal. |
Method Detail |
---|
void addProperty(String key, String value)
This method allows response properties to have multiple values.
Properties can be used by portlets to provide vendor specific information to the portal.
key
- the key of the property to be returned to the portalvalue
- the value of the property to be returned to the portal
IllegalArgumentException
- if key is null
.void setProperty(String key, String value)
Properties can be used by portlets to provide vendor specific information to the portal.
This method resets all properties previously added with the same key.
key
- the key of the property to be returned to the portalvalue
- the value of the property to be returned to the portal
IllegalArgumentException
- if key is null
.String encodeURL(String path)
Portlets should encode all resource URLs pointing to resources in the portlet application via this method in order to ensure that they get served via the portal application.
Some portal/portlet-container implementation may require those URLs to contain implementation specific data encoded in it. Because of that, portlets should use this method to create such URLs.
The encodeURL
method may include the session ID and other
portal/portlet-container specific information into the URL. If encoding
is not needed, it returns the URL unchanged.
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
).
IllegalArgumentException
- if path doesn't have a leading slash or is not an absolute
URLString getNamespace()
The namespace value must be constant for the lifetime of the portlet window.
void addProperty(String key, Element element)
If a DOM element with the provided key already exists the provided element will be stored in addition to the existing element under the same key.
If the element is null
the key is removed from
the response.
Properties can be used by portlets to provide vendor specific information to the portal.
key
- the key of the property to be returned to the portalelement
- the XML DOM element to be added to the response
IllegalArgumentException
- if key is null
.Element createElement(String tagName) throws DOMException
addProperty
method.
tagName
- name of the element type to instantiate
DOMException
- INVALID_CHARACTER_ERR: Raised if the specified name
contains an illegal character.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |