001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */package org.apache.openejb.webadmin.main;
017:
018: import java.io.IOException;
019: import java.io.PrintWriter;
020:
021: import org.apache.openejb.webadmin.HttpRequest;
022: import org.apache.openejb.webadmin.HttpResponse;
023: import org.apache.openejb.webadmin.WebAdminBean;
024: import org.apache.openejb.webadmin.HttpHome;
025:
026: import javax.ejb.Stateless;
027: import javax.ejb.RemoteHome;
028:
029: /** This class represents the "Home" page for the webadmin. It contains general
030: * information, and more content to be added later.
031: * @author <a href="mailto:tim_urberg@yahoo.com">Tim Urberg</a>
032: */
033: @Stateless(name="Webadmin/Home")
034: @RemoteHome(HttpHome.class)
035: public class HomeBean extends WebAdminBean {
036:
037: /** Creates a new instance of HomeBean */
038: public void ejbCreate() {
039: this .section = "Home";
040: }
041:
042: /** after the processing is completed
043: * @param request the http request
044: * @param response the http response
045: * @throws IOException if an exception is thrown
046: *
047: */
048: public void postProcess(HttpRequest request, HttpResponse response)
049: throws IOException {
050: }
051:
052: /** before the process is done
053: * @param request the http request
054: * @param response the http response
055: * @throws IOException if an exception is thrown
056: *
057: */
058: public void preProcess(HttpRequest request, HttpResponse response)
059: throws IOException {
060: }
061:
062: /** Write the main content
063: *
064: * @param body the output to write to
065: * @exception IOException if an exception is thrown
066: *
067: */
068: public void writeBody(PrintWriter body) throws IOException {
069: body
070: .println("Welcome to the OpenEJB Web Administration website. This website is designed to help automate");
071: body
072: .println("many of the command line processes in OpenEJB. Please begin by selecting from one of the menu");
073: body.println("options.<br><br>");
074: body
075: .println("We encourage our users to participate in giving suggestions and submitting code and documentation");
076: body
077: .println("for the improvement of OpenEJB. Because it's open source, it's not just our project, it's everyone's");
078: body
079: .println("project! <b>Your feedback and contributions make OpenEJB a better project for everyone!</b> ");
080: body
081: .println("Future revisions of the OpenEJB Web Administration will contain:");
082: body.println("<ul type=\"disc\">");
083: body.println("<li>Better bean deployment</li>");
084: body.println("<li>Container Managed Persistance Mapping</li>");
085: body.println("<li>EJB Jar Validator</li>");
086: body.println("<li>More system information</li>");
087: body.println("<li>Better menu orginization</li>");
088: body
089: .println("<li>Addition of an extensive help section and documentation</li>");
090: body.println("<li>Your suggestions!!</li>");
091: body.println("</ul>");
092: body.println("<br>");
093: body
094: .println("If you have any problems with this website, please don�t hesitate to email the OpenEJB users list: ");
095: body
096: .println("<a href=\"mailto:user@openejb.org\">user@openejb.org</a> and we�ll");
097: body.println("respond to you as soon as possible.");
098: }
099:
100: /** Write the TITLE of the HTML document. This is the part
101: * that goes into the <code><head><title>
102: * </title></head></code> tags
103: *
104: * @param body the output to write to
105: * @exception IOException of an exception is thrown
106: *
107: */
108: public void writeHtmlTitle(PrintWriter body) throws IOException {
109: body.println(HTML_TITLE);
110: }
111:
112: /** Write the title of the page. This is displayed right
113: * above the main block of content.
114: *
115: * @param body the output to write to
116: * @exception IOException if an exception is thrown
117: *
118: */
119: public void writePageTitle(PrintWriter body) throws IOException {
120: body.println("Web Administration Home");
121: }
122:
123: /** Write the sub items for this bean in the left navigation bar of
124: * the page. This should look somthing like the one below:
125: *
126: * <code>
127: * <tr>
128: * <td valign="top" align="left">
129: * <a href="system?show=deployments"><span class="subMenuOff">
130: * Deployments
131: * </span>
132: * </a></td>
133: * </tr>
134: * </code>
135: *
136: * Alternately, the bean can use the method formatSubMenuItem(..) which
137: * will create HTML like the one above
138: *
139: * @param body the output to write to
140: * @exception IOException if an exception is thrown
141: *
142: */
143: public void writeSubMenuItems(PrintWriter body) throws IOException {
144: }
145:
146: }
|