com.sri.emo.dbobj
Class WizDefinition

java.lang.Object
  extended by com.jcorporate.expresso.core.dataobjects.BaseDataObject
      extended by com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
          extended by com.jcorporate.expresso.core.dbobj.DBObject
              extended by com.jcorporate.expresso.core.dbobj.SecuredDBObject
                  extended by com.jcorporate.expresso.core.dbobj.RowSecuredDBObject
                      extended by com.sri.emo.dbobj.WizDefinition
All Implemented Interfaces:
Cacheable, ContextNested, DataObject, Securable, LookupInterface, IViewable, Serializable

public class WizDefinition
extends RowSecuredDBObject
implements IViewable

Definition of an Emo Wizard.

DataObjects provide the low-level Object Relational mapping between these objects and a JDBC backend.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.jcorporate.expresso.core.dbobj.DBObject
DBObject.FieldError, DBObject.FieldUpdate
 
Field Summary
static String DEFAULT_EDITING_CONTROLLER
          The default controller for editing a wizard.
static String FLD_ADDITIONAL_INFO
          Field that is the classname of any 1-1 mapping database object that provides additional information for this wizard.
static String FLD_CONTROLLER
          Name of the controller.
static String FLD_EDITOR_CONTROLLER
          The classname of the contorller for adding.
static String FLD_FACTORY
          Public constant for access to field "Factory".
static String FLD_ID
          Public constant for access to field "Item ID".
static String FLD_NAME
          Public constant for access to field "Name".
static String FLD_SUMMARY
          Public constant for access to field "Bean".
static String FLD_WIZARD
          Public constant for access to field "wizard class".
static String TABLE_NAME
          Table name.
 
Fields inherited from class com.jcorporate.expresso.core.dbobj.RowSecuredDBObject
DEFAULT_PERMISSION_CODE
 
Fields inherited from class com.jcorporate.expresso.core.dbobj.SecuredDBObject
ADD, ALL_FUNCTIONS, CACHE_NAME, CACHE_TTY, DELETE, SEARCH, SYSTEM_ACCOUNT_NAME, UPDATE
 
Fields inherited from class com.jcorporate.expresso.core.dbobj.DBObject
ATTRIBUTE_ERROR, ATTRIBUTE_ERROR_MESSAGE, ATTRIBUTE_PAGE_LIMIT, BIG_DECIMAL_ZERO, CACHE_LIMIT_PERCENT, CACHE_LIMIT_TTL, EMAIL_MASK, EVENT_ADD, EVENT_DELETE, EVENT_UPDATE, FLOAT_MASK, INT_MASK, IS_CHECK_RELATIONAL_INTEGRITY, IS_MUTABLE, sCacheStats, UPDATE_CHANGED_ONLY, WHERE_KEYWORD
 
Fields inherited from class com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
anyFieldsDistinct, anyFieldsToInput, anyFieldsToRetrieve, appendCustomWhere, caseSensitiveQuery, customWhereClause, dbKey, distinctFields, inputFields, localConnection, LONGBINARY_READ_DEFAULT_SIZE, maxRecords, myClassName, myUpdates, offsetRecord, recordSet, retrieveFields, sMetadataMap, sortKeys
 
Fields inherited from class com.jcorporate.expresso.core.dataobjects.BaseDataObject
currentStatus, globalMask
 
Fields inherited from interface com.jcorporate.expresso.core.dataobjects.Securable
SYSTEM_ACCOUNT
 
Fields inherited from interface com.jcorporate.expresso.core.dataobjects.DataObject
STATUS_CURRENT, STATUS_DELETED, STATUS_NEW, STATUS_UPDATED
 
Constructor Summary
WizDefinition()
          Creates an instance of WizDefinition.
WizDefinition(DBConnection connection)
           
WizDefinition(DBConnection dbConnection, int uid)
          Creates an instance of WizDefinition that uses an already grabbed DBConnection object.
 
