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

public class PersistableEntityProcessor extends BasicEntityProcessor
A default processor for performing creating, updating and deleting 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:
  • 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 created
      entityObject - The existing stored object before any attributes have been updated
      processorData - 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 a Persistable from the new or existing entity and attempts to populate the Persistable attributes from the entity. Can be overridden to create the Persistable from the entity or add additional properties on the Persistable.

      Supported API: true
      Parameters:
      entity -
      processorData -
      Returns:
      the entity to create as a new Persistable. The Persistable is 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 a Persistables from the given entities and populates the Persistables attributes from the entities. Can be overridden to create the Persistables from the entities or add additional properties on the Persistables.

      Supported API: true
      Parameters:
      entities -
      processorData -
      Returns:
      Map of entities to Persistables. The Persistables 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 the Persistable.

      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