Skip to main content
Skip table of contents

How to Tell the Difference Between a Placeholder Item and an Item Without Shapes [VC UG]

It's not obvious how to tell the difference between a placeholder item and an item without shapes in Vidispine. You can solve this by querying the API and asking for the transient metadata Vidispine provides. 

It is possible to end up with an item containing no shapes, for example by deleting shapes on a previously populated item. It's not immediately obvious whether such an item is empty, or if it is actually a placeholder item. In both cases /item/{id}/shape returns an empty list. So how can you tell the difference? 

The answer lies in what's called transient metadata. This is metadata that is not persisted in the database but is instead calculated on the fly when it is requested. It contains, among other things, information about shapes. The metadata field we are interested in in this case is called __placeholder_shape_size

Let's say we have an item VX-7659, and /item/VX-7659/shape returns an empty list. To determine whether it is a placeholder item or just an item with all of its shapes deleted, we can make the following request: GET /item/VX-7659?content=metadata&field=__placeholder_shape_size. It returns the following document: 

CODE
<ItemDocument id="VX-7659" xmlns="http://xml.vidispine.com/schema/vidispine">
  <metadata>
    <revision>VX-1546589,VX-1546604,VX-1546594</revision>
    <timespan start="-INF" end="+INF">
      <field>
        <name>__placeholder_shape_size</name>
        <value>0</value>
      </field>
    </timespan>
  </metadata>
</ItemDocument> 

 

Here we can see that the item actually contains zero placeholder shapes, so this is an empty item! If it was a placeholder item, it would return a non-zero value. For more information about transient metadata, and what other fields are available, have a look at the documentation on transient metadata.

JavaScript errors detected

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

If this problem persists, please contact our support.