|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecter.rest.entityDelegates.ERXAbstractRestEntityDelegate
public abstract class ERXAbstractRestEntityDelegate
Provides default implementations of many of the common entity delegate behaviors.
Constructor Summary | |
---|---|
ERXAbstractRestEntityDelegate()
|
Method Summary | |
---|---|
static java.lang.String |
_cascadingValue(ERXRestKey cascadingKey,
java.lang.String propertyPrefix,
java.lang.String propertySuffix)
|
static boolean |
_displayDetailsFromProperties(ERXRestKey result)
|
static java.lang.String[] |
_displayPropertiesFromProperties(ERXRestKey result,
boolean displayAllProperties,
boolean displayAllToMany)
|
protected boolean |
_isEOID(com.webobjects.eoaccess.EOEntity entity,
java.lang.String key)
|
protected com.webobjects.eocontrol.EOEnterpriseObject |
_objectWithKey(com.webobjects.eoaccess.EOEntity entity,
java.lang.String key,
ERXRestContext context)
|
protected void |
_updateArrayFromDocument(com.webobjects.eoaccess.EOEntity parentEntity,
com.webobjects.eocontrol.EOEnterpriseObject parentObject,
java.lang.String attributeName,
com.webobjects.eoaccess.EOEntity entity,
com.webobjects.foundation.NSArray currentObjects,
com.webobjects.foundation.NSArray toManyNodes,
ERXRestContext context)
|
void |
_updatePropertiesFromDocument(boolean inserting,
com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.EOEnterpriseObject eo,
ERXRestRequestNode eoNode,
ERXRestContext context)
|
void |
_updateRelationshipFromDocument(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.EOEnterpriseObject eo,
com.webobjects.eoaccess.EORelationship relationship,
ERXRestRequestNode relationshipNode,
ERXRestContext context)
|
protected com.webobjects.foundation.NSArray<java.lang.String> |
allPossiblePropertyNamesOnEarth(com.webobjects.eoaccess.EOEntity entity)
|
static java.lang.String |
cascadingValue(ERXRestKey result,
java.lang.String propertyPrefix,
java.lang.String propertySuffix,
java.lang.String defaultValue)
|
void |
delete(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.EOEnterpriseObject eo,
ERXRestContext context)
Deletes the given object. |
boolean |
displayDetails(ERXRestKey key,
ERXRestContext context)
|
java.lang.String[] |
displayProperties(ERXRestKey key,
boolean allProperties,
boolean allToMany,
ERXRestContext context)
|
java.lang.String |
entityAliasForEntityNamed(java.lang.String entityName)
Returns entityName; |
java.lang.String |
formatAttributeValue(com.webobjects.eoaccess.EOEntity entity,
java.lang.Object object,
java.lang.String attributeName,
java.lang.Object attributeValue)
Coerce the given value into a String for use in the restful response. |
protected java.lang.String |
idAttributeName(com.webobjects.eoaccess.EOEntity entity)
|
java.lang.Object |
idForEO(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.EOEnterpriseObject eo)
Returns the primary key of the given EO. |
protected java.lang.String |
idForNode(ERXRestRequestNode attributeNode)
|
void |
initializeEntityNamed(java.lang.String entityName)
Do nothing by default |
abstract void |
inserted(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.EOEnterpriseObject eo,
ERXRestContext context)
Called after performing the user's requested insert. |
com.webobjects.eocontrol.EOEnterpriseObject |
insertObjectFromDocument(com.webobjects.eoaccess.EOEntity entity,
ERXRestRequestNode insertNode,
com.webobjects.eoaccess.EOEntity parentEntity,
com.webobjects.eocontrol.EOEnterpriseObject parentObject,
java.lang.String parentKey,
ERXRestContext context)
Insert a new object of the given type into a parent object's keypath from an XML document. |
boolean |
isEOID(ERXRestKey restKey)
Returns whether or not the given key value is the primary key of an EO. |
com.webobjects.eocontrol.EOEnterpriseObject |
objectForNode(com.webobjects.eoaccess.EOEntity entity,
ERXRestRequestNode node,
ERXRestContext context)
Returns the object that is associated with the given node. |
com.webobjects.eocontrol.EOEnterpriseObject |
objectWithKey(com.webobjects.eoaccess.EOEntity entity,
java.lang.String key,
ERXRestContext context)
Returns the object that has the given key. |
com.webobjects.eocontrol.EOEnterpriseObject |
objectWithKey(com.webobjects.eoaccess.EOEntity entity,
java.lang.String key,
com.webobjects.foundation.NSArray objs,
ERXRestContext context)
Returns the object that has the given key from the provided array. |
java.lang.Object |
parseAttributeValue(com.webobjects.eoaccess.EOEntity entity,
java.lang.Object object,
java.lang.String attributeName,
java.lang.String attributeValue)
|
void |
preprocess(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.foundation.NSArray objects,
ERXRestContext context)
Does nothing. |
com.webobjects.eocontrol.EOEnterpriseObject |
processObjectFromDocument(com.webobjects.eoaccess.EOEntity entity,
ERXRestRequestNode eoNode,
ERXRestContext context)
Inserts or updates an object of the given type. |
java.lang.String |
propertyAliasForPropertyNamed(com.webobjects.eoaccess.EOEntity entity,
java.lang.String propertyName)
Returns propertyName. |
java.lang.String |
propertyNameForPropertyAlias(com.webobjects.eoaccess.EOEntity entity,
java.lang.String propertyAlias)
Returns propertyAlias. |
java.lang.String |
stringIDForEO(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.EOEnterpriseObject eo)
Returns the string form of the primary key of the given EO. |
void |
takeValueForKey(com.webobjects.eoaccess.EOEntity entity,
java.lang.Object obj,
java.lang.String propertyName,
java.lang.String value,
ERXRestContext context)
Parses the attribute with parseAttributeValue and sets it on the object. |
void |
updateArrayFromDocument(com.webobjects.eoaccess.EOEntity parentEntity,
com.webobjects.eocontrol.EOEnterpriseObject parentObject,
java.lang.String attributeName,
com.webobjects.eoaccess.EOEntity entity,
com.webobjects.foundation.NSArray currentObjects,
com.webobjects.foundation.NSArray toManyNodes,
ERXRestContext context)
Updates an array of objects for a to-many relationship from an XML document. |
abstract void |
updated(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.EOEnterpriseObject eo,
ERXRestContext context)
Called after performing the user's requested updates. |
void |
updateObjectFromDocument(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.EOEnterpriseObject eo,
ERXRestRequestNode eoNode,
ERXRestContext context)
Updates an existing object from an XML document. |
java.lang.Object |
valueForKey(com.webobjects.eoaccess.EOEntity entity,
java.lang.Object obj,
java.lang.String propertyName,
ERXRestContext context)
Returns the value for the given property name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface er.rest.entityDelegates.IERXRestEntityDelegate |
---|
nextEntity, objectsForEntity, visibleObjects |
Methods inherited from interface er.rest.entityDelegates.IERXRestSecurityDelegate |
---|
canDeleteObject, canInsertObject, canInsertObject, canInsertProperty, canUpdateObject, canUpdateProperty, canViewObject, canViewProperty |
Constructor Detail |
---|
public ERXAbstractRestEntityDelegate()
Method Detail |
---|
public void initializeEntityNamed(java.lang.String entityName)
initializeEntityNamed
in interface IERXRestEntityDelegate
entityName
- the name of the entity to initializepublic java.lang.String entityAliasForEntityNamed(java.lang.String entityName)
entityAliasForEntityNamed
in interface IERXRestEntityDelegate
entityName
- the name of the entity to lookup
public java.lang.String propertyNameForPropertyAlias(com.webobjects.eoaccess.EOEntity entity, java.lang.String propertyAlias)
propertyNameForPropertyAlias
in interface IERXRestEntityDelegate
entity
- the entity that contains the propertypropertyAlias
- the alias to lookup
public java.lang.String propertyAliasForPropertyNamed(com.webobjects.eoaccess.EOEntity entity, java.lang.String propertyName)
propertyAliasForPropertyNamed
in interface IERXRestEntityDelegate
entity
- the entity that contains the propertypropertyName
- the property name
public java.lang.Object valueForKey(com.webobjects.eoaccess.EOEntity entity, java.lang.Object obj, java.lang.String propertyName, ERXRestContext context)
valueForKey
in interface IERXRestEntityDelegate
entity
- the entity of the given objectobj
- the object itselfpropertyName
- the property name to lookupcontext
- the rest context
public void takeValueForKey(com.webobjects.eoaccess.EOEntity entity, java.lang.Object obj, java.lang.String propertyName, java.lang.String value, ERXRestContext context) throws java.text.ParseException, ERXRestException
takeValueForKey
in interface IERXRestEntityDelegate
entity
- the entity of the objectobj
- the object to set a property onpropertyName
- the property name to setvalue
- the new value of the propertycontext
- the rest context
ParseException
- if the property value cannot be parsed
ERXRestException
- if a general failure occurs.public void preprocess(com.webobjects.eoaccess.EOEntity entity, com.webobjects.foundation.NSArray objects, ERXRestContext context) throws ERXRestException
preprocess
in interface IERXRestEntityDelegate
entity
- the entity of the objectsobjects
- the objects to be displayed
ERXRestException
- if there is a general failureprotected com.webobjects.foundation.NSArray<java.lang.String> allPossiblePropertyNamesOnEarth(com.webobjects.eoaccess.EOEntity entity)
public boolean isEOID(ERXRestKey restKey)
isEOID
in interface IERXRestEntityDelegate
restKey
- the possible EO key
protected java.lang.String idAttributeName(com.webobjects.eoaccess.EOEntity entity)
protected boolean _isEOID(com.webobjects.eoaccess.EOEntity entity, java.lang.String key)
public java.lang.String stringIDForEO(com.webobjects.eoaccess.EOEntity entity, com.webobjects.eocontrol.EOEnterpriseObject eo)
stringIDForEO
in interface IERXRestEntityDelegate
eo
- the EO to get a primary key for
public java.lang.Object idForEO(com.webobjects.eoaccess.EOEntity entity, com.webobjects.eocontrol.EOEnterpriseObject eo)
idForEO
in interface IERXRestEntityDelegate
eo
- the EO to get a primary key for
protected java.lang.String idForNode(ERXRestRequestNode attributeNode)
public com.webobjects.eocontrol.EOEnterpriseObject objectForNode(com.webobjects.eoaccess.EOEntity entity, ERXRestRequestNode node, ERXRestContext context) throws ERXRestException, ERXRestNotFoundException, ERXRestSecurityException
IERXRestEntityDelegate
objectForNode
in interface IERXRestEntityDelegate
entity
- the entitynode
- the node that represents the objectcontext
- the rest context
ERXRestException
- if a general failure occurs
ERXRestNotFoundException
- if there is no object with the given key
ERXRestSecurityException
- if the caller is not permitted to view the requested objectpublic com.webobjects.eocontrol.EOEnterpriseObject objectWithKey(com.webobjects.eoaccess.EOEntity entity, java.lang.String key, ERXRestContext context) throws ERXRestException, ERXRestNotFoundException, ERXRestSecurityException
IERXRestEntityDelegate
objectWithKey
in interface IERXRestEntityDelegate
entity
- the entitykey
- the unique key for an objectcontext
- the rest context
ERXRestException
- if a general failure occurs
ERXRestNotFoundException
- if there is no object with the given key
ERXRestSecurityException
- if the caller is not permitted to view the requested objectprotected com.webobjects.eocontrol.EOEnterpriseObject _objectWithKey(com.webobjects.eoaccess.EOEntity entity, java.lang.String key, ERXRestContext context) throws ERXRestException, ERXRestNotFoundException, ERXRestSecurityException
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException
public com.webobjects.eocontrol.EOEnterpriseObject objectWithKey(com.webobjects.eoaccess.EOEntity entity, java.lang.String key, com.webobjects.foundation.NSArray objs, ERXRestContext context) throws ERXRestException, ERXRestSecurityException, ERXRestNotFoundException
IERXRestEntityDelegate
objectWithKey
in interface IERXRestEntityDelegate
entity
- the entitykey
- the unique key for an objectobjs
- the objects to restrict the match tocontext
- the rest context
ERXRestException
- if a general failure occurs
ERXRestSecurityException
- if the caller is not permitted to view the requested object
ERXRestNotFoundException
- if there is no object in the array with the given keypublic void delete(com.webobjects.eoaccess.EOEntity entity, com.webobjects.eocontrol.EOEnterpriseObject eo, ERXRestContext context) throws ERXRestException, ERXRestSecurityException
IERXRestEntityDelegate
delete
in interface IERXRestEntityDelegate
entity
- the entity of the objecteo
- the object to deletecontext
- the rest context
ERXRestException
- if a general failure occurs.
ERXRestSecurityException
- if a security failure occurspublic java.lang.String formatAttributeValue(com.webobjects.eoaccess.EOEntity entity, java.lang.Object object, java.lang.String attributeName, java.lang.Object attributeValue) throws java.text.ParseException, ERXRestException
IERXRestEntityDelegate
formatAttributeValue
in interface IERXRestEntityDelegate
entity
- the entity of the objectobject
- the objectattributeName
- the name of the keyattributeValue
- the value of the key to format
ParseException
- if a parse error occurs
ERXRestException
- if a general error occurspublic java.lang.Object parseAttributeValue(com.webobjects.eoaccess.EOEntity entity, java.lang.Object object, java.lang.String attributeName, java.lang.String attributeValue) throws java.text.ParseException, ERXRestException
java.text.ParseException
ERXRestException
public com.webobjects.eocontrol.EOEnterpriseObject insertObjectFromDocument(com.webobjects.eoaccess.EOEntity entity, ERXRestRequestNode insertNode, com.webobjects.eoaccess.EOEntity parentEntity, com.webobjects.eocontrol.EOEnterpriseObject parentObject, java.lang.String parentKey, ERXRestContext context) throws ERXRestSecurityException, ERXRestException, ERXRestNotFoundException
IERXRestEntityDelegate
insertObjectFromDocument
in interface IERXRestEntityDelegate
entity
- the entity of the object to insertinsertNode
- the node that describes the insertparentEntity
- the entity of the parent object to insert intoparentObject
- the parent object of the insertparentKey
- the key on the parent that represents the relationship to this new objectcontext
- the rest context
ERXRestSecurityException
- if a security failure occurs
ERXRestException
- if a general failure occurs
ERXRestNotFoundException
- if a related object cannot be foundpublic com.webobjects.eocontrol.EOEnterpriseObject processObjectFromDocument(com.webobjects.eoaccess.EOEntity entity, ERXRestRequestNode eoNode, ERXRestContext context) throws ERXRestSecurityException, ERXRestException, ERXRestNotFoundException
IERXRestEntityDelegate
processObjectFromDocument
in interface IERXRestEntityDelegate
entity
- the entity of the object to insert or updateeoNode
- the node that describes the insert or updatecontext
- the rest context
ERXRestSecurityException
- if a security failure occurs
ERXRestException
- if a general failure occurs
ERXRestNotFoundException
- if a related object cannot be foundpublic void updateObjectFromDocument(com.webobjects.eoaccess.EOEntity entity, com.webobjects.eocontrol.EOEnterpriseObject eo, ERXRestRequestNode eoNode, ERXRestContext context) throws ERXRestSecurityException, ERXRestException, ERXRestNotFoundException
IERXRestEntityDelegate
updateObjectFromDocument
in interface IERXRestEntityDelegate
entity
- the entity of the object to updateeo
- the object to updateeoNode
- the node that describes the updatecontext
- the rest context
ERXRestSecurityException
- if a security failure occurs
ERXRestException
- if a general failure occurs
ERXRestNotFoundException
- if a related object cannot be foundpublic void _updateRelationshipFromDocument(com.webobjects.eoaccess.EOEntity entity, com.webobjects.eocontrol.EOEnterpriseObject eo, com.webobjects.eoaccess.EORelationship relationship, ERXRestRequestNode relationshipNode, ERXRestContext context) throws ERXRestException, ERXRestNotFoundException, ERXRestSecurityException
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException
public void _updatePropertiesFromDocument(boolean inserting, com.webobjects.eoaccess.EOEntity entity, com.webobjects.eocontrol.EOEnterpriseObject eo, ERXRestRequestNode eoNode, ERXRestContext context) throws ERXRestSecurityException, ERXRestException, ERXRestNotFoundException
ERXRestSecurityException
ERXRestException
ERXRestNotFoundException
public void updateArrayFromDocument(com.webobjects.eoaccess.EOEntity parentEntity, com.webobjects.eocontrol.EOEnterpriseObject parentObject, java.lang.String attributeName, com.webobjects.eoaccess.EOEntity entity, com.webobjects.foundation.NSArray currentObjects, com.webobjects.foundation.NSArray toManyNodes, ERXRestContext context) throws ERXRestException, ERXRestNotFoundException, ERXRestSecurityException
IERXRestEntityDelegate
updateArrayFromDocument
in interface IERXRestEntityDelegate
parentEntity
- the entity of the parent objectparentObject
- the parent objectattributeName
- the name of the to-many key on the parententity
- the entity of the objects in the arraycurrentObjects
- the existing objects in the to-many relationshiptoManyNodes
- the array containing the nodes that describe the updatecontext
- the rest context
ERXRestException
- if a general failure occurs
ERXRestNotFoundException
- if a related object cannot be found
ERXRestSecurityException
- if a security failure occursprotected void _updateArrayFromDocument(com.webobjects.eoaccess.EOEntity parentEntity, com.webobjects.eocontrol.EOEnterpriseObject parentObject, java.lang.String attributeName, com.webobjects.eoaccess.EOEntity entity, com.webobjects.foundation.NSArray currentObjects, com.webobjects.foundation.NSArray toManyNodes, ERXRestContext context) throws ERXRestException, ERXRestNotFoundException, ERXRestSecurityException
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException
public static java.lang.String cascadingValue(ERXRestKey result, java.lang.String propertyPrefix, java.lang.String propertySuffix, java.lang.String defaultValue) throws ERXRestException, ERXRestNotFoundException, ERXRestSecurityException
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException
public static java.lang.String _cascadingValue(ERXRestKey cascadingKey, java.lang.String propertyPrefix, java.lang.String propertySuffix) throws ERXRestException, ERXRestNotFoundException, ERXRestSecurityException
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException
public static boolean _displayDetailsFromProperties(ERXRestKey result) throws ERXRestException, ERXRestNotFoundException, ERXRestSecurityException
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException
public static java.lang.String[] _displayPropertiesFromProperties(ERXRestKey result, boolean displayAllProperties, boolean displayAllToMany) throws ERXRestException, ERXRestNotFoundException, ERXRestSecurityException
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException
public java.lang.String[] displayProperties(ERXRestKey key, boolean allProperties, boolean allToMany, ERXRestContext context) throws ERXRestException, ERXRestNotFoundException, ERXRestSecurityException
displayProperties
in interface IERXRestEntityDelegate
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException
public boolean displayDetails(ERXRestKey key, ERXRestContext context) throws ERXRestException, ERXRestNotFoundException, ERXRestSecurityException
displayDetails
in interface IERXRestEntityDelegate
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException
public abstract void updated(com.webobjects.eoaccess.EOEntity entity, com.webobjects.eocontrol.EOEnterpriseObject eo, ERXRestContext context) throws ERXRestException, ERXRestSecurityException
entity
- the entity of the object being updatedeo
- the updated objectcontext
- the rest context
ERXRestException
- if a general error occurs
ERXRestSecurityException
- if a security error occurspublic abstract void inserted(com.webobjects.eoaccess.EOEntity entity, com.webobjects.eocontrol.EOEnterpriseObject eo, ERXRestContext context) throws ERXRestException, ERXRestSecurityException
entity
- the entity of the object being insertedeo
- the inserted objectcontext
- the rest context
ERXRestException
- if a general error occurs
ERXRestSecurityException
- if a security error occurs
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |