001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.cocoon.webapps.portal.components;
018:
019: import java.io.IOException;
020: import java.util.Map;
021:
022: import org.apache.cocoon.ProcessingException;
023: import org.apache.cocoon.environment.Redirector;
024: import org.apache.cocoon.webapps.session.context.SessionContext;
025: import org.apache.cocoon.xml.XMLConsumer;
026: import org.w3c.dom.Element;
027: import org.xml.sax.SAXException;
028:
029: /**
030: * This is the basis portal component
031: *
032: * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
033: * @version CVS $Id: PortalManager.java 433543 2006-08-22 06:22:54Z crossley $
034: */
035: public interface PortalManager {
036:
037: /** The avalon role */
038: String ROLE = PortalManager.class.getName();
039:
040: /** Values for the buildprofile type element */
041: String BUILDTYPE_VALUE_BASIC = "basic";
042: String BUILDTYPE_VALUE_GLOBAL = "global";
043: String BUILDTYPE_VALUE_ROLE = "role";
044: String BUILDTYPE_VALUE_ID = "user";
045:
046: /**
047: * The request parameters for customizing coplets
048: * The request parameter is <code>REQ_PARAMETER_CMD</code> and the
049: * the value is one from <code>REQ_CMD_</code> followed by
050: * '_<copletID>_<copletNR>'.
051: */
052: String REQ_PARAMETER_CMD = "portalcmd";
053:
054: String REQ_CMD_MAXIMIZE = "maximize";
055: String REQ_CMD_MINIMIZE = "minimize";
056: String REQ_CMD_CLOSE = "close";
057: String REQ_CMD_OPEN = "open";
058: String REQ_CMD_HIDE = "hide"; // synonym to close
059: String REQ_CMD_SHOW = "show"; // synonym to open
060: String REQ_CMD_CUSTOMIZE = "customize";
061: String REQ_CMD_UPDATE = "update";
062: String REQ_CMD_DELETE = "delete";
063: String REQ_CMD_MOVE = "move";
064: String REQ_CMD_NEW = "new";
065: String REQ_CMD_MOVEROW = "row"; // 1.1
066: String REQ_CMD_SAVEPROFILE = "save";
067:
068: /** This parameter is used for changing of profile value */
069: String REQ_PARAMETER_CONF = "portalconf";
070:
071: /** This parameter denotes the profile to be used */
072: String REQ_PARAMETER_PROFILE = "portalprofile";
073:
074: /** These parameter characterize the role and id */
075: String REQ_PARAMETER_ROLE = "portalrole";
076: String REQ_PARAMETER_ID = "portalid";
077: String REQ_PARAMETER_STATE = "portaladmin";
078: String REQ_PARAMETER_COPLET = "portalcoplet";
079: String REQ_PARAMETER_ADMIN_COPLETS = "portaladmin_coplets";
080:
081: /** This is the current role/id which is set in the context */
082: String ATTRIBUTE_PORTAL_ROLE = "role";
083: String ATTRIBUTE_PORTAL_ID = "ID";
084:
085: /** Some states for the admin configuration */
086: String ATTRIBUTE_ADMIN_STATE = "adminstate";
087: String ATTRIBUTE_ADMIN_ROLE = "adminrole";
088: String ATTRIBUTE_ADMIN_ID = "adminid";
089: String ATTRIBUTE_ADMIN_COPLETS = "admincoplets";
090:
091: /**
092: * Configure portal and check if it is allowed to see this coplet (if it is one).
093: * This is only a public wrapper for the getConfiguration method.
094: */
095: void configurationTest() throws ProcessingException, IOException,
096: SAXException;
097:
098: /**
099: * Include Portal URI into stream
100: */
101: void streamConfiguration(XMLConsumer consumer, String requestURI,
102: String profileID, String media, String contextID)
103: throws IOException, SAXException, ProcessingException;
104:
105: /**
106: * Show the admin configuration page.
107: */
108: void showAdminConf(XMLConsumer consumer) throws SAXException,
109: ProcessingException, IOException;
110:
111: /**
112: * Get the status profile
113: */
114: Element getStatusProfile() throws SAXException, IOException,
115: ProcessingException;
116:
117: /**
118: * Show the portal.
119: * The portal is included in the current stream.
120: */
121: void showPortal(XMLConsumer consumer, boolean configMode,
122: boolean adminProfile) throws SAXException,
123: ProcessingException, IOException;
124:
125: /**
126: * Check the authentication for the coplet. If it is not available do a redirect
127: */
128: boolean checkAuthentication(Redirector redirector, String copletID)
129: throws SAXException, IOException, ProcessingException;
130:
131: /**
132: * Get the current media type
133: */
134: String getMediaType() throws ProcessingException;
135:
136: /**
137: * Get the portal context of the current application
138: */
139: SessionContext getContext(boolean create)
140: throws ProcessingException, IOException, SAXException;
141:
142: /**
143: * Builds the key for caching
144: */
145: String getProfileID(String type, String role, String id,
146: boolean adminProfile) throws ProcessingException;
147:
148: /**
149: * Retrieve the profil
150: */
151: Map retrieveProfile(String profileID) throws ProcessingException;
152:
153: }
|