com.sri.emo.dbobj
Class WizStep

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.SecurDBObject
                      extended by com.sri.emo.dbobj.WizStep
All Implemented Interfaces:
Cacheable, ContextNested, DataObject, Securable, LookupInterface, IViewable, Serializable

public class WizStep
extends SecurDBObject
implements IViewable

WizStep is a definition of each step in the wizard. This definition represents "Single Table Inheritance" for all the various types of Wizard Steps out there. While this creates some complexity and wasted fields here, it saves trying to distribute all the data evenly across all the different tables and performing different joins. It may be necessary to refactor later on.

Author:
Mike Rimov
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 int CUSTOM_PICKLIST
          Constant for steps that have a custom picklist.
static String[] FIELDS_INDICATING_MATRIX_NEEDS_UPDATING
           
static String FLD_DIRECTIVE
          Public constant for access to field "New Field".
static String FLD_HELPTEXT
          Public constant for access to field "Help Text".
static String FLD_ID
          Public constant for access to field "Item ID".
static String FLD_ORDER
          Public constant for access to field "Page Order List".
static String FLD_STEP_TYPE
          Public constant for access to field "Step Type".
static String FLD_TITLE
          Public constant for access to field "New Field".
static String FLD_WIZID
          Public constant for access to field "Wizard Id".
static int INSTANCE_PICKLIST
          Constant for steps that have a per-instance picklist.
static int INSTRUCTIONS_ONLY
          Constant for steps that have custom instructions only.
static int MODEL_PICKLIST
          Constant for steps that have a per-model picklist.
static String TABLE_NAME
           
static int TEXT_ENTRY
          Constant for steps that have custom text entry.
static String TEXT_VV_MULTILINE
          Valid value constant for text type atttribute for multiline entry.
static String TEXT_VV_SINGLELINE
          Valid value constant for text type attribute.
static String TEXT_VV_UNDEFINED
          Valid value constant for text type attribute Undefined.
 
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
WizStep()
          Creates an instance of WizStep.
WizStep(DBConnection dbConnection)
          Creates an instance of WizStep that uses an already grabbed DBConnection object.
 
Method Summary
 void add()
          Overrides add to add attributes and to set the step order automatically if it hasn't been done so yet.
 void addStepAttribute(String key, String value)
          Add an attribute for the step.
 String getHelpText()
           
 String getHelpTextRaw()
           
 String getId()
          Retrieves the id field.
 String getMenuAttribLabel()
          Get the description to the valid value portion for the current field settting for FLD_MODELFIELD.
 ValidValue[] getMenuItems()
          Retrieve the menu items as a valid value array.
 String getModelField()
          Get the model field.
 String getModelName()
          Retrieve the model.
 NodeType getNodeType()
          Return the node type associated with this step.
 String getOrder()
           
 Part getPart()
          Get the part that is associated with this step.
 List getPartsValidValues()
          Retrieve a list of a valid value objects for use in the list of attributes.
 List getPicklistMenu(String attribType)
          Retrieve a list of valid value items for the picklist menu that may be associated with the wizsteps.
 String getStepAttribute(String key)
          Retrieve a a value for a step attribute.
 List getStepAttributeList()
          Retrieve a list of attributes associated with this step.
 Map getStepAttributes()
          Retrieve a map of all attributes associated with this step.
 int getStepType()
          Retrieves the type of step.
 Vector getTextStyleValidValues()
           
 String getTitle()
           
 int getType()
           
 Vector getValidValues(String fieldName)
          Override to provide 'custom type' for value list.
 Transition getViewTrans()
          Provide a transition for viewing this object, suitable for creating an HTTP link.
 WizDefinition getWizardDefinition()
          Allows up navigation to the owner hierarchy.
 WizardPage getWizardPage(EmoWizardMetadata metadata)
          Builds a wizard page given an instance of the metadata.
 String getWizId()
           
 boolean isAttribute()
          Returns true if we're using a multi-valued node attribute for this step.
 void removeAllAttributes()
          Delete all attributes.
 void removeStepAttribute(String key)
          Remove an attribute to be associated with the step.
 void setId(int stepId)
           
 void setId(String id)
           
 void setOrder(String order)
           
 void setStepAttributes(Map attributes)
          Sets the step attributes.
