Source Code Cross Referenced for RunExpireViewBean.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.io.*;
010:        import java.util.logging.Level;
011:        import java.util.logging.Logger;
012:
013:        import com.sun.portal.search.util.SearchConfig;
014:        import com.sun.portal.log.common.PortalLogger;
015:
016:        import javax.servlet.http.HttpServletRequest;
017:        import javax.servlet.http.HttpServletResponse;
018:        import javax.servlet.jsp.JspWriter;
019:        import com.iplanet.jato.RequestContext;
020:
021:        import com.iplanet.jato.view.event.DisplayEvent;
022:        import com.iplanet.jato.view.event.ChildDisplayEvent;
023:        import com.iplanet.jato.view.event.JspChildDisplayEvent;
024:        import com.iplanet.jato.view.event.RequestInvocationEvent;
025:
026:        import com.iplanet.jato.view.html.StaticTextField;
027:
028:        import com.iplanet.jato.view.View;
029:        import com.iplanet.jato.view.ViewBean;
030:        import com.iplanet.jato.view.ViewBeanBase;
031:
032:        import com.iplanet.jato.ViewBeanManager;
033:
034:        import com.iplanet.jato.model.*;
035:
036:        //import com.iplanet.am.console.components.view.html.ParentagePath;
037:        import com.iplanet.am.console.components.view.html.IPlanetButton;
038:
039:        //import com.sun.portal.search.admin.model.PropertiesModel;
040:        //import com.sun.portal.search.admin.model.PropertiesModelImpl;
041:
042:        /**
043:         * iPS admin console view bean: TODO
044:         */
045:        public class RunExpireViewBean extends CSViewBeanBase {
046:            public static final String DEFAULT_DISPLAY_URL = "/ps/searchadmin/RunExpire.jsp";
047:            public static final String PAGE_NAME = "RunExpire";
048:            public static final String PROGRESS_TEXT = "ProgressText";
049:
050:            // Create a Logger for this class
051:            private static Logger debugLogger = PortalLogger
052:                    .getLogger(RunExpireViewBean.class);
053:
054:            /**
055:             * constructor
056:             *
057:             * @param PageName  of this view bean
058:             * @param displayURL  default display URL
059:             */
060:            public RunExpireViewBean() {
061:                super (PAGE_NAME);
062:                setDefaultDisplayURL(DEFAULT_DISPLAY_URL);
063:                registerChildren();
064:            }
065:
066:            /**
067:             * register child component
068:             */
069:            protected void registerChildren() {
070:                registerChild(PROGRESS_TEXT, StaticTextField.class);
071:
072:            }
073:
074:            /**
075:             * create child component
076:             *
077:             * @param name of component
078:             * @return child component
079:             */
080:            protected View createChild(String name) {
081:                View Headerchild = super .createChild(name);
082:                if (Headerchild != null)
083:                    return Headerchild;
084:                if (name.equals(PROGRESS_TEXT)) {
085:                    return new StaticTextField(this , PROGRESS_TEXT, "");
086:                }
087:                throw new IllegalArgumentException("Invalid child name ["
088:                        + name + "]");
089:            }
090:
091:            public void beginDisplay(DisplayEvent event) {
092:                setPageEncoding();
093:            }
094:
095:            private boolean executeCli(String cmd, String[] env, JspWriter out) {
096:                Runtime rt = Runtime.getRuntime();
097:                try {
098:                    if (out != null) {
099:                        out.flush();
100:                    }
101:                    Process ps = rt.exec(cmd, env);
102:                    BufferedReader buf = new BufferedReader(
103:                            new InputStreamReader(ps.getInputStream()));
104:                    String outLine = null;
105:                    while ((outLine = buf.readLine()) != null) {
106:                        if (out != null) {
107:                            out.println(outLine);
108:                            out.flush();
109:                        }
110:                    }
111:                    //            return ps.exitValue() == 0 ? true : false;
112:                } catch (IOException e) {
113:                    debugLogger.log(Level.INFO, "PSSH_CSPSA0010", e
114:                            .getMessage());
115:                    return false;
116:                }
117:                return true;
118:            }
119:
120:            public boolean beginProgressTextDisplay(ChildDisplayEvent event)
121:                    throws IOException {
122:                String r_env[] = { CSConfig.getLibPath() };
123:
124:                //RunExpireAgent runImp = new RunExpireAgent(null, null, null, null, null);
125:                // This demonstates how to use the supplied display event to output
126:                // directly to the JSP output stream
127:                JspWriter out = ((JspChildDisplayEvent) event).getPageContext()
128:                        .getOut();
129:                out.println("<pre>");
130:
131:                debugLogger.finer("PSSH_CSPSA0106");
132:
133:                String cmd;
134:
135:                if (System.getProperty("os.name").startsWith("win")
136:                        || System.getProperty("os.name").startsWith("Win")
137:                        || System.getProperty("os.name").startsWith("WIN")) {
138:                    cmd = CSConfig.getServerRoot() + File.separator
139:                            + "run-cs-cli.bat rdmgr -p stdout -E";
140:                } else {
141:                    cmd = CSConfig.getServerRoot() + File.separator
142:                            + "run-cs-cli rdmgr -p stdout -E";
143:                }
144:                debugLogger.log(Level.FINER, "PSSH_CSPSA0107", cmd);
145:                executeCli(cmd, r_env, out);
146:                return true;
147:            }
148:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.