Expresso 5-6

com.jcorporate.expresso.services.servlet
Class DBCreate

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bycom.jcorporate.expresso.core.servlet.StdServlet
              extended bycom.jcorporate.expresso.core.servlet.DBServlet
                  extended bycom.jcorporate.expresso.services.servlet.DBCreate
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class DBCreate
extends DBServlet

Servlet to initialize the database and various default items in it. Use it as a friendly alternative to the DBTool command line utility.

Version:
$Revision: 1.25 $ $Date: 2004/11/17 20:48:18 $
Author:
Michael Nash
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.jcorporate.expresso.core.servlet.DBServlet
thisClass
 
Fields inherited from class com.jcorporate.expresso.core.servlet.StdServlet
mySchema
 
Constructor Summary
DBCreate()
           
 
Method Summary
 void doGet(HttpServletRequest request, HttpServletResponse response)
          doGet method presents a form allowing the user to select several intialize options
 void doPost(HttpServletRequest request, HttpServletResponse response)
          doPost receives the options from the form & calls methods to actually perform the intiailizations
 void init(ServletConfig sc)
          Initialize the serv.et
protected  boolean isAdmin(HttpServletRequest request, HttpServletResponse response)
          Checks to see if the current user is an Admin.
protected  boolean isInitialDatabaseCreated()
          Checks to see if a database of any sort has already been created in the default context.
 
Methods inherited from class com.jcorporate.expresso.core.servlet.DBServlet
destroy, getDBName, requireLogin, setDBName, setSkipLogin, setupChannels
 
Methods inherited from class com.jcorporate.expresso.core.servlet.StdServlet
getSchema, getServerName, getServerPort, getServletPrefix, getServletPrefix, getString, getString, getTitle, handleParam, setSchema, showError, showError
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBCreate

public DBCreate()
Method Detail

init

public void init(ServletConfig sc)
          throws ServletException
Initialize the serv.et

Specified by:
init in interface Servlet
Overrides:
init in class DBServlet
Parameters:
sc - The servlet config object given to us by the servlet container
Throws:
ServletException

doGet

public void doGet(HttpServletRequest request,
                  HttpServletResponse response)
           throws ServletException,
                  IOException
doGet method presents a form allowing the user to select several intialize options

Overrides:
doGet in class DBServlet
Parameters:
request - Standard request object
response - Standard response object
Throws:
ServletException - If an uncaught exception occurrs
IOException - If an I/O error occurrs communicating with the client

doPost

public void doPost(HttpServletRequest request,
                   HttpServletResponse response)
            throws ServletException,
                   IOException
doPost receives the options from the form & calls methods to actually perform the intiailizations

Overrides:
doPost in class DBServlet
Parameters:
request - Standard request object
response - Standard reponse object
Throws:
ServletException - If an uncaught exception occurrs
IOException - If an I/O error occurrs communicating with the client

isInitialDatabaseCreated

protected boolean isInitialDatabaseCreated()
Checks to see if a database of any sort has already been created in the default context.

Returns:
True if the schemalist object exists in the system

isAdmin

protected boolean isAdmin(HttpServletRequest request,
                          HttpServletResponse response)
                   throws ServletException
Checks to see if the current user is an Admin.

Parameters:
request - The ServletRequest object
response - The Servlet Response object
Returns:
true if the CurrentLogin is an Admin User
Throws:
ServletException - if there's an error processing the request

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.