|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jetspeed.serializer.JetspeedDDLApplication
public class JetspeedDDLApplication
Jetspeed Serializer DDL- Application invoke with mandatory either
-I directory or filename of schema files for input, if directory all xml files will be processed
and/or-O schema file for output log of current database
and (if -I denotes a directory:)-x if directory list provided for input schemas this pattern is excluded
-s name of the order file (if schema directory)
-m if directory list provided this is the merge file to use. If not set here or in the properties file, a hardcoded version is used
note that - if -I and -O are specified, the output file will contain the UPDATED database
invoke with (optional) parameters-P propertyFileName, for settings
-R (flag) replace : overwrites default "UPDATE" and clears out the database before processing (ignored with -O option above)
-dn databaseName, for example MYSQL or ORACLE10
-dc driverClass, for example com.mysql.jdbc.Driver
-ds url, ruls according to the driver used, URL needs to point to the correct database
-du user, user with create/drop etc. rights on the database
-dp password
-l log4j-level, ERROR (default), WARN, INFO
Nested Class Summary | |
---|---|
(package private) class |
JetspeedDDLApplication.LocalFilenameFilter
|
Field Summary | |
---|---|
(package private) String[] |
args
|
(package private) org.apache.commons.configuration.PropertiesConfiguration |
configuration
|
(package private) String |
databaseName
|
(package private) boolean |
doExport
|
(package private) boolean |
doImport
|
(package private) String |
driverClass
|
(package private) String |
exludeFileName
|
(package private) String[] |
filesToProcess
|
static String |
JNDI_DS_NAME
|
(package private) String |
logLevel
|
(package private) String |
mergeFile
|
(package private) String |
orderFileName
|
(package private) String |
outputFile
|
(package private) boolean |
overwrite
|
(package private) String |
password
|
(package private) String |
propertyFileName
|
(package private) String |
schemaDirectory
|
(package private) String |
url
|
(package private) String |
user
|
Constructor Summary | |
---|---|
JetspeedDDLApplication()
|
Method Summary | |
---|---|
private void |
checkDBSettings()
ensure that we have valid database settings |
private File |
createTemp(String suffix)
Helper routine to create a temporary file |
private File |
createXSLTFromFile(String fileName)
Open the merge file from disk |
private File |
createXSLTFromMemory()
If everything else fails, use a hardcoded XSLT here |
List |
getRows(JetspeedDDLUtil ddlUtil,
String tableName)
|
String |
getSelectQueryForAllString(JetspeedDDLUtil ddlUtil,
org.apache.ddlutils.model.Table table)
|
static void |
main(String[] args)
|
private String |
mergeFiles(String[] fileList)
process of merging two or more schema files into one schema file. |
private void |
parseArguments()
parse arguments for process instructions, order and exclude files as well as optional database arguments |
private String[] |
parseFiles()
process provided filename or directory name |
private void |
processArguments(String[] arguments)
setup environment by processing all arguments and call requested process routine |
private void |
processExport(JetspeedDDLUtil ddlUtil)
read database schema to file |
private void |
processImport(JetspeedDDLUtil ddlUtil)
create/alter database |
private void |
processPropertyFile()
read the property file and read what has not yet been defined |
private ArrayList |
readOrderFile(String importFileName)
read an xml file describing the basic order of the files to be processed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String JNDI_DS_NAME
String propertyFileName
String exludeFileName
String orderFileName
String logLevel
org.apache.commons.configuration.PropertiesConfiguration configuration
boolean doImport
boolean doExport
String schemaDirectory
String outputFile
boolean overwrite
String driverClass
String url
String user
String password
String databaseName
String[] filesToProcess
String mergeFile
String[] args
Constructor Detail |
---|
public JetspeedDDLApplication()
Method Detail |
---|
public static void main(String[] args) throws Exception
Exception
private void checkDBSettings()
private void parseArguments()
private String[] parseFiles()
private void processArguments(String[] arguments) throws Exception
arguments
-
Exception
private void processImport(JetspeedDDLUtil ddlUtil)
ddlUtil
- private File createTemp(String suffix)
suffix
-
private File createXSLTFromFile(String fileName)
fileName
-
private File createXSLTFromMemory()
private String mergeFiles(String[] fileList)
fileList
- The filelist contains a (potentially) ordered list of schemas
private void processExport(JetspeedDDLUtil ddlUtil)
private void processPropertyFile()
public List getRows(JetspeedDDLUtil ddlUtil, String tableName)
public String getSelectQueryForAllString(JetspeedDDLUtil ddlUtil, org.apache.ddlutils.model.Table table)
private ArrayList readOrderFile(String importFileName)
importFileName
-
SerializerException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |