View Javadoc

1   /*
2    * Copyright 2003,2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  /*
17   * This source code implements specifications defined by the Java
18   * Community Process. In order to remain compliant with the specification
19   * DO NOT add / change / or delete method signatures!
20   */
21  package javax.portlet;
22  
23  
24  
25  /***
26   * The <CODE>PortalContext</CODE> interface gives the portlet
27   * the ability to retrieve information about the portal calling this portlet.
28   * <p>
29   * The portlet can only read the <CODE>PortalContext</CODE> data.
30   */
31  public interface PortalContext
32  {
33  
34  
35    
36    /***
37     * Returns the portal property with the given name, 
38     * or a <code>null</code> if there is 
39     * no property by that name.
40     *
41     * @param  name    property name
42     *
43     * @return  portal property with key <code>name</code>
44     *
45     * @exception	java.lang.IllegalArgumentException	
46     *                      if name is <code>null</code>.
47     */
48  
49    public java.lang.String getProperty(java.lang.String name);
50  
51  
52    /***
53     * Returns all portal property names, or an empty 
54     * <code>Enumeration</code> if there are no property names.
55     *
56     * @return  All portal property names as an 
57     *          <code>Enumeration</code> of <code>String</code> objects
58     */
59    public java.util.Enumeration getPropertyNames();
60  
61  
62    /***
63     * Returns all supported portlet modes by the portal
64     * as an enumertation of <code>PorltetMode</code> objects.
65     * <p>
66     * The portlet modes must at least include the
67     * standard portlet modes <code>EDIT, HELP, VIEW</code>.
68     *
69     * @return  All supported portal modes by the portal
70     *          as an enumertation of <code>PorltetMode</code> objects.
71     */
72  
73    public java.util.Enumeration getSupportedPortletModes();
74  
75  
76    /***
77     * Returns all supported window states by the portal
78     * as an enumertation of <code>WindowState</code> objects.
79     * <p>
80     * The window states must at least include the
81     * standard window states <code> MINIMIZED, NORMAL, MAXIMIZED</code>.
82     *
83     * @return  All supported window states by the portal
84     *          as an enumertation of <code>WindowState</code> objects.
85     */
86  
87    public java.util.Enumeration getSupportedWindowStates();
88  
89  
90    /***
91     * Returns information about the portal like vendor, version, etc.
92     * <p>
93     * The form of the returned string is <I>servername/versionnumber</I>. For 
94     * example, the reference implementation Pluto may return the string 
95     * <CODE>Pluto/1.0</CODE>.
96     * <p>
97     * The portlet container may return other optional information  after the 
98     * primary string in parentheses, for example, <CODE>Pluto/1.0 
99     * (JDK 1.3.1; Windows NT 4.0 x86)</CODE>.
100    * 
101    * @return a <CODE>String</CODE> containing at least the portal name and version number
102    */
103 
104   public java.lang.String getPortalInfo();
105 }