|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jcorporate.expresso.core.dataobjects.BaseDataObject com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject com.jcorporate.expresso.core.dbobj.DBObject com.jcorporate.expresso.core.dbobj.SecuredDBObject com.jcorporate.expresso.core.dbobj.RowSecuredDBObject com.sri.emo.dbobj.Attribute
public class Attribute
encapsulate a name-value pair which is associated with a Node object
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.jcorporate.expresso.core.dbobj.DBObject |
---|
DBObject.FieldError, DBObject.FieldUpdate |
Field Summary | |
---|---|
static String |
ATTRIBUTE_COMMENT
|
static String |
ATTRIBUTE_COMMENT_PREFIX
|
static String |
ATTRIBUTE_CREATED
|
static String |
ATTRIBUTE_DESCRIPTION
|
static String |
ATTRIBUTE_DISPLAY_NAME
For now, attribute display name is stored in subclasses of PartDescriptor, as implemented in PartDescriptor.getParts(). |
static String |
ATTRIBUTE_ID
incrementing PK |
static String |
ATTRIBUTE_ID_PREFIX
|
static String |
ATTRIBUTE_ID_UNKNOWN
Attribute id is used to discern between multiple attributes with the same name for the same owner node. |
static String |
ATTRIBUTE_MODIFIED
|
static String |
ATTRIBUTE_ORDER
|
static String |
ATTRIBUTE_PICKLIST_DISPLAY
|
static String |
ATTRIBUTE_TAG
|
static String |
ATTRIBUTE_TYPE
Name is internal string, type of attribute (would be PK with nodeId if we didn't save multiple attributes of same type per node ). |
static String |
ATTRIBUTE_VALUE
|
static String |
ATTRIBUTE_VALUE_PREFIX
|
static String |
CUSTOM_ATTRIBUTE
|
static String |
NODE_ID
|
static String |
NODE_TYPE
Field NODE_TYPE breaks normalization by storing data in two places, but is convenient for finding all attributes for a given node type; |
static String |
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 | |
---|---|
Attribute()
Default constructor for Attribute
creates a new object of this type with no connection
yet allocated. |
|
Attribute(DBConnection theConnection,
int theUser)
Constructor |
|
Attribute(Node parent)
attribute for this parent |
|
Attribute(ReadOnlyUser theUser)
Constructor |
|
Attribute(String attribId)
|
Method Summary | |
---|---|
void |
acceptVisitor(ModelVisitor visitor)
Accepts the visitor and redirects the visitor to the appropriate type we're dealing with. |
void |
add()
We override to set dates and provide default ordering if nec. |
Attribute |
clone(String cloneNodeId)
deep copy fields to new attribute into attribute which attaches to node with given ID; expects fully saved Attribute (with ID) as source. |
Attribute |
clone(String cloneNodeId,
String destAttribType)
deep copy fields to new attribute into attribute which attaches to node with given ID; expects fully saved Attribute (with ID) as source. |
void |
delete(boolean deleteDetails)
We override to provide call to handler, if any, and reorder remaining, if nec. |
String |
getAttribComment()
|
String |
getAttribCommentRaw()
|
String |
getAttribCreated()
|
String |
getAttribId()
|
String |
getAttribModified()
|
String |
getAttribType()
|
String |
getAttribValue()
|
String |
getAttribValueRaw()
|
IPartHandler |
getCustomHandler()
|
Transition |
getEditTrans()
Provide a transition for editing of this object, suitable for creating an HTTP link. |
Transition |
getEditTrans(Map reqParams)
Provide a transition for SPECIAL editing of this object, suitable for creating an HTTP link. |
Part |
getExplicitPart()
Returns the value for an explicit Part if it has been set. |
String |
getField(String fieldName)
Extends the normal getField method to handle virtual fields. |
String |
getOrder()
|
int |
getOrderInt()
|
Node |
getParentNode()
|
String |
getParentNodeId()
|
String |
getParentNodeType()
|
Part |
getPart()
Retrieve the part why which this attribute belongs to. |
Output |
getViewComment(Map params)
Retrieve the view comment as an output. |
Transition |
getViewTrans()
Provide a transition for viewing this object, suitable for creating an HTTP link. |
Transition |
getViewTrans(Map reqParams)
Provide a transition for viewing this object, suitable for creating an HTTP link. |
org.dom4j.Element |
getXML(ExpressoRequest request,
boolean addOrder)
|
boolean |
hasCustomHandler()
|
boolean |
hasPicklist()
|
void |
isAllowed(String requestedFunction)
OVERRIDE to use parent node permissions |
boolean |
isRowAllowed(String requestedFunction)
override to use parent node perms for attrib. |
void |
setAttributeComment(String comment)
|
void |
setAttributeId(String id)
|
void |
setAttributeType(String attribType)
|
void |
setAttributeValue(String value)
|
void |
setExplicitPart(Part explicitPart)
Sets the part for this attribute explicitly. |
void |
setOrder(int order)
|
void |
setOrder(String value)
|
void |
setParentNode(Node node)
|
void |
setParentNodeId(String parentId)
note: new nodes need BOTH id and type from parent |
void |
setParentNodeType(String parentType)
note: new nodes need BOTH id and type from parent |
protected void |
setupFields()
Defines the database table name and fields for this DB object |
void |
update()
We override to set dates and fix ordering if nec. |
void |
updateOrder()
Update without triggering reordering; useful for 'transaction' where order of part A should be set before manipulating order of part B, as opposed to a deletion or otherwise, where reordering of all remaining is required. |
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, 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, search, setRequestingUid, setRequestingUser |
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 |
---|
public static final String ATTRIBUTE_ID
public static final String ATTRIBUTE_TAG
public static final String NODE_ID
public static final String NODE_TYPE
public static final String ATTRIBUTE_TYPE
public static final String ATTRIBUTE_VALUE
public static final String ATTRIBUTE_CREATED
public static final String ATTRIBUTE_MODIFIED
public static final String ATTRIBUTE_COMMENT
public static final String ATTRIBUTE_PICKLIST_DISPLAY
public static final String ATTRIBUTE_ORDER
public static final String ATTRIBUTE_DISPLAY_NAME
public static final String ATTRIBUTE_VALUE_PREFIX
public static final String ATTRIBUTE_COMMENT_PREFIX
public static final String ATTRIBUTE_ID_PREFIX
public static final String ATTRIBUTE_ID_UNKNOWN
public static final String ATTRIBUTE_DESCRIPTION
public static final String CUSTOM_ATTRIBUTE
public static final String TABLE_NAME
Constructor Detail |
---|
public Attribute() throws DBException
Attribute
creates a new object of this type with no connection
yet allocated.
DBException
- If the new object cannot be
createdpublic Attribute(DBConnection theConnection, int theUser) throws DBException
theConnection
- DBConnection to be used to
communicate with the databasetheUser
- User name attempting to access the
object
DBException
- If the user cannot access this
object or the object cannot be initializedpublic Attribute(String attribId) throws DBException
DBException
public Attribute(Node parent) throws DBException
DBException
public Attribute(ReadOnlyUser theUser) throws DBException
theUser
- User name attempting to access the object
DBException
- If the user cannot access this
object or the object cannot be initializedMethod Detail |
---|
protected void setupFields() throws DBException
setupFields
in class DBObject
DBException
- if the operation cannot be performedpublic String getField(String fieldName) throws DBException
getField
in interface DataObject
getField
in class DBObject
fieldName
- Name of the database field for which a value set is
requested
DBException
- If the operation cannot be performedpublic String getAttribId() throws DBException
DBException
public String getAttribValue() throws DBException
DBException
public void setAttributeId(String id) throws DBException
DBException
public String getParentNodeId() throws DBException
DBException
public Node getParentNode() throws DBException
DBException
- upon database access error.public String getOrder() throws DBException
DBException
public String getAttribComment() throws DBException
DBException
public void setAttributeComment(String comment) throws DBException
DBException
public String getAttribType() throws DBException
DBException
public void setParentNodeId(String parentId) throws DBException
DBException
setParentNode(Node)
public void setParentNodeType(String parentType) throws DBException
DBException
setParentNode(Node)
public void setAttributeType(String attribType) throws DBException
DBException
public String getAttribCreated() throws DBException
DBException
public String getAttribModified() throws DBException
DBException
public IPartHandler getCustomHandler() throws DBException
DBException
public Attribute clone(String cloneNodeId) throws DBException
cloneNodeId
-
DBException
- upon database access error.public Attribute clone(String cloneNodeId, String destAttribType) throws DBException
cloneNodeId
-
DBException
- upon database access error.public void add() throws DBException
add
in interface DataObject
add
in class RowSecuredDBObject
DBException
- upon database access error.public void isAllowed(String requestedFunction) throws SecurityException, DBException
isAllowed
in interface Securable
isAllowed
in class SecuredDBObject
requestedFunction
- The code of the requested function. The codes are:
DBException
- If the requested operation is not permitted to this user
SecurityException
- if the user is not allowed access to the object.public void update() throws DBException
update
in interface DataObject
update
in class RowSecuredDBObject
DBException
- upon database access error.public void delete(boolean deleteDetails) throws DBException
delete
in class RowSecuredDBObject
DBException
- upon database access error.public void updateOrder() throws DBException
DBException
- upon database access error.public org.dom4j.Element getXML(ExpressoRequest request, boolean addOrder) throws DBException
DBException
public Part getPart() throws DBException
DBException
- upon error.public void setAttributeValue(String value) throws DBException
DBException
public void setOrder(String value) throws DBException
DBException
public void setOrder(int order) throws DBException
DBException
public void setParentNode(Node node) throws DBException
DBException
public String getAttribCommentRaw() throws DBException
DBException
public String getAttribValueRaw() throws DBException
DBException
public boolean hasCustomHandler() throws DBException
DBException
public boolean hasPicklist() throws DBException
DBException
public int getOrderInt() throws DBException
DBException
public Transition getViewTrans() throws DBException
getViewTrans
in interface IViewable
DBException
- upon database access error.public Transition getViewTrans(Map reqParams) throws DBException
DBException
- upon database access error.public Transition getEditTrans(Map reqParams) throws DBException
DBException
- upon database access error.public Transition getEditTrans() throws DBException
DBException
- upon database access error.public void acceptVisitor(ModelVisitor visitor)
ModelVisitable
acceptVisitor
in interface ModelVisitable
visitor
- ViewVisitorpublic String getParentNodeType() throws DBException
DBException
public boolean isRowAllowed(String requestedFunction) throws DBException
isRowAllowed
in class RowSecuredDBObject
requestedFunction
- code for function -- Add, Update, Delete, Search (read)
SecurityException
- (unchecked) if not allowed
DBException
- for other data-related errors.public Output getViewComment(Map params) throws DBException
params
- map of ExpressoRequest params.
DBException
- upon Output construction error.public Part getExplicitPart()
public void setExplicitPart(Part explicitPart)
explicitPart
- Part
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |