KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > webapps > portal > components > PortalManager


1 /*
2  * Copyright 1999-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.webapps.portal.components;
17
18 import java.io.IOException JavaDoc;
19 import java.util.Map JavaDoc;
20
21 import org.apache.cocoon.ProcessingException;
22 import org.apache.cocoon.environment.Redirector;
23 import org.apache.cocoon.webapps.session.context.SessionContext;
24 import org.apache.cocoon.xml.XMLConsumer;
25 import org.w3c.dom.Element JavaDoc;
26 import org.xml.sax.SAXException JavaDoc;
27
28 /**
29  * This is the basis portal component
30  *
31  * @author <a HREF="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
32  * @version CVS $Id: PortalManager.java 30932 2004-07-29 17:35:38Z vgritsenko $
33 */

34 public interface PortalManager {
35
36     /** The avalon role */
37     String JavaDoc ROLE = PortalManager.class.getName();
38
39     /** Values for the buildprofile type element */
40     String JavaDoc BUILDTYPE_VALUE_BASIC = "basic";
41     String JavaDoc BUILDTYPE_VALUE_GLOBAL = "global";
42     String JavaDoc BUILDTYPE_VALUE_ROLE = "role";
43     String JavaDoc BUILDTYPE_VALUE_ID = "user";
44
45     /**
46      * The request parameters for customizing coplets
47      * The request parameter is <code>REQ_PARAMETER_CMD</code> and the
48      * the value is one from <code>REQ_CMD_</code> followed by
49      * '_<copletID>_<copletNR>'.
50      */

51     String JavaDoc REQ_PARAMETER_CMD = "portalcmd";
52
53     String JavaDoc REQ_CMD_MAXIMIZE = "maximize";
54     String JavaDoc REQ_CMD_MINIMIZE = "minimize";
55     String JavaDoc REQ_CMD_CLOSE = "close";
56     String JavaDoc REQ_CMD_OPEN = "open";
57     String JavaDoc REQ_CMD_HIDE = "hide"; // synonym to close
58
String JavaDoc REQ_CMD_SHOW = "show"; // synonym to open
59
String JavaDoc REQ_CMD_CUSTOMIZE= "customize";
60     String JavaDoc REQ_CMD_UPDATE = "update";
61     String JavaDoc REQ_CMD_DELETE = "delete";
62     String JavaDoc REQ_CMD_MOVE = "move";
63     String JavaDoc REQ_CMD_NEW = "new";
64     String JavaDoc REQ_CMD_MOVEROW = "row"; // 1.1
65
String JavaDoc REQ_CMD_SAVEPROFILE = "save";
66
67     /** This parameter is used for changing of profile value */
68     String JavaDoc REQ_PARAMETER_CONF = "portalconf";
69
70     /** This parameter denotes the profile to be used */
71     String JavaDoc REQ_PARAMETER_PROFILE = "portalprofile";
72
73     /** These parameter characterize the role and id */
74     String JavaDoc REQ_PARAMETER_ROLE = "portalrole";
75     String JavaDoc REQ_PARAMETER_ID = "portalid";
76     String JavaDoc REQ_PARAMETER_STATE= "portaladmin";
77     String JavaDoc REQ_PARAMETER_COPLET= "portalcoplet";
78     String JavaDoc REQ_PARAMETER_ADMIN_COPLETS = "portaladmin_coplets";
79
80     /** This is the current role/id which is set in the context */
81     String JavaDoc ATTRIBUTE_PORTAL_ROLE = "role";
82     String JavaDoc ATTRIBUTE_PORTAL_ID = "ID";
83
84     /** Some states for the admin configuration */
85     String JavaDoc ATTRIBUTE_ADMIN_STATE = "adminstate";
86     String JavaDoc ATTRIBUTE_ADMIN_ROLE = "adminrole";
87     String JavaDoc ATTRIBUTE_ADMIN_ID = "adminid";
88     String JavaDoc ATTRIBUTE_ADMIN_COPLETS = "admincoplets";
89
90     /**
91      * Configure portal and check if it is allowed to see this coplet (if it is one).
92      * This is only a public wrapper for the getConfiguration method.
93      */

94     void configurationTest()
95     throws ProcessingException, IOException JavaDoc, SAXException JavaDoc;
96
97     /**
98      * Include Portal URI into stream
99      */

100     void streamConfiguration(XMLConsumer consumer,
101                              String JavaDoc requestURI,
102                              String JavaDoc profileID,
103                              String JavaDoc media,
104                              String JavaDoc contextID)
105     throws IOException JavaDoc, SAXException JavaDoc, ProcessingException;
106
107     /**
108      * Show the admin configuration page.
109      */

110     void showAdminConf(XMLConsumer consumer)
111     throws SAXException JavaDoc, ProcessingException, IOException JavaDoc;
112
113     /**
114      * Get the status profile
115      */

116     Element JavaDoc getStatusProfile()
117     throws SAXException JavaDoc, IOException JavaDoc, ProcessingException;
118
119     /**
120      * Show the portal.
121      * The portal is included in the current stream.
122      */

123     void showPortal(XMLConsumer consumer,
124                     boolean configMode,
125                     boolean adminProfile)
126     throws SAXException JavaDoc, ProcessingException, IOException JavaDoc;
127
128     /**
129      * Check the authentication for the coplet. If it is not available do a redirect
130      */

131     boolean checkAuthentication(Redirector redirector, String JavaDoc copletID)
132     throws SAXException JavaDoc, IOException JavaDoc, ProcessingException;
133         
134     /**
135      * Get the current media type
136      */

137     String JavaDoc getMediaType()
138     throws ProcessingException;
139
140     /**
141      * Get the portal context of the current application
142      */

143     SessionContext getContext(boolean create)
144     throws ProcessingException, IOException JavaDoc, SAXException JavaDoc;
145
146     /**
147      * Builds the key for caching
148      */

149     String JavaDoc getProfileID(String JavaDoc type,
150                         String JavaDoc role,
151                         String JavaDoc id,
152                         boolean adminProfile)
153     throws ProcessingException;
154     
155     /**
156      * Retrieve the profil
157      */

158     Map JavaDoc retrieveProfile(String JavaDoc profileID)
159     throws ProcessingException;
160         
161 }
162
Popular Tags