Method Summary
 void add()
          Adds the record to the defined data source and adds the additional info dataobjects bound to this object as well.
 void checkField(String fieldName, String fieldValue)
          Override of standard checkfield to verify class name and factory name.
 void clear()
          Clears all field data as well as additional info.
 void delete(boolean deleteDetails)
          Override of delete that deletes 'additional info' 1-1 mappings as well.
 JDBCDataObject getAdditionalInfo()
          Retrieves an additional information object associated with this class.
 Class getAdditionalInfoClass()
          Retrieves the additional information class.
 String getController()
           
 String getId()
          Get the Wizard id.
 Controller getManagingController()
          Returns the managing contorller
 List getPageDefinitions()
          Retrieves all page definitions associated with this wizard definition.
 List getPertinentDecisionSteps()
          Retrieve a list of pertinent decision steps for the current wizard.
 Controller getRunningController()
          Retrieve the controller to 'run' the wizard.
 String getSummary()
           
 String getSummaryRaw()
           
 Transition getViewTrans()
          Provide a transition for viewing this object, suitable for creating an HTTP link.
 String getWizardClass()
           
 String getWizName()
          Get the Wizard name.
 void setAdditionalInfo(Class newClass)
          Default class for additional information.
 void setAdditionalInfo(JDBCDataObject replacementInfo)
          Sets a new object to the additional info placeholder.
 void setId(int id)
           
 void setId(String id)
           
protected  void setupFields()
          One time intiialization of all the field types.
 String toString()
           
 void update()
          Updates this object and any additional info objects bound to this wizard.
protected  void validateClass(String fieldName, String className, Class requiredSuperclass)
          Validates a class by (1) name, and (2) makes sure it derives from the specified class.
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.RowSecuredDBObject
add, addGroupPerm, canRequesterAdministrate, canRequesterRead, canRequesterWrite, checkDeleteDetailPerm, checkKeyLength, defaultGroup, defaultPermissions, deleteAll, find, getAdministrateGroups, getGroups, getPermissions, getReadGroups, getWriteGroups, isAdminGroup, isReadGroup, isRowAllowed, isRowAllowed, isWriteGroup, ownerID, removeGroup, retrieve, searchAndRetrieveList, searchAndRetrieveList, setPermissions, setPermissions
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.SecuredDBObject
canRequesterAdd, canRequesterDelete, canRequesterUpdate, checkAllowed, copyAttributes, count, createSecurityCache, delete, getRequestingUid, getRequestingUser, getString, getString, getString, getString, getString, getString, getSystemUid, instantiate, isAllowed, search, setRequestingUid, setRequestingUser
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.DBObject
addDetail, addField, addField, addFieldError, addFoundKeys, addIfNeeded, addIndex, addKey, addMaster, addOrUpdate, addSortKey, addTransition, addVirtualField, addVirtualField, addVirtualField, addVirtualField, average, basicAdd, cacheIsChangedComparison, canUseRetrieve, checkAllReferredToBy, checkAllRefs, checkAllRefsPublic, checkMutable, checkRef, checkRef, clearDistinctFields, clearError, clearFieldsToInput, clearFieldsToRetrieve, clearSortKeys, clone, containsWildCards, copyAllFields, deleteAll, deleteDetails, denotesRange, equals, fetchImmut, fetchImmutable, forKey, formatDateTime, get, getAllAttributes, getAttribute, getAttributesIterator, getBooleanFieldValue, getCacheSize, getCacheStatsMap, getCacheUtil, getCheckZeroUpdate, getCustomWhereClause, getDataContext, getDataField, getDataTransferObject, getDBName, getDetails, getDistinctFieldCount, getDistinctFields, getField, getFieldAttributesIterator, getFieldBigDecimal, getFieldBoolean, getFieldByte, getFieldByteArray, getFieldData, getFieldDate, getFieldDecimalFormatted, getFieldDouble, getFieldErrorMessage, getFieldFloat, getFieldInt, getFieldLong, getFieldMetaData, getFieldShort, getFieldsToInputCount, getFieldsToRetrieveCount, getFilterClass, getFoundCount, getFoundKeysArray, getIndexArray, getISOValuesDefault, getISOValuesDefault, getISOValuesDefault, getKey, getKeyFieldListIterator, getLength, getLengthInt, getLocale, getLogger, getLookupObject, getMax, getMax, getMaxRecords, getMyKeys, getMyUpdatesArray, getOffsetRecord, getPatternMatcher, getPrecision, getSerializedForm, getSizeEstimate, getStringFilter, getThisDBbj, getThisDBObj, getValidValueDescrip, getValidValues, getValidValuesList, getValues, getValuesDefault, getValuesDefault, getValuesDefault, hasError, hasErrors, haveAllKeys, initialize, isCached, isChanged, isDistinct, isEmpty, isFieldDistinct, isFieldNull, isFieldsToInput, isFieldsToRetrieve, isFieldToRetrieve, isMultiValued, isMutable, isMutable, isReadOnly, isSecret, isVirtual, loadFromConnection, logChange, max, min, newInstance, noNewLine, noQuotes, notifyListeners, populateDefaultValues, referredToBy, removeAttribute, removeFromCache, retrieveFromCache, saveBinaryField, search, set, setAttribute, setCacheLimit, setCacheLimit, setCacheLimitAsPercent, setCacheSize, setCharset, setCheckZeroUpdate, setConnection, setConnection, setCustomWhereClause, setCustomWhereClause, setDataContext, setDataField, setDataTransferObject, setDefaultValue, setDescription, setField, setField, setField, setField, setField, setField, setField, setField, setField, setField, setFieldData, setFieldData, setFieldDistinct, setFieldsToInput, setFieldsToRetrieve, setFilterClass, setFilterClass, setKey, setKeys, setLocale, setLookupField, setLookupObject, setMask, setMaxRecords, setMultiValued, setName, setOffsetRecord, setReadOnly, setSchema, setSecret, setSortKey, setStringFilter, setStringFiltersOnAll, setTargetDbSchema, setTargetTable, sqlAggrFunction, sum, toDebugString, update, updateAll, updateAll, updateIsChanged, verify
 
