ERD2RestDefaultEntityDelegate Class Reference

Inherits er::rest::entityDelegates::ERXAbstractRestEntityDelegate.

Collaboration diagram for ERD2RestDefaultEntityDelegate:

Collaboration graph
[legend]

List of all members.

Public Member Functions

boolean canDeleteObject (EOEntity entity, EOEnterpriseObject eo, ERXRestContext context)
final boolean canInsertObject (EOEntity parentEntity, Object parentObject, String parentKey, EOEntity entity, ERXRestContext context)
final boolean canInsertObject (EOEntity entity, ERXRestContext context)
final boolean canInsertProperty (EOEntity entity, EOEnterpriseObject eo, String propertyName, ERXRestContext context)
final boolean canUpdateObject (EOEntity entity, EOEnterpriseObject eo, ERXRestContext context)
final boolean canUpdateProperty (EOEntity entity, EOEnterpriseObject eo, String propertyName, ERXRestContext context)
boolean canViewObject (EOEntity entity, EOEnterpriseObject eo, ERXRestContext context)
boolean canViewProperty (EOEntity entity, Object obj, String propertyName, ERXRestContext context)
boolean displayDetails (ERXRestKey key, ERXRestContext context) throws ERXRestException, ERXRestNotFoundException, ERXRestSecurityException
String[] displayProperties (ERXRestKey key, boolean allProperties, boolean allToMany, ERXRestContext context) throws ERXRestException, ERXRestNotFoundException, ERXRestSecurityException
String entityAliasForEntityNamed (String entityName)
void inserted (EOEntity entity, EOEnterpriseObject eo, ERXRestContext context) throws ERXRestException, ERXRestSecurityException
EOEntity nextEntity (EOEntity entity, String key)
NSArray objectsForEntity (EOEntity entity, ERXRestContext context) throws ERXRestException, ERXRestSecurityException
String propertyAliasForPropertyNamed (EOEntity entity, String propertyName)
String propertyNameForPropertyAlias (EOEntity entity, String propertyAlias)
IERXRestSecurityDelegate securityHandler ()
void updated (EOEntity entity, EOEnterpriseObject eo, ERXRestContext context) throws ERXRestException, ERXRestSecurityException
NSArray visibleObjects (EOEntity parentEntity, Object parentObject, String parentKey, EOEntity entity, NSArray objects, ERXRestContext context) throws ERXRestException, ERXRestSecurityException, ERXRestNotFoundException

Protected Member Functions

Object valueForKey (String key, String secondKey, NSKeyValueCoding first, NSKeyValueCoding second, Object defaultValue)

Private Member Functions

D2WContext d2wContext ()

Private Attributes

IERXRestSecurityDelegate _securityHandler = new ERD2RestAllowSecurityDelegate()

Static Private Attributes

static Logger log = Logger.getLogger(ERD2RestDefaultEntityDelegate.class)


Member Function Documentation

boolean canDeleteObject ( EOEntity  entity,
EOEnterpriseObject  eo,
ERXRestContext  context 
) [virtual]

Returns whether or not the given object can be deleted. This is called prior to calling canDeleteProperty on any properties and acts as a first line of defenese to completely cut-off access to an object for delete. Note that the actual meaning of "delete" can be defined in your delete method, so returning true for this does not *necessarily* mean the object will be deleted. Instead it just means you will allow access to the delete method.

Parameters:
entity the entity of the object
eo the object to check
context the rest context
Returns:
whether or not the given object can be deleted

Implements IERXRestSecurityDelegate.

final boolean canInsertObject ( EOEntity  parentEntity,
Object  parentObject,
String  parentKey,
EOEntity  entity,
ERXRestContext  context 
) [virtual]

Returns whether or not a new object can be inserted into the specified relationship of an existing object.

Parameters:
parentEntity the entity of the parent
parentObject the parent
parentKey the name of the relationship on the parent
entity the entity of the object to insert
context the rest context
Returns:
whether or not a new object can be inserted

Implements IERXRestSecurityDelegate.

final boolean canInsertObject ( EOEntity  entity,
ERXRestContext  context 
) [virtual]

Returns whether or not the caller is allowed to insert a new object of the given entity. This variant is called if the caller tries to insert an object without traversing a keypath -- that is, a top level insert. You can return false from this without implying that canInsertObject(..., parentObject, parentKey ..) returns false -- the two are mutually exclusive.

Parameters:
entity the entity of the object to insert
context the rest context
Returns:
whether or not a new object can be inserted

Implements IERXRestSecurityDelegate.

final boolean canInsertProperty ( EOEntity  entity,
EOEnterpriseObject  eo,
String  propertyName,
ERXRestContext  context 
) [virtual]

Returns whether or not the given property can be set during an insert. This is only called if canInsertObject has returned true.

Parameters:
entity the entity of the object
eo the object
propertyName the property name to check
context the rest context
Returns:
whether or not the given property can be set during an insert

Implements IERXRestSecurityDelegate.

final boolean canUpdateObject ( EOEntity  entity,
EOEnterpriseObject  eo,
ERXRestContext  context 
) [virtual]

Returns whether or not the given object can be updated. This is called prior to calling canUpdateProperty on any properties and acts as a first line of defenese to completely cut-off access to an object for update

