Custom Fields

Although Limecraft Flow already has a lot of built-in fields for storing clip metadata, it is often useful to be able to define your own fields, relevant to your use case.

Custom Fields can be used to attach custom metadata properties to Annotations or EditorialObjects in a single production.

CustomFieldsDescription: Setting up custom fields

The structure and presence of custom fields can be defined and limited by using CustomFieldsDescriptions. Each time a custom field is updated or created, that field is validated against the relevant CustomFieldsDescription.

Each production has two CustomFieldsDescriptions (one for Annotations, one for Collections) which are basically the blueprint of the custom fields of the annotations / collections in that production. Each time a custom field is updated or created on an annotation / collection, that field is validated against the CustomFieldsDescription of the production.

Property reference

Field Name Required Type Description Format

allowUndefinedFields

Boolean

clientSettings

Object

fields

Map of CustomFieldDescription

name

String

  • allowUndefinedFields: this property indicated whether custom fields may be created without them being referenced in the CustomFieldsDescription.

  • fields: the list of custom fields who are subject to validation/visualisation.

Example CustomFieldsDescription

An example with comments of such a CustomFieldsDescription is:

{
    //set allowUndefinedFields to true to allow custom fields which are not described in the CustomFieldsDescription
    allowUndefinedFields: false,

    fields: {
        episode_title: {
            userProperties: { // use for client-side only properties. The backend does nothing with these properties.
                prop1: 'value1',
                prop2: 'value2',
                prop3: 'value3'
            },
            order: 0.5,

            //The type is enforced by trying to cast/convert the values in the custom fields to the type denoted in the CustomFieldsDescription.
            // Available types are: STRING, TEXT, BOOLEAN, INTEGER, DATE, DOUBLE and LONG.
            type: 'STRING',

            //Value to display when the annotation has no value for this custom field
            defaultValue: 'no_episode',

            //Label to be shown in ui
            label: 'episode_title',

            //Description
            description: 'episode title',

            clipAllowed: true, // can this custom field exist on a MediaObjectAnnotation?
            subClipAllowed: true, // can this custom field exist on an annotation which is not a MediaObjectAnnotation?
            restrictedTo: [] // a list of funnels for which the custom field can exist. When empty, all funnels are allowed (that still respect clipAllowed / subClipAllowed).
        },
        clip_number: {
            userProperties: {
                prop1: 'value1'
            },
            order: 0.1,
            type: 'INTEGER',
            defaultValue: 1,
            label: 'clip_number',
            description: 'clip number',

            //A validation expression in the expression language (EL) is also available. Reference to the value itself is made by using #this.
            // If the validation fails, a 406 http status code is returned.
            validation: '#this > 0',
            clipAllowed: true,
            subClipAllowed: false
        },
        author: {
            description: 'Author',
            label: 'Author',
            skipWhiteListValidation: true,
            type: 'STRING',

			//It's possible to define blacklist and whitelist values, if the value isn't in the whitelist the the call will be rejected
			// unless the skipWhiteListValidation parameter is set. Whitelist validation will also be skipped when the array is empty.
            whiteList: [
                'Gimli'
            ],

			//When a value is added to the blacklist it's not possible to set the field to that value.
            blackList: [
                'Legolas'
            ],
            clipAllowed: false,
            subClipAllowed: true,
            restrictedTo: ['BookAnnotation', 'MagazineAnnotation'] // where BookAnnotation and MagazineAnnotation are funnels
        }
    }
}

Fields

The fields Map of a CustomFieldsDescription contains the definitions of the individual fields. It is a map from the name of a field to a CustomFieldDescription. The structure of the latter is given below.

Property Reference

Field Name Required Type Description Format

autocompleteExtractor

String

autocompleteUrl

String

blackList

List of string

clientConfig

Object

clipAllowed

Boolean

defaultValue

Object

description

String

hidden

Boolean

label

String

multiValued

Boolean

order

Double

double

readOnly

Boolean

requiresId

Boolean

restrictedTo

List of string

skipWhiteListValidation

Boolean

subClipAllowed

Boolean

thesaurus

String

type

String

Enum: STRING, BOOLEAN, INTEGER, DATE, DOUBLE, LONG, JSON, TEXT, FRAME, COMPOUND, FLOW_ID, FLOW_OBJECT,

userProperties

Map of string

validation

String

whiteList

List of string

  • order (double, 0.0): The order in which the custom fields need to be displayed.

  • userProperties (map<string,string>): Can be used by the client for storing extra information.

  • validation (string, ""): Expression which should evaluate to true for the custom field value (e.g this>2).

  • type (CustomFieldType, STRING): possible values: STRING, BOOLEAN, INTEGER, DATE, DOUBLE, LONG, JSON, TEXT - determines how the field will be indexed and stored.

  • defaultValue (Object): Can be used be the client, empty custom fields are not filled in with the default value by the server.

  • label (string): Label for visualisation by the client.

  • description (string): Additional information for the custom field.

  • multiValued (boolean): Denotes whether this is a multivalued custom field or expects a single value.

  • requiresId (boolean, false): When set, an id is expected for each value in the custom fields, typically used in combination with thesaurus. Each entry in the value list will have an id which corresponds to an id in the given thesaurus. The ids itself are not verified.

  • clientConfig (string): Can be used by the client for storing extra information.

  • whiteList (string[]): The list of allowed/possible values. Used in combination with skipWhiteListValidation. When skipWhiteListValidation = true, the list can be used as possible values by the client.

  • blackList (string[]): The list of forbidden values.

  • skipWhiteListValidation (boolean): Skips the validation of the whiteList.

  • autocompleteUrl (string): URL used by Limecraft Flow to accomplish autocomplete.

  • autocompleteExtractor (string): Used by Limecraft Flow to accomplish autocomplete.

  • thesaurus (string): ID of the thesaurus which is used for autocomplete.

  • readOnly (boolean, false): Indicator for Limecraft Flow to enable custom field editing.

  • hidden (boolean, false): Indicator for Limecraft Flow to show the custom field or not.

  • clipAllowed (boolean, true): When used with annotations, allow the defined custom field on the MediaObjectAnnotation.

  • subClipAllowed (boolean, true): When used with annotations, allow the defined custom field on all Annotations.

  • restrictedTo (string[]): Restrict the use of the custom field on the given funnels.