|
||||||||||
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.NodeType
public class NodeType
Encapsulate the finite list of types allowed for a node.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.jcorporate.expresso.core.dbobj.DBObject |
---|
DBObject.FieldError, DBObject.FieldUpdate |
Field Summary | |
---|---|
static String |
ANY_OBJECT
|
static String |
DISPLAY_TITLE
|
static String |
NODE_TYPE_DESCRIP
|
static String |
NODE_TYPE_HANDLER
Class name for special handling if any. |
static String |
NODE_TYPE_ID
|
static String |
NODE_TYPE_NAME
|
static String |
NODE_TYPE_TABLE_NAME
|
static String |
NODE_TYPE_VERSION
|
static String |
USE_ID_FOR_REFERENCE
boolean for whether, when outputting xml, this node type should be 'abbreviated' as an ID rather than a full XML tree. |
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 | |
---|---|
NodeType()
Default constructor for NodeType
creates a new object of this type with no connection
yet allocated. |
|
NodeType(DBConnection theConnection,
int theUser)
Constructor |
|
NodeType(ExpressoRequest request)
Deprecated. Use RequestRegistry to propagate request contexts. |
|
NodeType(ReadOnlyUser userSecurityContext)
Constructor that takes the user security context. |
Method Summary | |
---|---|
void |
acceptVisitor(ModelVisitor visitor)
Accepts the visitor and redirects the visitor to the appropriate type we're dealing with. |
void |
add()
If the user is allowed to add, invoke the superclass add |
int |
compareTo(Object o)
Compares this object with the specified object for order. |
List |
getAllNodes()
Potentially hazardous function due to memory requirements for lots of nodes, but for small node sets, this is a valueable function for navigating the hierarchy of nodes. |
static NodeType[] |
getAllTypes()
|
INodeHandler |
getCustomHandler()
Retrieve a custom handler, null if there is none. |
String |
getDisplayName()
|
static String |
getDisplayName(String type)
Convenience method. |
String |
getEntityDescription()
|
String |
getEntityName()
|
static NodeType |
getFromId(int id)
|
static NodeType |
getFromTypeString(String s)
|
String |
getId()
|
Part[] |
getParts()
queries db for all parts; not efficient for repeated use. |
String |
getSpecialHandlerName()
|
Vector |
getValues()
Override of getValues to provide specific name to display formatting. |
String |
getVersion()
|
Transition |
getViewTrans()
provide a transition for viewing this object, suitable for creating an HTTP link |
boolean |
hasCustomHandler()
|
void |
incrementVersion()
|
boolean |
isReferenceIdPreferred()
Whether or not this node type prefers to export xml as a reference or not. |
void |
isReferenceIdPreferred(boolean is)
Whether or not this node type prefers to export xml as a reference or not. |
static boolean |
isValidType(String type)
|
void |
setCustomHandler(String customHandler)
|
void |
setDisplayName(String name)
|
void |
setEntityDescription(String s)
|
void |
setEntityName(String defaultType)
set name. |
void |
setId(String id)
|
protected void |
setupFields()
Defines the database table name and fields for this DB object |
void |
update()
Update the database with the new info SIDE-EFFECT: increments version number each time there is an update |
Methods inherited from class com.jcorporate.expresso.core.dbobj.RowSecuredDBObject |
---|
add, addGroupPerm, canRequesterAdministrate, canRequesterRead, canRequesterWrite, checkDeleteDetailPerm, checkKeyLength, defaultGroup, defaultPermissions, delete, deleteAll, find, getAdministrateGroups, getGroups, getPermissions, getReadGroups, getWriteGroups, isAdminGroup, isReadGroup, isRowAllowed, 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, isAllowed, 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 NODE_TYPE_TABLE_NAME
public static final String NODE_TYPE_ID
public static final String NODE_TYPE_NAME
public static final String DISPLAY_TITLE
public static final String NODE_TYPE_DESCRIP
public static final String NODE_TYPE_VERSION
public static final String NODE_TYPE_HANDLER
public static final String USE_ID_FOR_REFERENCE
public static final String ANY_OBJECT
Constructor Detail |
---|
public NodeType() throws DBException
NodeType
creates a new object of this type with no connection
yet allocated.
DBException
- If the new object cannot be
createdpublic NodeType(ExpressoRequest request) throws DBException
request
- ExpressoRequest
DBException
public NodeType(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 NodeType(ReadOnlyUser userSecurityContext) throws DBException
userSecurityContext
- ReadOnlyUser
DBException
- upon construction errorMethod Detail |
---|
protected void setupFields() throws DBException
setupFields
in class DBObject
DBException
- if the operation cannot be performedpublic static String getDisplayName(String type) throws DBException
type
- the internal entity name
DBException
- upon database access error.public static boolean isValidType(String type)
public String getId() throws DBException
DBException
public String getEntityName() throws DBException
DBException
public String getEntityDescription() throws DBException
DBException
public void setId(String id) throws DBException
DBException
public String getDisplayName() throws DBException
DBException
public Part[] getParts() throws DBException
DBException
- upon database access error.for more efficient (cached) usage
public List getAllNodes() throws DBException
DBException
public void setEntityName(String defaultType) throws DBException
defaultType
- the type name
DBException
- upon database access error.public static NodeType[] getAllTypes() throws DBException
DBException
public static NodeType getFromId(int id) throws DBException
DBException
public static NodeType getFromTypeString(String s) throws DBException
DBException
public String getVersion() throws DBException
DBException
public Vector getValues() throws DBException
getValues
in interface LookupInterface
getValues
in class DBObject
DBException
- If the values cannot be retrievedpublic String getSpecialHandlerName() throws DBException
DBException
public void add() throws DBException
add
in interface DataObject
add
in class RowSecuredDBObject
DBException
- If the user is not permitted to add
or if the add failspublic void update() throws DBException
update
in interface DataObject
update
in class RowSecuredDBObject
DBException
- if update is not allowed for the current userpublic void incrementVersion() throws DBException
DBException
public boolean hasCustomHandler() throws DBException
DBException
public INodeHandler getCustomHandler() throws DBException
DBException
- upon database access error.public void setCustomHandler(String customHandler) 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 void setDisplayName(String name) throws DBException
DBException
public void setEntityDescription(String s) throws DBException
DBException
public boolean isReferenceIdPreferred() throws DBException
DBException
- upon database access error.public void isReferenceIdPreferred(boolean is) throws DBException
(large entities like template and ed. standard prefer being exported as refs)
is
- boolean
DBException
- upon database access error.public Transition getViewTrans() throws DBException
getViewTrans
in interface IViewable
DBException
- upon self-query error.public void acceptVisitor(ModelVisitor visitor)
ModelVisitable
acceptVisitor
in interface ModelVisitable
visitor
- ViewVisitor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |