01: /**
02: * Copyright 2003 IBM Corporation and Sun Microsystems, Inc.
03: * All rights reserved.
04: * Use is subject to license terms.
05: */package javax.portlet;
06:
07: /**
08: * The <CODE>PortletResponse</CODE> defines the base interface to assist a
09: * portlet in creating and sending a response to the client.
10: * The portlet container uses two specialized versions of this interface
11: * when invoking a portlet, <CODE>ActionResponse</CODE> and
12: * <CODE>RenderResponse</CODE>. The portlet container creates these
13: * objects and passes them as arguments to the portlet's <CODE>processAction</CODE>
14: * and <CODE>render</CODE> methods.
15: *
16: * @see ActionResponse
17: * @see RenderResponse
18: */
19: public interface PortletResponse {
20:
21: /**
22: * Adds a String property to an existing key to be returned to the portal.
23: * <p>
24: * This method allows response properties to have multiple values.
25: * <p>
26: * Properties can be used by portlets to provide vendor specific
27: * information to the portal.
28: *
29: * @param key the key of the property to be returned to the portal
30: * @param value the value of the property to be returned to the portal
31: *
32: * @exception java.lang.IllegalArgumentException
33: * if key is <code>null</code>.
34: */
35:
36: public void addProperty(String key, String value);
37:
38: /**
39: * Sets a String property to be returned to the portal.
40: * <p>
41: * Properties can be used by portlets to provide vendor specific
42: * information to the portal.
43: * <p>
44: * This method resets all properties previously added with the same key.
45: *
46: * @param key the key of the property to be returned to the portal
47: * @param value the value of the property to be returned to the portal
48: *
49: * @exception java.lang.IllegalArgumentException
50: * if key is <code>null</code>.
51: */
52:
53: public void setProperty(String key, String value);
54:
55: /**
56: * Returns the encoded URL of the resource, like servlets,
57: * JSPs, images and other static files, at the given path.
58: * <p>
59: * Some portal/portlet-container implementation may require
60: * those URLs to contain implementation specific data encoded
61: * in it. Because of that, portlets should use this method to
62: * create such URLs.
63: * <p>
64: * The <code>encodeURL</code> method may include the session ID
65: * and other portal/portlet-container specific information into the URL.
66: * If encoding is not needed, it returns the URL unchanged.
67: *
68: * @param path
69: * the URI path to the resource. This must be either
70: * an absolute URL (e.g.
71: * <code>http://my.co/myportal/mywebap/myfolder/myresource.gif</code>)
72: * or a full path URI (e.g. <code>/myportal/mywebap/myfolder/myresource.gif</code>).
73: *
74: * @exception java.lang.IllegalArgumentException
75: * if path doesn't have a leading slash or is not an absolute URL
76: *
77: * @return the encoded resource URL as string
78: */
79:
80: public String encodeURL(String path);
81:
82: }
|