Source Code Cross Referenced for ScheduleView.java in  » Portal » Open-Portal » com » sun » portal » search » admin » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » Open Portal » com.sun.portal.search.admin 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


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.util.Set;
009:        import java.util.List;
010:        import java.util.Iterator;
011:        import java.util.logging.Logger;
012:        import java.util.logging.Level;
013:
014:        import javax.servlet.http.HttpServletRequest;
015:
016:        import com.iplanet.jato.RequestContext;
017:
018:        import com.iplanet.jato.view.event.DisplayEvent;
019:        import com.iplanet.jato.view.event.RequestInvocationEvent;
020:
021:        import com.iplanet.jato.view.html.StaticTextField;
022:        import com.iplanet.jato.view.html.TextField;
023:        import com.iplanet.jato.view.html.CheckBox;
024:        import com.iplanet.jato.view.html.Button;
025:        import com.iplanet.jato.view.html.ComboBox;
026:        import com.iplanet.jato.view.html.Option;
027:        import com.iplanet.jato.view.html.OptionList;
028:
029:        import com.iplanet.jato.view.View;
030:        import com.iplanet.jato.view.ContainerView;
031:        import com.iplanet.jato.RequestHandler;
032:        import com.iplanet.jato.view.RequestHandlingViewBase;
033:        import com.iplanet.jato.view.ViewBean;
034:        import com.iplanet.jato.view.ViewBeanBase;
035:
036:        import com.iplanet.jato.ViewBeanManager;
037:
038:        import com.iplanet.jato.model.*;
039:
040:        import com.iplanet.am.console.components.view.html.IPlanetButton;
041:
042:        import com.sun.portal.search.admin.model.ScheduleModel;
043:        import com.sun.portal.log.common.PortalLogger;
044:
045:        /**
046:         * iPS admin console view bean: TODO
047:         */
048:        public class ScheduleView extends RequestHandlingViewBase implements 
049:                ContainerView, RequestHandler {
050:            public static final String PAGE_NAME = "Schedule";
051:            public static final String NAME = "Name";
052:            public static final String DESC = "Description";
053:            public static final String COMMAND = ScheduleModel.FIELD_COMMAND;
054:            public static final String DIR = ScheduleModel.FIELD_DIR;
055:            public static final String HOUR_LIST = "HourList";
056:            public static final String MIN_LIST = "MinList";
057:            public static final String SUN_CHECKBOX = "SUN";
058:            public static final String MON_CHECKBOX = "MON";
059:            public static final String TUE_CHECKBOX = "TUE";
060:            public static final String WED_CHECKBOX = "WED";
061:            public static final String THU_CHECKBOX = "THU";
062:            public static final String FRI_CHECKBOX = "FRI";
063:            public static final String SAT_CHECKBOX = "SAT";
064:            private static OptionList hourOptions = new OptionList(
065:                    ScheduleModel.hourLabel, ScheduleModel.hourValues);
066:            private static OptionList minOptions = new OptionList(
067:                    ScheduleModel.minValues, ScheduleModel.minValues);
068:
069:            private ScheduleModel model = null;
070:
071:            // Create a Logger for this class
072:            private static Logger debugLogger = PortalLogger
073:                    .getLogger(ScheduleView.class);
074:
075:            /**
076:             * constructor
077:             *
078:             * @param PageName  of this view bean
079:             * @param displayURL  default display URL
080:             */
081:            public ScheduleView(View parent, String name) {
082:                super (parent, name);
083:                registerChildren();
084:            }
085:
086:            /**
087:             * register child component
088:             */
089:            protected void registerChildren() {
090:                registerChild(COMMAND, TextField.class);
091:                registerChild(DIR, TextField.class);
092:                registerChild(NAME, StaticTextField.class);
093:                registerChild(DESC, StaticTextField.class);
094:                registerChild(HOUR_LIST, ComboBox.class);
095:                registerChild(MIN_LIST, ComboBox.class);
096:                registerChild(SUN_CHECKBOX, CheckBox.class);
097:                registerChild(MON_CHECKBOX, CheckBox.class);
098:                registerChild(TUE_CHECKBOX, CheckBox.class);
099:                registerChild(WED_CHECKBOX, CheckBox.class);
100:                registerChild(THU_CHECKBOX, CheckBox.class);
101:                registerChild(FRI_CHECKBOX, CheckBox.class);
102:                registerChild(SAT_CHECKBOX, CheckBox.class);
103:            }
104:
105:            /**
106:             * create child component
107:             *
108:             * @param name of component
109:             * @return child component
110:             */
111:            protected View createChild(String name) {
112:                CSViewBeanBase pvb = (CSViewBeanBase) getParentViewBean();
113:                if (name.equals(this .NAME)) {
114:                    return new StaticTextField(this , NAME, pvb
115:                            .getLocalizedString("cron."
116:                                    + getName().toLowerCase()));
117:                }
118:                if (name.equals(this .DESC)) {
119:                    return new StaticTextField(this , DESC, pvb
120:                            .getLocalizedString("cron."
121:                                    + getName().toLowerCase() + ".desc"));
122:                }
123:                if (name.equals(COMMAND)) {
124:                    return new TextField(this , getModel(), COMMAND, COMMAND,
125:                            "", null);
126:                }
127:                if (name.equals(DIR)) {
128:                    return new TextField(this , getModel(), DIR, DIR, "", null);
129:                }
130:                if (name.equals(this .HOUR_LIST)) {
131:                    ComboBox child = new ComboBox(this , this .getModel(),
132:                            this .HOUR_LIST, ScheduleModel.FIELD_HOUR, "", null);
133:                    child.setOptions(this .hourOptions);
134:                    return child;
135:
136:                }
137:                if (name.equals(MIN_LIST)) {
138:                    ComboBox child = new ComboBox(this , getModel(), MIN_LIST,
139:                            ScheduleModel.FIELD_MIN, "", null);
140:                    child.setOptions(this .minOptions);
141:                    return child;
142:                }
143:                if (name.equals(SUN_CHECKBOX)) {
144:                    return new CheckBox(this , getModel(), SUN_CHECKBOX,
145:                            ScheduleModel.FIELD_SUN, "true", "false", false,
146:                            null);
147:                }
148:                if (name.equals(MON_CHECKBOX)) {
149:                    return new CheckBox(this , getModel(), MON_CHECKBOX,
150:                            ScheduleModel.FIELD_MON, "true", "false", false,
151:                            null);
152:                }
153:                if (name.equals(TUE_CHECKBOX)) {
154:                    return new CheckBox(this , getModel(), TUE_CHECKBOX,
155:                            ScheduleModel.FIELD_TUE, "true", "false", false,
156:                            null);
157:                }
158:                if (name.equals(WED_CHECKBOX)) {
159:                    return new CheckBox(this , getModel(), WED_CHECKBOX,
160:                            ScheduleModel.FIELD_WED, "true", "false", false,
161:                            null);
162:                }
163:                if (name.equals(THU_CHECKBOX)) {
164:                    return new CheckBox(this , getModel(), THU_CHECKBOX,
165:                            ScheduleModel.FIELD_THU, "true", "false", false,
166:                            null);
167:                }
168:                if (name.equals(FRI_CHECKBOX)) {
169:                    return new CheckBox(this , getModel(), FRI_CHECKBOX,
170:                            ScheduleModel.FIELD_FRI, "true", "false", false,
171:                            null);
172:                }
173:                if (name.equals(SAT_CHECKBOX)) {
174:                    return new CheckBox(this , getModel(), SAT_CHECKBOX,
175:                            ScheduleModel.FIELD_SAT, "true", "false", false,
176:                            null);
177:                }
178:                throw new IllegalArgumentException("Invalid child name ["
179:                        + name + "]");
180:            }
181:
182:            /**
183:             * Creates the model instance.
184:             *
185:             * @returns Instance of model
186:             */
187:            public ScheduleModel getModel() {
188:                if (model == null) {
189:                    //model = new ScheduleModel(this.getName());
190:                    model = new ScheduleModel();
191:                    if (model == null) {
192:                        /* TOFIX: Handle this case by displaying an error page.
193:                         * This should actually be done by making the SMDataModelImpl
194:                         * throw an exception and catching it.
195:                         */
196:                    } else {
197:                        model.setName(getName());
198:
199:                        try {
200:                            model.retrieve(null);
201:                        } catch (ModelControlException e) {
202:                            debugLogger.log(Level.INFO, "PSSH_CSPSA0010", e
203:                                    .getMessage());
204:                        }
205:                    }
206:                }
207:                return model;
208:            }
209:
210:            public void store() {
211:                ScheduleModel model = getModel();
212:                try {
213:                    model.update(null);
214:                } catch (Exception e) {
215:                    debugLogger.log(Level.INFO, "PSSH_CSPSA0010", e
216:                            .getMessage());
217:                }
218:            }
219:
220:            public void reset() {
221:                ScheduleModel model = getModel();
222:                try {
223:                    model.retrieve(null);
224:                } catch (Exception e) {
225:                    debugLogger.log(Level.INFO, "PSSH_CSPSA0010", e
226:                            .getMessage());
227:                }
228:            }
229:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.