View Javadoc

1   /*
2    * Copyright 2000-2001,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  package org.apache.jetspeed.services.rundata;
18  
19  import org.apache.jetspeed.portal.Portlet;
20  import org.apache.jetspeed.om.profile.Profile;
21  import org.apache.jetspeed.capability.CapabilityMap;
22  import org.apache.jetspeed.services.statemanager.SessionState;
23  import org.apache.turbine.services.rundata.TurbineRunData;
24  import org.apache.jetspeed.om.security.JetspeedUser;
25  
26  /***
27   * This interface extends the RunData interface with methods
28   * specific to the needs of a Jetspeed like portal implementation.
29   *
30   * <note>Several of these properties may be put in the base RunData
31   * interface in future releases of Turbine</note>
32   *
33   * @author <a href="mailto:raphael@apache.org">Raphaël Luta</a>
34   * @version $Id: JetspeedRunData.java,v 1.10 2004/02/23 03:36:10 jford Exp $
35   */
36  public interface JetspeedRunData extends TurbineRunData
37  {
38  
39      public int NORMAL = 0;
40      public int CUSTOMIZE = 1;
41      public int MAXIMIZE = 2;
42  
43      /***
44       * Returns the Jetspeed User (same as getUser without cast)
45       *
46       * @return the current user.
47       */
48      public JetspeedUser getJetspeedUser();
49  
50      /***
51       * Returns the portlet id referenced in this request
52       *
53       * @return the portlet id referenced or null
54       */
55      public String getPortlet();
56  
57      /***
58       * Returns the portlet id (PEID) referenced in this request
59       *
60       * @return the portlet id (PEID) referenced or null
61       */
62      public String getJs_peid();
63  
64      /***
65       * Sets the portlet id referenced for this request
66       *
67       * @param id the portlet id referenced in this request
68       */
69      public void setPortlet(String id);
70  
71      /***
72       * Sets the portlet id (PEID) referenced for this request
73       *
74       * @param id the portlet id (PEID) referenced in this request
75       */
76      public void setJs_peid(String peid);
77  
78      /***
79       * Returns the portlet id which should be customized for this request
80       *
81       * @return the portlet id being customized or null
82       */
83      public Portlet getCustomized();
84  
85      /***
86       * Sets the portlet id to customize
87       *
88       * @param id the portlet id to customize or null;
89       */
90      public void setCustomized(Portlet p);
91  
92      /***
93      * Get the psml profile being customized.
94      * @return the Profile being customized.
95      */
96      public Profile getCustomizedProfile();
97  
98      /***
99      * Set the psml profile being customized.
100     * @param profile The Profile being customized.
101     */
102     public void setCustomizedProfile(Profile profile);
103 
104     /***
105     * Clean up from customization
106     */
107     public void cleanupFromCustomization();
108 
109     /***
110      * Returns the portlet id which should be maximized for this request
111      *
112      * @return the portlet id being maximized or null
113      */
114     public int getMode();
115 
116     /***
117      * Sets the portlet id to maximize
118      *
119      * @param id the portlet id to maximize or null;
120      */
121     public void setMode(int mode);
122 
123     /***
124      * Sets the portlet id to maximize
125      *
126      * @param id the portlet id to maximize or null;
127      */
128     public void setMode(String mode);
129 
130     /***
131      * Returns the template path as requested from the parameters
132      */
133     public String getRequestedTemplate();
134 
135     /***
136      * Sets the template path as requested from the parameters
137      */
138     public void setRequestedTemplate(String id);
139 
140     /***
141      * Returns the capability map for the user agent issuing this request
142      *
143      * @return a capability map objet
144      */
145     public CapabilityMap getCapability();
146 
147     /***
148      * Gets the user portal profile for the current request
149      *
150      * @return a profile implementation for the current request
151      */
152     public Profile getProfile();
153 
154     /***
155      * Sets the user portal profile for the current request
156      *
157      * @param profile a profile implementation for the current request
158      */
159     public void setProfile(Profile profile);
160 
161     /***
162      * Get the user id for the current user.
163      * This method is provided as an abstraction to the very implementation
164      * specific method of retrieving user ids in Turbine.
165      *
166      * @return String The current user's id.
167      */
168     public String getUserId();
169 
170     /***
171      * Access an identifier for the current request's PageSession.
172      * A PageSession is a specific portal page being viewed in a specific
173      * user session (and perhaps, but not yet [@todo] in a specific browser window).
174      * @return the identifier for the current request's PageSession.
175      */
176     public String getPageSessionId();
177 
178     /***
179      * Access the current request's UserSession state object.
180      * @return the current request's UserSession state object (may be null).
181      */
182     public SessionState getUserSessionState();
183 
184     /***
185      * Access the current request's PageSession state object.
186      * @return the current request's PageSession state object (may be null).
187      */
188     public SessionState getPageSessionState();
189 
190     /***
191      * Access the current request's PortletSession state object.
192      * @param id The Portlet's unique id.
193      * @return the current request's PortletSession state object. (may be null).
194      */
195     public SessionState getPortletSessionState(String id);
196 
197 }
198