By default, Vidispine names new files according to site-id
-number**``.``**extension, all in one folder. This pattern can be overridden. This section describes three very different ways.
Putting all files in the same directory of a storage can cause degraded performance on some file systems. By setting the configuration property
fileHierarchy, the naming convention is changed to site-id
. extension. The number set in
fileHierarchy controls the size of number2. Example:
Note that the splitting into subdirectories is currently only done in one level, so no
The configuration property may be changed at any time, but old files will not be renamed.
A storage name rule dictates the filename that the file of a particular shape should have on a certain storage. Note that these rules doesn’t make sure a file is actually located on a storage, it just says what filename a file should have if it is located on that storage. Storage name rules are often used together with storage rules
The script will be invoked whenever a file needs to be created on the storage.
Setting the script
filenameScript to the storage. That is, the code is set using
If using curl, use
--data-binary instead of
-d to make sure all new-line characters are kept.
In the execution context of the script, there is a variable named
context, which has the following functions:
Returns a ShapeType (see Vidispine XSDs) object.
For example, to get the essence version, use
context.getShape().getEssenceVersion(). Can return
java.util.Map<String,String>. Can be
Returns an ItemType, which is the same output as
GET /item/(item-id)?content=metadata,shape,access,external. Can return
Returns a StorageType.
Returns a ComponentType. Can return
Returns the suggested extension for the file. Can return
Returns the file id of the file to be created.
java.util.Collection<String>of the shape tags of the shape the file belongs to.
Returns the original filename that was used when item was imported.
Returns the original filename that was used when component was created.
Most of the time this will return null, except when you want to split audio channels to separate files.
Returns the job id.
Returns the job type.
The script should return (last value) the file name of the file.
Existing file names
If the suggested file name is already in use on the Storage, the script will be called again, up to 10 times. The new invocations will run in the same context as the previous, so it is possible to store information, e.g. sequence numbers, to not repeat the same file name.
var l = "foobar-"+context.getStorage().getId()+"/"+context.getFileId(); if (context.getExtension() != null) l += "."+context.getExtension();