Project Wonder 5.0

er.rest.entityDelegates
Class ERXAbstractRestEntityDelegate

java.lang.Object
  extended by er.rest.entityDelegates.ERXAbstractRestEntityDelegate
All Implemented Interfaces:
IERXRestEntityDelegate, IERXRestSecurityDelegate
Direct Known Subclasses:
ERD2RestDefaultEntityDelegate, ERXStandardRestEntityDelegate

public abstract class ERXAbstractRestEntityDelegate
extends java.lang.Object
implements IERXRestEntityDelegate

Provides default implementations of many of the common entity delegate behaviors.

Author:
mschrag

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

ERXAbstractRestEntityDelegate

public ERXAbstractRestEntityDelegate()
Method Detail

initializeEntityNamed

public void initializeEntityNamed(java.lang.String entityName)
Do nothing by default

Specified by:
initializeEntityNamed in interface IERXRestEntityDelegate
Parameters:
entityName - the name of the entity to initialize

entityAliasForEntityNamed

public java.lang.String entityAliasForEntityNamed(java.lang.String entityName)
Returns entityName;

Specified by:
entityAliasForEntityNamed in interface IERXRestEntityDelegate
Parameters:
entityName - the name of the entity to lookup
Returns:
entityName

propertyNameForPropertyAlias

public java.lang.String propertyNameForPropertyAlias(com.webobjects.eoaccess.EOEntity entity,
                                                     java.lang.String propertyAlias)
Returns propertyAlias.

Specified by:
propertyNameForPropertyAlias in interface IERXRestEntityDelegate
Parameters:
entity - the entity that contains the property
propertyAlias - the alias to lookup
Returns:
propertyAlias

propertyAliasForPropertyNamed

public java.lang.String propertyAliasForPropertyNamed(com.webobjects.eoaccess.EOEntity entity,
                                                      java.lang.String propertyName)
Returns propertyName.

Specified by:
propertyAliasForPropertyNamed in interface IERXRestEntityDelegate
Parameters:
entity - the entity that contains the property
propertyName - the property name
Returns:
propertyName

valueForKey

public 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.

Specified by:
valueForKey in interface IERXRestEntityDelegate
Parameters:
entity - the entity of the given object
obj - the object itself
propertyName - the property name to lookup
context - the rest context
Returns:
the value for the given property

takeValueForKey

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
Parses the attribute with parseAttributeValue and sets it on the object.

Specified by:
takeValueForKey in interface IERXRestEntityDelegate
Parameters:
entity - the entity of the object
obj - the object to set a property on
propertyName - the property name to set
value - the new value of the property
context - the rest context
Throws:
ParseException - if the property value cannot be parsed
ERXRestException - if a general failure occurs.

preprocess

public void preprocess(com.webobjects.eoaccess.EOEntity entity,
                       com.webobjects.foundation.NSArray objects,
                       ERXRestContext context)
                throws ERXRestException
Does nothing.

Specified by:
preprocess in interface IERXRestEntityDelegate
Parameters:
entity - the entity of the objects
objects - the objects to be displayed
Throws:
ERXRestException - if there is a general failure

allPossiblePropertyNamesOnEarth

protected com.webobjects.foundation.NSArray<java.lang.String> allPossiblePropertyNamesOnEarth(com.webobjects.eoaccess.EOEntity entity)

isEOID

public boolean isEOID(ERXRestKey restKey)
Returns whether or not the given key value is the primary key of an EO. This is crazy -- It tries to guess if it's looking at a key or not.

Specified by:
isEOID in interface IERXRestEntityDelegate
Parameters:
restKey - the possible EO key
Returns:
true if key is a primary key

idAttributeName

protected java.lang.String idAttributeName(com.webobjects.eoaccess.EOEntity entity)

_isEOID

protected boolean _isEOID(com.webobjects.eoaccess.EOEntity entity,
                          java.lang.String key)

stringIDForEO

public 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.

Specified by:
stringIDForEO in interface IERXRestEntityDelegate
Parameters:
eo - the EO to get a primary key for
Returns:
the primary key

idForEO

public java.lang.Object idForEO(com.webobjects.eoaccess.EOEntity entity,
                                com.webobjects.eocontrol.EOEnterpriseObject eo)
Returns the primary key of the given EO.

Specified by:
idForEO in interface IERXRestEntityDelegate
Parameters:
eo - the EO to get a primary key for
Returns:
the primary key

idForNode

protected java.lang.String idForNode(ERXRestRequestNode attributeNode)

objectForNode

public com.webobjects.eocontrol.EOEnterpriseObject objectForNode(com.webobjects.eoaccess.EOEntity entity,
                                                                 ERXRestRequestNode node,
                                                                 ERXRestContext context)
                                                          throws ERXRestException,
                                                                 ERXRestNotFoundException,
                                                                 ERXRestSecurityException
Description copied from interface: IERXRestEntityDelegate
Returns the object that is associated with the given node.

