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 at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * 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 and14 * limitations under the License.15 */1617packageorg.apache.jetspeed.portal;
1819import org.apache.jetspeed.util.MimeType;
20import org.apache.turbine.util.RunData;
21import org.apache.ecs.ConcreteElement;
22import java.util.Map;
23import java.io.Serializable;
2425/***26 * A PortletController is responsible for laying out and rendering the content of 27 * a PortletSet. 28 * <p>As such, it also provides 2 additionnal services :29 * <ul>30 * <li>factory for the creating appropriate PortletSet;Constraints31 * <li>customization facilities for handling the addition of a new portlet32 * within the set and moving entries around within the set33 * </ul>34 *35 * @author <a href="mailto:raphael@apache.org">Raphaël Luta</a>36 * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>37 * @version $Id: PortletController.java,v 1.54 2004/02/23 04:05:35 jford Exp $38 */39publicinterfacePortletControllerextends Serializable
40 {
4142/***43 * Initialize this PortletController. This method must be called after44 * the Config object has been set and whenever it is changed45 */46publicvoid init();
4748/***49 * Sets the configuration object for this controller instance50 *51 * @param conf the controller configuration52 */53publicvoid setConfig(PortletControllerConfig conf);
5455/***56 * Returns the configuration object for this object57 *58 * @return a configuration object59 */60publicPortletControllerConfig getConfig();
6162/***63 * Sets the PotletSet to render by this controller64 *65 * @param portlets the portlet set to render66 */67publicvoid setPortlets(PortletSet portlets);
6869/***70 * Returns the PortletSet to render by this controller71 *72 * @return the portlet set that should currently be rendered by this73 * controller74 */75publicPortletSet getPortlets();
7677/***78 * Renders the content of the PortletSet for the current request79 * 80 * @param rundata the RunData for the request81 * @return the rendered content for this set or null if the content82 * was written directly on the writer available in RunData83 */84public ConcreteElement getContent( RunData rundata );
8586/***87 * Tests whether the controller supports outputting content for 88 * a specific mime type89 *90 * @param mimeType the requested mime type91 * @return true if the requested mime type is supported by this controller92 */93publicboolean supportsType( MimeType mimeType );
9495/***96 * Creates a constraint object based on an original source.97 *98 * @param original the source for this constraint object99 * @return a new Constraints object appropriate for this controller100 */101public PortletSet.Constraints getConstraints( Map original );
102103 }