|
Expresso 5-6 | ||||||||||
| 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 |
|
| Method Summary | |
void |
add(Job oneJob)
Deprecated. See the addJob(Class) method instead since Expresso 5.6 |
void |
add(String schemaClass,
String setupCode,
String descrip,
String defaultValue)
Deprecated. since 3/04; use addSetup() instead |
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. |
void |
addReportPage(Class reportClass)
Add a new report page to the schema. |
void |
addReportPage(String reportClassName)
Add a new ReportPage to the default category |
protected void |
addServlet(Class c)
New method of adding a servlet to the specified category. |
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)
Checks if a particular dbobject resides in a given schema. |
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. |
String |
getDataContext()
Return the name of the context/database connection that this schema is being applied to. |
String |
getDBName()
Deprecated. Use getDataContext() instead. Since v.5.5 |
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 Schema |
getInstance()
|
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()
Retrieve the 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. |
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()
Deprecated. Since Expresso 5.6 Tests have been separated from the main code base. |
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(String dbName)
Deprecated. 5.5+; 10/04. use otherSetup(log, dbcontext) instead |
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 |
setDataContext(String newOther)
Set the database name/context for this schema. |
void |
setDBName(String newOther)
Deprecated. Since Expresso 5.6 Use setDataContext(String) instead. |
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 and each Controller in the schema and call default-populate methods. |
| 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 |
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 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 add(Job oneJob)
throws DBException
oneJob - New job object to add as a member to this
schema
DBException - If the object cannot be addedprotected 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.
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 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 tablepublic Vector getConfig()
public List getControllerList()
public String getDefaultComponentCode()
public String getDefaultDescription()
public String getDBName()
public String getDataContext()
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(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 setDataContext(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 See: @see com.jcorporate.expresso.core.controller.Controller.setupDefaultValues
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 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 - if for some reason the Component cannot cope
with the configuration sent to it. If this exception is thrown then ZERO
reconfiguration takes place. Configure() must be an all or nothing 'transaction'
public void reconfigure(Configuration newConfig)
throws ConfigurationException
reconfigure in interface ComponentLifecyclenewConfig - The new Configuration
ConfigurationException - if for some reason the Component cannot cope
with the configuration sent to it. If this exception is thrown then ZERO
reconfiguration takes place. Configure() must be an all or nothing 'transaction'public void destroy()
ComponentLifecycle
destroy in interface ComponentLifecycle
public Controller getLoginController()
throws ControllerException
getLoginController in interface com.jcorporate.expresso.services.controller.RegistrationFactoryControllerException - if there is an error instantiating the controller
public Controller getRegistrationController()
throws ControllerException
getRegistrationController in interface com.jcorporate.expresso.services.controller.RegistrationFactoryControllerException - if there is an error instantiating the controllerpublic void setRequestingUser(int uid)
uid - ID of requesting userpublic int getRequestingUser()
public boolean contains(DBObject dbObject)
dbObject - the object to check against.
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||