Methods inherited from class com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
addInParam, addOutParam, buildWhereClause, buildWhereClauseBuffer, checkZeroUpdate, constructNewMetaData, createAndExecuteSearch, createAndRunStoreProcedure, createSQLSelectStatement, createSQLSelectStatement, getConnectionPool, getCustomStringFieldValue, getDef, getDistinctFieldArrayList, getExecutor, getFieldsToInputIterator, getFieldsToRetrieveIterator, getJDBCMetaData, getJDBCUtil, getLocalConnection, getMappedDataContext, getMetaData, getQueryInterface, getSerialForm, loadFromConnection, makeLimitationStub, quoteIfNeeded, runStoredProcedure, runStoredProcedureAndRetrieveList, selectFieldString, setCaseSensitiveQuery, setDBConnectionPool, setDBName, setMappedDataContext, setOriginalDBName, setTargetStoreProcedure
 
Methods inherited from class com.jcorporate.expresso.core.dataobjects.BaseDataObject
getGlobalMask, getStatus, isGlobalMasked, setFieldsWithDefaults, setGlobalMask, setStatus
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FLD_ID

public static final String FLD_ID
Public constant for access to field "Item ID".

See Also:
Constant Field Values

FLD_NAME

public static final String FLD_NAME
Public constant for access to field "Name".

See Also:
Constant Field Values

FLD_WIZARD

public static final String FLD_WIZARD
Public constant for access to field "wizard class".

See Also:
Constant Field Values

FLD_FACTORY

public static final String FLD_FACTORY
Public constant for access to field "Factory".

See Also:
Constant Field Values

FLD_SUMMARY

public static final String FLD_SUMMARY
Public constant for access to field "Bean".

See Also:
Constant Field Values

TABLE_NAME

public static final String TABLE_NAME
Table name.

See Also:
Constant Field Values

FLD_CONTROLLER

public static final String FLD_CONTROLLER
Name of the controller.

See Also:
Constant Field Values

FLD_EDITOR_CONTROLLER

public static final String FLD_EDITOR_CONTROLLER
The classname of the contorller for adding.

See Also:
Constant Field Values

FLD_ADDITIONAL_INFO

public static final String FLD_ADDITIONAL_INFO
Field that is the classname of any 1-1 mapping database object that provides additional information for this wizard.

See Also:
Constant Field Values

DEFAULT_EDITING_CONTROLLER

public static final String DEFAULT_EDITING_CONTROLLER
The default controller for editing a wizard.

Constructor Detail

WizDefinition

public WizDefinition()
              throws DBException
Creates an instance of WizDefinition. before using.

Throws:
DBException - upon initialization exception.
See Also:
SecuredDBObject.SecuredDBObject(java.lang.String, int)

WizDefinition

public WizDefinition(DBConnection dbConnection,
                     int uid)
              throws DBException
Creates an instance of WizDefinition that uses an already grabbed DBConnection object. This is for use inside transactions.

Example:

 DBConnection oneConnection = DBConnectionPool
 .getInstance("default").getConnection();
 oneConnection.setAutoCommit(false);
 WizDefinition myObj = new WizDefinition(oneConnection);
 //Set fields here....
 myObj.add();
 myObj.clear();
 //more set fields
 myObj.add();
 //Commit the transaction
 oneConnection.commit();
 oneConnection.release();
 

Parameters:
dbConnection - com.jcorporate.expresso.core.db.DBConnection
uid - the user id
Throws:
DBException - upon construction error

WizDefinition

public WizDefinition(DBConnection connection)
              throws DBException
Throws:
DBException
Method Detail

getManagingController

public Controller getManagingController()
                                 throws DBException,
                                        ControllerException
Returns the managing contorller

Returns:
Controller
Throws:
DBException
ControllerException

