Metadata projections

Vidispine supports two kinds of conversion tools for automating integration with other systems.

A metadata projection is a bidirectional XSLT transformation, meant to simplify integration of the Vidispine system with several third party systems.
The auto-projection is used to interact on metadata changes. For example, a change to one field may automatically trigger changes to other fields.


A projection consists of an incoming and an outgoing XSLT transformation.

  • The incoming projection transforms information in some format to a format supported by Vidispine.
  • The outgoing projection transforms information from Vidispine to a some other format.

When you use projections to transform item metadata then the outgoing projection will transform a MetadataListDocument and the incoming projection must produce a MetadataDocument.

Projection id

Projections are identified by a projection id of the regular expression form: [_A-Za-z][_A-Za-z0-9]*, maximum 32 characters. The projection is is case sensitive.


This is an example of valid XSL:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="" xmlns:vs="">

<xsl:template match="/">
  <item><xsl:value-of select="vs:MetadataListDocument/vs:item/@id"/></item>
    <xsl:for-each select="vs:MetadataListDocument/vs:item/vs:metadata/vs:timespan/vs:field">
        <name><xsl:value-of select="vs:name"/></name>
        <xsl:for-each select="vs:value">
          <value><xsl:value-of select="."/></value>

XSLT 2.0

New in version 4.2.

XSL Transformations version 2.0 are supported. Remember to specify the correct version in the stylesheet.

Job Information

New in version 4.2.

It is possible to access job information in the XSLT. This is done by adding the element <vs:vsXSLTVersion>2</vs:vsXSLTVersion> (xmlns:vs="") at the global level of the XSLT. When the xsltVersion option is set, the actual input to the transformation is no longer a MetadataListDocument, but an ExportInformationDocument. The new input contains two element:

The same as the old input to the transformation.
The current job, as outputted by /API/job/{jobid}?metadata=true.


The following example uses both XSLT v2.0 and the job information:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="" xmlns:vs="">
    <xsl:template match="/">
                <xsl:value-of select="vs:ExportInformationDocument/vs:job/vs:jobId/text()"/>
                <xsl:for-each select="vs:ExportInformationDocument/vs:job/vs:data[vs:key='custom']/vs:value/tokenize(.,',')">
                        <xsl:value-of select="."/>

Auto-projection rules

The auto projection is used to interact on metadata changes. For example, a change to one field may automatically trigger changes to other fields.

An AutoProjectionRuleDocument contains of four parts: <step>, <description>, <inputFilters> and <triggers>.


During the projection, a temporary structure called “MetadataWrapperDocument” is created for manipulation.

A MetadataWrapperDocument contains some of the fields below, depending on the values of inputFilters in AutoProjectionRuleDocument :

metadata The new incoming item metadata
oldMetadata The old metadata of the item
shapeMetadata The new incoming shape metadata
shape The shape list of the item
bulkyMetadata The new incoming bulky metadata of the item or shape
oldBulkyMetadata The old bulky metadata of the item

Projection steps

Multiple projection steps can be defined in different <step>, with their execution order, description, and script/XSLT respectively. Please note that <script> and <xslt> are used to hold JavaScript and XSLT respectively and each step can only contain one of them.


  <description>step1 description</description>
  <description>step2 description</description>

Input filters

Input filter defines which information should goes into the MetadataWrapperDocument during the projection. There are two kinds of filters: inputFilter and bulkyMetadataKeysRegex

Legal values of inputFilter are

oldMetadata Add old metadata of the item into the MetadataWrapperDocument
shapeDocument Add old shape metadata of the item into the MetadataWrapperDocument

All bulky metadata of the item whose key matches the pattern defined in bulkyMetadataKeysRegex will go into MetadataWrapperDocument. Multiple filters are allowed.



Rule triggers

Rule triggers defines what kinds of metadata update triggers this rule. They are:

itemMetadata Rule triggered if there is an item metadata update
shapeMetadata Rule triggered if there is a shape metadata update
bulkyMetadata Rule triggered if there is a bulky metadata update

Multiple triggers are allowed.


Auto-projection using JavaScript

A JavaScript projection is created by including the JavaScript in the script element of AutoProjectionRuleDocument. Vidispine is using Rhino as the JavaScript engine

A number of global variables are defined for the script to use:

  • api
  • helper
  • wrapper

The api object

Please see The api object.

The helper object

The helper object contains some convenient functions for generating a new metadata object.


Returns a new MetadataType.

helper.createMetadataTimespan(start, end)

Returns a new MetadataType.Timespan.

  • start (string) – The start timecode.
  • end (string) – The end timecode.

Returns a new MetadataGroupValueType.

  • name (string) – The name of the group.
helper.generateMetadataField(name, value)

Returns a new MetadataFieldValueType.

  • name (string) – The name of the field.
  • value (string) – The field value.

Translate a metadata object to a string.

  • metadataMetadataType

Write the value of obj.toString() to the server log.

The following example script

var metadata = helper.createMetadata();
var timespan = helper.createMetadataTimespan("0", "100");
var group = helper.createMetadataGroup("mrk_marker");
var field1 = helper.createMetadataField("mrk_color", "red");

will generate a metadata object like this:

<MetadataDocument xmlns="">
  <timespan start="0" end="100">

The wrapper object

The wrapper object represents the MetadataWrapperDocument during the projection. Below are available functions:


Get the new incoming item metadata.


Get the old metadata of the item.


Get the new incoming shape metadata.


Get the shape list of the item.


Get the new incoming bulky metadata of the item/shape.


Get the old bulky metadata of the item.


Get the old bulky metadata of the item.


Assign a new metadata to the wrapper document.

  • valueMetadataType

There are two ways to apply projection results to an item:

  1. If the rule is triggered by an item metadata update, one should manipulate the object reference returned by wrapper.getMetadata() directly. Because Vidispine will take that object as the projection result.

  2. If the rule is triggered by a shape metadata update or bulky metadata update, one should use the api object to update the item metadata:

    var metadata = helper.createMetadata();
    var xml = helper.metadataToStr(metadata);
    var id = wrapper.getTargetId();
    var result = api.path("item/" + id + "/metadata").input(xml, "application/xml").put();

Auto-projection using XSLT

A XSLT projection is created by including the XSL script in the xsl element of AutoProjectionRuleDocument.

The transformation result could either be a MetadataDocument or MetadataWrapperDocument. If the result is a MetadataWrapperDocument, the value of metadata element will be used as the projection result.

During a shape/bulky metadata update, one need to set up another step using the JavaScript api object to update the item metadata.


<xsl:stylesheet version="1.0" xmlns:xsl="" xmlns:vs="">
    <xsl:template match="/">
        <MetadataDocument xmlns="">
            <timespan start="-INF" end="+INF">
                <xsl:for-each select="vs:MetadataWrapperDocument/vs:metadata/vs:timespan/vs:field">
                            <xsl:value-of select="vs:name"/>
                        <value><xsl:value-of select="vs:value"/>+projection</value>