001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/site/tags/sakai_2-4-1/site-api/api/src/java/org/sakaiproject/site/api/SitePage.java $
003: * $Id: SitePage.java 18633 2006-12-05 02:13:45Z ggolden@umich.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.site.api;
021:
022: import java.io.Serializable;
023: import java.util.Collection;
024: import java.util.List;
025:
026: import org.sakaiproject.entity.api.Edit;
027: import org.sakaiproject.tool.api.Tool;
028:
029: /**
030: * <p>
031: * A Site Page is grouping of tools in a Site.
032: * </p>
033: */
034: public interface SitePage extends Edit, Serializable {
035: /** Layout value for a single column layout. */
036: public static final int LAYOUT_SINGLE_COL = 0;
037:
038: /** Layout value for a double column layout. */
039: public static final int LAYOUT_DOUBLE_COL = 1;
040:
041: /** @return The human readable Title of this SitePage. */
042: public String getTitle();
043:
044: /** @return the layout for this page. */
045: public int getLayout();
046:
047: /** @return the layout title for this page. */
048: public String getLayoutTitle();
049:
050: /** @return The List (ToolConfiguration) of tools on this page. */
051: public List getTools();
052:
053: /** @return The List (ToolConfiguration) of tools on this column (0 based) of this page. */
054: public List getTools(int col);
055:
056: /**
057: * Get all the tools placed in the site on this page that are of any of these tool ids.
058: *
059: * @param tooldIds
060: * The tool id array (String, such as sakai.chat, not a tool configuration / placement uuid) to search for.
061: * @return A Collection (ToolConfiguration) of all the tools placed in the site on this page that are of this tool id (may be empty).
062: */
063: Collection getTools(String[] toolIds);
064:
065: /** @return the skin to use for this page. */
066: public String getSkin();
067:
068: /** @return the site id for this page. */
069: public String getSiteId();
070:
071: /** @return true if page should open in new window. */
072: public boolean isPopUp();
073:
074: /**
075: * Access a tool on this page by id.
076: *
077: * @param id
078: * The tool id.
079: * @return The tool on this page with this id, or null if not found.
080: */
081: public ToolConfiguration getTool(String id);
082:
083: /**
084: * Access the site in which this page lives.
085: *
086: * @return the site in which this page lives.
087: */
088: public Site getContainingSite();
089:
090: /**
091: * Set the display title of this page.
092: *
093: * @param title
094: * The new title.
095: */
096: public void setTitle(String title);
097:
098: /**
099: * Set the layout for this page.
100: *
101: * @param layout
102: * The new layout.
103: */
104: public void setLayout(int layout);
105:
106: /**
107: * Set the popup status for this page.
108: *
109: * @param popup
110: * The new popup status.
111: */
112: public void setPopup(boolean popup);
113:
114: /**
115: * Add a new tool to the page.
116: *
117: * @return the ToolConfigurationEdit object for the new tool.
118: */
119: public ToolConfiguration addTool();
120:
121: /**
122: * Add a new tool to the page, initialized to the tool registration information provided.
123: *
124: * @param reg
125: * The tool registration information used to initialize the tool.
126: * @return the ToolConfigurationEdit object for the new tool.
127: */
128: public ToolConfiguration addTool(Tool reg);
129:
130: /**
131: * Add a new tool to the page, initialized to the tool id provided.
132: *
133: * @param toolId
134: * The tool id for this tool.
135: * @return the ToolConfigurationEdit object for the new tool.
136: */
137: public ToolConfiguration addTool(String toolId);
138:
139: /**
140: * Remove a tool from this page.
141: *
142: * @param tool
143: * The tool to remove.
144: */
145: public void removeTool(ToolConfiguration tool);
146:
147: /**
148: * Move this page one step towards the start of the order of pages in this site.
149: */
150: public void moveUp();
151:
152: /**
153: * Move this page one step towards the end of the order of pages in this site.
154: */
155: public void moveDown();
156:
157: /**
158: * Move this page to a specific (0 based index) position within the site's pages.
159: */
160: public void setPosition(int pos);
161:
162: /**
163: * get the 0 based index position of the page within the site's pages.
164: */
165: public int getPosition();
166: }
|