Source Code Cross Referenced for RunAutoclassifyBean.java in  » Portal » Open-Portal » com » sun » portal » admin » console » search » 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.admin.console.search 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Copyright 2005 Sun Microsystems, Inc. All
003:         * rights reserved. Use of this product is subject
004:         * to license terms. Federal Acquisitions:
005:         * Commercial Software -- Government Users
006:         * Subject to Standard License Terms and
007:         * Conditions.
008:         *
009:         * Sun, Sun Microsystems, the Sun logo, and Sun ONE
010:         * are trademarks or registered trademarks of Sun Microsystems,
011:         * Inc. in the United States and other countries.
012:         */package com.sun.portal.admin.console.search;
013:
014:        import java.util.*;
015:        import java.util.logging.Level;
016:        import java.io.*;
017:
018:        import javax.faces.context.FacesContext;
019:        import javax.faces.el.ValueBinding;
020:        import javax.servlet.http.HttpServletRequest;
021:        import javax.management.*;
022:
023:        import com.sun.web.ui.component.*;
024:        import com.sun.web.ui.model.*;
025:        import com.sun.web.ui.event.*;
026:
027:        import com.sun.data.provider.*;
028:        import com.sun.data.provider.impl.ObjectListDataProvider;
029:
030:        import com.sun.cacao.agent.JmxClient;
031:
032:        import com.sun.portal.admin.common.util.AdminClientUtil;
033:        import com.sun.portal.admin.console.common.PSBaseBean;
034:
035:        public class RunAutoclassifyBean extends PSBaseBean implements 
036:                WizardEventListener {
037:
038:            public String database = "default";
039:            public String result = "";
040:
041:            public RunAutoclassifyBean() {
042:            }
043:
044:            public boolean handleEvent(WizardEvent event) {
045:                int eventCode = event.getNavigationEvent();
046:                if (eventCode == WizardEvent.FINISH) {
047:                    runAutoclassify();
048:                } else if (eventCode == WizardEvent.CLOSE) {
049:                    database = "default";
050:                    result = "";
051:                }
052:                return true;
053:            }
054:
055:            public String getDatabase() {
056:                return database;
057:            }
058:
059:            public void setDatabase(String database) {
060:                this .database = database;
061:            }
062:
063:            public String getResult() {
064:                return result;
065:            }
066:
067:            public void setResult(String result) {
068:                this .result = result;
069:            }
070:
071:            public boolean isTransient() {
072:                return false;
073:            }
074:
075:            public void setTransient(boolean flag) {
076:            }
077:
078:            public Object saveState(FacesContext context) {
079:                return null;
080:            }
081:
082:            public void restoreState(FacesContext context, Object state) {
083:            }
084:
085:            private void runAutoclassify() {
086:                FacesContext fc = FacesContext.getCurrentInstance();
087:                HttpServletRequest request = (HttpServletRequest) fc
088:                        .getExternalContext().getRequest();
089:                Locale locale = request.getLocale();
090:                if (locale == null) {
091:                    locale = Locale.getDefault();
092:                }
093:
094:                StringBuffer sb = new StringBuffer();
095:                try {
096:                    LinkedList path = new LinkedList();
097:                    path.addFirst(AdminClientUtil.DEFAULT_DOMAIN);
098:                    path
099:                            .addFirst((String) getSessionAttribute("search.server.selected"));
100:                    path.addFirst("autoclassify");
101:                    ObjectName on = AdminClientUtil.getResourceMBeanObjectName(
102:                            AdminClientUtil.SEARCH_AUTOCLASSIFY_MBEAN_TYPE,
103:                            path);
104:
105:                    String output = "";
106:
107:                    String[] list = database.split(":");
108:                    if (list.length > 0) {
109:                        ArrayList al = new ArrayList();
110:                        for (int i = 0; i < list.length; i++) {
111:                            al.add(list[i]);
112:                        }
113:                        Object[] params = { al, locale.toString(), "" };
114:                        String[] signature = { "java.util.ArrayList",
115:                                "java.lang.String", "java.lang.String" };
116:                        output = (String) getMBeanServerConnection().invoke(on,
117:                                "runAutoclassify", params, signature);
118:                    } else {
119:                        Object[] params = { database, locale.toString(), "" };
120:                        String[] signature = { "java.lang.String",
121:                                "java.lang.String", "java.lang.String" };
122:                        output = (String) getMBeanServerConnection().invoke(on,
123:                                "runAutoclassify", params, signature);
124:                    }
125:                    if (output != null) {
126:                        StringTokenizer st = new StringTokenizer(output, "\n");
127:                        while (st.hasMoreTokens()) {
128:                            String message = st.nextToken();
129:                            sb.append(message + "<br><br>");
130:                        }
131:                    }
132:                } catch (Exception e) {
133:                    log(
134:                            Level.SEVERE,
135:                            "RunAutoclassifyBean.runAutoclassify() : Exception ",
136:                            e);
137:                }
138:                result = sb.toString();
139:            }
140:
141:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.