ERXDefaultRestDelegate Class Reference

Inherits er::rest::entityDelegates::IERXRestDelegate.

Inherited by ERD2RestDelegate.

Collaboration diagram for ERXDefaultRestDelegate:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void addDelegateForEntityNamed (IERXRestEntityDelegate entityDelegate, String entityName)
void delete (ERXRestRequest deleteRequest, ERXRestContext context) throws ERXRestException, ERXRestSecurityException, ERXRestNotFoundException
IERXRestEntityDelegate entityDelegate (EOEntity entity)
String entityNameForAlias (String entityAlias)
 ERXDefaultRestDelegate (IERXRestEntityDelegate defaultDelegate, boolean guessDelegateNames)
 ERXDefaultRestDelegate (IERXRestEntityDelegate defaultDelegate)
 ERXDefaultRestDelegate (boolean guessDelegateNames)
 ERXDefaultRestDelegate ()
ERXRestKey insert (ERXRestRequest insertRequest, ERXRestContext context) throws ERXRestException, ERXRestSecurityException, ERXRestNotFoundException
ERXRestKey process (ERXRestRequest restRequest, ERXRestContext context) throws ERXRestException, ERXRestSecurityException, ERXRestNotFoundException
void removeDelegateForEntityNamed (String entityName)
void update (ERXRestRequest updateRequest, ERXRestContext context) throws ERXRestException, ERXRestSecurityException, ERXRestNotFoundException
ERXRestKey view (ERXRestRequest restRequest, ERXRestContext restContext)

Protected Member Functions

ERXRestKey insertInto (EOEntity entity, ERXRestRequest insertRequest, EOEntity parentEntity, EOEnterpriseObject parentObject, String parentKey, ERXRestContext context) throws ERXRestSecurityException, ERXRestException, ERXRestNotFoundException

Private Attributes

IERXRestEntityDelegate _defaultDelegate
NSMutableDictionary< String,
String
_entityAliases
NSMutableDictionary< String,
IERXRestEntityDelegate
_entityDelegates
boolean _guessDelegateNames


Detailed Description

ERXDefaultRestDelegate is the default implementation of the IERXRestDelegate interface. It provides support for registering custom IERXRestEntityDelegates for specific entities.

Author:
mschrag

Constructor & Destructor Documentation

Constructs an ERXDefaultRestDelegate with an ERXDenyRestEntityDelegate as the default entity delegate.

ERXDefaultRestDelegate ( boolean  guessDelegateNames  ) 

Constructs an ERXDefaultRestDelegate with an ERXDenyRestEntityDelegate as the default entity delegate.

Parameters:
guessDelegateNames if true, delegates names will be guessed "<EntityName>RestEntityDelegate" before falling back to the default

Constructs an ERXDefaultRestDelegate with the given default entity delegate and with delegate name guessing turned on. If no entity delegate is specified for a particular entity name, the default delegate will be returned.

Parameters:
defaultDelegate the default entity delegate to use

ERXDefaultRestDelegate ( IERXRestEntityDelegate  defaultDelegate,
boolean  guessDelegateNames 
)

Constructs an ERXDefaultRestDelegate with the given default entity delegate. If no entity delegate is specified for a particular entity name, the default delegate will be returned.

Parameters:
defaultDelegate the default entity delegate to use
guessDelegateNames if true, delegates names will be guessed "<EntityName>RestEntityDelegate" before falling back to the default


Member Function Documentation

void addDelegateForEntityNamed ( IERXRestEntityDelegate  entityDelegate,
String  entityName 
)

Call this method to register an entity-specific delegate for a particular entity name.

Parameters:
entityDelegate the entity delegate
entityName the entity name to associate the delegate with

Reimplemented in ERD2RestDelegate.

Deletes the given object (NSArray of EOEnterpriseObject).

Parameters:
deleteRequest the incoming delete
context the rest context
Exceptions:
ERXRestException if there is a general failure
ERXRestSecurityException if the user attempts to delete objects that he/she is not permitted to delete
ERXRestNotFoundException if one of the requested objects does not exist

Implements IERXRestDelegate.

Reimplemented in ERD2RestDelegate.

IERXRestEntityDelegate entityDelegate ( EOEntity  entity  ) 

Returns the per-entity rest delegate.

Parameters:
entity the entity
Returns:
the per-entity rest delegate

Implements IERXRestDelegate.

Reimplemented in ERD2RestDelegate.

String entityNameForAlias ( String  entityAlias  ) 

Returns the actual name for the entity from its aliased name. The mappings for aliases is acquired when entity delegates are registered by calling entityAliasForEntityNamed.

Parameters:
entityAlias the entity alias
Returns:
the actual entity name

Implements IERXRestDelegate.

Reimplemented in ERD2RestDelegate.

Creates the objects defined by the XML document (which can contain a single object or an array inserts).

Parameters:
insertRequest the incoming inserts
context the rest context
Returns:
the inserted objects as an ERXRestResult
Exceptions:
ERXRestException if there is a general failure
ERXRestSecurityException if the user attempts to insert objects that he/she is not permitted to insert
ERXRestNotFoundException if one of the requested objects does not exist

Implements IERXRestDelegate.

Reimplemented in ERD2RestDelegate.

ERXRestKey insertInto ( EOEntity  entity,
ERXRestRequest  insertRequest,
EOEntity  parentEntity,
EOEnterpriseObject  parentObject,
String  parentKey,
ERXRestContext  context 
) throws ERXRestSecurityException, ERXRestException, ERXRestNotFoundException [protected]

Inserts or updates the objects defined by the XML document.

Parameters:
restRequest the incoming inserts or updates
context the rest context
Returns:
the inserted or updates objects as an ERXRestResult
Exceptions:
ERXRestException if there is a general failure
ERXRestSecurityException if the user attempts to insert or updates objects that he/she is not permitted to
ERXRestNotFoundException if one of the requested objects does not exist

Implements IERXRestDelegate.

void removeDelegateForEntityNamed ( String  entityName  ) 

Removes the delegate for the given entity name.

Parameters:
entityName the name of the entity

Reimplemented in ERD2RestDelegate.

Updates the objects defined by the XML document (which can contain partial updates or array updates).

Parameters:
updateRequest the incoming updates
context the rest context
Exceptions:
ERXRestException if there is a general failure
ERXRestSecurityException if the user attempts to update objects that he/she is not permitted to update
ERXRestNotFoundException if one of the requested objects does not exist

Implements IERXRestDelegate.

Reimplemented in ERD2RestDelegate.

ERXRestKey view ( ERXRestRequest  restRequest,
ERXRestContext  restContext 
)

Views the object defined by the incoming url.

Parameters:
restRequest the incoming viewing request.
restContext the rest context
Returns:
the actual result as an ERXRestResult
Exceptions:
ERXRestException if there is a general failure
ERXRestSecurityException if the user attempts to insert or updates objects that he/she is not permitted to
ERXRestNotFoundException if one of the requested objects does not exist

Implements IERXRestDelegate.

Reimplemented in ERD2RestDelegate.


Member Data Documentation

Reimplemented in ERD2RestDelegate.

boolean _guessDelegateNames [private]


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

Generated on Sat May 26 06:43:28 2012 for Project Wonder by  doxygen 1.5.8