KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > portal > profile > ProfileManager


1 /*
2  * Copyright 1999-2002,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 package org.apache.cocoon.portal.profile;
17
18 import java.util.Collection JavaDoc;
19 import java.util.List JavaDoc;
20
21 import org.apache.avalon.framework.component.Component;
22 import org.apache.cocoon.portal.coplet.CopletData;
23 import org.apache.cocoon.portal.coplet.CopletInstanceData;
24 import org.apache.cocoon.portal.layout.Layout;
25
26 /**
27  * The profile manager.
28  * Via this component you can get the profile (or parts of it) of the
29  * current 'user'.
30  *
31  * @author <a HREF="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
32  * @author <a HREF="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
33  *
34  * @version CVS $Id: ProfileManager.java 149059 2005-01-29 19:05:22Z cziegeler $
35  */

36 public interface ProfileManager extends Component {
37     
38     String JavaDoc ROLE = ProfileManager.class.getName();
39     
40     /**
41      * Get the portal layout defined by the layout key. This
42      * usually addresses the layout profile.
43      * With the optional subKey it's possible to retrieve
44      * a specific layout object in the profile defined by
45      * the layout key.
46      * @param layoutKey A key describing the layout or null for the default
47      * @param layoutID The id of a layout object or null for the root object
48      * @return The layout
49      */

50     Layout getPortalLayout(String JavaDoc layoutKey, String JavaDoc layoutID);
51     
52     CopletInstanceData getCopletInstanceData(String JavaDoc copletID);
53     
54     List JavaDoc getCopletInstanceData(CopletData data);
55     
56     /**
57      * Return the coplet data object
58      */

59     CopletData getCopletData(String JavaDoc copletDataId);
60     
61     /**
62      * This method is invoked when the user logs into the portal.
63      */

64     void login();
65     
66     /**
67      * This method is invoked when the user logs out of the portal
68      *
69      */

70     void logout();
71     
72     /**
73      * New coplet instance datas have to be registered using this method.
74      */

75     void register(CopletInstanceData coplet);
76     
77     /**
78      * Removed coplet instance datas have to be unregistered using this method.
79      */

80     void unregister(CopletInstanceData coplet);
81
82     /**
83      * New layouts have to be registered using this method.
84      */

85     void register(Layout layout);
86     
87     /**
88      * New layouts have to be unregistered using this method.
89      */

90     void unregister(Layout layout);
91
92     /**
93      * Save the profile. Usually this just calls {@link #saveUserCopletInstanceDatas(String)}
94      * and {@link #saveUserLayout(String)}, but implementations are free to
95      * implement this method in a different way.
96      * @param layoutKey
97      */

98     void saveUserProfiles(String JavaDoc layoutKey);
99
100     /**
101      * Save the layout
102      * @param layoutKey
103      */

104     void saveUserLayout(String JavaDoc layoutKey);
105
106     /**
107      * Save the coplet instance data
108      * @param layoutKey
109      */

110     void saveUserCopletInstanceDatas(String JavaDoc layoutKey);
111
112     /**
113      * Get all instances
114      */

115     Collection JavaDoc getCopletInstanceDatas();
116     
117     /**
118      * Get all coplets
119      */

120     Collection JavaDoc getCopletDatas();
121     
122     /**
123      * Store the provided profile under the layoutKey.
124      * This method can be used to overwrite a profile with another
125      * one.
126      */

127     void storeProfile(Layout rootLayout, String JavaDoc layoutKey);
128     
129     /**
130      * Get current user information
131      */

132     PortalUser getUser();
133 }
134
Popular Tags