Java Doc for Schema.java in  » J2EE » Expresso » com » jcorporate » expresso » core » dbobj » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » Expresso » com.jcorporate.expresso.core.dbobj 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.jcorporate.expresso.kernel.ContainerComponentBase
   com.jcorporate.expresso.core.dbobj.Schema

All known Subclasses:   com.jcorporate.expresso.core.dbobj.tests.RowSecuredDBObjectTestSchema,  com.jcorporate.expresso.core.ExpressoSchema,  com.jcorporate.expresso.core.dbobj.tests.TestSchema,  com.jcorporate.expresso.services.dbobj.tests.TestSchema,  com.jcorporate.expresso.ext.tests.StressTestSchema,
Schema
abstract public class Schema extends ContainerComponentBase implements ComponentLifecycle,RegistrationFactory(Code)

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.


author:
   Michael Nash



Constructor Summary
public  Schema()
    

Method Summary
public synchronized  voidadd(Job oneJob)
    
public synchronized  voidadd(String schemaClass, String setupCode, String descrip, String defaultValue)
    
protected synchronized  voidaddController(String controllerName)
    
protected synchronized  voidaddController(Class c)
     New method of adding a controller to the default category.
protected synchronized  voidaddController(String controllerName, String categoryName)
     New method to add controller objects to the list of controllers in this Schema object.
protected synchronized  voidaddController(Class c, String categoryName)
     New method of adding a controller to the default category.
protected synchronized  voidaddDBObject(String dbobjectClass)
    
protected synchronized  voidaddDBObject(Class c, String categoryName)
     New method of adding a dbobject to the specified category.
protected synchronized  voidaddDBObject(Class c)
     New method of adding a dbobject to the default category.
