|
Project Wonder 5.0 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
public interface IERXRestEntityDelegate
IERXRestEntityDelegate provides the interface for the applications to hook into the rest process on a per-entity basis. Entity delegates are typically registered on the ERXRestDelegate of ERXRestContext in your Application constructor.
ERXDefaultRestDelegate restDelegate = new ERXDefaultRestDelegate(); restDelegate.addDelegateForEntityNamed(new OrganizationRestEntityDelegate(), Organization.ENTITY_NAME);
| Method Summary | |
|---|---|
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 the alias for the given entity name. |
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. |
java.lang.Object |
idForEO(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.EOEnterpriseObject eo)
Returns the primary key of the given EO. |
void |
initializeEntityNamed(java.lang.String entityName)
Called by the rest delegate for each entity that gets requested. |
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.eoaccess.EOEntity |
nextEntity(com.webobjects.eoaccess.EOEntity entity,
java.lang.String key)
Returns the destination entity for the given key on the specified entity. |
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.foundation.NSArray |
objectsForEntity(com.webobjects.eoaccess.EOEntity entity,
ERXRestContext context)
Returns an array of all of the EOs visible to the user for the given entity. |
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. |
void |
preprocess(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.foundation.NSArray objects,
ERXRestContext context)
Called before enumerating the given array of objects for display. |
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)
Just like for entity names, it may be necessary to rename certain properties of your entities for consumers of your restful service. |
java.lang.String |
propertyNameForPropertyAlias(com.webobjects.eoaccess.EOEntity entity,
java.lang.String propertyAlias)
The inverse of propertyAliasForPropertyNamed. |
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)
Sets the value for the specified property name on the given 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. |
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 specified property name on the given object. |
com.webobjects.foundation.NSArray |
visibleObjects(com.webobjects.eoaccess.EOEntity parentEntity,
java.lang.Object parentObject,
java.lang.String parentKey,
com.webobjects.eoaccess.EOEntity entity,
com.webobjects.foundation.NSArray objects,
ERXRestContext context)
Given an array, this method filters the array based on the callers permission level. |
| Methods inherited from interface er.rest.entityDelegates.IERXRestSecurityDelegate |
|---|
canDeleteObject, canInsertObject, canInsertObject, canInsertProperty, canUpdateObject, canUpdateProperty, canViewObject, canViewProperty |
| Method Detail |
|---|
void initializeEntityNamed(java.lang.String entityName)
entityName - the name of the entity to initializejava.lang.String entityAliasForEntityNamed(java.lang.String entityName)
entityName - the name of the entity to lookup
java.lang.String propertyAliasForPropertyNamed(com.webobjects.eoaccess.EOEntity entity,
java.lang.String propertyName)
entity - the entity that contains the propertypropertyName - the property name
java.lang.String propertyNameForPropertyAlias(com.webobjects.eoaccess.EOEntity entity,
java.lang.String propertyAlias)
entity - the entity that contains the propertypropertyAlias - the alias to lookup
com.webobjects.eocontrol.EOEnterpriseObject objectWithKey(com.webobjects.eoaccess.EOEntity entity,
java.lang.String key,
ERXRestContext context)
throws ERXRestException,
ERXRestNotFoundException,
ERXRestSecurityException
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 object
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
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
ERXRestNotFoundException - if there is no object in the array with the given key
ERXRestSecurityException - if the caller is not permitted to view the requested object
com.webobjects.eocontrol.EOEnterpriseObject objectForNode(com.webobjects.eoaccess.EOEntity entity,
ERXRestRequestNode node,
ERXRestContext context)
throws ERXRestException,
ERXRestNotFoundException,
ERXRestSecurityException
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 object
java.lang.Object valueForKey(com.webobjects.eoaccess.EOEntity entity,
java.lang.Object obj,
java.lang.String propertyName,
ERXRestContext context)
entity - the entity of the given objectobj - the object itselfpropertyName - the property name to lookupcontext - the rest context
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
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.
void delete(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.EOEnterpriseObject eo,
ERXRestContext context)
throws ERXRestException,
ERXRestSecurityException
entity - the entity of the objecteo - the object to deletecontext - the rest context
ERXRestException - if a general failure occurs.
ERXRestSecurityException - if a security failure occurs
com.webobjects.eocontrol.EOEnterpriseObject processObjectFromDocument(com.webobjects.eoaccess.EOEntity entity,
ERXRestRequestNode eoNode,
ERXRestContext context)
throws ERXRestSecurityException,
ERXRestException,
ERXRestNotFoundException
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 found
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
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 found
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
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
ERXRestSecurityException - if a security failure occurs
ERXRestException - if a general failure occurs
ERXRestNotFoundException - if a related object cannot be found
void updateObjectFromDocument(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.EOEnterpriseObject eo,
ERXRestRequestNode eoNode,
ERXRestContext context)
throws ERXRestSecurityException,
ERXRestException,
ERXRestNotFoundException
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 found
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
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 occurs
com.webobjects.foundation.NSArray objectsForEntity(com.webobjects.eoaccess.EOEntity entity,
ERXRestContext context)
throws ERXRestException,
ERXRestSecurityException
entity - the entity to fetchcontext - the rest context
ERXRestException - if there is a general failure
ERXRestSecurityException - if the user requests objects that he/she is not permitted to see
void preprocess(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.foundation.NSArray objects,
ERXRestContext context)
throws ERXRestException
entity - the entity of the objectsobjects - the objects to be displayed
ERXRestException - if there is a general failure
com.webobjects.foundation.NSArray visibleObjects(com.webobjects.eoaccess.EOEntity parentEntity,
java.lang.Object parentObject,
java.lang.String parentKey,
com.webobjects.eoaccess.EOEntity entity,
com.webobjects.foundation.NSArray objects,
ERXRestContext context)
throws ERXRestException,
ERXRestSecurityException,
ERXRestNotFoundException
parentEntity - the entity of the parentparentObject - the parent objectparentKey - the key in the parent that references this arrayentity - the entity of the objects in the arrayobjects - the actual array of objects to filtercontext - the rest context
ERXRestException - if a general failure occurs
ERXRestSecurityException - if a security violation occurs (note that filtering results should not constitute a security
violation)
ERXRestNotFoundException - if an object cannot be found
com.webobjects.eoaccess.EOEntity nextEntity(com.webobjects.eoaccess.EOEntity entity,
java.lang.String key)
entity - the entity to checkkey - the key to return the entity for
boolean isEOID(ERXRestKey restKey)
restKey - the possible EO key
java.lang.String stringIDForEO(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.EOEnterpriseObject eo)
eo - the EO to get a primary key for
java.lang.Object idForEO(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.EOEnterpriseObject eo)
eo - the EO to get a primary key for
java.lang.String[] displayProperties(ERXRestKey key,
boolean allProperties,
boolean allToMany,
ERXRestContext context)
throws ERXRestException,
ERXRestNotFoundException,
ERXRestSecurityException
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException
boolean displayDetails(ERXRestKey key,
ERXRestContext context)
throws ERXRestException,
ERXRestNotFoundException,
ERXRestSecurityException
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException
|
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 | |||||||||||