com.sri.emo.dbobj
Class StepAttributes

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.sri.emo.dbobj.StepAttributes
All Implemented Interfaces:
Cacheable, ContextNested, DataObject, Securable, LookupInterface, Serializable

public class StepAttributes
extends SecuredDBObject

This is a collection of attributes for a particular wizard step. If you add attributes, you need to modify the getValidValues() function as well since this class enforces just what kind of attributes you can use.

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 ATTRIBUTE_INSTANCE_FIELD
          the ID of the Part, when step is of type 'attribute of instance'
static String ATTRIBUTE_INSTANCE_ID
          the ID of the instance, when step is of type 'attribute of instance'
static String ATTRIBUTE_MODEL
          Attribute Constant Supported for 'model'.
static String ATTRIBUTE_MODEL_FIELD
          Attribute Constant Supported for 'model field'.
static String ATTRIBUTE_PICKLIST_ID
          Attribute Constant supported for 'Custom Picklist Id'
static String ATTRIBUTE_TEXT_STYLE
          Attribute Constant Supported for 'text style'.
static String FLD_ATTRIBUTEKEY
          Public constant for access to field "Attribute Key"
static String FLD_ATTRIBUTEVALUE
          Public constant for access to field "Attribute Value"
static String FLD_ID
          Public constant for access to field "Item ID"
static String FLD_STEPID
          Public constant for access to field "Wizard Step ID"
static String TABLE_NAME
          DBObject table name
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.
 
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
StepAttributes()
          Creates an instance of StepAttributes.
StepAttributes(DBConnection dbConnection)
          Creates an instance of StepAttributes that uses an already grabbed DBConnection object.
StepAttributes(DBConnection dbConnection, String securityContext)
          

Constructor that sets a connection as the object is created - typically this is used when a particular DBConnection is required for the purposes of maintaining a database transaction.

StepAttributes(ReadOnlyUser userSecurity)
          Constructor for security setup.
 
Method Summary
 String getAttributeKey()
          Retrieve the attribute key field.
 String getAttributeValue()
          Retrieve the attribute value field.
 Vector getValidValues(String fieldName)
          Retrieves the attributes allowable.
 void setStepId(String id)
           
protected  void setupFields()
          One time intiialization of all the field types.
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.SecuredDBObject
add, 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, update
 
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
 

Field Detail

ATTRIBUTE_TEXT_STYLE

public static final String ATTRIBUTE_TEXT_STYLE
Attribute Constant Supported for 'text style'.

See Also:
Constant Field Values

ATTRIBUTE_MODEL_FIELD

public static final String ATTRIBUTE_MODEL_FIELD
Attribute Constant Supported for 'model field'.

See Also:
Constant Field Values

ATTRIBUTE_MODEL

public static final String ATTRIBUTE_MODEL
Attribute Constant Supported for 'model'.

See Also:
Constant Field Values

ATTRIBUTE_INSTANCE_ID

public static final String ATTRIBUTE_INSTANCE_ID
the ID of the instance, when step is of type 'attribute of instance'

See Also:
Constant Field Values

ATTRIBUTE_INSTANCE_FIELD

public static final String ATTRIBUTE_INSTANCE_FIELD
the ID of the Part, when step is of type 'attribute of instance'

See Also:
Constant Field Values

ATTRIBUTE_PICKLIST_ID

public static final String ATTRIBUTE_PICKLIST_ID
Attribute Constant supported for 'Custom Picklist Id'

See Also:
Constant Field Values

TABLE_NAME

public static final String TABLE_NAME
DBObject 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_STEPID

public static final String FLD_STEPID
Public constant for access to field "Wizard Step ID"

See Also:
Constant Field Values

FLD_ATTRIBUTEKEY

public static final String FLD_ATTRIBUTEKEY
Public constant for access to field "Attribute Key"

See Also:
Constant Field Values

FLD_ATTRIBUTEVALUE

public static final String FLD_ATTRIBUTEVALUE
Public constant for access to field "Attribute Value"

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
Constructor Detail

StepAttributes

public StepAttributes()
               throws DBException
Creates an instance of StepAttributes. Call setRequestingUid() and setDataContext() before using.

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

StepAttributes

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

Example:

 DBConnection oneConnection = DBConnectionPool.getInstance("default").getConnection();
 oneConnection.setAutoCommit(false);
 StepAttributes myObj = new StepAttributes(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
Throws:
DBException - upon construction error

StepAttributes

public StepAttributes(DBConnection dbConnection,
                      String securityContext)
               throws DBException

Constructor that sets a connection as the object is created - typically this is used when a particular DBConnection is required for the purposes of maintaining a database transaction. If a specific connection is not used, there is no way to use commit() and rollback() in the event of failure, as a different DBConnection might be used for each phase of the transaction. Critial sections should therefore explicity request a DBConnection from the connection pool and pass it to each of the DB objects in that section.

This constructor is neceesary to work with otherDBMap and transaction capabilities

Parameters:
dbConnection - The DBConnection to utilize
securityContext - The data context that contains the setup (and security) tables for this object
Throws:
DBException - upon initialization error

StepAttributes

public StepAttributes(ReadOnlyUser userSecurity)
               throws DBException
Constructor for security setup.

Parameters:
userSecurity - ReadOnlyUser security context.
Throws:
DBException - upon construction error.
Method Detail

getAttributeKey

public String getAttributeKey()
                       throws DBException
Retrieve the attribute key field.

Returns:
String may be empty string if attribute doesn't exist.
Throws:
DBException - upon error.

getAttributeValue

public String getAttributeValue()
                         throws DBException
Retrieve the attribute value field.

Returns:
String may be empty string if attribute doesn't exist.
Throws:
DBException - upon 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
To Do:
fill this function out to use your dbobject.

getValidValues

public Vector getValidValues(String fieldName)
                      throws DBException
Retrieves the attributes allowable.

Overrides:
getValidValues in class DBObject
Parameters:
fieldName - String
Returns:
Vector of valid value objects.
Throws:
DBException - upon error.

setStepId

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


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