KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > portlet > ActionResponse


1 /**
2   * Copyright 2003 IBM Corporation and Sun Microsystems, Inc.
3   * All rights reserved.
4   * Use is subject to license terms.
5   */

6
7 package javax.portlet;
8
9
10 /**
11  * The <CODE>ActionResponse</CODE> interface represents the portlet
12  * response to an action request.
13  * It extends the <CODE>PortletResponse</CODE> interface to provide specific
14  * action response functionality to portlets.<br>
15  * The portlet container creates an <CODE>ActionResponse</CODE> object and
16  * passes it as argument to the portlet's <CODE>processAction</CODE> method.
17  *
18  * @see ActionRequest
19  * @see PortletResponse
20  */

21 public interface ActionResponse extends PortletResponse
22 {
23
24   /**
25    * Sets the window state of a portlet to the given window state.
26    * <p>
27    * Possible values are the standard window states and any custom
28    * window states supported by the portal and the portlet.
29    * Standard window states are:
30    * <ul>
31    * <li>MINIMIZED
32    * <li>NORMAL
33    * <li>MAXIMIZED
34    * </ul>
35    *
36    * @param windowState
37    * the new portlet window state
38    *
39    * @exception WindowStateException
40    * if the portlet cannot switch to the specified window state.
41    * To avoid this exception the portlet can check the allowed
42    * window states with <code>Request.isWindowStateAllowed()</code>.
43    * @exception java.lang.IllegalStateException
44    * if the method is invoked after <code>sendRedirect</code> has been called.
45    *
46    * @see WindowState
47    */

48
49   public void setWindowState (WindowState windowState)
50     throws WindowStateException;
51
52
53   /**
54    * Sets the portlet mode of a portlet to the given portlet mode.
55    * <p>
56    * Possible values are the standard portlet modes and any custom
57    * portlet modes supported by the portal and the portlet. Portlets
58    * must declare in the deployment descriptor the portlet modes they
59    * support for each markup type.
60    * Standard portlet modes are:
61    * <ul>
62    * <li>EDIT
63    * <li>HELP
64    * <li>VIEW
65    * </ul>
66    * <p>
67    * Note: The portlet may still be called in a different window
68    * state in the next render call, depending on the portlet container / portal.
69    *
70    * @param portletMode
71    * the new portlet mode
72    *
73    * @exception PortletModeException
74    * if the portlet cannot switch to this portlet mode,
75    * because the portlet or portal does not support it for this markup,
76    * or the current user is not allowed to switch to this portlet mode.
77    * To avoid this exception the portlet can check the allowed
78    * portlet modes with <code>Request.isPortletModeAllowed()</code>.
79    * @exception java.lang.IllegalStateException
80    * if the method is invoked after <code>sendRedirect</code> has been called.
81    */

82
83   public void setPortletMode (PortletMode portletMode)
84     throws PortletModeException;
85
86
87   /**
88    * Instructs the portlet container to send a redirect response
89    * to the client using the specified redirect location URL.
90    * <p>
91    * This method only accepts an absolute URL (e.g.
92    * <code>http://my.co/myportal/mywebap/myfolder/myresource.gif</code>)
93    * or a full path URI (e.g. <code>/myportal/mywebap/myfolder/myresource.gif</code>).
94    * If required,
95    * the portlet container may encode the given URL before the
96    * redirection is issued to the client.
97    * <p>
98    * The sendRedirect method can not be invoked after any of the
99    * following methods of the ActionResponse interface has been called:
100    * <ul>
101    * <li>setPortletMode
102    * <li>setWindowState
103    * <li>setRenderParameter
104    * <li>setRenderParameters
105    * </ul>
106    *
107    * @param location the redirect location URL
108    *
109    * @exception java.io.IOException
110    * if an input or output exception occurs.
111    * @exception java.lang.IllegalArgumentException
112    * if a relative path URL is given
113    * @exception java.lang.IllegalStateException
114    * if the method is invoked after any of above mentioned methods of
115    * the ActionResponse interface has been called.
116    */

117
118   public void sendRedirect(String JavaDoc location)
119     throws java.io.IOException JavaDoc;
120
121
122   /**
123    * Sets a parameter map for the render request.
124    * <p>
125    * All previously set render parameters are cleared.
126    * <p>
127    * These parameters will be accessible in all
128    * sub-sequent render calls via the
129    * <code>PortletRequest.getParameter</code> call until
130    * a new request is targeted to the portlet.
131    * <p>
132    * The given parameters do not need to be encoded
133    * prior to calling this method.
134    *
135    * @param parameters Map containing parameter names for
136    * the render phase as
137    * keys and parameter values as map
138    * values. The keys in the parameter
139    * map must be of type String. The values
140    * in the parameter map must be of type
141    * String array (<code>String[]</code>).
142    *
143    * @exception java.lang.IllegalArgumentException
144    * if parameters is <code>null</code>, if
145    * any of the key/values in the Map are <code>null</code>,
146    * if any of the keys is not a String, or if any of
147    * the values is not a String array.
148    * @exception java.lang.IllegalStateException
149    * if the method is invoked after <code>sendRedirect</code> has been called.
150    */

151
152   public void setRenderParameters(java.util.Map JavaDoc parameters);
153
154
155   /**
156    * Sets a String parameter for the render request.
157    * <p>
158    * These parameters will be accessible in all
159    * sub-sequent render calls via the
160    * <code>PortletRequest.getParameter</code> call until
161    * a request is targeted to the portlet.
162    * <p>
163    * This method replaces all parameters with the given key.
164    * <p>
165    * The given parameter do not need to be encoded
166    * prior to calling this method.
167    *
168    * @param key key of the render parameter
169    * @param value value of the render parameter
170    *
171    * @exception java.lang.IllegalArgumentException
172    * if key or value are <code>null</code>.
173    * @exception java.lang.IllegalStateException
174    * if the method is invoked after <code>sendRedirect</code> has been called.
175    */

176
177   public void setRenderParameter(String JavaDoc key, String JavaDoc value);
178
179
180   /**
181    * Sets a String array parameter for the render request.
182    * <p>
183    * These parameters will be accessible in all
184    * sub-sequent render calls via the
185    * <code>PortletRequest.getParameter</code> call until
186    * a request is targeted to the portlet.
187    * <p>
188    * This method replaces all parameters with the given key.
189    * <p>
190    * The given parameter do not need to be encoded
191    * prior to calling this method.
192    *
193    * @param key key of the render parameter
194    * @param values values of the render parameter
195    *
196    * @exception java.lang.IllegalArgumentException
197    * if key or value are <code>null</code>.
198    * @exception java.lang.IllegalStateException
199    * if the method is invoked after <code>sendRedirect</code> has been called.
200    */

201
202   public void setRenderParameter(String JavaDoc key, String JavaDoc[] values);
203
204
205 }
206
207
208
Popular Tags