protected synchronized  voidaddDBObject(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 synchronized  voidaddDBObject(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 synchronized  voidaddJob(Class c)
     method of adding a job to the specified category.
public synchronized  voidaddReportPage(Class reportClass)
     Add a new report page to the schema.
Parameters:
  reportClass - the class of the report.
public synchronized  voidaddReportPage(String reportClassName)
    
protected synchronized  voidaddServlet(Class c)
     New method of adding a servlet to the specified category.
public synchronized  voidaddSetup(String schemaClass, String setupCode, String descrip, String defaultValue)
    
public synchronized  voidaddSetup(String setupCode, String descrip, String defaultValue)
    
public  voidconfigure(Configuration newConfig)
    
public  booleancontains(DBObject dbObject)
     Checks if a particular dbobject resides in a given schema.
Parameters:
  dbObject - the object to check against.
public  voiddestroy()
    
public synchronized  VectorgetConfig()
    
public  java.util.ListgetControllerList()
     Return a list of the Controller objects that are members of this schema.
public synchronized  StringgetDBName()
     Return the name of the context/database connection that this schema is being applied to.
public  HashtablegetDBObjMap()
     Retrieves the DBObject Map for table creation.
public synchronized  StringgetDataContext()
     Return the name of the context/database connection that this schema is being applied to.
public  StringgetDefaultComponentCode()
     Returns the default component code for this schema.
public  StringgetDefaultDescription()
     Returns the default description for this schema.
public static  SchemagetInstance()
    
public  EnumerationgetJobs()
    
public  ControllergetLoginController()
     Retrieve the login controller for your schema.
public  EnumerationgetMembers()
    
public  StringgetMessageBundlePath()
     Return the path, relative to the classpath, of the MessageBundle file for this schema.
public  URLgetMetadataLocation()
     Base metadata location.
public  ControllergetRegistrationController()
     Retrieve the registration controller.
public synchronized  VectorgetReports()
     Return the list of ExpressoReport objects that are required by this schema.
public  intgetRequestingUser()
     Retrieve the UID of requesting user. UID of requesting user, if known.
public  EnumerationgetServlets()
    
protected  StringgetSetupDefault(String paramName, String defaultValue)
     Return the value if this property is defined in the properties file for this config key.
public  StringgetSetupValue(String key)
     Retrieve one of the Setup values for the schema.
Parameters:
  key - The setup value key java.lang.String the value of the setup value.
public  ControllergetStartController()
     Return a single transaction as the "starting point" for this application.
protected  StringgetString(String stringCode)
     Get the i18N'ized string for this schema
Parameters:
  stringCode - The string code to find in the messages bundle.
public  EnumerationgetTests()
    
public  StringgetVersion()
    

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.

public  voidinitialize()
     Initialize Lifecycle event.
public static  Schemainstantiate(String className)
    
public synchronized  voidotherSetup(InstallLog installLog, String dataContext)
     preferable way of performaing other setup.
public synchronized  voidotherSetup(String dbName)
     Perform any additional setup/intialize functions required by this schema.
public synchronized  voidpopulateSchemaData(String dbName)
     Allow populations of sample data where all tables must be set up first.
public  voidreconfigure(Configuration newConfig)
     Reconfigure Lifecycle Event.
protected  voidrequiresVersion(String versionString, String schemaClassName)
     Method for a schema to define a dependance on another schema with a particular version - e.g.
public synchronized  voidsetDBName(String newOther)
     Set the database name/context for this schema.
public synchronized  voidsetDataContext(String newOther)
     Set the database name/context for this schema.
public  voidsetRequestingUser(int uid)
     Set the user ID of requester.
public  voidsetSetupValue(String key, String value)
    
public synchronized  voidsetupDefaultValues(String dbName)
    
public synchronized  voidsetupDefaultValuesWithException(String dbName)
    


Constructor Detail
Schema
public Schema()(Code)
Constructor




Method Detail
add
public synchronized void add(Job oneJob) throws DBException(Code)
Add a new Job object to this schema
Parameters:
  oneJob - New job object to add as a member to thisschema
throws:
  DBException - If the object cannot be added



add
public synchronized void add(String schemaClass, String setupCode, String descrip, String defaultValue) throws DBException(Code)
Add a new setup value to this schema
Parameters:
  schemaClass - Class name of this schema
Parameters:
  setupCode - Code of the new setup value
Parameters:
  descrip - A description of the new setup value
Parameters:
  defaultValue - A default value for the new setup value
throws:
  DBException - If the value cannot be added to the setup table
See Also:   Schema.addSetup



addController
protected synchronized void addController(String controllerName)(Code)
Add a controller to the default category
Parameters:
  controllerName - the String name of the controller to add to theschema



addController
protected synchronized void addController(Class c)(Code)
New method of adding a controller to the default category. Call by writing: addController("your.class.here.class");
Parameters:
  c - the class of the controller that you want to add. If you mis-typeyour controller name, the compiler will catch it at compile time.



addController
protected synchronized void addController(String controllerName, String categoryName)(Code)
New method to add controller objects to the list of controllers in this Schema object. We no longer add the object itself (as this is not very efficient, to say the least) we only store the *name* of the controller.
Parameters:
  controllerName - The class name of the controller object
Parameters:
  categoryName - The category to which this controller belongs



addController
protected synchronized void addController(Class c, String categoryName)(Code)
New method of adding a controller to the default category. Call by writing: addController("your.class.here.class");
Parameters:
  c - the class of the controller that you want to add. If you mis-typeyour controller name, the compiler will catch it at compile time.
Parameters:
  categoryName - the category to which this controller belongs.



addDBObject
protected synchronized void addDBObject(String dbobjectClass)(Code)
Method to add a dbobject to the list of dbobjects in this schema
Parameters:
  dbobjectClass - the class name of the DBObject that you want to add.



addDBObject
protected synchronized void addDBObject(Class c, String categoryName)(Code)
New method of adding a dbobject to the specified category. Call by writing:
Parameters:
  c - the class name of the DBObject that you want to add.
Parameters:
  categoryName - the category to which this controller belongs.



addDBObject
protected synchronized void addDBObject(Class c)(Code)
New method of adding a dbobject to the default category. Call by writing: addController("your.class.here.class");
Parameters:
  c - the class of the controller that you want to add. If you mis-typeyour controller name, the compiler will catch it at compile time.



addDBObject
protected synchronized void addDBObject(String dbobjectClass, String otherDBName)(Code)
Method to add a dbobject to the list of dbobjects in this schema for a named dbother location in the default category. Please note that otherdb tables are not created on a DBCreate run.
Parameters:
  dbobjectClass - the name of the database object class to use
Parameters:
  otherDBName - The dbcontext to use for this dataobject.



addDBObject
protected synchronized void addDBObject(String dbobjectClass, String otherDBName, String categoryName)(Code)
Method to add a dbobject to the list of dbobjects in this schema for a named dbother location and named category.
Parameters:
  dbobjectClass - The name of the dbobject to add to the schema.
Parameters:
  otherDBName - The dbcontext to use for this dataobject.
Parameters:
  categoryName - the navigation category to use for this database object



addJob
protected synchronized void addJob(Class c)(Code)
method of adding a job to the specified category. Call by writing: addController("your.class.here.class");
Parameters:
  c - the class of the controller that you want to add. If you mis-typeyour controller name, the compiler will catch it at compile time.



addReportPage
public synchronized void addReportPage(Class reportClass)(Code)
Add a new report page to the schema.
Parameters:
  reportClass - the class of the report. Usually obtained by typingout the class name and adding ".class" at the end. Example:com.jcorporate.ext.report.DownloadUsers.class



addReportPage
public synchronized void addReportPage(String reportClassName)(Code)
Add a new ReportPage to the default category
Parameters:
  reportClassName - The class name of a "ReportPage" object that ispart of this schema



addServlet
protected synchronized void addServlet(Class c)(Code)
New method of adding a servlet to the specified category. Call by writing: addController("your.class.here.class");
Parameters:
  c - the class of the controller that you want to add. If you mis-typeyour controller name, the compiler will catch it at compile time.



addSetup
public synchronized void addSetup(String schemaClass, String setupCode, String descrip, String defaultValue) throws DBException(Code)
Add a new setup value to the named schema; will not change value if one already exists in Setup table
Parameters:
  schemaClass - Class name of this schema
Parameters:
  setupCode - Code of the new setup value
Parameters:
  descrip - A description of the new setup value
Parameters:
  defaultValue - A default value for the new setup value
throws:
  DBException - If the value cannot be added to the setup table



addSetup
public synchronized void addSetup(String setupCode, String descrip, String defaultValue) throws DBException(Code)
Add a new setup value to this schema for THIS schema; will not change value if one already exists in Setup table
Parameters:
  setupCode - Code of the new setup value
Parameters:
  descrip - A description of the new setup value
Parameters:
  defaultValue - A default value for the new setup value
throws:
  DBException - If the value cannot be added to the setup table



configure
public void configure(Configuration newConfig) throws ConfigurationException(Code)
Provide Configurations
Parameters:
  newConfig - the new configuration object



contains
public boolean contains(DBObject dbObject)(Code)
Checks if a particular dbobject resides in a given schema.
Parameters:
  dbObject - the object to check against. true if this schema contains this object



destroy
public void destroy()(Code)



getConfig
public synchronized Vector getConfig()(Code)
Return the list of configuration values required by this schema Vector A vector of setup/configuration values for this schema



getControllerList
public java.util.List getControllerList()(Code)
Return a list of the Controller objects that are members of this schema. Controllers are instantiated if not already cached. However, since ControllerFactory caches the instances, performance of calls after the initial call is faster java.util.List of Controller objects that belong to this schema



getDBName
public synchronized String getDBName()(Code)
Return the name of the context/database connection that this schema is being applied to. If none is set, then we are applying to the "default" database/context. the database context that this Schema object is associated with.



getDBObjMap
public Hashtable getDBObjMap()(Code)
Retrieves the DBObject Map for table creation. java.util.Hashtable



getDataContext
public synchronized String getDataContext()(Code)
Return the name of the context/database connection that this schema is being applied to. If none is set, then we are applying to the "default" database/context. the database context that this Schema objectis associated with.
since:
   Expresso 5.6



getDefaultComponentCode
public String getDefaultComponentCode()(Code)
Returns the default component code for this schema. Useful for automated component testing/installation the component code string as defined by the derived schema class



getDefaultDescription
public String getDefaultDescription()(Code)
Returns the default description for this schema. Useful for automated component testing/installation the component friendly name as defined by the derived schema class



getInstance
public static Schema getInstance()(Code)
an an instance of this schema instance.



getJobs
public Enumeration getJobs()(Code)
Return an enumeration of the jobs that are members of this schema Enumeration List of Transaction objects that belong tothis schema



getLoginController
public Controller getLoginController() throws ControllerException(Code)
Retrieve the login controller for your schema. The default implementation checks the ClassHandler section and returns it or the default (SimpleLogin) if there is none defined in the ClassHandlers. Override for your own apps to have custom and multiple logins and registration controllers. Controller Instance
throws:
  ControllerException - if there is an error instantiating the controller



getMembers
public Enumeration getMembers()(Code)
Return an enumeration of the database objects that belong to this schema Enumeration List of DBObject objects that belong to this schema



getMessageBundlePath
public String getMessageBundlePath()(Code)
Return the path, relative to the classpath, of the MessageBundle file for this schema. For example, the Expresso schema (com.jcorporate.expresso.core.ExpressoSchema) returns "com/jcorporate/expresso/core", as this is where it's message files are stored. A String describing the location of the MessageBundle Path



getMetadataLocation
public URL getMetadataLocation()(Code)
Base metadata location. All schemas have the same component metadata, unless you want to specify your own. In which case, you'll want to override based upon your own information. java.net.URL



getRegistrationController
public Controller getRegistrationController() throws ControllerException(Code)
Retrieve the registration controller. The default version checks the classhandlers section in the expresso-config.xml file and returns what's appropriate there or SimpleRegistration if none is defined. a controller instance for Registration
throws:
  ControllerException - if there is an error instantiating the controller



getReports
public synchronized Vector getReports()(Code)
Return the list of ExpressoReport objects that are required by this schema. Vector A list of ExpressoReport objects that are standard reportsin this schema.



getRequestingUser
public int getRequestingUser()(Code)
Retrieve the UID of requesting user. UID of requesting user, if known. otherwise, returns 0



getServlets
public Enumeration getServlets()(Code)
Return an enumeration of the servlets that are members of this schema Enumeration List of StdServlet objects that belong tothis schema



getSetupDefault
protected String getSetupDefault(String paramName, String defaultValue)(Code)
Return the value if this property is defined in the properties file for this config key.
Parameters:
  paramName - Property Name
Parameters:
  defaultValue - value if property is not defined String Value of this property in the property file for this DBconfig.



getSetupValue
public String getSetupValue(String key)(Code)
Retrieve one of the Setup values for the schema.
Parameters:
  key - The setup value key java.lang.String the value of the setup value. May be null;



getStartController
public Controller getStartController()(Code)
Return a single transaction as the "starting point" for this application. Each Schema object may define such a transaction, and the appropriate application can then be invoked from that point a Controller Instance of the starting controller point.



getString
protected String getString(String stringCode)(Code)
Get the i18N'ized string for this schema
Parameters:
  stringCode - The string code to find in the messages bundle. The Mapped String



getTests
public Enumeration getTests()(Code)
Return the list of Junit tests in this application An Enumeration of all tests for this schema



getVersion
public String getVersion()(Code)

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

  • 1.0.1 : First Major Version with a bugfix release.
  • 2.2.2-2: Second Major Version, Second Minor Version, Second Bugfix release and it is currently considered ea-2
the Version you define for your system.



initialize
public void initialize()(Code)
Initialize Lifecycle event. Provide quick initialization



instantiate
public static Schema instantiate(String className) throws DBException(Code)
Convenience method to create a Schema object from it's name
Parameters:
  className - The ClassName to instantiate A newly initialized Schema Object
throws:
  DBException - if there's an instantiation problem



otherSetup
public synchronized void otherSetup(InstallLog installLog, String dataContext) throws DBException(Code)
preferable way of performaing other setup. Utilizes the context independant logging system.
Parameters:
  installLog - the InstallLog implementation that the setup processwill log progress to.
Parameters:
  dataContext - he database context to execute this process against.
throws:
  DBException - If there's a database communication error



otherSetup
public synchronized void otherSetup(String dbName) throws DBException(Code)
Perform any additional setup/intialize functions required by this schema. This is where applications can set up default values for lookup tables, reference values, etc. Subclass does not extend this method if it is not needed.
Parameters:
  dbName - The database context to execute this process against.
throws:
  DBException - If there's a database communication error



populateSchemaData
public synchronized void populateSchemaData(String dbName) throws DBException(Code)
Allow populations of sample data where all tables must be set up first.
Parameters:
  dbName - The name to add the data tosee com.jcorporate.eforum.ForumSchema#populateSchemaData for example.
throws:
  DBException - if an error occurs while populating the table.



reconfigure
public void reconfigure(Configuration newConfig) throws ConfigurationException(Code)
Reconfigure Lifecycle Event. Nullify values and restart.
Parameters:
  newConfig - The new Configuration



requiresVersion
protected void requiresVersion(String versionString, String schemaClassName) throws DBException(Code)
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
Parameters:
  versionString - String the string version this requires.
Parameters:
  schemaClassName - the class name to check against.
throws:
  DBException - if an error occurs locating the appropriate schemaclass



setDBName
public synchronized void setDBName(String newOther) throws DBException(Code)
Set the database name/context for this schema. If setDBName is not called, the "default" db name and context is used.
Parameters:
  newOther - The name of the context or database to use
throws:
  DBException - If there's a problem switching to the database context.



setDataContext
public synchronized void setDataContext(String newOther) throws DBException(Code)
Set the database name/context for this schema. If setDBName is not called, the "default" db name and context is used.
Parameters:
  newOther - The name of the context or database to use
throws:
  DBException - If there's a problem switching to the database context.



setRequestingUser
public void setRequestingUser(int uid)(Code)
Set the user ID of requester.
Parameters:
  uid - ID of requesting user



setSetupValue
public void setSetupValue(String key, String value)(Code)
Sets the setup values for the given key
Parameters:
  key - The name of the setup value.
Parameters:
  value - the Value of the setup value.



setupDefaultValues
public synchronized void setupDefaultValues(String dbName)(Code)
Go through each DBobject in the schema and call populateDefaultValues.

See: @see com.jcorporate.expresso.core.dbobj.DBObject.populateDefaultValues
Parameters:
  dbName - The name of the database to set this up on.




setupDefaultValuesWithException
public synchronized void setupDefaultValuesWithException(String dbName) throws DBException(Code)
Go through each DBobject and each Controller in the schema and call default-populate methods.

See: @see com.jcorporate.expresso.core.dbobj.DBObject.populateDefaultValues See: @see com.jcorporate.expresso.core.controller.Controller.setupDefaultValues
Parameters:
  dbName - The name of the database to set this up on.
throws:
  DBException - if a database exception occurs




Methods inherited from com.jcorporate.expresso.kernel.ContainerComponentBase
public synchronized ComponentContainer getContainerImplementation()(Code)(Java Doc)
public synchronized ExpressoComponent locateComponent(String componentName)(Code)(Java Doc)
public synchronized void setContainerImplementation(ComponentContainer newContainer)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.