com.sri.emo.dbobj
Class Setting

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.Setting
All Implemented Interfaces:
Cacheable, ContextNested, DataObject, Securable, LookupInterface, ISetting, Serializable

public class Setting
extends RowSecuredDBObject
implements ISetting

A setting for a variable.

Author:
larry hamel
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 COMMENT
           
static String NOT_SPECIFIED_DISPLAY
           
static String NOT_SPECIFIED_ENTRY_INDEX
           
static String SETTING_DESCRIPTION
           
static String SETTING_NODE_ID
          for this particular node, somehow associated with template, this setting applies
static String TEMPLATE_NODE_ID
          TEMPLATE node id.
static String VALUE
          the chosen category
 
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
Setting()
           
Setting(DBConnection theConnection, int theUser)
          Constructor
Setting(ReadOnlyUser userSecurity)
          Constructor for security setup.
Setting(String templateId, String settingParentNodeId)
           
 
Method Summary
 boolean canWrite(int uid, boolean valueIfNew)
           
 String getComment()
           
 String getDisplayValue()
           
 ISetting getInstance(String templateId, String settingParentNodeId)
           
 Node getSettingTarget()
          will throw if not found
 String getSettingTargetId()
           
 String getTemplateId()
           
 String getValue()
           
 void isAllowed(String requestedFunction)
          OVERRIDE to use parent node permissions
 boolean isRowAllowed(String requestedFunction)
          override to use parent node perms for attrib.
 void setComment(String comment)
           
 void setSettingTargetId(String nodeId)
           
 void setTemplateId(String nodeId)
           
protected  void setupFields()
          Defines the database table name and fields for this DB object
 void setValue(String val)
           
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.RowSecuredDBObject
add, add, addGroupPerm, canRequesterAdministrate, canRequesterRead, canRequesterWrite, checkDeleteDetailPerm, checkKeyLength, defaultGroup, defaultPermissions, delete, deleteAll, find, getAdministrateGroups, getGroups, getPermissions, getReadGroups, getWriteGroups, isAdminGroup, isReadGroup, isRowAllowed, isWriteGroup, ownerID, removeGroup, retrieve, searchAndRetrieveList, searchAndRetrieveList, setPermissions, setPermissions, update
 
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, 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, checkField, checkMutable, checkRef, checkRef, clear, 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, toString, wait, wait, wait
 
Methods inherited from interface com.sri.emo.dbobj.ISetting
searchAndRetrieveList
 

Field Detail

TEMPLATE_NODE_ID

public static final String TEMPLATE_NODE_ID
TEMPLATE node id. PK with SETTING_NODE_ID, foreign key to node table Settings are attached to templates only

See Also:
Constant Field Values

SETTING_NODE_ID

public static final String SETTING_NODE_ID
for this particular node, somehow associated with template, this setting applies

See Also:
Constant Field Values

VALUE

public static final String VALUE
the chosen category

See Also:
Constant Field Values

COMMENT

public static final String COMMENT
See Also:
Constant Field Values

SETTING_DESCRIPTION

public static final String SETTING_DESCRIPTION
See Also:
Constant Field Values

NOT_SPECIFIED_DISPLAY

public static final String NOT_SPECIFIED_DISPLAY
See Also:
Constant Field Values

NOT_SPECIFIED_ENTRY_INDEX

public static final String NOT_SPECIFIED_ENTRY_INDEX
See Also:
Constant Field Values
Constructor Detail

Setting

public Setting()
        throws DBException
Throws:
DBException - If the new object cannot be created

Setting

public Setting(String templateId,
               String settingParentNodeId)
        throws DBException
Throws:
DBException

Setting

public Setting(DBConnection theConnection,
               int theUser)
        throws DBException
Constructor

Parameters:
theConnection - DBConnection to be used to communicate with the database
theUser - User name attempting to access the object
Throws:
DBException - If the user cannot access this object or the object cannot be initialized

Setting

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

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

getInstance

public ISetting getInstance(String templateId,
                            String settingParentNodeId)
                     throws DBException
Specified by:
getInstance in interface ISetting
Throws:
DBException

setupFields

protected void setupFields()
                    throws DBException
Defines the database table name and fields for this DB object

Overrides:
setupFields in class DBObject
Throws:
DBException - if the operation cannot be performed

getValue

public String getValue()
                throws DBException
Throws:
DBException

getSettingTargetId

public String getSettingTargetId()
                          throws DBException
Specified by:
getSettingTargetId in interface ISetting
Returns:
ID for node which actually carries the setting value (i.e., not the template)
Throws:
DBException

getSettingTarget

public Node getSettingTarget()
                      throws DBException
will throw if not found

Specified by:
getSettingTarget in interface ISetting
Returns:
the node, like task-model variable, that receives the setting
Throws:
DBException

setTemplateId

public void setTemplateId(String nodeId)
                   throws DBException
Specified by:
setTemplateId in interface ISetting
Throws:
DBException

setSettingTargetId

public void setSettingTargetId(String nodeId)
                        throws DBException
Specified by:
setSettingTargetId in interface ISetting
Throws:
DBException

setValue

public void setValue(String val)
              throws DBException
Specified by:
setValue in interface ISetting
Throws:
DBException

getDisplayValue

public String getDisplayValue()
                       throws DBException
Specified by:
getDisplayValue in interface ISetting
Returns:
if item is menued, we store menu id, so translate stored ID into string; otherwise if freeform, just return stored string, defaulting to (not specified)
Throws:
DBException

getComment

public String getComment()
                  throws DBException
Specified by:
getComment in interface ISetting
Throws:
DBException

setComment

public void setComment(String comment)
                throws DBException
Specified by:
setComment in interface ISetting
Throws:
DBException

canWrite

public boolean canWrite(int uid,
                        boolean valueIfNew)
                 throws DBException
Specified by:
canWrite in interface ISetting
Throws:
DBException

getTemplateId

public String getTemplateId()
                     throws DBException
Specified by:
getTemplateId in interface ISetting
Throws:
DBException

isRowAllowed

public boolean isRowAllowed(String requestedFunction)
                     throws DBException
override to use parent node perms for attrib.

Overrides:
isRowAllowed in class RowSecuredDBObject
Parameters:
requestedFunction - code for function -- Add, Update, Delete, Search (read)
Returns:
true if this function is allowed for this requesting user
Throws:
SecurityException - (unchecked) if not allowed
DBException - for other data-related errors.

isAllowed

public void isAllowed(String requestedFunction)
               throws SecurityException,
                      DBException
OVERRIDE to use parent node permissions

Specified by:
isAllowed in interface Securable
Overrides:
isAllowed in class SecuredDBObject
Parameters:
requestedFunction - The code of the requested function. The codes are:
  1. A: Add
  2. S: Search
  3. U: Update
  4. D: Delete
Throws:
DBException - If the requested operation is not permitted to this user
SecurityException - if the user is not allowed access to the object.


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