Source Code Cross Referenced for PopularSearchViewBean.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.lang.*;
009:        import java.text.*;
010:        import java.util.*;
011:
012:        import javax.servlet.*;
013:        import javax.servlet.http.*;
014:
015:        import com.sun.portal.search.admin.CSViewBeanBase;
016:        import com.sun.portal.search.util.SearchConfig;
017:
018:        import com.iplanet.jato.RequestContext;
019:        import com.iplanet.jato.RequestHandler;
020:
021:        import com.iplanet.jato.view.event.DisplayEvent;
022:        import com.iplanet.jato.view.event.ChildDisplayEvent;
023:        import com.iplanet.jato.view.event.RequestInvocationEvent;
024:
025:        import com.iplanet.jato.view.html.OptionList;
026:        import com.iplanet.jato.view.html.Option;
027:        import com.iplanet.jato.view.html.CheckBox;
028:        import com.iplanet.jato.view.html.TextField;
029:        import com.iplanet.jato.view.html.ListBox;
030:        import com.iplanet.jato.view.html.StaticTextField;
031:
032:        import com.iplanet.jato.view.View;
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.ModelControlException;
039:
040:        import com.iplanet.am.console.components.view.html.IPlanetButton;
041:
042:        import com.sun.portal.search.admin.model.PopularSearchModel;
043:
044:        /**
045:         *  Schema Editor Wizard for editing database schema
046:         *  It extends from <code>CSViewBeanBase</code>.
047:         */
048:
049:        public class PopularSearchViewBean extends CSViewBeanBase implements 
050:                RequestHandler {
051:
052:            // The "logical" name for this page.
053:            public static final String PAGE_NAME = "PopularSearch";
054:            public static final String DEFAULT_DISPLAY_URL = "/ps/searchadmin/PopularSearch.jsp";
055:
056:            public static final String CHK_BROWSE = "ExcludeBrowse";
057:            public static final String BTN_OK = "ok";
058:            public static final String SINCE_TEXT = "SinceDate";
059:            public static final String NUM_QUERY_TEXT = "NumOfQuery";
060:            public static final String SEARCH_LIST = "SearchList";
061:            public static final String STATUS_UPDATE_TIME = "UpdateTime";
062:
063:            private PopularSearchModel model = null;
064:
065:            /*
066:             * Default constructor
067:             *
068:             */
069:            public PopularSearchViewBean() {
070:                super (PAGE_NAME);
071:                setDefaultDisplayURL(DEFAULT_DISPLAY_URL);
072:                registerChildren();
073:            }
074:
075:            /**
076:             * Child methods
077:             */
078:            protected void registerChildren() {
079:                // Add an entry for each child. Note, the children are not instantiated
080:                // at this time. Instead, child instantiation is handled in a lazy fashion.
081:
082:                registerChild(CHK_BROWSE, CheckBox.class);
083:                registerChild(BTN_OK, IPlanetButton.class);
084:                registerChild(SINCE_TEXT, StaticTextField.class);
085:                registerChild(NUM_QUERY_TEXT, StaticTextField.class);
086:                registerChild(BTN_OK, IPlanetButton.class);
087:                registerChild(SEARCH_LIST, PopularSearchListView.class);
088:                registerChild(this .STATUS_UPDATE_TIME, StaticTextField.class);
089:            }
090:
091:            protected View createChild(String name) {
092:                // Create HeaderView Child
093:                View child = super .createChild(name);
094:                if (child != null) {
095:                    return child;
096:
097:                } else if (name.equals(BTN_OK)) {
098:                    return new IPlanetButton(this , BTN_OK, "");
099:                } else if (name.equals(CHK_BROWSE)) {
100:                    return new CheckBox(this , CHK_BROWSE, "true", "false",
101:                            false);
102:                } else if (name.equals(SINCE_TEXT)) {
103:                    return new StaticTextField(this , SINCE_TEXT, "");
104:                } else if (name.equals(NUM_QUERY_TEXT)) {
105:                    return new StaticTextField(this , NUM_QUERY_TEXT, "");
106:                } else if (name.equals(SEARCH_LIST)) {
107:                    return new PopularSearchListView(this , SEARCH_LIST);
108:                } else if (name.equals(this .STATUS_UPDATE_TIME)) {
109:                    return new StaticTextField(this , this .STATUS_UPDATE_TIME,
110:                            "");
111:                }
112:                throw new IllegalArgumentException("Invalid child name \""
113:                        + name + "\"");
114:
115:            }
116:
117:            public void beginDisplay(DisplayEvent event) {
118:                setPageEncoding();
119:                DateFormat df = DateFormat.getDateTimeInstance(DateFormat.LONG,
120:                        DateFormat.LONG, getUserLocale());
121:                PopularSearchListView child = (PopularSearchListView) getChild(SEARCH_LIST);
122:                if (model == null) {
123:                    model = getModel();
124:                    child.setModel(model);
125:                }
126:                Date startAT = model.getFirstDate();
127:                setDisplayFieldValue(SINCE_TEXT, ((startAT == null) ? "" : df
128:                        .format(startAT)));
129:                setDisplayFieldValue(NUM_QUERY_TEXT, model.getNumberOfQuery());
130:                setDisplayFieldValue(this .STATUS_UPDATE_TIME, df.format(model
131:                        .getLastUpdated()));
132:                setDisplayFieldValue(BTN_OK, getLocalizedString("update.text"));
133:            }
134:
135:            /**
136:             *
137:             *
138:             */
139:            public boolean beginSearchListSectDisplay(ChildDisplayEvent event) {
140:                return (model != null && model.getSize() > 0);
141:            }
142:
143:            /*
144:             * Request event handler methods - for button and HREF fields
145:             *
146:             */
147:            public void handleOkRequest(RequestInvocationEvent event)
148:                    throws ServletException {
149:                model = getModel();
150:
151:                boolean exclBrowse = getDisplayFieldBooleanValue(CHK_BROWSE);
152:                model.execute(exclBrowse);
153:                PopularSearchListView child = (PopularSearchListView) getChild(SEARCH_LIST);
154:                child.setModel(model);
155:                forwardTo();
156:            }
157:
158:            /*
159:             * handles invocation of Reset Button
160:             *
161:             * @param event   request invocation event
162:             */
163:            public void handleResetRequest(RequestInvocationEvent event) {
164:                forwardTo();
165:            }
166:
167:            protected PopularSearchModel getModel() {
168:                if (model == null) {
169:                    model = new PopularSearchModel();
170:                    model.userLocale = getUserLocale();
171:                }
172:                return model;
173:            }
174:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.