KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openejb > webadmin > main > HomeBean


1 /**
2  * Redistribution and use of this software and associated documentation
3  * ("Software"), with or without modification, are permitted provided
4  * that the following conditions are met:
5  *
6  * 1. Redistributions of source code must retain copyright
7  * statements and notices. Redistributions must also contain a
8  * copy of this document.
9  *
10  * 2. Redistributions in binary form must reproduce the
11  * above copyright notice, this list of conditions and the
12  * following disclaimer in the documentation and/or other
13  * materials provided with the distribution.
14  *
15  * 3. The name "OpenEJB" must not be used to endorse or promote
16  * products derived from this Software without prior written
17  * permission of The OpenEJB Group. For written permission,
18  * please contact dev@openejb.org.
19  *
20  * 4. Products derived from this Software may not be called "OpenEJB"
21  * nor may "OpenEJB" appear in their names without prior written
22  * permission of The OpenEJB Group. OpenEJB is a registered
23  * trademark of The OpenEJB Group.
24  *
25  * 5. Due credit should be given to the OpenEJB Project
26  * (http://www.openejb.org/).
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE OPENEJB GROUP AND CONTRIBUTORS
29  * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
30  * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
31  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
32  * THE OPENEJB GROUP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
33  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
35  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
37  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
39  * OF THE POSSIBILITY OF SUCH DAMAGE.
40  *
41  * Copyright 2001 (C) The OpenEJB Group. All Rights Reserved.
42  *
43  * $Id: HomeBean.java 1912 2005-06-16 22:29:56Z jlaskowski $
44  */

45 package org.openejb.webadmin.main;
46
47 import java.io.IOException JavaDoc;
48 import java.io.PrintWriter JavaDoc;
49
50 import org.openejb.webadmin.HttpRequest;
51 import org.openejb.webadmin.HttpResponse;
52 import org.openejb.webadmin.WebAdminBean;
53
54 /** This class represents the "Home" page for the webadmin. It contains general
55  * information, and more content to be added later.
56  * @author <a HREF="mailto:tim_urberg@yahoo.com">Tim Urberg</a>
57  */

58 public class HomeBean extends WebAdminBean {
59
60     /** Creates a new instance of HomeBean */
61     public void ejbCreate() {
62         this.section = "Home";
63     }
64
65     /** after the processing is completed
66      * @param request the http request
67      * @param response the http response
68      * @throws IOException if an exception is thrown
69      *
70      */

71     public void postProcess(HttpRequest request, HttpResponse response) throws IOException JavaDoc {}
72
73     /** before the process is done
74      * @param request the http request
75      * @param response the http response
76      * @throws IOException if an exception is thrown
77      *
78      */

79     public void preProcess(HttpRequest request, HttpResponse response) throws IOException JavaDoc {}
80
81     /** Write the main content
82      *
83      * @param body the output to write to
84      * @exception IOException if an exception is thrown
85      *
86      */

87     public void writeBody(PrintWriter JavaDoc body) throws IOException JavaDoc {
88         body.println(
89             "Welcome to the OpenEJB Web Administration website. This website is designed to help automate");
90         body.println(
91             "many of the command line processes in OpenEJB. Please begin by selecting from one of the menu");
92         body.println("options.<br><br>");
93         body.println(
94             "We encourage our users to participate in giving suggestions and submitting code and documentation");
95         body.println(
96             "for the improvement of OpenEJB. Because it's open source, it's not just our project, it's everyone's");
97         body.println(
98             "project! <b>Your feedback and contributions make OpenEJB a better project for everyone!</b> ");
99         body.println("Future revisions of the OpenEJB Web Administration will contain:");
100         body.println("<ul type=\"disc\">");
101         body.println("<li>Better bean deployment</li>");
102         body.println("<li>Container Managed Persistance Mapping</li>");
103         body.println("<li>EJB Jar Validator</li>");
104         body.println("<li>More system information</li>");
105         body.println("<li>Better menu orginization</li>");
106         body.println("<li>Addition of an extensive help section and documentation</li>");
107         body.println("<li>Your suggestions!!</li>");
108         body.println("</ul>");
109         body.println("<br>");
110         body.println(
111             "If you have any problems with this website, please don’t hesitate to email the OpenEJB users list: ");
112         body.println(
113             "<a HREF=\"mailto:user@openejb.org\">user@openejb.org</a> and we’ll");
114         body.println("respond to you as soon as possible.");
115     }
116
117     /** Write the TITLE of the HTML document. This is the part
118      * that goes into the <code>&lt;head&gt;&lt;title&gt;
119      * &lt;/title&gt;&lt;/head&gt;</code> tags
120      *
121      * @param body the output to write to
122      * @exception IOException of an exception is thrown
123      *
124      */

125     public void writeHtmlTitle(PrintWriter JavaDoc body) throws IOException JavaDoc {
126         body.println(HTML_TITLE);
127     }
128
129     /** Write the title of the page. This is displayed right
130      * above the main block of content.
131      *
132      * @param body the output to write to
133      * @exception IOException if an exception is thrown
134      *
135      */

136     public void writePageTitle(PrintWriter JavaDoc body) throws IOException JavaDoc {
137         body.println("Web Administration Home");
138     }
139
140     /** Write the sub items for this bean in the left navigation bar of
141      * the page. This should look somthing like the one below:
142      *
143      * <code>
144      * &lt;tr&gt;
145      * &lt;td valign="top" align="left"&gt;
146      * &lt;a HREF="system?show=deployments"&gt;&lt;span class="subMenuOff"&gt;
147      * &nbsp;&nbsp;&nbsp;Deployments
148      * &lt;/span&gt;
149      * &lt;/a&gt;&lt;/td&gt;
150      * &lt;/tr&gt;
151      * </code>
152      *
153      * Alternately, the bean can use the method formatSubMenuItem(..) which
154      * will create HTML like the one above
155      *
156      * @param body the output to write to
157      * @exception IOException if an exception is thrown
158      *
159      */

160     public void writeSubMenuItems(PrintWriter JavaDoc body) throws IOException JavaDoc {}
161
162 }
163
Popular Tags