001: /*
002: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
003: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
004: */
005:
006: package com.sun.portal.search.admin;
007:
008: import java.io.*;
009: import java.util.*;
010: import java.util.logging.Logger;
011: import java.util.logging.Level;
012: import java.text.*;
013:
014: import com.sun.portal.search.admin.model.DbStatModel;
015: import com.sun.portal.search.admin.model.DbStatModelImpl;
016: import com.sun.portal.search.admin.util.DBUtil;
017:
018: import javax.servlet.http.HttpServletRequest;
019: import javax.servlet.*;
020: import javax.servlet.http.*;
021:
022: import com.iplanet.jato.Log;
023: import com.iplanet.jato.RequestContext;
024: import com.iplanet.jato.model.Model;
025: import com.iplanet.jato.ModelManager;
026:
027: import com.iplanet.jato.view.event.DisplayEvent;
028: import com.iplanet.jato.view.event.RequestInvocationEvent;
029:
030: import com.iplanet.jato.view.html.StaticTextField;
031: import com.iplanet.jato.view.html.TextField;
032: import com.iplanet.jato.view.html.Button;
033: import com.iplanet.jato.view.html.HREF;
034:
035: import com.iplanet.jato.view.View;
036: import com.iplanet.jato.view.ViewBean;
037: import com.iplanet.jato.view.ViewBeanBase;
038:
039: import com.iplanet.jato.ViewBeanManager;
040:
041: import com.iplanet.jato.model.ModelControlException;
042:
043: import com.iplanet.am.console.components.view.html.ParentagePath;
044: import com.iplanet.am.console.components.view.html.IPlanetButton;
045: import com.iplanet.sso.SSOTokenManager;
046: import com.iplanet.sso.SSOToken;
047: import com.iplanet.sso.SSOException;
048: import com.iplanet.sso.SSOTokenID;
049:
050: import com.sun.portal.search.soif.SOIF;
051: import com.sun.portal.search.db.SToken;
052: import com.sun.portal.log.common.PortalLogger;
053:
054: /**
055: * iCS admin console view bean: TODO
056: */
057: public class DbStatViewBean extends CSViewBeanBase {
058: public static final String DEFAULT_DISPLAY_URL = "/ps/searchadmin/DbStat.jsp";
059: public static final String PAGE_NAME = "DbStat";
060:
061: // list of Jato elements
062: public static final String DBSTAT_LIST_DB_VIEW = "DbStatListDBView";
063:
064: private static Properties stateProperties = new Properties();
065: private static ResourceBundle adminMsgs;
066:
067: private DbStatModel dbStatModel = null;
068:
069: // Create a logger for this class
070: private static Logger debugLogger = PortalLogger
071: .getLogger(DbStatViewBean.class);
072:
073: static {
074: try {
075: adminMsgs = ResourceBundle
076: .getBundle(CompassAdminConstants.RESOURCE_BUNDLE_FILE);
077: } catch (MissingResourceException e) {
078: debugLogger.log(Level.INFO, "PSSH_CSPSA0014",
079: CompassAdminConstants.RESOURCE_BUNDLE_FILE);
080: }
081: }
082:
083: /**
084: * constructor
085: *
086: * @param PageName of this view bean
087: * @param displayURL default display URL
088: */
089: public DbStatViewBean() {
090: super (PAGE_NAME);
091: setDefaultDisplayURL(DEFAULT_DISPLAY_URL);
092: registerChildren();
093: }
094:
095: /**
096: * register child component
097: */
098: protected void registerChildren() {
099: registerChild(DBSTAT_LIST_DB_VIEW, DbStatListDBView.class);
100: }
101:
102: /**
103: * create child component
104: *
105: * @param name of component
106: * @return child component
107: */
108: protected View createChild(String name) {
109: View child = super .createChild(name);
110: if (child != null) {
111: return child;
112: }
113: if (name.equals(DBSTAT_LIST_DB_VIEW)) {
114: child = new DbStatListDBView(this , DBSTAT_LIST_DB_VIEW);
115: if (child == null) {
116: debugLogger.finer("PSSH_CSPSA0035");
117: }
118: return child;
119: }
120: debugLogger.log(Level.INFO, "PSSH_CSPSA0002", name);
121: throw new IllegalArgumentException("Invalid child name ["
122: + name + "]");
123: }
124:
125: /**
126: *
127: */
128: public String getDisplayURL() {
129: return DEFAULT_DISPLAY_URL;
130: }
131:
132: /** begin displaying page. we set the required information
133: *
134: * @param event display event
135: * @throws ModelControlException if problem access value of component
136: */
137: public void beginDisplay(DisplayEvent event) {
138: setPageEncoding();
139: }
140: }
|