Digital Entity Manager
General Purpose
This service is used to execute digital entities commands.
Interface type: Web Service
Input Parameters
The DigitalEntityManager service uses a DigitalEntityCall method that gets two parameters: a general attribute XML and a digital entity call.
DigitalEntityManager.digitalEntityCall API
A generic function for creating / deleting / updating / retrieving digital entities
Parameters | Description |
---|---|
general | A General document |
digital_entity_call | A DigitalEntityCall document |
returns | A DigitalEntityResult document |
Updating A Digital Entity
When updating a digital entity, each node that you want to update should be marked for update by the cmd attribute.
The control section is always updated as a whole. Thus, to update only part of the control section, the best practice would be to first retrieve the digital entity, modify it, and then send a request for update.
On the mds/relations nodes, the cmd attribute can have one of the following values:
- delete_and_insert_all – deletes all existing sub-items and inserts the new ones
- delete_and_insert_delta – updates each item separately
On the md/relation/stream_ref node, the cmd attribute can have delete/insert/update values
DigitalEntityResult Document
The digitalEntityCall method returns a DigitalEntityResult document. This document holds the results digital entity and error if applicable.
For example, a delete call that failed because the object does not exist:
Result from success create call:
DigitalEntityManager.digitalEntityWithRelationsCall API
Returns a digital entity with extended relation information for a given PID:
DigitalEntityManager.digitalEntityWithRelationsCall API
Returns a digital entity with extended relation information for a given PID:
Parameters | Description |
---|---|
PID | The PID of the requested digital entity |
Returns | DigitalEntityResult document with extended information about the related entities |
Examples
- Creating a digital entity with metadata / local stream / and relation
<?xml version="1.0" encoding="UTF-8"?> <xb:digital_entity_call xmlns:xb="http://com/exlibris/digitool/repository/api/xmlbeans"> <xb:digital_entity> <control> <label>hello world</label> <note>bla bla..</note> </control> <mds> <md> <description>general dc record for book</description> <name>descriptive</name> <type>dc</type> <value>The dc records goes here...</value> </md> </mds> <relations> <relation> <type>part_of</type> <pid>1001</pid> </relation> </relations> <stream_ref store_command="copy" location="nfs"> <file_name>/temp/file1.txt</file_name> </stream_ref> </xb:digital_entity> <command>create</command> </xb:digital_entity_call>
- Deleting a digital entity by a given PID
<?xml version="1.0" encoding="UTF-8"?> <xb:digital_entity_call xmlns:xb="http://com/exlibris/digitool/repository/api/xmlbeans"> <xb:digital_entity> <pid>1001</pid> </xb:digital_entity> <command>delete</command> </xb:digital_entity_call>
- Retrieving a digital entity by a given PID
<?xml version="1.0" encoding="UTF-8"?> <xb:digital_entity_call xmlns:xb="http://com/exlibris/digitool/repository/api/xmlbeans"> <xb:digital_entity> <pid>1001</pid> <stream_ref cmd="update" store_command="copy" location="nfs"> <file_name>/temp/file1.txt</file_name> </stream_ref> </xb:digital_entity> <command>update</command> </xb:digital_entity_call>
- Deleting all digital entity relations
<?xml version="1.0" encoding="UTF-8"?> <xb:digital_entity_call xmlns:xb="http://com/exlibris/digitool/repository/api/xmlbeans"> <xb:digital_entity> <pid>1001</pid> <relations cmd="delete_and_insert_all"/> </xb:digital_entity> <command>update</command> </xb:digital_entity_call>
- Deleting a metadata node from a digital entity
<?xml version="1.0" encoding="UTF-8"?> <xb:digital_entity_call xmlns:xb="http://com/exlibris/digitool/repository/api/xmlbeans"> <xb:digital_entity> <pid>1001</pid> <mds cmd=delete_and_insert_delta"> <md cmd="delete"> <mid>2001</mid> </md> </mds> </xb:digital_entity> <command>update</command> </xb:digital_entity_call>
- Linking (shared) Metadata to a Digital Entity
<?xml version="1.0" encoding="UTF-8"?> <xb:digital_entity_call xmlns:xb="http://com/exlibris/digitool/repository/api/xmlbeans"> <xb:digital_entity> <pid>1001</pid> <mds cmd="delete_and_insert_delta"> <md cmd="insert" link_to_exists="true"> <mid>2001</mid> </md> </mds> </xb:digital_entity> <command>update</command> </xb:digital_entity_call>