001: /* Copyright 2001 The JA-SIG Collaborative. All rights reserved.
002: * See license distributed with this file and
003: * available online at http://www.uportal.org/license.html
004: */
005:
006: package org.jasig.portal;
007:
008: import java.io.Serializable;
009:
010: import org.jasig.portal.i18n.LocaleManager;
011:
012: /**
013: * A user profile associates a user layout with a structure and theme stylesheet.
014: * @author Peter Kharchenko
015: * @version $Revision: 36782 $
016: */
017: public class UserProfile implements Serializable {
018: public static final String USER_PROFILE = "UserProfile";
019: protected int id = -1;
020: protected String pName;
021: protected String description;
022: protected int layout_id;
023: protected int struct_ss_id;
024: protected int theme_ss_id;
025: protected boolean system = false;
026: protected LocaleManager localeManager;
027:
028: public UserProfile() {
029: };
030:
031: public UserProfile(int id, String name, String desc, int layout_id,
032: int struct_ss, int theme_ss) {
033: this .id = id;
034: pName = name;
035: description = desc != null ? desc : "";
036: this .layout_id = layout_id;
037: struct_ss_id = struct_ss;
038: theme_ss_id = theme_ss;
039: }
040:
041: public int getProfileId() {
042: return id;
043: }
044:
045: public String getProfileName() {
046: return pName;
047: }
048:
049: public String getProfileDescription() {
050: return description;
051: }
052:
053: public int getLayoutId() {
054: return layout_id;
055: }
056:
057: public int getStructureStylesheetId() {
058: return struct_ss_id;
059: }
060:
061: public int getThemeStylesheetId() {
062: return theme_ss_id;
063: }
064:
065: public boolean isSystemProfile() {
066: return system;
067: }
068:
069: public void setProfileId(int id) {
070: this .id = id;
071: }
072:
073: public void setProfileName(String name) {
074: pName = name;
075: }
076:
077: public void setProfileDescription(String desc) {
078: description = desc;
079: }
080:
081: public void setLayoutId(int layout_id) {
082: this .layout_id = layout_id;
083: }
084:
085: public void setStructureStylesheetId(int ss_id) {
086: struct_ss_id = ss_id;
087: }
088:
089: public void setThemeStylesheetId(int ss_id) {
090: theme_ss_id = ss_id;
091: }
092:
093: public void setSystemProfile(boolean s) {
094: system = s;
095: }
096:
097: public boolean equals(Object o) {
098: boolean retValue = false;
099: if (o instanceof UserProfile) {
100: UserProfile profile = (UserProfile) o;
101: retValue = this .id == profile.id
102: && this .system == profile.system;
103: }
104: return retValue;
105: }
106:
107: // uPortal i18n
108: public void setLocaleManager(LocaleManager lm) {
109: localeManager = lm;
110: }
111:
112: public LocaleManager getLocaleManager() {
113: return localeManager;
114: }
115:
116: public String toString() {
117: return "name :" + pName + "," + "description: " + description
118: + "," + "layout_id: " + layout_id + ","
119: + "struct_ss_id: " + struct_ss_id + ","
120: + "theme_ss_id: " + theme_ss_id + "," + "system: "
121: + system + "," + "localeManager: " + localeManager;
122: }
123: }
|