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.search;
013:
014: import java.util.*;
015:
016: import com.sun.portal.admin.console.common.PSBaseBean;
017:
018: public class RobotSiteBean extends PSBaseBean {
019:
020: public String id = "";
021: public String name = "";
022: public String status = "";
023: public String imagelink = "";
024: public boolean checked = false;
025:
026: static String SECURE_SERVER_IMAGE = "../images/search/key_on.gif";
027: static String OPEN_SERVER_IMAGE = "../images/search/key_off.gif";
028: static String DOMAIN_IMAGE = "../images/search/domain.gif";
029: static String FILE_IMAGE = "../images/search/file.gif";
030: static String BLANK_IMAGE = "../images/search/blank.gif";
031:
032: private Boolean state = Boolean.TRUE;
033:
034: public RobotSiteBean() {
035: checked = false;
036: }
037:
038: public RobotSiteBean(String id, HashMap frs) {
039: this .id = id;
040: checked = false;
041: name = (String) frs.get("SiteName");
042: if (((Boolean) frs.get("State")).booleanValue()) {
043: status = getLocalizedString("search.general.enabled");
044: } else {
045: status = getLocalizedString("search.general.disabled");
046: }
047:
048: LinkedList servers = (LinkedList) frs.get("ServerGroup");
049: if (servers.size() > 0) {
050: HashMap server = (HashMap) servers.get(0);
051: String proto = (String) server.get("Protocol");
052: if (proto.compareToIgnoreCase("https") == 0) {
053: imagelink = SECURE_SERVER_IMAGE;
054: } else if (proto.compareToIgnoreCase("file") == 0) {
055: imagelink = FILE_IMAGE;
056: } else {
057: imagelink = OPEN_SERVER_IMAGE;
058: }
059: }
060:
061: LinkedList domains = (LinkedList) frs.get("DomainGroup");
062: if (domains.size() > 0) {
063: imagelink = DOMAIN_IMAGE;
064: }
065:
066: }
067:
068: public String getId() {
069: return id;
070: }
071:
072: public void setId(String id) {
073: this .id = id;
074: }
075:
076: public String getName() {
077: return name;
078: }
079:
080: public void setName(String name) {
081: this .name = name;
082: }
083:
084: public String getStatus() {
085: return status;
086: }
087:
088: public void setStatus(String status) {
089: this .status = status;
090: }
091:
092: public boolean getChecked() {
093: return checked;
094: }
095:
096: public void setChecked(boolean checked) {
097: this .checked = checked;
098: }
099:
100: /*
101: * Private Methods
102: */
103: private String getLocalizedString(String key) {
104: return super .getLocalizedString("search", key);
105: }
106:
107: }
|