protected  void setupFields()
          One time intiialization of all the field types.
 void setWizId(String wizId)
           
 boolean shouldUpdateDecisionMatrix()
          Assumes that this object has been retrieved and then certain fields have been set from request parameters.
 void update()
          Override of Normal Update to save all attributes to disk.
 void updateStepAttribute(String key, String value)
          Update an attribute for the step.
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.SecuredDBObject
canRequesterAdd, canRequesterDelete, canRequesterRead, canRequesterUpdate, checkAllowed, copyAttributes, count, createSecurityCache, delete, deleteAll, find, getRequestingUid, getRequestingUser, getString, getString, getString, getString, getString, getString, getSystemUid, instantiate, isAllowed, retrieve, search, searchAndRetrieveList, searchAndRetrieveList, 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, checkDeleteDetailPerm, checkField, checkMutable, checkRef, checkRef, clear, clearDistinctFields, clearError, clearFieldsToInput, clearFieldsToRetrieve, clearSortKeys, clone, containsWildCards, copyAllFields, delete, 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, 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, toString, wait, wait, wait
 
Methods inherited from interface com.jcorporate.expresso.core.dataobjects.Securable
getRequestingUid, isAllowed, setRequestingUid, setRequestingUser
 

Field Detail

TABLE_NAME

public static final String TABLE_NAME
See Also:
Constant Field Values

FLD_ID

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

See Also:
Constant Field Values

FLD_WIZID

public static final String FLD_WIZID
Public constant for access to field "Wizard Id".

See Also:
Constant Field Values

FLD_TITLE

public static final String FLD_TITLE
Public constant for access to field "New Field".

See Also:
Constant Field Values

FLD_DIRECTIVE

public static final String FLD_DIRECTIVE
Public constant for access to field "New Field".

See Also:
Constant Field Values

FLD_HELPTEXT

public static final String FLD_HELPTEXT
Public constant for access to field "Help Text".

See Also:
Constant Field Values

FLD_STEP_TYPE

public static final String FLD_STEP_TYPE
Public constant for access to field "Step Type".

See Also:
Constant Field Values

FLD_ORDER

public static final String FLD_ORDER
Public constant for access to field "Page Order List".

See Also:
Constant Field Values

TEXT_VV_UNDEFINED

public static final String TEXT_VV_UNDEFINED
Valid value constant for text type attribute Undefined.

See Also:
Constant Field Values

TEXT_VV_SINGLELINE

public static final String TEXT_VV_SINGLELINE
Valid value constant for text type attribute.

See Also:
Constant Field Values

TEXT_VV_MULTILINE

public static final String TEXT_VV_MULTILINE
Valid value constant for text type atttribute for multiline entry.

See Also:
Constant Field Values

MODEL_PICKLIST

public static final int MODEL_PICKLIST
Constant for steps that have a per-model picklist.

See Also:
Constant Field Values

INSTANCE_PICKLIST

public static final int INSTANCE_PICKLIST
Constant for steps that have a per-instance picklist.

See Also:
Constant Field Values

CUSTOM_PICKLIST

public static final int CUSTOM_PICKLIST
Constant for steps that have a custom picklist.

See Also:
Constant Field Values

TEXT_ENTRY

public static final int TEXT_ENTRY
Constant for steps that have custom text entry.

See Also:
Constant Field Values

INSTRUCTIONS_ONLY

public static final int INSTRUCTIONS_ONLY
Constant for steps that have custom instructions only.

See Also:
Constant Field Values

FIELDS_INDICATING_MATRIX_NEEDS_UPDATING

public static final String[] FIELDS_INDICATING_MATRIX_NEEDS_UPDATING
Constructor Detail

WizStep

public WizStep()
        throws DBException
Creates an instance of WizStep.

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

WizStep

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

Parameters:
dbConnection - com.jcorporate.expresso.core.db.DBConnection
Throws:
DBException - upon construction error
Method Detail

getPartsValidValues

public List getPartsValidValues()
                         throws DBException
Retrieve a list of a valid value objects for use in the list of attributes.

Returns:
List
Throws:
DBException - upon database error.

getPart

public Part getPart()
             throws DBException
Get the part that is associated with this step.

Returns:
Part instance or null if not found.
Throws:
DBException - upon database error.

getStepAttributes

public Map getStepAttributes()
                      throws DBException
Retrieve a map of all attributes associated with this step.

Returns:
Map of Strings keyed to Strings
Throws:
DBException - upon error.

getStepType

public int getStepType()
                throws DBException
Retrieves the type of step.

Returns:
int
Throws:
DBException

getStepAttributeList

public List getStepAttributeList()
                          throws DBException
Retrieve a list of attributes associated with this step.

Returns:
List
Throws:
DBException - upon error.

getStepAttribute

public String getStepAttribute(String key)
                        throws DBException
Retrieve a a value for a step attribute.

Parameters:
key - String the attribute key.
Returns:
String
Throws:
DBException

addStepAttribute

public void addStepAttribute(String key,
                             String value)
                      throws DBException
