|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecter.rest.entityDelegates.ERXDenyRestEntityDelegate
public class ERXDenyRestEntityDelegate
ERXDenyRestEntityDelegate is the safe default entity delegate (and is used by default on ERXRestDelegate). This delegate denies all requests (view, insert, update, etc) and throws security exceptions at any attempt to perform an action.
Constructor Summary | |
---|---|
ERXDenyRestEntityDelegate()
|
Method Summary | |
---|---|
boolean |
canDeleteObject(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.EOEnterpriseObject eo,
ERXRestContext context)
Returns whether or not the given object can be deleted. |
boolean |
canInsertObject(com.webobjects.eoaccess.EOEntity entity,
ERXRestContext context)
Returns whether or not the caller is allowed to insert a new object of the given entity. |
boolean |
canInsertObject(com.webobjects.eoaccess.EOEntity parentEntity,
java.lang.Object parentObject,
java.lang.String parentKey,
com.webobjects.eoaccess.EOEntity entity,
ERXRestContext context)
Returns whether or not a new object can be inserted into the specified relationship of an existing object. |
boolean |
canInsertProperty(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.EOEnterpriseObject eo,
java.lang.String propertyName,
ERXRestContext context)
Returns whether or not the given property can be set during an insert. |
boolean |
canUpdateObject(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.EOEnterpriseObject eo,
ERXRestContext context)
Returns whether or not the given object can be updated. |
boolean |
canUpdateProperty(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.EOEnterpriseObject eo,
java.lang.String propertyName,
ERXRestContext context)
Returns whether or not the given property can be set during an update. |
boolean |
canViewObject(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.EOEnterpriseObject eo,
ERXRestContext context)
Returns whether or not the given object can be seen. |
boolean |
canViewProperty(com.webobjects.eoaccess.EOEntity entity,
java.lang.Object obj,
java.lang.String propertyName,
ERXRestContext context)
Returns whether or not the given property can be seen. |
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. |
void |
inserted(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.EOEnterpriseObject eo,
ERXRestContext context)
|
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.eocontrol.EOEnterpriseObject |
objectFromNode(com.webobjects.eoaccess.EOEntity entity,
ERXRestRequestNode node,
ERXRestContext context)
|
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 |
updated(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.EOEnterpriseObject eo,
ERXRestContext context)
|
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 parent,
java.lang.String key,
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 class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ERXDenyRestEntityDelegate()
Method Detail |
---|
public void initializeEntityNamed(java.lang.String entityName)
IERXRestEntityDelegate
initializeEntityNamed
in interface IERXRestEntityDelegate
entityName
- the name of the entity to initializepublic java.lang.String entityAliasForEntityNamed(java.lang.String entityName)
IERXRestEntityDelegate
entityAliasForEntityNamed
in interface IERXRestEntityDelegate
entityName
- the name of the entity to lookup
public java.lang.String propertyNameForPropertyAlias(com.webobjects.eoaccess.EOEntity entity, java.lang.String propertyAlias)
IERXRestEntityDelegate
propertyNameForPropertyAlias
in interface IERXRestEntityDelegate
entity
- the entity that contains the propertypropertyAlias
- the alias to lookup
public java.lang.String propertyAliasForPropertyNamed(com.webobjects.eoaccess.EOEntity entity, java.lang.String propertyName)
IERXRestEntityDelegate
propertyAliasForPropertyNamed
in interface IERXRestEntityDelegate
entity
- the entity that contains the propertypropertyName
- the property name
public java.lang.Object idForEO(com.webobjects.eoaccess.EOEntity entity, com.webobjects.eocontrol.EOEnterpriseObject eo)
IERXRestEntityDelegate
idForEO
in interface IERXRestEntityDelegate
eo
- the EO to get a primary key for
public boolean isEOID(ERXRestKey restKey)
IERXRestEntityDelegate
isEOID
in interface IERXRestEntityDelegate
restKey
- the possible EO key
public java.lang.String stringIDForEO(com.webobjects.eoaccess.EOEntity entity, com.webobjects.eocontrol.EOEnterpriseObject eo)
IERXRestEntityDelegate
stringIDForEO
in interface IERXRestEntityDelegate
eo
- the EO to get a primary key for
public com.webobjects.eocontrol.EOEnterpriseObject processObjectFromDocument(com.webobjects.eoaccess.EOEntity entity, ERXRestRequestNode eoNode, ERXRestContext context) throws ERXRestSecurityException, ERXRestException, ERXRestNotFoundException
IERXRestEntityDelegate
processObjectFromDocument
in interface IERXRestEntityDelegate
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 foundpublic com.webobjects.eocontrol.EOEnterpriseObject objectWithKey(com.webobjects.eoaccess.EOEntity entity, java.lang.String key, ERXRestContext context) throws ERXRestException, ERXRestNotFoundException, ERXRestSecurityException
IERXRestEntityDelegate
objectWithKey
in interface IERXRestEntityDelegate
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 objectpublic com.webobjects.eocontrol.EOEnterpriseObject objectForNode(com.webobjects.eoaccess.EOEntity entity, ERXRestRequestNode node, ERXRestContext context) throws ERXRestException, ERXRestNotFoundException, ERXRestSecurityException
IERXRestEntityDelegate
objectForNode
in interface IERXRestEntityDelegate
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 objectpublic com.webobjects.eocontrol.EOEnterpriseObject objectFromNode(com.webobjects.eoaccess.EOEntity entity, ERXRestRequestNode node, ERXRestContext context) throws ERXRestException, ERXRestNotFoundException, ERXRestSecurityException
ERXRestException
ERXRestNotFoundException
ERXRestSecurityException
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
IERXRestEntityDelegate
objectWithKey
in interface IERXRestEntityDelegate
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
ERXRestSecurityException
- if the caller is not permitted to view the requested object
ERXRestNotFoundException
- if there is no object in the array with the given keypublic 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
IERXRestEntityDelegate
insertObjectFromDocument
in interface IERXRestEntityDelegate
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 foundpublic 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
IERXRestEntityDelegate
updateArrayFromDocument
in interface IERXRestEntityDelegate
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
ERXRestException
- if a general failure occurs
ERXRestNotFoundException
- if a related object cannot be found
ERXRestSecurityException
- if a security failure occurspublic void updateObjectFromDocument(com.webobjects.eoaccess.EOEntity entity, com.webobjects.eocontrol.EOEnterpriseObject eo, ERXRestRequestNode eoNode, ERXRestContext context) throws ERXRestSecurityException, ERXRestException, ERXRestNotFoundException
IERXRestEntityDelegate
updateObjectFromDocument
in interface IERXRestEntityDelegate
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 foundpublic 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
IERXRestEntityDelegate
formatAttributeValue
in interface IERXRestEntityDelegate
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 occurspublic 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
IERXRestEntityDelegate
takeValueForKey
in interface IERXRestEntityDelegate
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.public java.lang.Object valueForKey(com.webobjects.eoaccess.EOEntity entity, java.lang.Object obj, java.lang.String propertyName, ERXRestContext context)
IERXRestEntityDelegate
valueForKey
in interface IERXRestEntityDelegate
entity
- the entity of the given objectobj
- the object itselfpropertyName
- the property name to lookupcontext
- the rest context
public void delete(com.webobjects.eoaccess.EOEntity entity, com.webobjects.eocontrol.EOEnterpriseObject eo, ERXRestContext context) throws ERXRestException
IERXRestEntityDelegate
delete
in interface IERXRestEntityDelegate
entity
- the entity of the objecteo
- the object to deletecontext
- the rest context
ERXRestException
- if a general failure occurs.public void updated(com.webobjects.eoaccess.EOEntity entity, com.webobjects.eocontrol.EOEnterpriseObject eo, ERXRestContext context) throws ERXRestException
ERXRestException
public void inserted(com.webobjects.eoaccess.EOEntity entity, com.webobjects.eocontrol.EOEnterpriseObject eo, ERXRestContext context) throws ERXRestException
ERXRestException
public boolean canInsertProperty(com.webobjects.eoaccess.EOEntity entity, com.webobjects.eocontrol.EOEnterpriseObject eo, java.lang.String propertyName, ERXRestContext context)
IERXRestSecurityDelegate
canInsertProperty
in interface IERXRestSecurityDelegate
entity
- the entity of the objecteo
- the objectpropertyName
- the property name to checkcontext
- the rest context
public boolean canUpdateProperty(com.webobjects.eoaccess.EOEntity entity, com.webobjects.eocontrol.EOEnterpriseObject eo, java.lang.String propertyName, ERXRestContext context)
IERXRestSecurityDelegate
canUpdateProperty
in interface IERXRestSecurityDelegate
entity
- the entity of the objecteo
- the objectpropertyName
- the property name to checkcontext
- the rest context
public com.webobjects.foundation.NSArray objectsForEntity(com.webobjects.eoaccess.EOEntity entity, ERXRestContext context)
IERXRestEntityDelegate
objectsForEntity
in interface IERXRestEntityDelegate
entity
- the entity to fetchcontext
- the rest context
public boolean canInsertObject(com.webobjects.eoaccess.EOEntity entity, ERXRestContext context)
IERXRestSecurityDelegate
canInsertObject
in interface IERXRestSecurityDelegate
entity
- the entity of the object to insertcontext
- the rest context
public boolean canInsertObject(com.webobjects.eoaccess.EOEntity parentEntity, java.lang.Object parentObject, java.lang.String parentKey, com.webobjects.eoaccess.EOEntity entity, ERXRestContext context)
IERXRestSecurityDelegate
canInsertObject
in interface IERXRestSecurityDelegate
parentEntity
- the entity of the parentparentObject
- the parentparentKey
- the name of the relationship on the parententity
- the entity of the object to insertcontext
- the rest context
public boolean canDeleteObject(com.webobjects.eoaccess.EOEntity entity, com.webobjects.eocontrol.EOEnterpriseObject eo, ERXRestContext context)
IERXRestSecurityDelegate
canDeleteObject
in interface IERXRestSecurityDelegate
entity
- the entity of the objecteo
- the object to checkcontext
- the rest context
public boolean canUpdateObject(com.webobjects.eoaccess.EOEntity entity, com.webobjects.eocontrol.EOEnterpriseObject eo, ERXRestContext context)
IERXRestSecurityDelegate
canUpdateObject
in interface IERXRestSecurityDelegate
entity
- the entity of the objecteo
- the object to checkcontext
- the rest context
public boolean canViewObject(com.webobjects.eoaccess.EOEntity entity, com.webobjects.eocontrol.EOEnterpriseObject eo, ERXRestContext context)
IERXRestSecurityDelegate
canViewObject
in interface IERXRestSecurityDelegate
entity
- the entity of the objecteo
- the object to checkcontext
- the rest context
public boolean canViewProperty(com.webobjects.eoaccess.EOEntity entity, java.lang.Object obj, java.lang.String propertyName, ERXRestContext context)
IERXRestSecurityDelegate
canViewProperty
in interface IERXRestSecurityDelegate
entity
- the entity of the objectobj
- the objectpropertyName
- the property name to checkcontext
- the rest context
public com.webobjects.foundation.NSArray visibleObjects(com.webobjects.eoaccess.EOEntity parentEntity, java.lang.Object parent, java.lang.String key, com.webobjects.eoaccess.EOEntity entity, com.webobjects.foundation.NSArray objects, ERXRestContext context)
IERXRestEntityDelegate
visibleObjects
in interface IERXRestEntityDelegate
parentEntity
- the entity of the parentparent
- the parent objectkey
- 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
public void preprocess(com.webobjects.eoaccess.EOEntity entity, com.webobjects.foundation.NSArray objects, ERXRestContext context) throws ERXRestException
IERXRestEntityDelegate
preprocess
in interface IERXRestEntityDelegate
entity
- the entity of the objectsobjects
- the objects to be displayed
ERXRestException
- if there is a general failurepublic com.webobjects.eoaccess.EOEntity nextEntity(com.webobjects.eoaccess.EOEntity entity, java.lang.String key)
IERXRestEntityDelegate
nextEntity
in interface IERXRestEntityDelegate
entity
- the entity to checkkey
- the key to return the entity for
public boolean displayDetails(ERXRestKey key, ERXRestContext context)
displayDetails
in interface IERXRestEntityDelegate
public java.lang.String[] displayProperties(ERXRestKey key, boolean allProperties, boolean allToMany, ERXRestContext context) throws ERXRestException, ERXRestNotFoundException, ERXRestSecurityException
displayProperties
in interface IERXRestEntityDelegate
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 |