|
||||||||||
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.SecurDBObject com.sri.emo.dbobj.Part
public class Part
A part of an "entity" (a Node object). Our modeling environment allows dynamic building of objects. Parts have a complex typing system because the "type" field is overloaded for two kinds of parts: owned attributes and shared nodes.
For owned attributes, the Type field is a simple string, unique within the parent object. For shared nodes, the Type field is the nodeType of the shared nodes. However, multiple parts within a single entity can be of "shared node" type AND share the same kind of node. For example, Is a kind of/These are kinds of me -- these two part labels apply to the same kind of shared node, so their part types are the same. Parts which are shared-node parts are distinguished (uniquely) by a combination of part type, relation type, and parent type.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.jcorporate.expresso.core.dbobj.DBObject |
---|
DBObject.FieldError, DBObject.FieldUpdate |
Field Summary | |
---|---|
static String |
CARDINALITY
|
static String[][] |
CARDINALITY_CHOICES
|
static String |
DELIMITER
|
static String |
DEST_NODE_REF
|
static String |
KEEP_DETAILS
|
static String |
MULTIPLE_ALLOWED
attribute limitation constants (could be in other "def" table) |
static String |
NODE_PART_RELATION_TYPE
|
static String |
NOT_SPECIFIED_ID
|
static String |
PARENT_TYPE
|
static String |
PART_DESCRIP
|
static String |
PART_DISPLAY_NAME
|
static String |
PART_HELP_STRING
|
static String |
PART_ID
field names |
static String |
PART_IS_ATTRIB
|
static String |
PART_LABEL
|
static String |
PART_NUM
|
static String |
PART_TYPE
|
static String |
PART_TYPE_TABLE_NAME
|
static String |
PICKLIST_SINGLE_ALLOWED
|
static String |
REL_REF
|
static String |
SINGLE_ALLOWED
|
static String[] |
SINGLE_CARDINALITY_CHOICES
|
static String |
SPECIAL_HANDLER
|
static String |
SRC_NODE_REF
|
static String |
SUMMARY_SINGLE_ALLOWED
|
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 | |
---|---|
Part()
Default constructor for Part
creates a new object of this type with no connection
yet allocated. |
|
Part(ControllerRequest request)
Deprecated. |
|
Part(SecuredDBObject obj)
|
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 not to check permissions (which is done at the table level by superclass) but rather to add default permissions |
boolean |
areMultipleAttributesAllowed()
|
void |
changeRelations(String oldNodeRelation)
change all relations associated with this part IFF the nodeRelation changed |
int |
compareTo(Object o)
Compares this object with the specified object for order. |
void |
delete()
Delete a part; deletes all attribs or relations associated with this part, unless the part has a KEEP_DETAILS attribute (an expresso attribute associated with the dbobject) |
void |
deleteRelations()
Delete all relations associated with this part. |
String |
getCardinality()
|
String |
getCardinalityLabel()
Retrieves the label for the cardinality. |
IPartHandler |
getCustomHandler()
|
String |
getDefinition(boolean isHTML)
for definition page, |
String |
getDisplayTitleOfParentNodeType(int requestingUid)
Return display title of node type of parent node, or empty string "" if not found. |
Transition |
getEditTrans(String nodeId,
Map params)
provide a transition for editing this part, suitable for creating an HTTP link |
String |
getId()
|
String |
getNodeRelation()
Return code for node relation type. |
RelationType |
getNodeRelationEntity()
|
String |
getNodeRelationLabel(ExpressoRequest request)
|
String |
getNodeRelationObjectLabel()
|
NodeType |
getParentEntity()
|
String |
getParentType()
|
String |
getPartDescription()
|
String |
getPartDescriptionRaw()
|
static Part |
getPartFromXMLName(String name)
|
String |
getPartLabel()
|
String |
getPartNum()
|
int |
getPartNumInt()
|
String |
getPartType()
|
String |
getPartUniqueId()
|
List |
getPickList()
|
List |
getPicklist(ExpressoRequest request)
|
List |
getPickList(String dataContext,
int uid)
|
String[][] |
getPicklistArray(ExpressoRequest request)
|
String[][] |
getPicklistArrayAssumeSecure()
|
ValidValue[] |
getPickListValidValues()
|
String |
getPicklistXMLName()
|
List |
getRelations()
|
String |
getSpecialHandlerName()
|
Transition |
getViewTrans()
provide a transition for viewing this object, suitable for creating an HTTP link |
boolean |
hasPicklist()
|
void |
isAllowed(String requestedFunction)
See if the current user of this DB object is allowed to perform the requested function, given the function's code. |
boolean |
isHaveCustomHandler()
|
boolean |
isMultipleAllowed()
can be for attribute OR shared relation; simply describes cardinality |
boolean |
isOwnedAttribute()
|
void |
isOwnedAttribute(boolean attribute)
|
boolean |
isRowAllowed(String requestedFunction)
override to use permissions of parent node type |
boolean |
isSharedNodeAttrib()
|
boolean |
isSingleValued()
Can be for attribute OR shared relation; simply describes cardinality. |
boolean |
isSummary()
|
int |
numDisplayLines()
|
void |
refreshSpecialHandlerCache()
|
void |
setCustomHandler(String customHandler)
|
void |
setId(String id)
|
void |
setNodeRelation(String nodeRelation)
|
void |
setParentType(String type)
|
void |
setPartCardinality(String card)
|
void |
setPartDescrip(String s)
|
void |
setPartId(int partId)
|
void |
setPartId(String partId)
|
void |
setPartLabel(String s)
|
void |
setPartNum(int i)
|
void |
setPartType(String partType)
|
void |
setSpecialHandler(String s)
|
protected void |
setupFields()
Defines the database table name and fields for this DB object |
void |
update()
add cache maintenance |
Methods inherited from class com.jcorporate.expresso.core.dbobj.SecuredDBObject |
---|
canRequesterAdd, canRequesterDelete, canRequesterRead, canRequesterUpdate, checkAllowed, copyAttributes, count, createSecurityCache, deleteAll, find, getRequestingUid, getRequestingUser, getString, getString, getString, getString, getString, getString, getSystemUid, instantiate, retrieve, search, searchAndRetrieveList, searchAndRetrieveList, 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 |
Methods inherited from interface com.jcorporate.expresso.core.dataobjects.Securable |
---|
getRequestingUid, setRequestingUid, setRequestingUser |
Field Detail |
---|
public static final String PART_TYPE_TABLE_NAME
public static final String KEEP_DETAILS
public static final String DELIMITER
public static final String PART_ID
public static final String PARENT_TYPE
public static final String PART_NUM
public static final String PART_LABEL
public static final String SPECIAL_HANDLER
public static final String PART_TYPE
public static final String NODE_PART_RELATION_TYPE
public static final String CARDINALITY
public static final String PART_DESCRIP
public static final String PART_IS_ATTRIB
public static final String MULTIPLE_ALLOWED
public static final String SINGLE_ALLOWED
public static final String SUMMARY_SINGLE_ALLOWED
public static final String PICKLIST_SINGLE_ALLOWED
public static final String NOT_SPECIFIED_ID
public static final String[][] CARDINALITY_CHOICES
public static final String[] SINGLE_CARDINALITY_CHOICES
public static final String PART_DISPLAY_NAME
public static final String PART_HELP_STRING
public static final String REL_REF
public static final String SRC_NODE_REF
public static final String DEST_NODE_REF
Constructor Detail |
---|
public Part() throws DBException
Part
creates a new object of this type with no connection
yet allocated.
DBException
- If the new object cannot be
createdpublic Part(ControllerRequest request) throws DBException
request
- ControllerRequest
DBException
public Part(SecuredDBObject obj) throws DBException
DBException
Method Detail |
---|
protected void setupFields() throws DBException
setupFields
in class DBObject
DBException
- if the operation cannot be performedpublic void setParentType(String type) throws DBException
DBException
public String getPartLabel() throws DBException
DBException
public String getPartType() throws DBException
DBException
public boolean isOwnedAttribute() throws DBException
DBException
public String getPartNum() throws DBException
DBException
public String getSpecialHandlerName() throws DBException
DBException
public String getCardinality() throws DBException
DBException
public String getPartDescription() throws DBException
DBException
public void setPartType(String partType) throws DBException
DBException
public String getParentType() throws DBException
DBException
public String getNodeRelation() throws DBException
DBException
- upon database exception error.public void setNodeRelation(String nodeRelation) throws DBException
DBException
public NodeType getParentEntity() throws DBException
DBException
public String getDefinition(boolean isHTML) throws DBException
isHTML
- signals whether to use HTML tags, or if false, to use Docbook tags
DBException
- upon database exception error.public void setId(String id) throws DBException
DBException
public String getId() throws DBException
DBException
public void setPartNum(int i) throws DBException
DBException
public boolean hasPicklist() throws DBException
DBException
- upon database exception error.public boolean isHaveCustomHandler() throws DBException
DBException
public IPartHandler getCustomHandler() throws DBException
DBException
- upon database exception error.public void setCustomHandler(String customHandler) throws DBException
DBException
public String getDisplayTitleOfParentNodeType(int requestingUid)
requestingUid
- the requesting uid.
public String[][] getPicklistArray(ExpressoRequest request) throws DBException
request
- the ControllerRequest for parameters.
DBException
- upon database exception error.public List getPicklist(ExpressoRequest request) throws DBException
DBException
public List getPickList(String dataContext, int uid) throws DBException
DBException
public List getPickList() throws DBException
DBException
public ValidValue[] getPickListValidValues() throws DBException
DBException
public boolean isSummary() throws DBException
DBException
- upon database exception error.public boolean areMultipleAttributesAllowed() throws DBException
DBException
- upon database exception error.public int numDisplayLines() throws DBException
DBException
public void refreshSpecialHandlerCache()
public void delete() throws DBException
delete
in interface DataObject
delete
in class SecuredDBObject
DBException
- if delete is not allowed for the current userDBObject.setAttribute(java.lang.String, java.lang.Object)
,
KEEP_DETAILS
public boolean isRowAllowed(String requestedFunction) throws DBException
requestedFunction
- code for function -- Add, Update, Delete, Search (read)
SecurityException
- (unchecked) if not allowed
DBException
- for other data-related errors.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 SecuredDBObject
DBException
- upon database exception error.public void add() throws DBException
add
in interface DataObject
add
in class SecuredDBObject
DBException
- upon database exception error.public boolean isSharedNodeAttrib() throws DBException
DBException
public List getRelations() throws DBException
DBException
- upon database exception error.public void deleteRelations() throws DBException
DBException
- upon database exception error.public void changeRelations(String oldNodeRelation) throws DBException
oldNodeRelation
- the old relation; assumes new relation is in "this"
DBException
- upon database exception error.public int getPartNumInt() throws DBException
DBException
public void setPartLabel(String s) throws DBException
DBException
public void setPartCardinality(String card) throws DBException
card
- cardinality type; see constants in this file
DBException
- upon database exception error.public void isOwnedAttribute(boolean attribute) throws DBException
DBException
public String getPartUniqueId() throws DBException
DBException
- upon database exception error.public boolean isSingleValued() throws DBException
DBException
- upon getField exceptions.isMultipleAllowed()
public String getCardinalityLabel() throws DBException
DBException
- upon database exception error.public String getNodeRelationLabel(ExpressoRequest request) throws DBException
request
- the ControllerRequest object.
DBException
- upon database exception error.public String getNodeRelationObjectLabel() throws DBException
DBException
- upon database exception error.public void setPartDescrip(String s) throws DBException
DBException
public void setSpecialHandler(String s) throws DBException
DBException
public int compareTo(Object o)
In the foregoing description, the notation sgn(expression) designates the mathematical signum function, which is defined to return one of -1, 0, or 1 according to whether the value of expression is negative, zero or positive. The implementor must ensure sgn(x.compareTo(y)) == -sgn(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception iff y.compareTo(x) throws an exception.)
The implementor must also ensure that the relation is transitive: (x.compareTo(y)>0 && y.compareTo(z)>0) implies x.compareTo(z)>0.
Finally, the implementer must ensure that x.compareTo(y)==0 implies that sgn(x.compareTo(z)) == sgn(y.compareTo(z)), for all z.
It is strongly recommended, but not strictly required that (x.compareTo(y)==0) == (x.equals(y)). Generally speaking, any class that implements the Comparable interface and violates this condition should clearly indicate this fact. The recommended language is "Note: this class has a natural ordering that is inconsistent with equals."
compareTo
in interface Comparable
o
- the Object to be compared.
ClassCastException
- if the specified object's type prevents it
from being compared to this Object.public String[][] getPicklistArrayAssumeSecure() throws DBException
DBException
public void setPartId(int partId) throws DBException
DBException
public void setPartId(String partId) throws DBException
DBException
public String getPartDescriptionRaw() throws DBException
DBException
public Transition getEditTrans(String nodeId, Map params) throws DBException
nodeId
- The parent node id.params
- request parameters; assumes NODE_ID is within this map
DBException
- upon DBObject-related error.public Transition getViewTrans() throws DBException
getViewTrans
in interface IViewable
DBException
- upon DBObject-related error.public void acceptVisitor(ModelVisitor visitor)
ModelVisitable
acceptVisitor
in interface ModelVisitable
visitor
- ViewVisitorpublic boolean isMultipleAllowed() throws DBException
DBException
- upon DBObject-related error.isSingleValued()
public RelationType getNodeRelationEntity() throws DBException
DBException
- upon DBObject-related error.public String getPicklistXMLName() throws DBException
DBException
public static Part getPartFromXMLName(String name) throws DBException
DBException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |