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;
1819//standard java stuff20import java.util.Map;
21import java.util.Enumeration;
2223/***24 * The PortletSet is basically a wrapper around an array of portlets. It provides25 * runtime context for a set of portlets.26 * A portlet can get its current set by calling via its PortletConfig27 * 28 * @author <a href="mailto:raphael@apache.org">Raphaël Luta</a>29 * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>30 * @version $Id: PortletSet.java,v 1.26 2004/02/23 04:05:35 jford Exp $31 */32publicinterfacePortletSetextendsPortlet33 {
34/***35 * Return the current controller for this set36 */37publicPortletController getController();
3839/***40 * Set the controller for this set41 */42publicvoid setController(PortletController controller);
4344/***45 * Returns the number of portlets currently stored in this set46 */47publicint size();
4849/***50 * Returns the portlet set as an array.51 */52publicPortlet[] toArray();
5354/***55 * Returns the Portlet at position pos56 */57publicPortlet getPortletAt(int pos);
5859/***60 * Returns the Portlet with the given id61 */62publicPortlet getPortletByID(String id);
6364/***65 Returns the Portlet with the given name66 */67publicPortlet getPortletByName(String name);
6869/***70 * Returns the portlet set as an Enumeration71 */72public Enumeration getPortlets();
7374/***75 * Add a portlet to this set.It updates its config to modify the current set76 */77publicvoid addPortlet(Portlet portlet);
7879/***80 * Add a portlet to this set.It updates its config to modify the current set81 */82publicvoid addPortlet(Portlet portlet, int position);
8384/***85 * Add a portlet to this set.It updates its config to modify the current set86 */87publicvoid addPortlet(Portlet portlet, Constraints constraints);
8889/***90 * Add a portlet to this set.It updates its config to modify the current set91 */92publicvoid addPortlet(Portlet portlet, Constraints constraints, int position);
9394/***95 * The PortletSetConstraints is used to associate layout constraints with a 96 * Portlet within a Set. These constraints may be used by the PortletController97 * to render the layout of any given PortletSet correctly.98 */99publicinterface Constraints extends Map
100 {
101/*** Get the column the portlet should be displayed in102 *103 * @return a positive column number or null104 */105public Integer getColumn();
106107/*** Set the column the portlet should be displayed in. This108 * integer must be positive109 *110 * @param col the column position111 */112publicvoid setColumn(Integer col) throws IllegalArgumentException;
113114/*** Get the row the portlet should be displayed in115 *116 * @return a positive row number or null117 */118public Integer getRow();
119120/*** Set the row the portlet should be displayed in. This121 * integer must be positive122 *123 * @param row the column position124 */125publicvoid setRow(Integer row) throws IllegalArgumentException;
126 }
127 }