01: /**
02: * Copyright 2005 Sun Microsystems, Inc. All
03: * rights reserved. Use of this product is subject
04: * to license terms. Federal Acquisitions:
05: * Commercial Software -- Government Users
06: * Subject to Standard License Terms and
07: * Conditions.
08: *
09: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
10: * are trademarks or registered trademarks of Sun Microsystems,
11: * Inc. in the United States and other countries.
12: */package com.sun.portal.admin.console.search;
13:
14: import java.util.*;
15: import java.io.*;
16: import java.text.*;
17:
18: import javax.faces.context.FacesContext;
19: import javax.faces.application.FacesMessage;
20: import javax.faces.component.UIComponent;
21: import javax.faces.validator.*;
22: import javax.servlet.http.HttpServletRequest;
23: import javax.management.*;
24:
25: import com.sun.web.ui.model.*;
26:
27: import com.sun.data.provider.*;
28: import com.sun.data.provider.impl.ObjectListDataProvider;
29:
30: import com.sun.cacao.agent.JmxClient;
31:
32: import com.sun.portal.admin.common.util.AdminClientUtil;
33: import com.sun.portal.admin.console.common.PSBaseBean;
34:
35: public class EditResourceDescriptionAttributeBean extends PSBaseBean {
36:
37: private ResourceDescriptionAttributeBean rdab = null;
38: private String returnString = null;
39:
40: public EditResourceDescriptionAttributeBean() {
41: rdab = (ResourceDescriptionAttributeBean) getSessionAttribute("search.resourcedescriptionattribute.rdab");
42: returnString = (String) getSessionAttribute("search.resourcedescriptionattribute.return");
43: setSessionAttribute("search.categoriespopuperda.mode", "browse");
44: setSessionAttribute("search.categoriespopuperda.category", null);
45: }
46:
47: public String getPageTitle() {
48: MessageFormat mf = new MessageFormat("");
49: if (returnString.equals("gotoEditResourceDescription")) {
50: mf
51: .applyPattern(getLocalizedString("search",
52: "search.editresourcedescriptionattribute.pagetitle1"));
53: return mf
54: .format(new Object[] {
55: rdab.key,
56: (String) getSessionAttribute("search.resourcedescription.selected") });
57: } else {
58: mf
59: .applyPattern(getLocalizedString("search",
60: "search.editresourcedescriptionattribute.pagetitle2"));
61: return mf.format(new Object[] { rdab.key });
62: }
63: }
64:
65: public String[] getList() {
66: int total = rdab.newValues.size();
67: String[] strings = new String[total];
68: for (int index = 0; index < total; index++) {
69: strings[index] = (String) rdab.newValues.get(index);
70: }
71: return strings;
72: }
73:
74: public void setList(String[] values) {
75: rdab.newValues.clear();
76: for (int index = 0; index < values.length; index++) {
77: rdab.newValues.add(values[index]);
78: rdab.apply = true;
79: }
80: }
81:
82: public boolean getIsClassification() {
83: if (rdab.key.equals("Classification")) {
84: return true;
85: } else {
86: return false;
87: }
88: }
89:
90: public String save() {
91: return returnString;
92: }
93:
94: public String cancel() {
95: return returnString;
96: }
97:
98: }
|