Inheritance [ENT 22.1 IG]
Motivation
Metadata inheritance as described in Metadata Model [INT ENT XY.Z IG] is a powerful tool for sharing information between multiple entities in VidiCore.
Workflow
Fields
Metadata fields can be inherited from a collection to an item. To implement this on the VidiCore API, first define a metadata field with the attribute interitance
set to true:
POST /API/metadata-field/V3_StringTestInterit
<MetadataFieldDocument xmlns=http://xml.vidispine.com/schema/vidispine inheritance="true">
<type>string</type>
</MetadataFieldDocument>
Then set the field value on the collection:
PUT /API/collection/VX-7/metadata
<MetadataDocument xmlns="http://xml.vidispine.com/schema/vidispine">
<timespan start="-INF" end="+INF">
<field>
<name>V3_StringTestInterit</name>
<value>This value was set on the collection</value>
</field>
</timespan>
</MetadataDocument>
When you now retrieve metadata for an item in this collection you will automatically get the inherited metadata fields:
GET /API/item/VX-51?content=metadata
will return:
...
<field inheritance="Collection/VX-7" uuid="5902cf5f-bdad-4e5d-a527-bbd3a3ec9ff6" user="admin" timestamp="2018-03-14T13:47:43.046+01:00" change="VX-151">
<name>V3_StringTestInterit</name>
<value uuid="6701864f-c7f2-41a2-a12e-6567c263e447" user="admin" timestamp="2018-03-14T13:47:43.046+01:00" change="VX-151">This value was set on the collection</value>
</field>
...
If you set this field directly on the item the inherited value will be replaced:
...
<field uuid="b2129dc1-fda6-468e-9554-19f751950338" user="admin" timestamp="2018-03-14T13:50:45.046+01:00" change="VX-152">
<name>V3_StringTestInterit</name>
<value uuid="556dc463-1821-4f38-bd8c-f8953bfb4d18" user="admin" timestamp="2018-03-14T13:50:45.046+01:00" change="VX-152">This value was set on the item</value>
</field>
...
Changing the value on the collection will not affect the item any more.
Groups
Inheritance on field groups works the same way by setting the interitance
attribute on the group definition to true
.