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.portal;
018:
019: import java.util.Iterator;
020: import java.util.List;
021: import java.util.Map;
022:
023: import org.apache.avalon.framework.component.Component;
024: import org.apache.cocoon.portal.layout.Layout;
025:
026: /**
027: * This is the central component in the portal. It holds the configuration
028: * of the portal, the current name etc.
029: * The main use of this component is to get the {@link PortalComponentManager}
030: * to get all the other portal components.
031: * This component is a singleton.
032: *
033: * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
034: * @author <a href="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
035: *
036: * @version CVS $Id: PortalService.java 433543 2006-08-22 06:22:54Z crossley $
037: */
038: public interface PortalService extends Component {
039:
040: /** The role to lookup this component. */
041: String ROLE = PortalService.class.getName();
042:
043: /**
044: * The name of the portal - as defined in the portal configuration.
045: */
046: String getPortalName();
047:
048: void setPortalName(String value);
049:
050: /**
051: * Return the value of an attribute
052: * @param key The key of the attribute
053: * @return The value of the attribute or null.
054: */
055: Object getAttribute(String key);
056:
057: /**
058: * Set an attribute
059: * @param key The key of the attribute
060: * @param value The new value
061: */
062: void setAttribute(String key, Object value);
063:
064: /**
065: * Remove an attribute
066: * @param key The key of the attribute
067: */
068: void removeAttribute(String key);
069:
070: /**
071: * Return the names of all attributes
072: */
073: Iterator getAttributeNames();
074:
075: /**
076: * Return the value of a temporary attribute
077: * @param key The key of the attribute
078: * @return The value of the attribute or null.
079: */
080: Object getTemporaryAttribute(String key);
081:
082: /**
083: * Set a temporary attribute
084: * @param key The key of the attribute
085: * @param value The new value
086: */
087: void setTemporaryAttribute(String key, Object value);
088:
089: /**
090: * Remove a temporary attribute
091: * @param key The key of the attribute
092: */
093: void removeTemporaryAttribute(String key);
094:
095: /**
096: * Return the names of all temporary attributes
097: */
098: Iterator getTemporaryAttributeNames();
099:
100: /**
101: * Return the component manager for the current portal
102: */
103: PortalComponentManager getComponentManager();
104:
105: /**
106: * FIXME this is for the full-screen function
107: * @param layoutKey TODO
108: */
109: void setEntryLayout(String layoutKey, Layout object);
110:
111: Layout getEntryLayout(String layoutKey);
112:
113: /**
114: * Change the default layout key for most functions
115: */
116: void setDefaultLayoutKey(String layoutKey);
117:
118: /**
119: * Get the default layout key
120: */
121: String getDefaultLayoutKey();
122:
123: /**
124: * Return all skins
125: */
126: List getSkinDescriptions();
127:
128: /**
129: * Return the current object model.
130: * @since 2.1.8
131: */
132: Map getObjectModel();
133:
134: /**
135: * Indicates whether aspects which are sensitive to rendering state should render
136: * @param renderable true if all aspects should render
137: */
138: void setRenderable(Boolean renderable);
139:
140: /**
141: * Returns true if all aspects should render, false if only "static" aspects should
142: * render.
143: */
144: Boolean isRenderable();
145: }
|