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.net.URL;
009: import java.io.*;
010:
011: import com.sun.portal.search.admin.CSViewBeanBase;
012: import com.sun.portal.search.admin.model.ScheduleModel;
013: import com.sun.portal.search.admin.cli.CronController;
014:
015: import javax.servlet.http.HttpServletRequest;
016: import javax.servlet.http.HttpServletResponse;
017:
018: import com.iplanet.jato.RequestContext;
019:
020: import com.iplanet.jato.view.event.DisplayEvent;
021: import com.iplanet.jato.view.event.ChildDisplayEvent;
022: import com.iplanet.jato.view.event.RequestInvocationEvent;
023:
024: import com.iplanet.jato.view.html.StaticTextField;
025: import com.iplanet.jato.view.html.TextField;
026: import com.iplanet.jato.view.html.CheckBox;
027: import com.iplanet.jato.view.html.Button;
028: import com.iplanet.jato.view.html.ComboBox;
029: import com.iplanet.jato.view.html.RadioButtonGroup;
030:
031: import com.iplanet.jato.view.html.Option;
032: import com.iplanet.jato.view.html.OptionList;
033:
034: import com.iplanet.jato.view.View;
035: import com.iplanet.jato.view.ViewBean;
036: import com.iplanet.jato.view.ViewBeanBase;
037:
038: import com.iplanet.jato.ViewBeanManager;
039:
040: import com.iplanet.jato.model.*;
041:
042: import com.iplanet.am.console.components.view.html.IPlanetButton;
043:
044: /**
045: * iPS admin console view bean: TODO
046: */
047: public class ImportScheduleViewBean extends CSViewBeanBase {
048: public static final String DEFAULT_DISPLAY_URL = "/ps/searchadmin/ImportSchedule.jsp";
049: public static final String PAGE_NAME = "ImportSchedule";
050: public static final String START_VIEW = "StartImport";
051: public static final String SUBMIT_BUTTON = "SubmitButton";
052: public static final String RESET_BUTTON = "ResetButton";
053:
054: /**
055: * constructor
056: *
057: * @param PageName of this view bean
058: * @param displayURL default display URL
059: */
060: public ImportScheduleViewBean() {
061: super (PAGE_NAME);
062: setDefaultDisplayURL(DEFAULT_DISPLAY_URL);
063: registerChildren();
064: }
065:
066: /**
067: * register child component
068: */
069: protected void registerChildren() {
070: registerChild(SUBMIT_BUTTON, IPlanetButton.class);
071: registerChild(RESET_BUTTON, IPlanetButton.class);
072: registerChild(START_VIEW, ScheduleView.class);
073: }
074:
075: /**
076: * create child component
077: *
078: * @param name of component
079: * @return child component
080: */
081: protected View createChild(String name) {
082: View Headerchild = super .createChild(name);
083: if (Headerchild != null)
084: return Headerchild;
085: if (name.equals(SUBMIT_BUTTON)) {
086: return new IPlanetButton(this , SUBMIT_BUTTON, "");
087: }
088: if (name.equals(RESET_BUTTON)) {
089: return new IPlanetButton(this , RESET_BUTTON, "");
090: }
091: if (name.equals(START_VIEW)) {
092: return new ScheduleView(this , START_VIEW);
093: }
094:
095: throw new IllegalArgumentException("Invalid child name ["
096: + name + "]");
097: }
098:
099: /** begin displaying page. we set the required information
100: *
101: * @param event display event
102: * @throws ModelControlException if problem access value of component
103: */
104: public void beginDisplay(DisplayEvent event) {
105: setPageEncoding();
106: setDisplayFieldValue(SUBMIT_BUTTON,
107: getLocalizedString("submit.text"));
108: setDisplayFieldValue(RESET_BUTTON,
109: getLocalizedString("reset.text"));
110: }
111:
112: public void handleSubmitButtonRequest(RequestInvocationEvent event) {
113:
114: ScheduleView child = (ScheduleView) getChild(this .START_VIEW);
115: child.store();
116: forwardTo();
117: }
118:
119: public void handleResetButtonRequest(RequestInvocationEvent event) {
120:
121: ScheduleView child = (ScheduleView) getChild(this.START_VIEW);
122: child.reset();
123: forwardTo();
124: }
125:
126: }
|