getRunningController

public Controller getRunningController()
                                throws DBException,
                                       ControllerException
Retrieve the controller to 'run' the wizard.

Returns:
Controller
Throws:
DBException
ControllerException

getPageDefinitions

public List getPageDefinitions()
                        throws DBException
Retrieves all page definitions associated with this wizard definition. Only useful for Selection Wizards

Returns:
List of WizStep objects.
Throws:
DBException - upon error.
To Do:
Refactor Selection wizard specifics to a separate table.

setupFields

protected void setupFields()
                    throws DBException
One time intiialization of all the field types. Set all specifications here such as field names, table name, friendly name of the data object, characterset, etc.

Overrides:
setupFields in class DBObject
Throws:
DBException - upon error

setAdditionalInfo

public void setAdditionalInfo(Class newClass)
                       throws DBException
Default class for additional information.

Parameters:
newClass - Class
Throws:
DBException

getAdditionalInfoClass

public Class getAdditionalInfoClass()
                             throws DBException
Retrieves the additional information class.

Returns:
Class or null if no additional information is set.
Throws:
DBException

setAdditionalInfo

public void setAdditionalInfo(JDBCDataObject replacementInfo)
Sets a new object to the additional info placeholder.

Parameters:
replacementInfo - DataObject

getAdditionalInfo

public JDBCDataObject getAdditionalInfo()
                                 throws DBException,
                                        DBRecordNotFoundException
Retrieves an additional information object associated with this class.

Returns:
DataObject or null if there is no info class associated with this wizard instance.
Throws:
DBException - upon general database error.
DBRecordNotFoundException - if unable to locate the additional info.

checkField

public void checkField(String fieldName,
                       String fieldValue)
                throws DBException
Override of standard checkfield to verify class name and factory name.

Specified by:
checkField in interface DataObject
Overrides:
checkField in class DBObject
Parameters:
fieldName - the name of the field to check.
fieldValue - the value of the field to check.
Throws:
DBException - upon validation error.

validateClass

protected void validateClass(String fieldName,
                             String className,
                             Class requiredSuperclass)
                      throws DBException
Validates a class by (1) name, and (2) makes sure it derives from the specified class.

Parameters:
className - the name of the class.
requiredSuperclass - the required superclass.
fieldName - the name of the field we're validating.
Throws:
DBException - upon validation error.

getPertinentDecisionSteps

public List getPertinentDecisionSteps()
                               throws DBException
Retrieve a list of pertinent decision steps for the current wizard.

Returns:
List a list of WizStep instances.
Throws:
DBException - upon error. Only useful for Selection Wizards
To Do:
Refactor Selection wizard specifics to a separate table.

getViewTrans

public Transition getViewTrans()
                        throws DBException
Provide a transition for viewing this object, suitable for creating an HTTP link.

Specified by:
getViewTrans in interface IViewable
Returns:
transtion for viewing, including label for name of object; never null
Throws:
DBException - upon error.

getId

public String getId()
             throws DBException
Get the Wizard id.

Returns:
java.lang.String
Throws:
DBException - upon getField error

getWizName

public String getWizName()
                  throws DBException
Get the Wizard name.

Returns:
java.lang.String
Throws:
DBException - upon getField error

setId

public void setId(String id)
           throws DBException
Throws:
DBException

getWizardClass

public String getWizardClass()
                      throws DBException
Throws:
DBException

getSummary

public String getSummary()
                  throws DBException
Throws:
DBException

getController

public String getController()
                     throws DBException
Throws:
DBException

setId

public void setId(int id)
           throws DBException
Throws:
DBException

getSummaryRaw

public String getSummaryRaw()
                     throws DBException
Throws:
DBException

delete

public void delete(boolean deleteDetails)
            throws DBException
Override of delete that deletes 'additional info' 1-1 mappings as well.

Overrides:
delete in class RowSecuredDBObject
Throws:
DBException

add

public void add()
         throws DBException
Adds the record to the defined data source and adds the additional info dataobjects bound to this object as well.

Specified by:
add in interface DataObject
Overrides:
add in class RowSecuredDBObject
Throws:
DBException - upon error.

update

public void update()
            throws DBException
Updates this object and any additional info objects bound to this wizard.

Specified by:
update in interface DataObject
Overrides:
update in class RowSecuredDBObject
Throws:
DBException - upon error.

clear

public void clear()
           throws DBException
Clears all field data as well as additional info.

Specified by:
clear in interface DataObject
Overrides:
clear in class DBObject
Throws:
DBException - upon error.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2006 Codeguild, Inc.. All Rights Reserved.