Parameters:
entity the entity of the object
eo the object to check
context the rest context
Returns:
whether or not the given object can be updated

Implements IERXRestSecurityDelegate.

final boolean canUpdateProperty ( EOEntity  entity,
EOEnterpriseObject  eo,
String  propertyName,
ERXRestContext  context 
) [virtual]

Returns whether or not the given property can be set during an update. This is only called if canUpdateObject has returned true.

Parameters:
entity the entity of the object
eo the object
propertyName the property name to check
context the rest context
Returns:
whether or not the given property can be set during an update

Implements IERXRestSecurityDelegate.

boolean canViewObject ( EOEntity  entity,
EOEnterpriseObject  eo,
ERXRestContext  context 
) [virtual]

Returns whether or not the given object can be seen. This is called prior to calling canViewProperty on any properties and acts as a first line of defenese to completely cut-off access to an object.

Parameters:
entity the entity of the object
eo the object to check
context the rest context
Returns:
whether or not the given object can be seen

Implements IERXRestSecurityDelegate.

boolean canViewProperty ( EOEntity  entity,
Object  obj,
String  propertyName,
ERXRestContext  context 
) [virtual]

Returns whether or not the given property can be seen. This is only called if canViewObject has returned true.

Parameters:
entity the entity of the object
obj the object
propertyName the property name to check
context the rest context
Returns:
whether or not the given property can be seen

Implements IERXRestSecurityDelegate.

D2WContext d2wContext (  )  [private]

boolean displayDetails ( ERXRestKey  key,
ERXRestContext  context 
) throws ERXRestException, ERXRestNotFoundException, ERXRestSecurityException

Reimplemented from ERXAbstractRestEntityDelegate.

String [] displayProperties ( ERXRestKey  key,
boolean  allProperties,
boolean  allToMany,
ERXRestContext  context 
) throws ERXRestException, ERXRestNotFoundException, ERXRestSecurityException

Reimplemented from ERXAbstractRestEntityDelegate.

String entityAliasForEntityNamed ( String  entityName  ) 

Returns entityName;

Returns:
entityName

Reimplemented from ERXAbstractRestEntityDelegate.

void inserted ( EOEntity  entity,
EOEnterpriseObject  eo,
ERXRestContext  context 
) throws ERXRestException, ERXRestSecurityException [virtual]

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
Exceptions:
ERXRestException if a general error occurs
ERXRestSecurityException if a security error occurs

Implements ERXAbstractRestEntityDelegate.

EOEntity nextEntity ( EOEntity  entity,
String  key 
)

Returns the destination entity for the given key on the specified entity. If the key is a non-entity, you can return null.

Parameters:
entity the entity to check
key the key to return the entity for
Returns:
the destination entity for the given key (or null if there isn't one)

Implements IERXRestEntityDelegate.

NSArray objectsForEntity ( EOEntity  entity,
ERXRestContext  context 
) throws ERXRestException, ERXRestSecurityException

Returns an array of all of the EOs visible to the user for the given entity.

Parameters:
entity the entity to fetch
context the rest context
Returns:
the array of EOs
Exceptions:
ERXRestException if there is a general failure
ERXRestSecurityException if the user requests objects that he/she is not permitted to see

Implements IERXRestEntityDelegate.

String propertyAliasForPropertyNamed ( EOEntity  entity,
String  propertyName 
)

Returns propertyName.

Returns:
propertyName

Reimplemented from ERXAbstractRestEntityDelegate.

String propertyNameForPropertyAlias ( EOEntity  entity,
String  propertyAlias 
)

Returns propertyAlias.

Returns:
propertyAlias

Reimplemented from ERXAbstractRestEntityDelegate.

IERXRestSecurityDelegate securityHandler (  ) 

void updated ( EOEntity  entity,
EOEnterpriseObject  eo,
ERXRestContext  context 
) throws ERXRestException, ERXRestSecurityException [virtual]

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
Exceptions:
ERXRestException if a general error occurs
ERXRestSecurityException if a security error occurs

Implements ERXAbstractRestEntityDelegate.

Object valueForKey ( String  key,
String  secondKey,
NSKeyValueCoding  first,
NSKeyValueCoding  second,
Object  defaultValue 
) [protected]

NSArray visibleObjects ( EOEntity  parentEntity,
Object  parentObject,
String  parentKey,
EOEntity  entity,
NSArray  objects,
ERXRestContext  context 
) throws ERXRestException, ERXRestSecurityException, ERXRestNotFoundException

Given an array, this method filters the array based on the callers permission level. This method should never return null. To cut off access to the array entirely, return NSArray.EmptyArray. This method is only called after having verified access to the specified key on the parent object.

Parameters:
parentEntity the entity of the parent
parentObject the parent object
parentKey the key in the parent that references this array
entity the entity of the objects in the array
objects the actual array of objects to filter
context the rest context
Returns:
a filtered array
Exceptions:
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

Implements IERXRestEntityDelegate.


Member Data Documentation

Logger log = Logger.getLogger(ERD2RestDefaultEntityDelegate.class) [static, private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:42:48 2012 for Project Wonder by  doxygen 1.5.8