Specified by:
objectForNode in interface IERXRestEntityDelegate
Parameters:
entity - the entity
node - the node that represents the object
context - the rest context
Returns:
the matching object
Throws:
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

objectWithKey

public com.webobjects.eocontrol.EOEnterpriseObject objectWithKey(com.webobjects.eoaccess.EOEntity entity,
                                                                 java.lang.String key,
                                                                 ERXRestContext context)
                                                          throws ERXRestException,
                                                                 ERXRestNotFoundException,
                                                                 ERXRestSecurityException
Description copied from interface: IERXRestEntityDelegate
Returns the object that has the given key. In all of the provided implementations, key is interpreted to be an integer primary key in string form.

Specified by:
objectWithKey in interface IERXRestEntityDelegate
Parameters:
entity - the entity
key - the unique key for an object
context - the rest context
Returns:
the matching object
Throws:
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

_objectWithKey

protected com.webobjects.eocontrol.EOEnterpriseObject _objectWithKey(com.webobjects.eoaccess.EOEntity entity,
                                                                     java.lang.String key,
                                                                     ERXRestContext context)
                                                              throws ERXRestException,
                                                                     ERXRestNotFoundException,
                                                                     ERXRestSecurityException
Throws:
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException

objectWithKey

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
Description copied from interface: IERXRestEntityDelegate
Returns the object that has the given key from the provided array. This is just like objectWithKey except limited to an array instead of the entire set of objects for the entity. In all of the provided implementations, key is interpreted to be an integer primary key in string form.

Specified by:
objectWithKey in interface IERXRestEntityDelegate
Parameters:
entity - the entity
key - the unique key for an object
objs - the objects to restrict the match to
context - the rest context
Returns:
the matching object
Throws:
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 key

delete

public void delete(com.webobjects.eoaccess.EOEntity entity,
                   com.webobjects.eocontrol.EOEnterpriseObject eo,
                   ERXRestContext context)
            throws ERXRestException,
                   ERXRestSecurityException
Description copied from interface: IERXRestEntityDelegate
Deletes the given object.

Specified by:
delete in interface IERXRestEntityDelegate
Parameters:
entity - the entity of the object
eo - the object to delete
context - the rest context
Throws:
ERXRestException - if a general failure occurs.
ERXRestSecurityException - if a security failure occurs

formatAttributeValue

public 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
Description copied from interface: IERXRestEntityDelegate
Coerce the given value into a String for use in the restful response. This may move to the RestResponseWriter at some point, but it's kind of a strange design issue.

Specified by:
formatAttributeValue in interface IERXRestEntityDelegate
Parameters:
entity - the entity of the object
object - the object
attributeName - the name of the key
attributeValue - the value of the key to format
Returns:
the formatted string for the attributeValue
Throws:
ParseException - if a parse error occurs
ERXRestException - if a general error occurs

parseAttributeValue

public 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
Throws:
java.text.ParseException
ERXRestException

insertObjectFromDocument

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
Description copied from interface: IERXRestEntityDelegate
Insert a new object of the given type into a parent object's keypath from an XML document.

Specified by:
insertObjectFromDocument in interface IERXRestEntityDelegate
Parameters:
entity - the entity of the object to insert
insertNode - the node that describes the insert
parentEntity - the entity of the parent object to insert into
parentObject - the parent object of the insert
parentKey - the key on the parent that represents the relationship to this new object
context - the rest context
Returns:
the newly created object
Throws:
ERXRestSecurityException - if a security failure occurs
ERXRestException - if a general failure occurs
ERXRestNotFoundException - if a related object cannot be found

processObjectFromDocument

public com.webobjects.eocontrol.EOEnterpriseObject processObjectFromDocument(com.webobjects.eoaccess.EOEntity entity,
                                                                             ERXRestRequestNode eoNode,
                                                                             ERXRestContext context)
                                                                      throws ERXRestSecurityException,
                                                                             ERXRestException,
                                                                             ERXRestNotFoundException
Description copied from interface: IERXRestEntityDelegate
Inserts or updates an object of the given type.

Specified by:
processObjectFromDocument in interface IERXRestEntityDelegate
Parameters:
entity - the entity of the object to insert or update
eoNode - the node that describes the insert or update
context - the rest context
Returns:
the inserted or updated object
Throws:
ERXRestSecurityException - if a security failure occurs
ERXRestException - if a general failure occurs
ERXRestNotFoundException - if a related object cannot be found

updateObjectFromDocument

public void updateObjectFromDocument(com.webobjects.eoaccess.EOEntity entity,
                                     com.webobjects.eocontrol.EOEnterpriseObject eo,
                                     ERXRestRequestNode eoNode,
                                     ERXRestContext context)
                              throws ERXRestSecurityException,
                                     ERXRestException,
                                     ERXRestNotFoundException
Description copied from interface: IERXRestEntityDelegate
Updates an existing object from an XML document.

