001: /**********************************************************************************
002: * $URL:https://source.sakaiproject.org/svn/osp/trunk/portal/api/src/java/org/theospi/portfolio/portal/model/SiteType.java $
003: * $Id:SiteType.java 9134 2006-05-08 20:28:42Z chmaurer@iupui.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 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.theospi.portfolio.portal.model;
021:
022: import org.sakaiproject.metaobj.shared.model.IdentifiableObject;
023:
024: import java.util.List;
025:
026: /**
027: * Created by IntelliJ IDEA.
028: * User: John Ellis
029: * Date: Feb 11, 2006
030: * Time: 2:31:03 PM
031: * To change this template use File | Settings | File Templates.
032: */
033: public class SiteType extends IdentifiableObject implements Comparable {
034:
035: private String key;
036: private String description;
037: private String skin;
038: private int order;
039: private int firstCategory = 0;
040: private int lastCategory = 0;
041: private List toolCategories;
042: private List specialSites;
043: private String name;
044: private boolean hidden = false;
045: private boolean displayTab = true;
046: public static final SiteType OTHER = new SiteType(
047: "org.theospi.portfolio.portal.other", "other",
048: Integer.MAX_VALUE);
049: public static final SiteType MY_WORKSPACE = new SiteType(
050: "org.theospi.portfolio.portal.myWorkspace", "workspace", 0);
051: public static final SiteType GATEWAY = new SiteType(
052: "org.theospi.portfolio.portal.gateway", "gateway", 0);
053:
054: public SiteType() {
055: }
056:
057: public SiteType(String key, String name, int order) {
058: this .name = name;
059: this .key = key;
060: this .order = order;
061: }
062:
063: public String getName() {
064: return name;
065: }
066:
067: public void setName(String name) {
068: this .name = name;
069: }
070:
071: public String getKey() {
072: return key;
073: }
074:
075: public void setKey(String key) {
076: this .key = key;
077: }
078:
079: public int getOrder() {
080: return order;
081: }
082:
083: public void setOrder(int order) {
084: this .order = order;
085: }
086:
087: public String getSkin() {
088: return skin;
089: }
090:
091: public void setSkin(String skin) {
092: this .skin = skin;
093: }
094:
095: public int compareTo(Object o) {
096: Integer order = new Integer(getOrder());
097: Integer other = new Integer(((SiteType) o).getOrder());
098: return order.compareTo(other);
099: }
100:
101: public List getToolCategories() {
102: return toolCategories;
103: }
104:
105: public void setToolCategories(List toolCategories) {
106: this .toolCategories = toolCategories;
107: }
108:
109: public int getFirstCategory() {
110: return firstCategory;
111: }
112:
113: public void setFirstCategory(int firstCategory) {
114: this .firstCategory = firstCategory;
115: }
116:
117: public int getLastCategory() {
118: return lastCategory;
119: }
120:
121: public void setLastCategory(int lastCategory) {
122: this .lastCategory = lastCategory;
123: }
124:
125: public List getSpecialSites() {
126: return specialSites;
127: }
128:
129: public void setSpecialSites(List specialSites) {
130: this .specialSites = specialSites;
131: }
132:
133: /**
134: * @return the hidden
135: */
136: public boolean isHidden() {
137: return hidden;
138: }
139:
140: /**
141: * @param hidden the hidden to set
142: */
143: public void setHidden(boolean hidden) {
144: this .hidden = hidden;
145: }
146:
147: public boolean isDisplayTab() {
148: return displayTab;
149: }
150:
151: public void setDisplayTab(boolean displayTab) {
152: this .displayTab = displayTab;
153: }
154:
155: public String getDescription() {
156: return description;
157: }
158:
159: public void setDescription(String description) {
160: this .description = description;
161: }
162:
163: public boolean equals(Object o) {
164: if (this == o) {
165: return true;
166: }
167: if (o == null || getClass() != o.getClass()) {
168: return false;
169: }
170: if (!super .equals(o)) {
171: return false;
172: }
173:
174: final SiteType siteType = (SiteType) o;
175:
176: if (!key.equals(siteType.key)) {
177: return false;
178: }
179:
180: return true;
181: }
182:
183: public int hashCode() {
184: int result = super .hashCode();
185: result = 29 * result + key.hashCode();
186: return result;
187: }
188:
189: }
|