|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Thread
com.jcorporate.expresso.core.utility.DBTool
DBTool is a multi-purpose tool for working with database objects. It can:
configDir - <Directory that contains your config files>
webbAppDir -<The Expresso webapp directory>
db=<The database to create>
These arguments define the role to use as well as some arguments are specific for a given task.
| Field Summary |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
DBTool()
Constructor |
|
| Method Summary | |
static List |
compareTables(InstallLog theLog,
Vector allSchemas,
String dbName)
Reverse engineer the table for each db object for every known schema, then compare the fields in the database to the fields in the db object and report on the differences to the the log and to System.err todo why isn't this log passed in used? |
static void |
createTables(InstallLog theLog,
Vector allSchemas,
String dataContext)
Create the tables required by the database objects in the list of schemas. |
static void |
deleteSchema(Page myPage,
String dbName,
String schemaName)
Method to remove an installed schema. |
static void |
deleteSchema(Page myPage,
String dbName,
Vector schemas)
Method wipes out more than one installed schema. |
static void |
deleteTable(String dbName,
String tableName)
Delete Table - Deletes a table from the specified db |
static void |
main(String[] args)
Main method so that DBTool can be launched from a command line |
static void |
otherSetups(InstallLog theLog,
Vector allSchemas,
String dbName)
Method to perform any other additonal setup required by each schema |
static void |
populateTables(InstallLog installLog,
Vector allSchemas,
String dbName)
This method goes through the schemas and populates tables with default values if they do not exist. |
static void |
setupConfig(InstallLog installLog,
Vector allSchemas,
String dbName)
Method to set up the default Setup values for each schema. |
static void |
setupSecurity(InstallLog theLog,
Vector allSchemas,
String dbName)
This method creates default security entries for all of the database objects and controller objects for the known schemas. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public DBTool()
| Method Detail |
public static void deleteTable(String dbName,
String tableName)
throws DBException
dbName - - the name of the db that contains this tabletableName - - The name of the table to delete.
DBException
public static void deleteSchema(Page myPage,
String dbName,
Vector schemas)
throws DBException,
HtmlException,
IllegalArgumentException
myPage - an HTML page to render output to (optional)dbName - The database context to create the database in.schemas - List of the schema objects to delete
HtmlException - if an error occurs constructing the HTML code
DBException
IllegalArgumentException
public static void deleteSchema(Page myPage,
String dbName,
String schemaName)
throws DBException,
HtmlException,
IllegalArgumentException
myPage - - The page to output the 'log' to.dbName - - the name of the database to perform this operationschemaName - - the full classname of the schema to delete.
IllegalArgumentException - if the schema doesn't exist.
DBException - If there is a database problem creating
the new default values
HtmlException - If there is a problem building the
confirmation page
Modify by Yves Henri AMAIZO
public static List compareTables(InstallLog theLog,
Vector allSchemas,
String dbName)
throws DBException,
ConfigurationException
theLog - the Install log to output toallSchemas - a vector of all the schemas to comparedbName - the data context to use
DBException
ConfigurationExceptionpublic static void main(String[] args)
args - Command line arguments to supply the information to
connect to the database
public static void createTables(InstallLog theLog,
Vector allSchemas,
String dataContext)
throws DBException
theLog - The installLog object. Use ConsoleInstallLog if you
don't know what this does.allSchemas - List of the schema objectsdataContext - The database context to create the database in.
DBException - If there is a problem creating the tables
public static void otherSetups(InstallLog theLog,
Vector allSchemas,
String dbName)
throws DBException
theLog - InstallLog object to save the data toallSchemas - List of the schema objectsdbName - The database context to create the database in.
DBException - If there is a database problem creating
the new default values
public static void populateTables(InstallLog installLog,
Vector allSchemas,
String dbName)
throws DBException
installLog - The InstallLog to save the output traces toallSchemas - List of the schema objectsdbName - The database context to create the database in.
DBException - If a problem occurrs putting the default records
in the database
public static void setupConfig(InstallLog installLog,
Vector allSchemas,
String dbName)
throws DBException
installLog - - The installation log to log output toallSchemas - A list of all of the schema objectsdbName - The database context to setup the config in.
DBException - If there is a database problem creating
the new default values
public static void setupSecurity(InstallLog theLog,
Vector allSchemas,
String dbName)
throws DBException
theLog - Installation LogallSchemas - List of the schema objectsdbName - The database context to create the database in.
DBException - If a problem occurrs putting the security info
in the database
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||