|
Expresso 5-5-0 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.kernel.ComponentBase
com.jcorporate.expresso.kernel.ContainerComponentBase
com.jcorporate.expresso.core.dbobj.Schema
A Schema contains a collection of DBObjects, Controllers, Jobs, and MessageBundles allowing them to be created all at once, dropped at once, and reported on as a group A schema also contains (optional) a list of ReportPage objects that make up the standard reports for a package
You create your own schema as the hub of your Expresso-based component. To do this, derive your own class from Schema, override the abstract members to give your component a name, component code, etc. And then in the constructor of the schema, you add the various components such as DBOBjects to your schema.
| Constructor Summary | |
Schema()
Constructor - actual Schema objects should extend this constructor, not override it. |
|
| Method Summary | |
void |
add(Controller oneController)
Deprecated. See the addController(Class) method instead |
void |
add(DBObject oneMember)
Deprecated. See the addDBObject(Class) method instead Since Expresso 5.0 |
void |
add(DBObject oneMember,
String otherDBName)
Deprecated. See the addDBObject(String) method instead since Expresso 5.3 |
void |
add(Job oneJob)
Add a new Job object to this schema |
void |
add(ReportPage oneReport)
Deprecated. See addReportPage(String) method instead |
void |
add(StdServlet oneServlet)
Deprecated. See addServlet(Class) method instead |
void |
add(String schemaClass,
String setupCode,
String descrip,
String defaultValue)
Deprecated. since 3/04; use addSetup() instead |
void |
addCategory(String string1,
String string2)
Deprecated. since Expresso 5.1 |
protected void |
addController(Class c)
New method of adding a controller to the default category. |
protected void |
addController(Class c,
String categoryName)
New method of adding a controller to the default category. |
protected void |
addController(String controllerName)
Add a controller to the default category |
protected void |
addController(String controllerName,
String categoryName)
New method to add controller objects to the list of controllers in this Schema object. |
protected void |
addDBObject(Class c)
New method of adding a dbobject to the default category. |
protected void |
addDBObject(Class c,
String categoryName)
New method of adding a dbobject to the specified category. |
protected void |
addDBObject(String dbobjectClass)
Method to add a dbobject to the list of dbobjects in this schema |
protected void |
addDBObject(String dbobjectClass,
String otherDBName)
Method to add a dbobject to the list of dbobjects in this schema for a named dbother location in the default category. |
protected void |
addDBObject(String dbobjectClass,
String otherDBName,
String categoryName)
Method to add a dbobject to the list of dbobjects in this schema for a named dbother location and named category. |
protected void |
addJob(Class c)
method of adding a job to the specified category. |
protected void |
addJob(Class c,
String unused)
Deprecated. Categories are no longer supported since Expresso 5.3 |
void |
addJob(String jobClassName)
Deprecated. Use addJob(class) instead |
void |
addJob(String jobClassName,
String unused)
Deprecated. Categories are no longer supported since Expresso 5.3 |
void |
addReportPage(Class reportClass)
Add a new report page to the schema. |
void |
addReportPage(String reportClassName)
Add a new ReportPage to the default category |
void |
addReportPage(String reportClassName,
String categoryName)
Deprecated. Since Expresso 5.3 Category is no longer supported |
protected void |
addServlet(Class c)
New method of adding a servlet to the specified category. |
protected void |
addServlet(Class c,
String unused)
Deprecated. category name parameter is no longer supported |
void |
addServlet(String servletClassName)
Deprecated. use addServlet(Class) instead |
void |
addServlet(String servletClassName,
String unused)
Deprecated. since Expresso 5.3 category name is not supported |
void |
addSetup(String setupCode,
String descrip,
String defaultValue)
Add a new setup value to this schema for THIS schema; will not change value if one already exists in Setup table |
void |
addSetup(String schemaClass,
String setupCode,
String descrip,
String defaultValue)
Add a new setup value to the named schema; will not change value if one already exists in Setup table |
void |
configure(Configuration newConfig)
Provide Configurations |
boolean |
contains(DBObject dbObject)
|
Vector |
createAsNeeded(String dbName)
Deprecated. Use TableCreator.getInstance().createAsNeeded(this,dbName); |
void |
createTable(DBObject dbObj)
Deprecated. Use TableCreator.getInstance().createTable(DBObj) instead |
void |
destroy()
Called upon destruction of the service. |
Vector |
getConfig()
Return the list of configuration values required by this schema |
List |
getControllerList()
Return a list of the Controller objects that are members of this schema. |
Enumeration |
getControllers()
Deprecated. Since Expresso 5.3 use getControllerList() instead. |
String |
getDBName()
Return the name of the context/database connection that this schema is being applied to. |
Hashtable |
getDBObjMap()
Retrieves the DBObject Map for table creation. |
String |
getDefaultComponentCode()
Returns the default component code for this schema. |
String |
getDefaultDescription()
Returns the default description for this schema. |
static Hashtable |
getExpressoToSQLMap(String dataContext)
Deprecated. Use TypeMapper.getInstance(dbKey).getExpressoToSQLMap() instead |
static Schema |
getInstance()
|
static int |
getJavaSQLType(String dataContext,
String fieldType)
Deprecated. Use TypeMapper.getInstance(dbKey).getJavaSQLType(fieldType) instead |
Enumeration |
getJobs()
Return an enumeration of the jobs that are members of this schema |
Controller |
getLoginController()
Retrieve the login controller for your schema. |
Enumeration |
getMembers()
Return an enumeration of the database objects that belong to this schema |
String |
getMessageBundlePath()
Return the path, relative to the classpath, of the MessageBundle file for this schema. |
URL |
getMetadataLocation()
Base metadata location. |
Controller |
getRegistrationController()
Retrieve the registration controller. |
Vector |
getReports()
Return the list of ExpressoReport objects that are required by this schema. |
int |
getRequestingUser()
UID of requesting user |
Enumeration |
getServlets()
Return an enumeration of the servlets that are members of this schema |
protected String |
getSetupDefault(String paramName,
String defaultValue)
Return the value if this property is defined in the properties file for this config key. |
String |
getSetupValue(String key)
Retrieve one of the Setup values for the schema. |
static Hashtable |
getSQLToDBMap(String dataContext)
Deprecated. Use TypeMapper.getInstance(dbKey).getSQLToDBMap(fieldType) instead |
Controller |
getStartController()
Return a single transaction as the "starting point" for this application. |
protected String |
getString(String stringCode)
Get the i18N'ized string for this schema |
Enumeration |
getTests()
Return the list of Junit tests in this application |
String |
getVersion()
Method to return the current version number of an application Schema. |
void |
initialize()
Initialize Lifecycle event. |
static Schema |
instantiate(String className)
Convenience method to create a Schema object from it's name |
void |
otherSetup(InstallLog installLog,
String dataContext)
preferable way of performaing other setup. |
void |
otherSetup(Page myPage,
String dbName)
Deprecated. since Expresso 5.1 use otherSetup(InstallLog,String) instead |
void |
otherSetup(String dbName)
Perform any additional setup/intialize functions required by this schema. |
void |
populateSchemaData(String dbName)
Allow populations of sample data where all tables must be set up first. |
void |
reconfigure(Configuration newConfig)
Reconfigure Lifecycle Event. |
protected void |
requiresVersion(String versionString,
String schemaClassName)
Method for a schema to define a dependance on another schema with a particular version - e.g. if eContent requires expresso 3.11, it can call this method to ensure that's the version it's being run with |
void |
setDBName(String newOther)
Set the database name/context for this schema. |
void |
setRequestingUser(int uid)
set the user ID of requester |
void |
setSetupValue(String key,
String value)
Sets the setup values for the given key |
void |
setupDefaultValues(String dbName)
Go through each DBobject in the schema and call populateDefaultValues. |
void |
setupDefaultValuesWithException(String dbName)
Go through each DBobject in the schema and call populateDefaultValues. |
static String |
typeForDB(String dbName,
String expressoType)
Deprecated. use TypeMapper.getInstance(dbName).getTypeForDB(String) instead |
static String |
typeForExpresso(String dbName,
int sqlType)
Deprecated. use TypeMapper.getInstance(dbName).getTypeForExpresso(int) instead |
| Methods inherited from class com.jcorporate.expresso.kernel.ContainerComponentBase |
getContainerImplementation, locateComponent, setContainerImplementation |
| Methods inherited from class com.jcorporate.expresso.kernel.ComponentBase |
getMetaData, getParent, setMetaData, setParent |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.jcorporate.expresso.kernel.ExpressoComponent |
getMetaData, getParent, setParent |
| Constructor Detail |
public Schema()
| Method Detail |
public static Hashtable getExpressoToSQLMap(String dataContext)
dataContext - The database context to retrieve the values for.
public static int getJavaSQLType(String dataContext,
String fieldType)
throws DBException
dataContext - the data context to retrievefieldType - the type of the field to map.
DBException - if there was an error initializing the ExpressoToSQL maps.public static Hashtable getSQLToDBMap(String dataContext)
dataContext - The database context to retrieve the values for.
protected void addDBObject(String dbobjectClass)
dbobjectClass - the class name of the DBObject that you want to add.
protected void addDBObject(Class c,
String categoryName)
c - the class name of the DBObject that you want to add.categoryName - the category to which this controller belongs.protected void addDBObject(Class c)
addController("your.class.here.class");
- Parameters:
c - the class of the controller that you want to add. If you mis-type
your controller name, the compiler will catch it at compile time.
protected void addDBObject(String dbobjectClass,
String otherDBName)
dbobjectClass - the name of the database object class to useotherDBName - The dbcontext to use for this dataobject.
protected void addDBObject(String dbobjectClass,
String otherDBName,
String categoryName)
dbobjectClass - The name of the dbobject to add to the schema.otherDBName - The dbcontext to use for this dataobject.categoryName - the navigation category to use for this database objectprotected void addController(String controllerName)
controllerName - the String name of the controller to add to the
schemaprotected void addController(Class c)
addController("your.class.here.class");
- Parameters:
c - the class of the controller that you want to add. If you mis-type
your controller name, the compiler will catch it at compile time.
protected void addController(String controllerName,
String categoryName)
controllerName - The class name of the controller objectcategoryName - The category to which this controller belongs
protected void addController(Class c,
String categoryName)
addController("your.class.here.class");
- Parameters:
c - the class of the controller that you want to add. If you mis-type
your controller name, the compiler will catch it at compile time.categoryName - the category to which this controller belongs.
public void add(Controller oneController)
throws DBException
oneController - New transaction object to add as a member to this
schema
DBException - If the object cannot be added
public void add(ReportPage oneReport)
throws DBException
oneReport - A new ReportPage object to add as a member of this
Schema
DBException - If the object cannot be addedpublic void addReportPage(Class reportClass)
reportClass - the class of the report. Usually obtained by typing
out the class name and adding ".class" at the end. Example:
com.jcorporate.ext.report.DownloadUsers.classpublic void addReportPage(String reportClassName)
reportClassName - The class name of a "ReportPage" object that is
part of this schema
public void addReportPage(String reportClassName,
String categoryName)
reportClassName - The class name of a "ReportPage" object that is
part of this schemacategoryName - the navigation category to add this report page to.
public void add(Job oneJob)
throws DBException
oneJob - New job object to add as a member to this
schema
DBException - If the object cannot be added
protected void addJob(Class c,
String unused)
addController("your.class.here.class");
- Parameters:
c - the class of the controller that you want to add. If you mis-type
your controller name, the compiler will catch it at compile time.unused -
protected void addJob(Class c)
addController("your.class.here.class");
- Parameters:
c - the class of the controller that you want to add. If you mis-type
your controller name, the compiler will catch it at compile time.
public void addJob(String jobClassName)
jobClassName - the Job classname to use.
public void addJob(String jobClassName,
String unused)
jobClassName - the Job classname to use.unused -
public void add(StdServlet oneServlet)
throws DBException
oneServlet - An instantiated Servlet to use
DBException - If there's an error adding the servlet to the schema
protected void addServlet(Class c,
String unused)
addController("your.class.here.class");
- Parameters:
c - the class of the controller that you want to add. If you mis-type
your controller name, the compiler will catch it at compile time.unused -
protected void addServlet(Class c)
addController("your.class.here.class");
- Parameters:
c - the class of the controller that you want to add. If you mis-type
your controller name, the compiler will catch it at compile time.
public void addServlet(String servletClassName)
servletClassName - The class name of the servlet to add.
public void addServlet(String servletClassName,
String unused)
servletClassName - The name of the servlet class to addunused -
public void add(DBObject oneMember)
throws DBException
oneMember - New database object to add as a member to this
schema
DBException - If the object cannot be added
public void addCategory(String string1,
String string2)
string1 - No-opstring2 - No-op
public void add(DBObject oneMember,
String otherDBName)
throws DBException
oneMember - New database object to add as a member to this
schemaotherDBName - The other db context that this data object should be mapped to
DBException - If the object cannot be added
public void add(String schemaClass,
String setupCode,
String descrip,
String defaultValue)
throws DBException
schemaClass - Class name of this schemasetupCode - Code of the new setup valuedescrip - A description of the new setup valuedefaultValue - A default value for the new setup value
DBException - If the value cannot be added to the setup tableaddSetup(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public void addSetup(String schemaClass,
String setupCode,
String descrip,
String defaultValue)
throws DBException
schemaClass - Class name of this schemasetupCode - Code of the new setup valuedescrip - A description of the new setup valuedefaultValue - A default value for the new setup value
DBException - If the value cannot be added to the setup table
public void addSetup(String setupCode,
String descrip,
String defaultValue)
throws DBException
setupCode - Code of the new setup valuedescrip - A description of the new setup valuedefaultValue - A default value for the new setup value
DBException - If the value cannot be added to the setup table
public Vector createAsNeeded(String dbName)
throws DBException
dbName - The database context to create the tables.
DBException - If the create process failsTableCreatorpublic Vector getConfig()
public Enumeration getControllers()
public List getControllerList()
public String getDefaultComponentCode()
public String getDefaultDescription()
public String getDBName()
public static Schema getInstance()
public Enumeration getJobs()
public Enumeration getMembers()
public String getMessageBundlePath()
public Vector getReports()
ExpressoReport objects that are standard reports
in this schema.public Enumeration getServlets()
protected String getSetupDefault(String paramName,
String defaultValue)
paramName - Property NamedefaultValue - value if property is not defined
public Controller getStartController()
public String getSetupValue(String key)
key - The setup value key
public void setSetupValue(String key,
String value)
key - The name of the setup value.value - the Value of the setup value.
public void otherSetup(Page myPage,
String dbName)
throws DBException,
HtmlException
myPage - The HTML to output in-progress messages todbName - The database context to execute this process against.
DBException - If there's a database communication error
HtmlException - If your system puts mal-formed HTML into the Page
element.
public void otherSetup(InstallLog installLog,
String dataContext)
throws DBException
installLog - the InstallLog implementation that the setup process
will log progress to.dataContext - he database context to execute this process against.
DBException - If there's a database communication error
public void otherSetup(String dbName)
throws DBException
dbName - The database context to execute this process against.
DBException - If there's a database communication error
public void setDBName(String newOther)
throws DBException
newOther - The name of the context or database to use
DBException - If there's a problem switching to the database context.public void setupDefaultValues(String dbName)
See: @see com.jcorporate.expresso.core.dbobj.DBObject.populateDefaultValues
dbName - The name of the database to set this up on.
public void setupDefaultValuesWithException(String dbName)
throws DBException
See: @see com.jcorporate.expresso.core.dbobj.DBObject.populateDefaultValues
dbName - The name of the database to set this up on.
DBException - if a database exception occurs
public void populateSchemaData(String dbName)
throws DBException
dbName - The name to add the data to
see com.jcorporate.eforum.ForumSchema#populateSchemaData for example.
DBException - if an error occurs while populating the table.public Enumeration getTests()
public Hashtable getDBObjMap()
protected String getString(String stringCode)
stringCode - The string code to find in the messages bundle.
public void createTable(DBObject dbObj)
throws DBException
dbObj - The Instantiated Database Object to check against.
DBException - If there's an error creating the table with the
databaseTableCreator
public static String typeForDB(String dbName,
String expressoType)
throws DBException
dbName - The database context to check against.expressoType - The java.sql datatype to check against.
DBException - If there's an getting the datatype.
public static String typeForExpresso(String dbName,
int sqlType)
throws DBException
dbName - The database context to check against.sqlType - The java.sql datatype to check against.
DBException - If there's an getting the datatype.public String getVersion()
Method to return the current version number of an application Schema. Individual Schema objects may override this method if they define a version, then other dependant applications can use that information to make sure that the current version dependancies are met.
How to define your own version string:
The format is: MajorVersion.MinorVersion.Release-EA Release Number
MajorVerseion,MinorVersion, and Release represent the typical: 1.0.1 type of version formatting. -EAReleaseNumber is also a number but is optional if you do not wish to use a EA number if the version number.
Examples
protected void requiresVersion(String versionString,
String schemaClassName)
throws DBException
versionString - String the string version this requires.schemaClassName - the class name to check against.
DBException - if an error occurs locating the appropriate schema
class
public static Schema instantiate(String className)
throws DBException
className - The ClassName to instantiate
DBException - if there's an instantiation problempublic URL getMetadataLocation()
getMetadataLocation in interface DescribablegetMetadataLocation in class ComponentBasepublic void initialize()
initialize in interface ComponentLifecycle
public void configure(Configuration newConfig)
throws ConfigurationException
configure in interface ComponentLifecyclenewConfig - the new configuration object
ConfigurationException
public void reconfigure(Configuration newConfig)
throws ConfigurationException
reconfigure in interface ComponentLifecyclenewConfig - The new Configuration
ConfigurationExceptionpublic void destroy()
ComponentLifecycle
destroy in interface ComponentLifecycle
public Controller getLoginController()
throws ControllerException
getLoginController in interface RegistrationFactoryControllerException - if there is an error instantiating the controllerSimpleLoginController
public Controller getRegistrationController()
throws ControllerException
getRegistrationController in interface RegistrationFactoryControllerException - if there is an error instantiating the controllerSimpleRegistrationpublic void setRequestingUser(int uid)
uid - ID of requesting userpublic int getRequestingUser()
public boolean contains(DBObject dbObject)
|
Expresso 5-5-0 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||