Search definition file for deletion
The search definition file for deletion defines which content is to be deleted in an ImageMaster repository. The following search methods can be applied to identify objects to delete:
-
searchAllRevisionsByKey (deletes whole documents)
-
searchAllRevisionsByDocumentId (deletes whole documents)
-
searchByRevisionId (deletes revisions)
-
searchLatestRevisionByKey (deletes revisions)
-
searchLatestRevisionByDocumentId (deletes revisions)
-
searchByQueryToDelete (can delete revisions or documents based on the key)
The key “deletionObjectType” in a query can be “revisions” or “documents”.
Example search definitions for deletion
The sections below present example search definitions for deletion, which could be applied in a definition file (delete.xml). In general, within one search definition file several searches can be combined to delete multiple documents as in example 4 where two queries are used.
For details on how to formulate a query, consult the corresponding system manual [SM IS]. In particular, this manual contains some more complex queries in the context of example rights and roles, see
RAQL queries can be of a complex nature and there can be dependencies in the document model that need to be considered:
For example, a document without any associated revision is not allowed by design of the ImageMaster document model. Instead, the complete document must be deleted with a document deletion request. Consequently, a deletion of a single revision can fail, if the belonging document only contains this one revision as its only associated revision.
Example 1 – deletion by key attribute
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<search id="860cf6e4-3b27-406a-8c40-1a6a257d6675">
<searchAllRevisionsByKey>
<attribute name="customer_key_string">C10256</attribute>
</searchAllRevisionsByKey>
</search>
</ns2:operation>
Example 2 – deletion by document ID
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:operation xmlns:ns2="http://imafis.imaes.ecm.tsystems.com/" name="delete">
<search id="5d6935c3-2dc2-4eeb-b9dd-dd2c44ec88e2">
<searchAllRevisionsByDocumentId>
<documentId>ff00931c-ec65-4b15-a382-c18d3b55278e</documentId>
</searchAllRevisionsByDocumentId>
</search>
</ns2:operation>
Example 3 – deletion by revision ID
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:operation xmlns:ns2="http://imafis.imaes.ecm.tsystems.com/" name="delete">
<search id="64da268c-6f4a-496f-8ec1-b014094db1b0">
<searchByRevisionId>
<revisionId>c7352a85-2259-4cd1-9773-dafa1fcb6c09</revisionId>
</searchByRevisionId>
</search>
</ns2:operation>
Example 4 – deletion by queries
In this example several documents are deleted by two separate queries, which are independent from each other. The first query deletes all revisions that are characterized by an attribute name “status_str” with the value “obsolete”, whereas the second query deletes all documents which are characterized by an attribute name “item_category” with the value “LegacyFinancialRecord”.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:operation xmlns:ns2="http://imafis.imaes.ecm.tsystems.com/" name="delete">
<search id="4c899fdd-3653-499e-8fc7-e1d24116140d">
<searchByQueryToDelete>
<language>RAQL</language>
<query>restrict(ima:attribute:hasValue(
ima:metadata:status_str(ref('revisions')),
const('obsolete')),
galaxy(revisions))
</query>
<deletionObjectType>revisions</deletionObjectType>
</searchByQueryToDelete>
</search>
<search id="ed04b2b3-465b-4f7a-9e5c-b99aab53114f">
<searchByQueryToDelete>
<language>RAQL</language>
<query>restrict(ima:attribute:hasValue(
ima:metadata:item_category(ref('revisions')),
const('LegacyFinancialRecord')),
galaxy(revisions))
</query>
<deletionObjectType>documents</deletionObjectType>
</searchByQueryToDelete>
</search>
</ns2:operation>