Setting up a Folder Structure

By Patrik - August 4, 2015 (Last updated: August 24, 2017)

Vidispine don’t care where files are located as all information about the files are stored in the database. However, the performance of a file system can be degraded if too many files are stored in the same directory.

This is why Vidispine have several options to create sub-folders for file storage, using either a pre-defined configuration in Vidispine, or by applying your own logic to create the folder structure. The options are documented in the API documentation here.

The simplest solution is to set the configuration property fileHierachy. This can be done for example by making a PUT request to /configuration/properties . See Configuration properties in the APIdocs.

with the following XML (config.xml).

<ConfigurationPropertyDocument xmlns="http://xml.vidispine.com/schema/vidispine">
  <key>fileHierarchy</key>
  <value>100</value>
</ConfigurationPropertyDocument>

You can also use Javascript to create your own logic for the file structure. This Javascript is stored as metadata on the actual storage, and can be set using PUT /storage/(storage-id}/metadata/filenameScript.

For example, if you want to set the filename according to the structure source-{storage-id}/{file-id}, you can use the following Javascript:

var l = "source-"+context.getStorage().getId()+"/"+context.getFileId();
if (context.getExtension() != null)
    l += "."+context.getExtension();

For more information about how you can control the filename using Javascript, see file naming in the Vidispine API documentation.

Categories

TechnologyVidispine