Specified by:
updateObjectFromDocument in interface IERXRestEntityDelegate
Parameters:
entity - the entity of the object to update
eo - the object to update
eoNode - the node that describes the update
context - the rest context
Throws:
ERXRestSecurityException - if a security failure occurs
ERXRestException - if a general failure occurs
ERXRestNotFoundException - if a related object cannot be found

_updateRelationshipFromDocument

public 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
Throws:
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException

_updatePropertiesFromDocument

public void _updatePropertiesFromDocument(boolean inserting,
                                          com.webobjects.eoaccess.EOEntity entity,
                                          com.webobjects.eocontrol.EOEnterpriseObject eo,
                                          ERXRestRequestNode eoNode,
                                          ERXRestContext context)
                                   throws ERXRestSecurityException,
                                          ERXRestException,
                                          ERXRestNotFoundException
Throws:
ERXRestSecurityException
ERXRestException
ERXRestNotFoundException

updateArrayFromDocument

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
Description copied from interface: IERXRestEntityDelegate
Updates an array of objects for a to-many relationship from an XML document. This method is responsible for deleting and inserting objects into the specified relationship.

Specified by:
updateArrayFromDocument in interface IERXRestEntityDelegate
Parameters:
parentEntity - the entity of the parent object
parentObject - the parent object
attributeName - the name of the to-many key on the parent
entity - the entity of the objects in the array
currentObjects - the existing objects in the to-many relationship
toManyNodes - the array containing the nodes that describe the update
context - the rest context
Throws:
ERXRestException - if a general failure occurs
ERXRestNotFoundException - if a related object cannot be found
ERXRestSecurityException - if a security failure occurs

_updateArrayFromDocument

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)
                                 throws ERXRestException,
                                        ERXRestNotFoundException,
                                        ERXRestSecurityException
Throws:
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException

cascadingValue

public static java.lang.String cascadingValue(ERXRestKey result,
                                              java.lang.String propertyPrefix,
                                              java.lang.String propertySuffix,
                                              java.lang.String defaultValue)
                                       throws ERXRestException,
                                              ERXRestNotFoundException,
                                              ERXRestSecurityException
Throws:
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException

_cascadingValue

public static java.lang.String _cascadingValue(ERXRestKey cascadingKey,
                                               java.lang.String propertyPrefix,
                                               java.lang.String propertySuffix)
                                        throws ERXRestException,
                                               ERXRestNotFoundException,
                                               ERXRestSecurityException
Throws:
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException

_displayDetailsFromProperties

public static boolean _displayDetailsFromProperties(ERXRestKey result)
                                             throws ERXRestException,
                                                    ERXRestNotFoundException,
                                                    ERXRestSecurityException
Throws:
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException

_displayPropertiesFromProperties

public static java.lang.String[] _displayPropertiesFromProperties(ERXRestKey result,
                                                                  boolean displayAllProperties,
                                                                  boolean displayAllToMany)
                                                           throws ERXRestException,
                                                                  ERXRestNotFoundException,
                                                                  ERXRestSecurityException
Throws:
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException

displayProperties

public java.lang.String[] displayProperties(ERXRestKey key,
                                            boolean allProperties,
                                            boolean allToMany,
                                            ERXRestContext context)
                                     throws ERXRestException,
                                            ERXRestNotFoundException,
                                            ERXRestSecurityException
Specified by:
displayProperties in interface IERXRestEntityDelegate
Throws:
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException

displayDetails

public boolean displayDetails(ERXRestKey key,
                              ERXRestContext context)
                       throws ERXRestException,
                              ERXRestNotFoundException,
                              ERXRestSecurityException
Specified by:
displayDetails in interface IERXRestEntityDelegate
Throws:
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException

updated

public abstract void updated(com.webobjects.eoaccess.EOEntity entity,
                             com.webobjects.eocontrol.EOEnterpriseObject eo,
                             ERXRestContext context)
                      throws ERXRestException,
                             ERXRestSecurityException
Called after performing the user's requested updates. This provides support for subclasses to extend and perform "automatic" updates. For instance, if you wanted to set a last modified date, or a modified-by-user field, you could do that here.

Parameters:
entity - the entity of the object being updated
eo - the updated object
context - the rest context
Throws:
ERXRestException - if a general error occurs
ERXRestSecurityException - if a security error occurs

inserted

public abstract void inserted(com.webobjects.eoaccess.EOEntity entity,
                              com.webobjects.eocontrol.EOEnterpriseObject eo,
                              ERXRestContext context)
                       throws ERXRestException,
                              ERXRestSecurityException
Called after performing the user's requested insert. This provides support for subclasses to extend and set "automatic" attributes. For instance, if you wanted to set a creation date, or a created-by-user field, you could do that here.

Parameters:
entity - the entity of the object being inserted
eo - the inserted object
context - the rest context
Throws:
ERXRestException - if a general error occurs
ERXRestSecurityException - if a security error occurs

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.