Source Code Cross Referenced for RDFormViewBean.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.log.common.PortalLogger;
054:
055:        /**
056:         * iPS admin console view bean: TODO
057:         */
058:        public class RDFormViewBean extends CSViewBeanBase {
059:            public static final String DEFAULT_DISPLAY_URL = "/ps/searchadmin/RDForm.jsp";
060:            public static final String PAGE_NAME = "RDForm";
061:            public static final String RD_VIEW = "RDView";
062:            public static final String SUBMIT_BUTTON = "SubmitButton";
063:            public static final String RESET_BUTTON = "ResetButton";
064:            public static final String CLOSE_BUTTON = "CloseButton";
065:            public static final String BROWSER_VIEW = "TaxonomyBrowser";
066:            private SToken st = null;
067:            private boolean isSingle = false;
068:            private boolean isUpdated = false;
069:
070:            // Create a Logger for this class
071:            private static Logger debugLogger = PortalLogger
072:                    .getLogger(RDFormViewBean.class);
073:
074:            /**
075:             * constructor
076:             *
077:             * @param PageName  of this view bean
078:             * @param displayURL  default display URL
079:             */
080:            public RDFormViewBean() {
081:                super (PAGE_NAME);
082:                setDefaultDisplayURL(DEFAULT_DISPLAY_URL);
083:                registerChildren();
084:
085:            }
086:
087:            /**
088:             * register child component
089:             */
090:            protected void registerChildren() {
091:                registerChild(RD_VIEW, RDView.class);
092:                registerChild(SUBMIT_BUTTON, IPlanetButton.class);
093:                registerChild(RESET_BUTTON, IPlanetButton.class);
094:                registerChild(CLOSE_BUTTON, IPlanetButton.class);
095:                registerChild(BROWSER_VIEW, TaxonomyBrowserView.class);
096:
097:            }
098:
099:            /**
100:             * create child component
101:             *
102:             * @param name of component
103:             * @return child component
104:             */
105:            protected View createChild(String name) {
106:                View Headerchild = super .createChild(name);
107:                if (Headerchild != null)
108:                    return Headerchild;
109:                if (name.equals(RD_VIEW)) {
110:                    return new RDView(this , RD_VIEW);
111:                }
112:                if (name.equals(SUBMIT_BUTTON)) {
113:                    IPlanetButton btn = new IPlanetButton(this , SUBMIT_BUTTON,
114:                            "");
115:                    btn.validate(true);
116:                    return btn;
117:                }
118:                if (name.equals(RESET_BUTTON)) {
119:                    return new IPlanetButton(this , RESET_BUTTON, "");
120:                }
121:                if (name.equals(CLOSE_BUTTON)) {
122:                    return new IPlanetButton(this , CLOSE_BUTTON, "");
123:                }
124:                if (name.equals(BROWSER_VIEW)) {
125:                    return new TaxonomyBrowserView(this , BROWSER_VIEW);
126:                }
127:                throw new IllegalArgumentException("Invalid child name ["
128:                        + name + "]");
129:            }
130:
131:            public boolean beginEditorSectionDisplay(ChildDisplayEvent event) {
132:                String isBrowsing = (String) getPageSessionAttribute(TaxonomyBrowserView.SESION_ATTR_BROWSING_ON);
133:                debugLogger.log(Level.FINER, "PSSH_CSPSA0071", isBrowsing);
134:                return (isBrowsing == null || !isBrowsing
135:                        .equalsIgnoreCase("true"))
136:                        && !beginBatchConfirmSectionDisplay(event);
137:            }
138:
139:            public boolean beginBrowseSectionDisplay(ChildDisplayEvent event) {
140:                String isBrowsing = (String) getPageSessionAttribute(TaxonomyBrowserView.SESION_ATTR_BROWSING_ON);
141:                setPageSessionAttribute(TaxonomyBrowserView.CHILD_PAGE_HELP,
142:                        this .getLocalizedString("rd.edit.browse.help"));
143:                debugLogger.log(Level.FINER, "PSSH_CSPSA0071", isBrowsing);
144:                return (isBrowsing != null && isBrowsing
145:                        .equalsIgnoreCase("true"));
146:            }
147:
148:            public boolean beginBatchConfirmSectionDisplay(
149:                    ChildDisplayEvent event) {
150:                return isUpdated && !isSingle;
151:            }
152:
153:            /** begin displaying page. we set the required information
154:             *
155:             * @param event   display event
156:             * @throws ModelControlException  if problem access value of component
157:             */
158:            public void beginDisplay(DisplayEvent event) {
159:                setPageEncoding();
160:                if (getPageSessionAttribute(TaxonomyBrowserView.SESION_ATTR_BROWSING_ON) != null) {
161:                    return;
162:                }
163:                String editTimeStamp = (String) getPageSessionAttribute("editTimeStamp");
164:                if (editTimeStamp == null) {
165:                    editTimeStamp = getRequestContext().getRequest()
166:                            .getParameter("editTimeStamp");
167:                    if (editTimeStamp != null) {
168:                        setPageSessionAttribute("editTimeStamp", editTimeStamp);
169:                    }
170:                }
171:                ArrayList urlList = (ArrayList) getRequestContext()
172:                        .getRequest().getSession().getAttribute(
173:                                "urls" + editTimeStamp);
174:                if (urlList == null) {
175:                    String urlsPar = getRequestContext().getRequest()
176:                            .getParameter("urls");
177:                    if (urlsPar != null) {
178:                        urlList = RDView.parseURLSString(urlsPar);
179:                    }
180:                }
181:                if ((urlList != null) && urlList.size() == 1) {
182:                    isSingle = true;
183:                }
184:                debugLogger.log(Level.FINER, "PSSH_CSPSA0088", Boolean
185:                        .toString(isSingle));
186:                if (!isSingle && !isUpdated) {
187:                    infoMessage = getLocalizedString("rd.batchmode.desc");
188:                }
189:
190:                setDisplayFieldValue(SUBMIT_BUTTON,
191:                        getLocalizedString("submit.text"));
192:                setDisplayFieldValue(RESET_BUTTON,
193:                        getLocalizedString("reset.text"));
194:                setDisplayFieldValue(CLOSE_BUTTON,
195:                        getLocalizedString("close.text"));
196:
197:            }
198:
199:            private SToken getSToken() {
200:                if (st == null) {
201:                    HttpServletRequest req = getRequestContext().getRequest();
202:                    try {
203:                        SSOTokenManager manager = SSOTokenManager.getInstance();
204:                        SSOToken token = null;
205:                        token = manager.createSSOToken(req);
206:                        st = new SToken((Object) token, true, true);
207:                    } catch (SSOException e) {
208:                        debugLogger.log(Level.INFO, "PSSH_CSPSA0010", e
209:                                .getMessage());
210:                        // nothing, might be sso cookie is not there
211:                    }
212:                }
213:                return st;
214:            }
215:
216:            /**
217:             * handles invocation of view bean
218:             *
219:             * @param event   request invocation event
220:             */
221:            public void handleResetButtonRequest(RequestInvocationEvent event) {
222:                this .forwardTo();
223:            }
224:
225:            public void handleSubmitButtonRequest(RequestInvocationEvent event) {
226:                RDView rdview = (RDView) getChild(RD_VIEW);
227:                try {
228:                    rdview.update();
229:                    infoMessage = getLocalizedString("rd.update.success");
230:                    String editTimeStamp = (String) getPageSessionAttribute("editTimeStamp");
231:                    removePageSessionAttribute("editTimeStamp");
232:                    removePageSessionAttribute(TaxonomyBrowserView.SESION_ATTR_SELECTED_TAX
233:                            + editTimeStamp);
234:                    removePageSessionAttribute(TaxonomyBrowserView.SESION_ATTR_SELECTED_TAX_ORG
235:                            + editTimeStamp);
236:                    isUpdated = true;
237:                } catch (Exception e) {
238:                    errorMessage = getLocalizedString("rd.update.error");
239:                }
240:                forwardTo();
241:
242:            }
243:
244:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.