Add an attribute for the step.

Parameters:
key - String the attribute key.
value - The new value for the step attribute.
Throws:
DBException - upon error

updateStepAttribute

public void updateStepAttribute(String key,
                                String value)
                         throws DBException
Update an attribute for the step.

Parameters:
key - String the attribute key.
value - The new value for the step attribute.
Throws:
DBException - upon error

setStepAttributes

public void setStepAttributes(Map attributes)
                       throws DBException
Sets the step attributes.

Parameters:
attributes - Map
Throws:
DBException

removeStepAttribute

public void removeStepAttribute(String key)
                         throws DBException
Remove an attribute to be associated with the step.

Parameters:
key - String the attribute key.
Throws:
DBException - upon delete error.

removeAllAttributes

public void removeAllAttributes()
                         throws DBException
Delete all attributes.

Throws:
DBException

getMenuAttribLabel

public String getMenuAttribLabel()
                          throws DBException
Get the description to the valid value portion for the current field settting for FLD_MODELFIELD.

Returns:
String the description for the current setting
Throws:
DBException - upon database access error.

getNodeType

public NodeType getNodeType()
                     throws DBException
Return the node type associated with this step.

Returns:
NodeType or null if none is defined by the step.
Throws:
DBException - upon database access OR if we can't find the associated node type.

getPicklistMenu

public List getPicklistMenu(String attribType)
                     throws DBException
Retrieve a list of valid value items for the picklist menu that may be associated with the wizsteps.

Parameters:
attribType - The attribute type.
Returns:
List of Picklist objects
Throws:
DBException - if no menu is defined for this step.

getMenuItems

public ValidValue[] getMenuItems()
Retrieve the menu items as a valid value array.

Returns:
ValidValue[], never null, can be empty

getWizardPage

public WizardPage getWizardPage(EmoWizardMetadata metadata)
                         throws WizardException
Builds a wizard page given an instance of the metadata. [that has all links properly set]

Parameters:
metadata - the emo metadata instance.
Returns:
instance of a WizardPage
Throws:
WizardException - upon construction error.

getWizardDefinition

public WizDefinition getWizardDefinition()
                                  throws DBException
Allows up navigation to the owner hierarchy.

Returns:
WizDefinition instance associated with this Wizard Step.
Throws:
DBException - upon access error.

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

getValidValues

public Vector getValidValues(String fieldName)
                      throws DBException
Override to provide 'custom type' for value list.

Overrides:
getValidValues in class DBObject
Parameters:
fieldName - the name of the field for values.
Returns:
Vector of valid values.
Throws:
DBException

getTextStyleValidValues

public Vector getTextStyleValidValues()

add

public void add()
         throws DBException
Overrides add to add attributes and to set the step order automatically if it hasn't been done so yet.

Specified by:
add in interface DataObject
Overrides:
add in class SecuredDBObject
Throws:
DBException - upon database error

isAttribute

public boolean isAttribute()
                    throws DBException
Returns true if we're using a multi-valued node attribute for this step.

Returns:
boolean true for attribute.
Throws:
DBException - upon getField() error,

getModelName

public String getModelName()
                    throws DBException
Retrieve the model.

Returns:
String the name of the model.
Throws:
DBException - upon getField() error.

getModelField

public String getModelField()
                     throws DBException
Get the model field.

Returns:
String the name of the field of the model
Throws:
DBException - upon getFieldErorr();

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 access error.

getId

public String getId()
             throws DBException
Retrieves the id field.

Returns:
String
Throws:
DBException - upon getField() error.

update

public void update()
            throws DBException
Override of Normal Update to save all attributes to disk.

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

setId

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

setId

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

getWizId

public String getWizId()
                throws DBException
Throws:
DBException

setWizId

public void setWizId(String wizId)
              throws DBException
Throws:
DBException

shouldUpdateDecisionMatrix

public boolean shouldUpdateDecisionMatrix()
                                   throws DBException
Assumes that this object has been retrieved and then certain fields have been set from request parameters. Therefore, we can use internal 'isChanged()' to determine if fields have been changed by input.

Returns:
true if this object has changed key fields that require a Decision Matrix update as well
Throws:
DBException - upon database access error.

getTitle

public String getTitle()
                throws DBException
Throws:
DBException

getOrder

public String getOrder()
                throws DBException
Throws:
DBException

setOrder

public void setOrder(String order)
              throws DBException
Throws:
DBException

getType

public int getType()
            throws DBException
Throws:
DBException

getHelpText

public String getHelpText()
                   throws DBException
Throws:
DBException

getHelpTextRaw

public String getHelpTextRaw()
                      throws DBException
Throws:
DBException


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