Inherited by ERXUnsafeReadOnlyRestEntityDelegate, and ERXUnsafeRestEntityDelegate.

In particular it adds support for loading certain common configuration out of your application Properties file, including:
Entity aliases allow you to remap the name of entity from its actual internal name to some other name that is shown to consumers of your service:
ERXRest.[EntityName].alias=SomeOtherName
For example:
ERXRest.Person.alias = Employee
In the above example, our entity is named Person, but we want users of our service to see it named "Employee."
Just like entity aliases, it is often desirable to be able to rename properties of your entity for use externally. Property aliases provide a mechanism to do this, and ERXStandardRestEntityDelegate allows you to define these mappings in your Application properties file.
ERXRest.[EntityName].[propertyName].alias=someOtherName
For example:
ERXRest.Person.displayName.alias = name
In the above example, the we are saying that the "displayName" property of the "Person" entity should be called "name" to users of the service. The entity name in this property should be the actual entity name, not the entity alias if one exists.
There are three types of properties you can control: view, update, and insert. View properties are the set of properties (keys, attributes, relationships, etc) that a particular caller is allowed to view on an object. Insert properties are the properties that a caller is allowed to specify at creation time for a new object. Update properties are the properties that a caller is allowed to update during an update request. Insert and update properties are implicitly view properties, and update properties are implicitly insert properties.
Note that all properties that appear in a properties definition should be "actual" property names, not property aliases. Similarly, all entity names should be the actual entity names and not entity aliases.
If you have already ERXXmlRestResponseWriter (if not, you should), you know that it can define a set of properties that CAN be displayed to your users for any particular entity or keypath (the "detailsProperties"). The properties defined for the renderer only define what the user can possibly see -- it does not deal with security, which is the entity delegate's responsibility. So it is possible to declare that the renderer should show "firstName,lastName,email" for a Person in details, but your view properties may only allow you to see "firstName".
This implementation provides a simple way to define view, insert, and update properties for an entity. These definitions, by default, are fixed for any use of the entity by any user. If you want to dynamically adjust what keypaths users can view, insert, and update based on some more complicated permissions structure, then you can either override the corresponding methods, or extend ERXAbstractRestEntityDelegate instead of this implementation.
Because the view properties are not dynamic by default, it is a common desire to use the detailsProperties declaration from ERXXmlRestResponseWriter as the view properties also. To do this, you can use the the ERXStandardRestEntityDelegate(String entityName) variant of the constructor, or you can use the ERXStandardRestEntityDelegate() constructor and manually call loadDetailsPropertiesAsViewPropertiesForEntityNamed(String entityName) and it will automatically make all details properties view properties.
To define view, insert, and update properties in your Application's Properties file, you can declare:
ERXRest.[EntityName].viewProperties=property1,property2,property3,... ERXRest.[EntityName].insertProperties=property1,property2,property3,... ERXRest.[EntityName].updateProperties=property1,property2,property3,...
For example:
ERXRest.BlogPost.viewProperties=author,title,submissionDate,contents ERXRest.BlogPost.insertProperties=author,title,contents ERXRest.BlogPost.updateProperties=title,contents
In the above example, we allow users to see the author, title, submissionDate and contents properties of a BlogPost. However, when they insert, we want to automatically set "submissionDate", so we do not allow that property. Additionally we don't want to allow users to change the original author of a post (note this example is a bit contrived), so we don't include "author" key in the updateProperties.
Constructs an ERXStandardRestEntityDelegate without an explicit entity reference. loadDetailsPropertiesAsViewPropertiesForEntityNamed, loadViewPropertiesForEntityNamed, loadUpdatePropertiesForEntityNamed, and loadInsertPropertiesForEntityNamed will NOT be called.
| ERXStandardRestEntityDelegate | ( | String | entityName, | |
| boolean | detailsPropertiesAreViewProperties | |||
| ) |
Constructs an ERXStandardRestEntityDelegate with an explicit entity name, optionally loading details properties as view properties. Additionally, loadViewPropertiesForEntityNamed, loadUpdatePropertiesForEntityNamed, and loadInsertPropertiesForEntityNamed WILL be called.
| entityName | the name of the entity that this delegate represents | |
| detailsPropertiesAreViewProperties | if true, .detailsProperties will be loaded as .viewProperties |
| ERXStandardRestEntityDelegate | ( | String | entityName | ) |
Constructs an ERXStandardRestEntityDelegate with an explicit entity name, and WILL load details properties as view properties. Additionally, loadViewPropertiesForEntityNamed, loadUpdatePropertiesForEntityNamed, and loadInsertPropertiesForEntityNamed WILL be called.
| entityName | the name of the entity that this delegate represents |
Adds an insert property for the specified entity.
| entityName | the name of the entity | |
| insertPropertyName | the name of the insert property |
Adds an update property for the specified entity.
| entityName | the name of the entity | |
| updatePropertyName | the name of the update property |
Adds a view property for the specified entity.
| entityName | the name of the entity | |
| visiblePropertyName | the name of the view property |
| boolean canInsertProperty | ( | EOEntity | entity, | |
| EOEnterpriseObject | eo, | |||
| String | propertyName, | |||
| ERXRestContext | context | |||
| ) | [virtual] |
Returns true if propertyName is declared as an insert property.
| entity | the entity | |
| eo | the object to check | |
| propertyName | the property name to check | |
| context | the rest context |
Implements IERXRestSecurityDelegate.
Reimplemented in ERXUnsafeReadOnlyRestEntityDelegate, and ERXUnsafeRestEntityDelegate.
| boolean canUpdateProperty | ( | EOEntity | entity, | |
| EOEnterpriseObject | eo, | |||
| String | propertyName, | |||
| ERXRestContext | context | |||
| ) | [virtual] |
Returns true if propertyName is declared as an update property.
| entity | the entity | |
| eo | the object to check | |
| propertyName | the property name to check | |
| context | the rest context |
Implements IERXRestSecurityDelegate.
Reimplemented in ERXUnsafeReadOnlyRestEntityDelegate, and ERXUnsafeRestEntityDelegate.
| boolean canViewProperty | ( | EOEntity | entity, | |
| Object | obj, | |||
| String | propertyName, | |||
| ERXRestContext | context | |||
| ) | [virtual] |
Returns true if propertyName is declared as a view property.
| entity | the entity | |
| obj | the object to check | |
| propertyName | the property name to check | |
| context | the rest context |
Implements IERXRestSecurityDelegate.
Reimplemented in ERXUnsafeReadOnlyRestEntityDelegate, and ERXUnsafeRestEntityDelegate.
| String defaultIDAttributeName | ( | ) | [protected] |
Returns the default "id" attribute name for all entities.
Returns the entity alias for the given entity name. This looks in the ERXRest.[EntityName].alias property. If not found, entityName is returned.
| entityName | the name of the entity |
Reimplemented from ERXAbstractRestEntityDelegate.
| boolean hasViewProperties | ( | ) | [protected] |
Returns whether or not there are any view properties.
| String idAttributeName | ( | EOEntity | entity | ) | [protected] |
Reimplemented from ERXAbstractRestEntityDelegate.
| void inserted | ( | EOEntity | entity, | |
| EOEnterpriseObject | eo, | |||
| ERXRestContext | context | |||
| ) | throws ERXRestException, ERXRestSecurityException [virtual] |
Default empty implementation. Extend to do custom insertion processing for the object.
| entity | the entity of the object | |
| eo | the inserted object | |
| context | the rest context |
| ERXRestException | if a general error occurs | |
| ERXRestSecurityException | if a security exception occurs |
Implements ERXAbstractRestEntityDelegate.
Reimplemented in ERXUnsafeReadOnlyRestEntityDelegate.
| void loadDetailsPropertiesAsViewPropertiesForEntityNamed | ( | String | entityName | ) | [protected] |
Loads the details properties for the specified entity from the configuration for ERXXmlRestResponseWriter and calls addViewPropertyName for each.
| entityName | the name of the entity to load properties for |
| void loadInsertPropertiesForEntityNamed | ( | String | entityName | ) | [protected] |
Loads the insert properties for the specified entity from the property ERXRest.[EntityName].insertProperties and calls addInsertPropertyName for each.
| entityName | the name of the entity to load properties for |
| void loadUpdatePropertiesForEntityNamed | ( | String | entityName | ) | [protected] |
Loads the update properties for the specified entity from the property ERXRest.[EntityName].updateProperties and calls addUpdatePropertyName for each.
| entityName | the name of the entity to load properties for |
| void loadViewPropertiesForEntityNamed | ( | String | entityName | ) | [protected] |
Loads the view properties for the specified entity from the property ERXRest.[EntityName].viewProperties and calls addViewPropertyName for each.
| entityName | the name of the entity to load properties for |
| EOEntity nextEntity | ( | EOEntity | entity, | |
| String | key | |||
| ) |
Looks up the key from the property ERXRest.[EntityName].[key].nextEntity . Extend to provide support for custom non-model properties.
| entity | the entity of the object | |
| key | the key of the entity to return an entity definition for |
Implements IERXRestEntityDelegate.
Returns the property alias for the given property name for the specified entity. This looks in the ERXRest.[EntityName].[propertyName].alias property. If not found, entityName is returned.
| entity | the entity | |
| propertyName | the name of the property |
Reimplemented from ERXAbstractRestEntityDelegate.
Returns the property name for the given property alias for the specified entity. This looks in the ERXRest.[EntityName].[propertyName].alias property. If not found, entityName is returned.
| entity | the entity | |
| propertyAlias | the name of the property alias |
Reimplemented from ERXAbstractRestEntityDelegate.
| EOQualifier qualifierFromContext | ( | ERXRestContext | context | ) | [protected] |
A shortcut for pulling a qualifier from the "qualifier" form value.
| context | the rest context |
| void setDefaultIDAttributeName | ( | String | defaultIDAttributeName | ) |
Sets the default "id" attribute name for all entities.
| defaultIDAttributeName | the default "id" attribute name for all entities |
| NSArray<EOSortOrdering> sortOrderingsFromContext | ( | ERXRestContext | context | ) | [protected] |
A shortcut for pulling the sort ordering from the "order" and "direction" form values.
| context | the rest context |
| void updated | ( | EOEntity | entity, | |
| EOEnterpriseObject | eo, | |||
| ERXRestContext | context | |||
| ) | throws ERXRestException, ERXRestSecurityException [virtual] |
Default empty implementation. Extend to do custom update processing for the object.
| entity | the entity of the object | |
| eo | the updated object | |
| context | the rest context |
| ERXRestException | if a general error occurs | |
| ERXRestSecurityException | if a security exception occurs |
Implements ERXAbstractRestEntityDelegate.
Reimplemented in ERXUnsafeReadOnlyRestEntityDelegate.
String _defaultIDAttributeName [private] |
NSMutableSet<String> _insertPropertyNames [private] |
NSMutableDictionary<String, String> _propertyAliasForPropertyName [private] |
NSMutableDictionary<String, String> _propertyNameForPropertyAlias [private] |
NSMutableSet<String> _updatePropertyNames [private] |
NSMutableSet<String> _viewPropertyNames [private] |
1.5.8