Source Code Cross Referenced for HeaderView.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:        import java.io.*;
014:
015:        import javax.servlet.http.HttpServletRequest;
016:
017:        import com.iplanet.jato.RequestContext;
018:
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.Option;
028:        import com.iplanet.jato.view.html.OptionList;
029:
030:        import com.iplanet.jato.view.View;
031:        import com.iplanet.jato.view.ContainerView;
032:        import com.iplanet.jato.RequestHandler;
033:        import com.iplanet.jato.view.RequestHandlingViewBase;
034:        import com.iplanet.jato.view.ViewBean;
035:        import com.iplanet.jato.view.ViewBeanBase;
036:
037:        import com.iplanet.jato.ViewBeanManager;
038:
039:        import com.iplanet.jato.model.ModelControlException;
040:
041:        import com.iplanet.am.console.components.view.html.IPlanetButton;
042:
043:        import com.sun.portal.search.admin.resources.SearchResource;
044:        import com.sun.portal.search.admin.model.CSServiceModel;
045:        import com.sun.portal.search.admin.model.CSServiceModelImpl;
046:        import com.sun.portal.search.util.SearchConfig;
047:        import com.sun.portal.log.common.PortalLogger;
048:
049:        /**
050:         * iPS admin console view bean: TODO
051:         */
052:        public class HeaderView extends RequestHandlingViewBase implements 
053:                ContainerView, RequestHandler {
054:            public static final String DEFAULT_DISPLAY_URL = "/ps/searchadmin/Header.jsp";
055:            public static final String PAGE_NAME = "Header";
056:            public static final String INSTANCE_LIST = "InstanceList";
057:            public static final String SELECTED_SUBMIT = "InstanceSubmit";
058:            public static final String MENU_LIST = "MenuList";
059:            public static final String TAB_PANEL = "TabMenu";
060:            private CSServiceModel model = null;
061:
062:            // Create a logger for this class
063:            private static Logger debugLogger = PortalLogger
064:                    .getLogger(HeaderView.class);
065:
066:            /**
067:             * constructor
068:             *
069:             * @param PageName  of this view bean
070:             * @param displayURL  default display URL
071:             */
072:            public HeaderView(View parent, String name) {
073:                super (parent, name);
074:                registerChildren();
075:            }
076:
077:            /**
078:             * register child component
079:             */
080:            protected void registerChildren() {
081:                registerChild(INSTANCE_LIST, ComboBox.class);
082:                //registerChild(MENU_LIST, MenuListView.class);
083:                registerChild(SELECTED_SUBMIT, IPlanetButton.class);
084:                //registerChild(TAB_PANEL, TabPanelView.class);
085:            }
086:
087:            /**
088:             * create child component
089:             *
090:             * @param name of component
091:             * @return child component
092:             */
093:            protected View createChild(String name) {
094:
095:                if (name.equals(INSTANCE_LIST)) {
096:                    return new ComboBox(this , INSTANCE_LIST, "");
097:                }
098:                if (name.equals(SELECTED_SUBMIT)) {
099:                    return new Button(this , SELECTED_SUBMIT, "");
100:                }
101:                throw new IllegalArgumentException("Invalid child name ["
102:                        + name + "]");
103:            }
104:
105:            /** begin displaying page. we set the required information
106:             *
107:             * @param event   display event
108:             * @throws ModelControlException  if problem access value of component
109:             */
110:            public void beginDisplay(DisplayEvent event)
111:                    throws ModelControlException {
112:                CSServiceModel m = getModel();
113:
114:                // Get request attributes and store them as Page Session Attributes
115:                RequestContext rc = getRequestContext();
116:                HttpServletRequest req = rc.getRequest();
117:                String server = req.getServerName();
118:                int port = req.getServerPort();
119:
120:                String currInst = (req.isSecure() ? "https" : "http") + "://"
121:                        + server + ":" + port + req.getContextPath();
122:                debugLogger.log(Level.FINER, "PSSH_CSPSA0042", currInst);
123:                ComboBox instance = (ComboBox) getChild(INSTANCE_LIST);
124:                //instance.setLabelForNoneSelected("---------------------------");
125:                instance.setLabelForNoneSelected("        ");
126:                if (instance != null) {
127:                    if (m != null) {
128:                        Set instances = m.getInstances();
129:                        if (instances != null) {
130:                            OptionList options = new OptionList();
131:                            Iterator items = instances.iterator();
132:                            while (items.hasNext()) {
133:                                String value = (String) items.next();
134:                                options.add(value, value);
135:                            }
136:                            instance.setOptions(options);
137:                        }
138:                    }
139:                    instance.setMultiSelect(false);
140:                    instance.setValue(currInst);
141:                }
142:            }
143:
144:            /**
145:             * Creates the model instance.
146:             *
147:             * @returns Instance of model
148:             */
149:            public CSServiceModel getModel() {
150:                if (model == null) {
151:                    model = new CSServiceModelImpl(getRequestContext()
152:                            .getRequest(), "searchadminmsgs");
153:                    //                "amAdminServiceMsgs");
154:                    if (model == null) {
155:                        /* TOFIX: Handle this case by displaying an error page.
156:                         * This should actually be done by making the SMDataModelImpl
157:                         * throw an exception and catching it.
158:                         */
159:                    } else {
160:                        model.process();
161:                    }
162:                }
163:                return model;
164:            }
165:
166:            /**
167:             * handles invocation of view bean
168:             *
169:             * @param event   request invocation event
170:             */
171:            public void handleInstanceSubmitRequest(RequestInvocationEvent event) {
172:                String url = (String) getDisplayFieldValue(INSTANCE_LIST)
173:                        + "/searchadmin/";
174:                debugLogger.log(Level.FINER, "PSSH_CSPSA0043", url);
175:                try {
176:                    getRequestContext().getResponse().sendRedirect(url);
177:                } catch (IOException e) {
178:                    debugLogger.log(Level.INFO, "PSSH_CSPSA0010", e
179:                            .getMessage());
180:                }
181:            }
182:
183:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.