001: /**
002: * Copyright 2005 Sun Microsystems, Inc. All
003: * rights reserved. Use of this product is subject
004: * to license terms. Federal Acquisitions:
005: * Commercial Software -- Government Users
006: * Subject to Standard License Terms and
007: * Conditions.
008: *
009: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
010: * are trademarks or registered trademarks of Sun Microsystems,
011: * Inc. in the United States and other countries.
012: */package com.sun.portal.admin.console.communities;
013:
014: import java.util.*;
015: import java.util.logging.Level;
016: import java.io.*;
017: import java.text.*;
018:
019: import com.sun.portal.admin.console.common.PSBaseBean;
020:
021: public class CommunityBean extends PSBaseBean {
022:
023: public String name = "";
024: public String description = "";
025: public String category = "";
026: public String unlisted = "";
027: public String membershipRestricted = "";
028: public String secured = "";
029: public String disabled = "";
030: public String deleted = "";
031: public String users = "";
032: public String pendingUsers = "";
033:
034: public void initialize(Properties p) {
035: this .name = p.getProperty("name");
036: this .description = (String) p.getProperty("description");
037: this .category = (String) p.getProperty("category");
038: this .unlisted = (String) p.getProperty("unlisted");
039: this .membershipRestricted = (String) p
040: .getProperty("membershiprestricted");
041: this .secured = (String) p.getProperty("secured");
042: this .disabled = (String) p.getProperty("disabled");
043: this .deleted = (String) p.getProperty("deleted");
044: this .users = (String) p.getProperty("users");
045: if (this .users == null) {
046: this .users = "0";
047: }
048: this .pendingUsers = (String) p.getProperty("pendingusers");
049: if (this .pendingUsers == null) {
050: this .pendingUsers = "0";
051: }
052: }
053:
054: public String getName() {
055: return name;
056: }
057:
058: public void setName(String name) {
059: }
060:
061: public String getDescription() {
062: return description;
063: }
064:
065: public void setDescription(String description) {
066: }
067:
068: public String getCategory() {
069: return category;
070: }
071:
072: public void setCategory(String category) {
073: }
074:
075: public String getUnlisted() {
076: if (unlisted.equals("true")) {
077: return getLocalizedString("communities",
078: "communitieshome.unlisted");
079: } else {
080: return getLocalizedString("communities",
081: "communitieshome.listed");
082: }
083: }
084:
085: public void setUnlisted(String unlisted) {
086: }
087:
088: public String getMembershipRestricted() {
089: if (membershipRestricted.equals("true")) {
090: return getLocalizedString("communities",
091: "communitieshome.membershiprestricted");
092: } else {
093: return getLocalizedString("communities",
094: "communitieshome.membershipunrestricted");
095: }
096: }
097:
098: public void setMembershipRestricted(String membershipRestricted) {
099: }
100:
101: public String getSecured() {
102: if (secured.equals("true")) {
103: return getLocalizedString("communities",
104: "communitieshome.secured");
105: } else {
106: return getLocalizedString("communities",
107: "communitieshome.unsecured");
108: }
109: }
110:
111: public void setSecured(String secured) {
112: }
113:
114: public String getDisabled() {
115: if (disabled.equals("true")) {
116: return getLocalizedString("communities",
117: "communitieshome.disabled");
118: } else {
119: return getLocalizedString("communities",
120: "communitieshome.enabled");
121: }
122: }
123:
124: public void setDisabled(String disabled) {
125: }
126:
127: public String getDeleted() {
128: if (deleted.equals("true")) {
129: return getLocalizedString("communities",
130: "communitieshome.deleted");
131: } else {
132: return getLocalizedString("communities",
133: "communitieshome.undeleted");
134: }
135: }
136:
137: public void setDeleted(String deleted) {
138: }
139:
140: public String getUsers() {
141: if (pendingUsers.equals("0")) {
142: return users;
143: } else {
144: MessageFormat mf = new MessageFormat("");
145: mf.applyPattern(getLocalizedString("communities",
146: "communitieshome.users"));
147: return mf.format(new Object[] { users, pendingUsers });
148: }
149: }
150:
151: public void setUsers(String users) {
152: }
153:
154: }
|