Source Code Cross Referenced for RDAddNewViewBean.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.net.URL;
009:        import java.util.ArrayList;
010:        import java.util.logging.Level;
011:        import java.util.logging.Logger;
012:
013:        import com.sun.portal.search.admin.CSViewBeanBase; //import com.sun.portal.search.admin.cli.RobotController;
014:
015:        import javax.servlet.http.HttpServletRequest;
016:
017:        import com.iplanet.jato.RequestContext;
018:        import com.iplanet.jato.model.*;
019:        import com.iplanet.jato.view.event.DisplayEvent;
020:        import com.iplanet.jato.view.event.RequestInvocationEvent;
021:
022:        import com.iplanet.jato.view.html.StaticTextField;
023:        import com.iplanet.jato.view.html.TextField;
024:        import com.iplanet.jato.view.html.CheckBox;
025:        import com.iplanet.jato.view.html.Button;
026:        import com.iplanet.jato.view.html.ComboBox;
027:        import com.iplanet.jato.view.html.ListBox;
028:        import com.iplanet.jato.view.html.RadioButtonGroup;
029:
030:        import com.iplanet.jato.view.html.Option;
031:        import com.iplanet.jato.view.html.OptionList;
032:
033:        import com.iplanet.jato.view.View;
034:        import com.iplanet.jato.view.ViewBean;
035:        import com.iplanet.jato.view.ViewBeanBase;
036:        import com.iplanet.jato.view.event.ChildDisplayEvent;
037:
038:        import com.iplanet.jato.ViewBeanManager;
039:
040:        import com.iplanet.jato.model.ModelControlException;
041:        import com.iplanet.jato.util.Encoder;
042:
043:        //import com.iplanet.am.console.components.view.html.ParentagePath;
044:        import com.iplanet.am.console.components.view.html.IPlanetButton;
045:
046:        import com.iplanet.sso.SSOTokenManager;
047:        import com.iplanet.sso.SSOToken;
048:        import com.iplanet.sso.SSOException;
049:        import com.iplanet.sso.SSOTokenID;
050:
051:        import com.sun.portal.search.soif.SOIF;
052:        import com.sun.portal.search.db.SToken;
053:        import com.sun.portal.search.admin.util.DBUtil;
054:        import com.sun.portal.log.common.PortalLogger;
055:
056:        /**
057:         *  PS admin console view bean
058:         */
059:        public class RDAddNewViewBean extends CSViewBeanBase {
060:            public static final String DEFAULT_DISPLAY_URL = "/ps/searchadmin/RDAddNew.jsp";
061:            public static final String PAGE_NAME = "RDAddNew";
062:            public static final String RD_ADDVIEW = "RDAddView";
063:            public static final String SUBMIT_BUTTON = "SubmitButton";
064:            public static final String RESET_BUTTON = "ResetButton";
065:            public static final String CANCEL_BUTTON = "CancelButton";
066:            public static final String BROWSER_VIEW = "TaxonomyBrowser";
067:            public static final String SEARCH_DB_COMBO = "SearchDatabase";
068:
069:            private boolean isSingle = false;
070:            private boolean isUpdated = false;
071:
072:            // Create a Logger for this class
073:            private static Logger debugLogger = PortalLogger
074:                    .getLogger(RDAddNewViewBean.class);
075:
076:            /**
077:             * constructor
078:             *
079:             * @param PageName  of this view bean
080:             * @param displayURL  default display URL
081:             */
082:            public RDAddNewViewBean() {
083:                super (PAGE_NAME);
084:                setDefaultDisplayURL(DEFAULT_DISPLAY_URL);
085:                registerChildren();
086:
087:            }
088:
089:            /**
090:             * register child component
091:             */
092:            protected void registerChildren() {
093:                registerChild(RD_ADDVIEW, RDAddView.class);
094:                registerChild(SUBMIT_BUTTON, IPlanetButton.class);
095:                registerChild(RESET_BUTTON, IPlanetButton.class);
096:                registerChild(CANCEL_BUTTON, IPlanetButton.class);
097:                registerChild(BROWSER_VIEW, TaxonomyBrowserView.class);
098:                registerChild(SEARCH_DB_COMBO, ComboBox.class);
099:
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 Headerchild = super .createChild(name);
110:                if (Headerchild != null) {
111:                    return Headerchild;
112:                }
113:                if (name.equals(RD_ADDVIEW)) {
114:                    return new RDAddView(this , RD_ADDVIEW);
115:                }
116:                if (name.equals(SUBMIT_BUTTON)) {
117:                    IPlanetButton btn = new IPlanetButton(this , SUBMIT_BUTTON,
118:                            "");
119:                    btn.validate(true);
120:                    return btn;
121:                }
122:                if (name.equals(RESET_BUTTON)) {
123:                    return new IPlanetButton(this , RESET_BUTTON, "");
124:                }
125:                if (name.equals(CANCEL_BUTTON)) {
126:                    return new IPlanetButton(this , CANCEL_BUTTON, "");
127:                }
128:                if (name.equals(BROWSER_VIEW)) {
129:                    return new TaxonomyBrowserView(this , BROWSER_VIEW);
130:                }
131:                if (name.equals(SEARCH_DB_COMBO)) {
132:                    ComboBox child = new ComboBox(this , SEARCH_DB_COMBO,
133:                            "default");
134:                    child.setOptions(getDBListOption());
135:                    return child;
136:                }
137:                throw new IllegalArgumentException("Invalid child name ["
138:                        + name + "]");
139:            }
140:
141:            OptionList getDBListOption() {
142:                try {
143:                    String[] dbs = DBUtil.getDBStringArray(CSConfig
144:                            .getServerRoot());
145:                    return new OptionList(dbs, dbs);
146:                } catch (Exception e) {
147:                    debugLogger.log(Level.INFO, "PSSH_CSPSA0010", e
148:                            .getMessage());
149:                }
150:
151:                return new OptionList();
152:
153:            }
154:
155:            public boolean beginEditorSectionDisplay(ChildDisplayEvent event) {
156:                String isBrowsing = (String) getPageSessionAttribute(TaxonomyBrowserView.SESION_ATTR_BROWSING_ON);
157:                debugLogger.log(Level.FINER, "PSSH_CSPSA0071", isBrowsing);
158:                return (isBrowsing == null || !isBrowsing
159:                        .equalsIgnoreCase("true"))
160:                        && !beginBatchConfirmSectionDisplay(event);
161:            }
162:
163:            public boolean beginBrowseSectionDisplay(ChildDisplayEvent event) {
164:                String isBrowsing = (String) getPageSessionAttribute(TaxonomyBrowserView.SESION_ATTR_BROWSING_ON);
165:                debugLogger.log(Level.FINER, "PSSH_CSPSA0071", isBrowsing);
166:                return (isBrowsing != null && isBrowsing
167:                        .equalsIgnoreCase("true"));
168:            }
169:
170:            public boolean beginBatchConfirmSectionDisplay(
171:                    ChildDisplayEvent event) {
172:                return isUpdated && !isSingle;
173:            }
174:
175:            /** begin displaying page. we set the required information
176:             *
177:             * @param event   display event
178:             * @throws ModelControlException  if problem access value of component
179:             */
180:            public void beginDisplay(DisplayEvent event) {
181:                setPageEncoding();
182:                if (getPageSessionAttribute(TaxonomyBrowserView.SESION_ATTR_BROWSING_ON) != null) {
183:                    return;
184:                }
185:
186:                String editTimeStamp = (String) getPageSessionAttribute("editTimeStamp");
187:                String currDBStr = (String) getPageSessionAttribute("database"
188:                        + editTimeStamp);
189:                if (currDBStr != null) {
190:                    setDisplayFieldValue(SEARCH_DB_COMBO, currDBStr);
191:                }
192:
193:                setDisplayFieldValue(SUBMIT_BUTTON,
194:                        getLocalizedString("submit.text"));
195:                setDisplayFieldValue(RESET_BUTTON,
196:                        getLocalizedString("reset.text"));
197:                setDisplayFieldValue(CANCEL_BUTTON,
198:                        getLocalizedString("cancel.text"));
199:
200:            }
201:
202:            /**
203:             * handles invocation of view bean
204:             *
205:             * @param event   request invocation event
206:             */
207:            public void handleResetButtonRequest(RequestInvocationEvent event) {
208:                this .forwardTo();
209:            }
210:
211:            public void handleSubmitButtonRequest(RequestInvocationEvent event) {
212:
213:                String editTimeStamp = (String) getPageSessionAttribute("editTimeStamp");
214:                setPageSessionAttribute(
215:                        "database" + editTimeStamp,
216:                        (java.io.Serializable) getDisplayFieldValue(SEARCH_DB_COMBO));
217:
218:                RDAddView rdaddview = (RDAddView) getChild(RD_ADDVIEW);
219:                try {
220:                    rdaddview.addRD();
221:                    infoMessage = getLocalizedString("rd.update.success");
222:                    isUpdated = true;
223:                } catch (Exception e) {
224:                    errorMessage = getLocalizedString("rd.update.error");
225:                }
226:
227:                RequestContext rc = getRequestContext();
228:                ViewBeanManager mgr = rc.getViewBeanManager();
229:                RDEditorViewBean target = (RDEditorViewBean) mgr
230:                        .getViewBean(com.sun.portal.search.admin.RDEditorViewBean.class);
231:                target.forwardTo(rc);
232:            }
233:
234:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.