KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jetspeed > portlet > PortletConfig


1 /* ====================================================================
2  * The Apache Software License, Version 1.1
3  *
4  * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
5  * reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in
16  * the documentation and/or other materials provided with the
17  * distribution.
18  *
19  * 3. The end-user documentation included with the redistribution,
20  * if any, must include the following acknowledgment:
21  * "This product includes software developed by the
22  * Apache Software Foundation (http://www.apache.org/)."
23  * Alternately, this acknowledgment may appear in the software itself,
24  * if and wherever such third-party acknowledgments normally appear.
25  *
26  * 4. The names "Apache" and "Apache Software Foundation" and
27  * "Apache Jetspeed" must not be used to endorse or promote products
28  * derived from this software without prior written permission. For
29  * written permission, please contact apache@apache.org.
30  *
31  * 5. Products derived from this software may not be called "Apache" or
32  * "Apache Jetspeed", nor may "Apache" appear in their name, without
33  * prior written permission of the Apache Software Foundation.
34  *
35  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
36  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
37  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
38  * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
39  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
41  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
42  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
43  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
44  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
45  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46  * SUCH DAMAGE.
47  * ====================================================================
48  *
49  * This software consists of voluntary contributions made by many
50  * individuals on behalf of the Apache Software Foundation. For more
51  * information on the Apache Software Foundation, please see
52  * <http://www.apache.org/>.
53  */

54
55 package org.apache.jetspeed.portlet;
56
57 import java.util.Enumeration JavaDoc;
58 import java.util.Locale JavaDoc;
59
60 /**
61  ** The <CODE>PortletConfig</CODE> interface provides the portlet with
62  ** its configuration. The configuration holds information about
63  ** the portlet that is valid for all users, and is
64  ** maintained by the administrator. The portlet can therefore only
65  ** read the configuration. Only when the portlet is in CONFIGURE mode,
66  ** it has write access to the configuartion data (the rest of the configuration
67  ** is managed by the portlet container directly).
68  **
69  ** @see Portlet
70  **
71  ** @author <A HREF="mailto:tboehme@us.ibm.com">Thomas F. Boehme</A>
72  **/

73
74 public interface PortletConfig
75 {
76     /**
77      ** Returns the name of the portlet. The portlet container needs the
78      ** portlet name for internal and administration purposes.
79      **
80      ** @return the portlet name
81      **/

82
83     public String JavaDoc getName ();
84
85     /**
86      ** Sets the attribute with the given name and value.
87      **
88      ** @param name
89      ** the attribute name
90      ** @param value
91      ** the attribute value
92      **
93      ** @exception AccessDeniedException
94      ** if the caller isn't authorized to access
95      ** this data object
96      **/

97
98     public void setAttribute (String JavaDoc name, String JavaDoc value) throws AccessDeniedException;
99
100     /**
101      ** Returns the value of the attribute with the given name,
102      ** or <CODE>null</CODE> if no such attribute exists.
103      **
104      ** @param name
105      ** the attribute name
106      **
107      ** @return the attribute value
108      **
109      ** @exception AccessDeniedException
110      ** if the caller isn't authorized to access
111      ** this data object
112      **/

113
114     public String JavaDoc getAttribute (String JavaDoc name) throws AccessDeniedException;
115
116     /**
117      ** Returns an enumeration of all available attributes names.
118      **
119      ** @return an enumeration of attribute names
120      **
121      ** @exception AccessDeniedException
122      ** if the caller isn't authorized to access
123      ** this data object
124      **
125      ** @see #getAttribute(String)
126      **/

127
128     public Enumeration JavaDoc getAttributeNames () throws AccessDeniedException;
129
130     /**
131      ** Removes the attribute with the given name. If no such
132      ** attribute exists, this method does nothing.
133      **
134      ** @param name
135      ** the attribute name
136      **
137      ** @exception AccessDeniedException
138      ** if the caller isn't authorized to access
139      ** this data object
140      **/

141
142     public void removeAttribute (String JavaDoc name) throws AccessDeniedException;
143
144     /**
145      ** Returns the title of this window. This method returns
146      ** only a static title from the portlet configuration.
147      **
148      ** @param locale
149      ** the locale
150      ** @param client
151      ** the client
152      **
153      ** @return the text of the portlet title
154      **/

155
156     public String JavaDoc getTitle (Locale JavaDoc locale,
157                             Client client);
158
159     /**
160      * Returns whether the portlet window supports the given state
161      *
162      * @param state the portlet window state to be supported
163      * @return <CODE>true</CODE> if the portlet window provides support, <BR>
164      * <CODE>false</CODE> otherwise
165      * @see PortletWindow.State
166      */

167     public boolean supports (PortletWindow.State state);
168
169     /**
170      ** Returns whether the portlet supports the given locale.
171      **
172      ** @param locale
173      ** the locale to be supported
174      **
175      ** @return <CODE>true</CODE> if the portlet provides support, <BR>
176      ** <CODE>false</CODE> otherwise
177      **/

178
179     public boolean supports (Locale JavaDoc locale);
180
181     /**
182      * Returns whether the portlet supports the given mode for
183      * the given client.
184      *
185      * @param mode
186      * the portlet mode to be supported
187      * @param client
188      * the client to be supported
189      * @return <CODE>true</CODE> if the portlet provides support, <BR>
190      * <CODE>false</CODE> otherwise
191      * @see Portlet.Mode
192      */

193     public boolean supports (Portlet.Mode mode, Client client);
194
195     /**
196      ** Returns the portlet context.
197      **
198      ** @return the portlet context
199      **/

200
201     public PortletContext getContext ();
202 }
203
Popular Tags