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: * @throws java.lang.IllegalArgumentException
32: * if key is <code>null</code>.
33: */
34:
35: public void addProperty(String key, String value);
36:
37: /**
38: * Sets a String property to be returned to the portal.
39: * <p/>
40: * Properties can be used by portlets to provide vendor specific
41: * information to the portal.
42: * <p/>
43: * This method resets all properties previously added with the same key.
44: *
45: * @param key the key of the property to be returned to the portal
46: * @param value the value of the property to be returned to the portal
47: * @throws java.lang.IllegalArgumentException
48: * if key is <code>null</code>.
49: */
50:
51: public void setProperty(String key, String value);
52:
53: /**
54: * Returns the encoded URL of the resource, like servlets,
55: * JSPs, images and other static files, at the given path.
56: * <p/>
57: * Some portal/portlet-container implementation may require
58: * those URLs to contain implementation specific data encoded
59: * in it. Because of that, portlets should use this method to
60: * create such URLs.
61: * <p/>
62: * The <code>encodeURL</code> method may include the session ID
63: * and other portal/portlet-container specific information into the URL.
64: * If encoding is not needed, it returns the URL unchanged.
65: *
66: * @param path the URI path to the resource. This must be either
67: * an absolute URL (e.g.
68: * <code>http://my.co/myportal/mywebap/myfolder/myresource.gif</code>)
69: * or a full path URI (e.g. <code>/myportal/mywebap/myfolder/myresource.gif</code>).
70: * @return the encoded resource URL as string
71: * @throws java.lang.IllegalArgumentException
72: * if path doesn't have a leading slash or is not an absolute URL
73: */
74:
75: public String encodeURL(String path);
76:
77: }
|