Class PersistableEntityProcessor
java.lang.Object
com.ptc.odata.core.entity.processor.BasicEntityProcessor
com.ptc.odata.windchill.entity.processor.PersistableEntityProcessor
- All Implemented Interfaces:
EntityObjectProcessor
- Direct Known Subclasses:
RemoteChangeItemEntityProcessor
A default processor for performing creating, updating and deleting
Supported API: true
Extendable: true
Persistable type objects. Uses the
persistence service for creating, updating and deleting the Windchill instance of a resource entity
Supported API: true
Extendable: true
- See Also:
-
Field Summary
Fields inherited from class com.ptc.odata.core.entity.processor.BasicEntityProcessor
ADD_ENTITY_ASSOCIATION, CREATE_ENTITY_DATA, CREATE_MEDIA_ENTITY, DELETE_ALL_ENTITY_ASSOCIATIONS, DELETE_ENTITY_ASSOCIATION, DELETE_ENTITY_COLLECTION, DELETE_ENTITY_DATA, FOUND_UNSUPPORTED_OBJECT_FOR_ENTITY_TYPE, GET_RELATED_ENTITY_COLLECTION, IS_VALID_ENTITY_KEY, IS_VALID_NAVIGATION, READ_ENTITY_DATA, READ_ENTITY_SET_DATA, READ_MEDIA_ENTITY, TO_ENTITIES, TO_OBJECTS, UPDATE_ENTITY_ASSOCIATIONS, UPDATE_ENTITY_DATA, UPDATE_MEDIA_ENTITY -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisValidObject(TypeIdentifier objectType, WcEntityConfig entityConfig) Checks if the given object type is valid Windchill type based on the type configured for the given entity config.multiOperationPreProcess(org.apache.olingo.commons.api.data.EntityCollection entities, EntityProcessorData processorData) Creates aPersistables from the given entities and populates thePersistables attributes from the entities.voidoperationPostProcess(Object object, org.apache.olingo.commons.api.data.Entity entity, EntityProcessorData processorData) Can be overridden to do additional processing after the entity was stored or updated within the same transaction.operationPreProcess(org.apache.olingo.commons.api.data.Entity entity, EntityProcessorData processorData) Creates aPersistablefrom the new or existing entity and attempts to populate thePersistableattributes from the entity.processAdditionalAttributes(org.apache.olingo.commons.api.data.Entity entity, Object entityObject, EntityProcessorData processorData) Called to set any additional driver attributes.Methods inherited from class com.ptc.odata.core.entity.processor.BasicEntityProcessor
addEntityAssociation, callAssociationMethod, deleteAllEntityAssociations, deleteEntityAssociation, getParentProcessorData, getRelatedEntityCollection, processActionVoid, toEntity, toObject, updateEntityAssociationsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.ptc.odata.core.entity.processor.EntityObjectProcessor
getOrderByProcessor
-
Method Details
-
processAdditionalAttributes
public Collection<AttributeData> processAdditionalAttributes(org.apache.olingo.commons.api.data.Entity entity, Object entityObject, EntityProcessorData processorData) throws org.apache.olingo.server.api.ODataApplicationException Called to set any additional driver attributes. For example an inheritable delegate may set the container reference or org id.
Supported API: true- Parameters:
entity- Entity to be createdentityObject- The existing stored object before any attributes have been updatedprocessorData- Data for processing a action request- Returns:
- the updated object from the entity
- Throws:
org.apache.olingo.server.api.ODataApplicationException- Returns: collection of AttributeData called during create and update, When to implement javascript hook: To set properties not in entity configuration (linking fields, for example) Example: ProdMgmt/PartUses.js
-
operationPreProcess
public Object operationPreProcess(org.apache.olingo.commons.api.data.Entity entity, EntityProcessorData processorData) throws org.apache.olingo.server.api.ODataApplicationException Creates aPersistablefrom the new or existing entity and attempts to populate thePersistableattributes from the entity. Can be overridden to create thePersistablefrom the entity or add additional properties on thePersistable.
Supported API: true- Parameters:
entity-processorData-- Returns:
- the entity to create as a new
Persistable. ThePersistableis not yet stored. - Throws:
org.apache.olingo.server.api.ODataApplicationException- Returns: a fully populated Windchill object to be stored When to implement javascript hook: Rarely Example: ProdMgmt/Parts.js
-
multiOperationPreProcess
public Map<org.apache.olingo.commons.api.data.Entity,Object> multiOperationPreProcess(org.apache.olingo.commons.api.data.EntityCollection entities, EntityProcessorData processorData) throws org.apache.olingo.server.api.ODataApplicationException Creates aPersistables from the given entities and populates thePersistables attributes from the entities. Can be overridden to create thePersistables from the entities or add additional properties on thePersistables.
Supported API: true- Parameters:
entities-processorData-- Returns:
- Map of entities to
Persistables. ThePersistables are not yet stored. - Throws:
org.apache.olingo.server.api.ODataApplicationException
-
operationPostProcess
public void operationPostProcess(Object object, org.apache.olingo.commons.api.data.Entity entity, EntityProcessorData processorData) throws org.apache.olingo.server.api.ODataApplicationException Can be overridden to do additional processing after the entity was stored or updated within the same transaction. Can be overridden to add associations on thePersistable.
Supported API: true- Parameters:
object-entity-processorData-- Throws:
org.apache.olingo.server.api.ODataApplicationException- Returns: no return value When to implement javascript hook: Rarely, if ever Example: none
-
isValidObject
public static boolean isValidObject(TypeIdentifier objectType, WcEntityConfig entityConfig) throws org.apache.olingo.commons.api.ex.ODataException Checks if the given object type is valid Windchill type based on the type configured for the given entity config.
Supported API: true- Parameters:
objectType-entityConfig-- Returns:
- true if the object type is valid for the entity config; otherwise, false
- Throws:
org.apache.olingo.commons.api.ex.ODataException
-