Skip to main content
Skip table of contents

UC Edit Collection Metadata [C IG]

Motivation

It is not uncommon that metadata related to a collection is updated. This could be metadata defining the current status of the collection within a workflow or content descriptions just to mention some examples.

When doing updates to metadata in VidiCore the changes are stored in a change set. Looking at the collection the current revision of the metadata is essentially the superset of all change sets.

Example

In order to have a metadata field for our collection, we first have to create the field within the system.

PUT /metadata-field/sport_type

CODE
<MetadataFieldDocument xmlns="http://xml.vidispine.com/schema/vidispine">
  <type>string</type>
</MetadataFieldDocument>

Where sport_type is the name of our metadata field which we define to be of the type string .

Once we have the field we can update the field for our collection by doing a PUT request to the collection

PUT /collection/VX-1/metadata

CODE
<MetadataDocument xmlns="http://xml.vidispine.com/schema/vidispine">
  <timespan start="-INF" end="+INF">
    <field> 
      <name>sport_type</name> 
      <value>golf</value> 
    </field> 
  </timespan>
</MetadataDocument>

In this example we put the metadata field with a timespan covering the entire collection, but it could be set for a specific timespan as well. The value has been set to golf.

If we have a look at the collection via

GET /collection/VX-1?content=metadata

We can see that the field has been updated

CODE
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<CollectionDocument xmlns="http://xml.vidispine.com/schema/vidispine">
    <loc>http://localhost:8080/API/collection/VX-46/</loc>
    <id>VX-1</id>
    <metadata>
        <revision>VX-302,VX-301,VX-303</revision>
        <timespan start="-INF" end="+INF">
            <field uuid="eda0c9d6-6dc7-45da-9fad-b720cae53ecd" user="system" timestamp="2022-05-16T10:58:30.155+02:00" change="VX-301">
                <name>created</name>
                <value uuid="552f2e9b-93a5-4d21-9569-c9f1eb9f854e" user="system" timestamp="2022-05-16T10:58:30.155+02:00" change="VX-301">2022-05-16T08:58:29.247Z</value>
            </field>
            <field uuid="57c05bd4-735f-4aed-95ec-a187caa42d73" user="system" timestamp="2022-05-16T10:58:30.155+02:00" change="VX-301">
                <name>collectionId</name>
                <value uuid="c1b38cf9-1ffc-44d3-9f3b-39b5c714d829" user="system" timestamp="2022-05-16T10:58:30.155+02:00" change="VX-301">VX-46</value>
            </field>
            <field uuid="56429f88-d480-4fcc-a418-5107b2b04aeb" user="admin" timestamp="2022-05-16T11:09:42.172+02:00" change="VX-303">
                <name>sport_type</name>
                <value uuid="e12fc927-be77-4b69-b897-0511fe61c44d" user="admin" timestamp="2022-05-16T11:09:42.172+02:00" change="VX-303">golf</value>
            </field>
            <field>
                <name>__metadata_last_modified</name>
                <value>2022-05-16T11:09:42.172+02:00</value>
            </field>
            <field>
                <name>__user</name>
                <value>admin</value>
            </field>
            <field>
                <name>user</name>
                <value>admin</value>
            </field>
            <field>
                <name>__parent_collection_size</name>
                <value>0</value>
            </field>
            <field>
                <name>__child_collection_size</name>
                <value>0</value>
            </field>
            <field>
                <name>__items_size</name>
                <value>0</value>
            </field>
            <field>
                <name>__ancestor_collection_size</name>
                <value>0</value>
            </field>
            <field>
                <name>__folder_mapped</name>
                <value>false</value>
            </field>
        </timespan>
    </metadata>
</CollectionDocument>

Resources

For more information on updating collection metadata, please refer to the following section

https://apidoc.vidispine.com/latest/ref/metadata/metadata.html#manipulating-change-sets

How to

More information on metadata-fields can be found here

https://apidoc.vidispine.com/latest/item/metadata/metadata.html#item-metadata

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.