Tibigen Digital Repository - REST API - 3.52
Tibigen Digital Repository - REST API - 3.52
1. General
This is official Tibigen Digital Repository REST API documentation. The document describes all web-
services, data formats and authentication methods needed to integrate with Tibigen Digital Repository.
A significant part of functionality provided by TDR GUI is internally implemented using this REST API.
The REST API uses mostly XML format for data representation.
1.1.1. Timecode
Timecode represents single point in video or audio time-line. The timecode syntax is as in image
below:
1.1.2. Datetime
Datetime represents local date and time on machine where TDR is installed. The datetime syntax is as
in image below:
1.1.3. UUID
A universally unique identifier (UUID) is an identifier standard used in software construction. A UUID
is simply a 128-bit value, i.e. de305d54-75b4-431b-adb2-eb6b9e546014. More information about UUID
1
Tibigen Digital Repository - REST API
REST API can provide error description in selected language. For now, English and Polish are
supported.
1.2.1. Response
Example of successful response representation
<response status="SUCCESS">
<language default="true">EN</language>
</response>
<response status="FAILED">
<error code="AuthenticationFailedException">
<description lang="en">Authentication failed.</description>
</error>
</response>
1.2.2. Error
Example of representation
<error code="AuthenticationFailedException">
<description lang="en">Authentication failed.</description>
</error>
2
Tibigen Digital Repository - REST API
1.2.3. Description
Example of representation
1.3. Values
Value object is a very simple object able to contain single value and its name. Values are used across
entire system when simple data need to be returned from web-service call, e.g. id of newly created
object.
Values can be packed into lists which are represented as Value List objects. Value lists are used where
multiple but simple values need to be returned.
1.3.1. Value
Example of representation
<value name="test_name">test_value</value>
3
Tibigen Digital Repository - REST API
Example of representation
<value-list>
<value name="test_name">test_value</value>
</value-list>
1.4. Languages
A language object represents a single language in the system. The object stores two letter code of
represented language and it is used in multiple places in the system where multi-language content
occurs, for example in metadata or dictionaries modules.
At the same time, only one language can be default. This means that when somebody requests multi-
language data and does not provide language in which these data should be returned, system will
return data in default language.
Default language is defined during the installation phase, and can be later changed. However,
changing language is a very demanding operation - all data in new default language must exist in the
system. As an example, let say we have dictionary with label in EN. EN is our default language. When
we want other defined language, e.g. PL to be default, our previously mentioned dictionary must have
PL label and PL version of all the terms.
1.4.1. Language
Example of representation
<language default="true">EN</language>
xml value string The two letter code of this language as in ISO 639.
4
Tibigen Digital Repository - REST API
Example of representation
<languages>
<language default="true">EN</language>
<language default="false">PL</language>
</languages>
Request
GET /languages
Authorization
This request does not require authentication.
Response
If successful, the response status code is 200 OK and body contains Language List object wrapped in
Response object.
Request
GET /languages/default
Authorization
This request does not require authentication.
Response
If successful, the response status code is 200 OK and body contains Language object wrapped in
Response object.
5
Tibigen Digital Repository - REST API
Request
POST /languages
In the request body, supply a Language object with at least required properties.
Authorization
This request requires authorization with permission manage.language.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
Request
PUT /languages/{name}
Path parameters
In the request body, supply a Language object with default property set to true.
Authorization
This request requires authorization with permission manage.language.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
6
Tibigen Digital Repository - REST API
Errors
DefaultLanguageDataMissing 400 Cannot set this language to default because there are objects
Exception in the system not having representations in this language.
Request
DELETE /languages/{name}
Path parameters
Authorization
This request requires authorization with permission manage.language.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
LanguageInUseException 400 Other system components use this language and therefore
language cannot be deleted.
7
Tibigen Digital Repository - REST API
1.5. Labels
Many objects in TDR have name property. This property contains user-defined name that helps with
identification of the objects. However, restrictions imposed on these names (see String Identifier) do
not allow user to create user-friendly descriptions. Other useful feature, which is not possible with
name property is to give objects names in different languages. The name property can contain only
one value, so only one language representation of the name can be stored. To solve above problems,
TDR introduces objects called labels.
Labels allow users to store in the system any textual value as a description of the object. Single object is
able to have multiple labels, each in different language. For the moment, objects like dictionaries,
metadata entry types and grouping criteria support this mechanism.
1.5.1. Label
Example of representation
xml value string A longer description of object to which label is attached. For
now, only metadata entry types use this property.
Example of representation
<labels>
<label id="1" lang="EN" value="Duration">Video duration in minutes.</label>
<label id="2" lang="PL" value="Czas trwania">Czas trwania wideo w minutach.</label>
</labels>
1.6. Locks
A lock object is used to explicitly block operations on objects in TDR. Every lock has object-type and
8
Tibigen Digital Repository - REST API
There are two type of locks: READ_WRITE and WRITE. Each of them forbid different operation on
locked objects. Single locked object can have multiple WRITE locks. These locks block write operation
(mostly update and delete). If object has WRITE lock, this probably means that some other component
is using that object. READ_WRITE locks, in turn, can occur only once on locked objects. They are
blocking all operations on target object so any other component cannot use it. READ_WRITE locks are
mostly used when some object is being deleted and deletion process is not an immediate operation.
Every component that creates lock is obliged to remove that lock after it will stop using locked object.
In case where component does not delete locks, system will automatically reclaim locked object by
expiring the locks which block it. For this purpose, every lock in the system has so-called lifetime. The
lock’s lifetime is a time interval between lock’s creation and lock’s expiration and depends on the type
of object that it blocks:
• FILE and SERVICE - infinite lifetime, these locks will never expire,
1.6.1. Lock
Example of representation
<lock id="1"
lock-type="READ_WRITE"
object-type="FILE"
object-id="1"
inserted="2015-12-04 14:28:30"
user="admin" />
9
Tibigen Digital Repository - REST API
object-id string The identifier of locked object e.g. metadata item UUID, file instance id.
Required.
Example of representation
<locks total="2">
<lock id="1" lock-type="READ_WRITE" object-id="1" object-type="FILE" inserted="2015-12-04
14:28:30"
user="admin"/>
<lock id="2" lock-type="WRITE" object-id="2" object-type="FILE" inserted="2015-12-04
14:29:49"
user="admin"/>
</locks>
10
Tibigen Digital Repository - REST API
Request
GET /locks?user={user}&lock-type={type}&object-type={type}&object-
id={id}&page={page}&size={size}
Query parameters
size integer The size of the page of results. Default value is 10.
Authorization
This request requires authentication.
Response
If successful, the response status code is 200 OK and body contains Lock List wrapped in Response
object.
Request
GET /locks/{id}
Path parameters
11
Tibigen Digital Repository - REST API
Authorization
This request requires authentication.
Response
If successful, the response status code is 200 OK and body contains Lock object wrapped in Response
object.
Errors
Request
POST /locks
In the request body, supply a Lock object with at least required properties.
Authorization
This request requires authentication.
Response
If successful, the response status code is 200 OK and body contains Value object with id of newly
created lock, wrapped in Response object.
Errors
12
Tibigen Digital Repository - REST API
Request
DELETE /locks/{id}
Path parameters
Authorization
If creator of the lock tries to delete it, only authentication is required. Otherwise, request requires
authorization with permission manage.lock.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
1.7. Properties
Properties are simple mechanism for storing key-value configuration options for different components
of the system. Each property contains a name and a value. Furthermore, you can mark the chosen
properties as protected, which means that additional permission will be needed to view these
properties.
Other system, integrating with TDR, can use this API to store relevant configuration. This ease
configuration, providing single place with all possible options to change. A great example of system,
that stores its configuration in properties and uses other parts of REST API is TDR GUI.
13
Tibigen Digital Repository - REST API
<properties>
<property name="solr.url" protected="false" value="http://localhost:8983/solr"/>
<property name="job-daemon.url" protected="false" value="http://localhost:8080/job-
daemon"/>
<property name="file.accept_delete" protected="true" value="true"/>
<property name="meta.accept_delete" protected="true" value="true"/>
<property name="job-daemon.notifications.statuses" protected="false" value=
"FAILED,WAITING_FOR_APPROVAL"/>
<property name="gui.gallery.images" protected="false" value="Klatki kluczowe,Plakaty,Logo
"/>
<property name="meta.schema_order.metadata_item" protected="false" value=
"film;series;person"/>
<property name="search.fold_to_ascii" protected="false" value="false"/>
<property name="mail.password" protected="true" value="password"/>
<property name="mail.default.recipent" protected="true" value=
"[email protected],[email protected],[email protected]"/>
<property name="mail.default.recipent.lang" protected="true" value="PL"/>
<property name="mail.send" protected="true" value="true"/>
<property name="mail.smtp.host" protected="true" value="smtp.tibigen.com"/>
<property name="mail.smtp.port" protected="true" value="465"/>
<property name="mail.user" protected="true" value="mail_user"/>
<property name="mail.user.address" protected="true" value="[email protected]"/>
<property name="tsm.library.name" protected="false" value="TS3310"/>
<property name="tsm.password" protected="true" value="admin"/>
<property name="tsm.device_class" protected="false" value="LTOCLASS"/>
<property name="tsm.storage.pool.disk" protected="false" value="SEQ_DISK"/>
<property name="tsm.user" protected="true" value="admin"/>
<property name="job-daemon.job-types" protected="false" value="CHECK_ACCESS
,CLEAR_DIRECTORY ,COPY_FILES,DELETE ,DELETE_ITEM,DUMMY_JOB,EXPORT
,GENERATE_DESCRIPTOR,IMAGE_CONVERT ,IMPORT ,RENAME_FILE
,RESOLVE_PATH,RETRIEVE_TECHNICAL_METADATA ,SEARCH_VIDEO
,SELECT_SPECIFICATION,SET_FIELD
,SPACE_CHECKER,STORAGE_CLEANER,TRANSCODE,TRANSFER,TSM_ARCHIVE ,TSM_DELETE
,TSM_INSERT_TAPES,TSM_REMOVE_TAPES ,TSM_RETRIEVE ,TSM_SYNCHRONIZE,UNZIP
,VALIDATE ,ZIP"/>
<property name="search.perspective" protected="false" value=
"teaser|attr.file_type,attr.item_type,field.teaser_title;series|attr.file_type,attr.item_type,field.s
eries_title,field.series_creator,field.series_peremiere,field.series_genre;season|attr.file_type,at
tr.item_type,field.season_title;episode|attr.item_type,field.episode_title;movie|attr.file_type,at
tr.item_type,field.movie_title,field.movie_year_of_production;"/>
14
Tibigen Digital Repository - REST API
file.accept_delete true boolean If true, file deleting processes will require additional
acceptance. Default value is false.
file.exclude false string List of files, separated by :, defining files and directories,
which will be ignored during Import process and List
content on storage. Java regular expressions should be used
as excluded file name.
jd.housekeeping false boolean If true, job daemon will be automatically deleting finished
queues after time period configured withing
jd.housekeeping.age_in_days. Default value is true.
jd.housekeeping.ag false integer Number of days after which job daemon will automatically
e_in_days delete finished queue. Default value is 30.
jd.worker.reconnec false integer Number of reconnects after which non unresponsive worker
t_limit will be unregistered. Default value is 5.
15
Tibigen Digital Repository - REST API
meta.accept_delete true boolean If true, item deleting process will require additional
acceptance. Default value is false.
job- false string List of job statuses which will trigger e-mail notifications.
daemon.notificatio Statuses are separated by commas. Available statuses are: -
ns.statuses FINISHED - jobs finished without errors,
- FAILED - failed jobs,
- WAITING_FOR_APPROVAL - jobs waiting for acceptance,
gui.gallery.images false string List of names of asset types, which defines order of asset
types in gallery. Names are separated by commas. To know
more about gallery, see User Guide documentation.
ldap false boolean If true, system will be using ldap as second source for
authentication.
ldap.base false string Base distinguished name (DN) for LDAP search.
ldap.groups false string List of names of LDAP groups, which members can
authenticate in TDR. For each group will be created role
with the same name. Group’s names are separated by
semicolons.
ldap.login.attribute false string Name of LDAP attribute, which will be used for querying
LDAP users.
ldap.url false string Address of LDAP server. Preferred port is 3268 (for querying
in global catalog) as current implementation does not
support LDAP Referrals.
ldap.user.dn false string LDAP user distinguished name (DN), which will be used to
synchronize users and roles with LDAP server.
ldap.user.password true passwor LDAP user password, which will be used to synchronize
d users and roles with LDAP server.
16
Tibigen Digital Repository - REST API
mail.user true string Login to e-mail account used by system to send notifications
to the e-mail addresses defined in property
mail.default.recipent.
mail.smtp.host true string Host of SMTP server used by system for e-mail notifications.
mail.smtp.port true integer Port of SMTP server used by system for e-mail notifications.
meta.schema_orde false string List of names of item types, which defines order of item
r.metadata_item types in menu Add item in GUI. Names are separated by
semicolons. More information can be found in User Guide
documentation.
notify.retention.da false integer System TDR will be sending e-mail notifications about items
ys containing files that will be outdated in given time in days. If
number of days is set to '0', notification will not be send.
search.fold_to_ascii false boolean If true, system will replace polish diacritics to most similar
equivalents from ASCII encoding in search suggestions.
tsm.device_class false string Device class of tapes in TSM. Used while creating new
storage pool.
17
Tibigen Digital Repository - REST API
1.7.1. Property
Example of representation
Example of representation
<properties>
<property name="solr.url" protected="false" value="http://localhost:8983/solr"/>
</properties>
Request
GET /properties?protected={protected}
Query parameters
18
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission view.config.
Response
If successful, the response status code is 200 OK and body contains Property List object wrapped in
Response object.
Request
GET /properties/{property-name}
Path parameters
Authorization
If property is protected, authorization with permission view.config.protected is required. Otherwise,
required permission is view.config.basic.
Response
If successful, the response status code is 200 OK and body contains Property object wrapped in
Response object.
Errors
19
Tibigen Digital Repository - REST API
Request
POST /properties
In the request body, supply a Property object with at least required properties.
Authorization
This request requires authorization with permission manage.config.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
InvalidPropertyException 400 The name of property is not specified or is empty. The value
of property is not specified.
PropertyAlreadyExistsExcepti 409 Property with the same name is already in the system.
on
Request
PUT /properties/{property-name}
Path parameters
20
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission manage.config.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
InvalidPropertyException 400 The name of property is not specified or is empty. The value
of property is not specified.
Request
DELETE /properties/{property-name}
Path parameters
Authorization
This request requires authorization with permission manage.config.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
21
Tibigen Digital Repository - REST API
1.8.1. URI
Example of representation
<uri>http://10.0.0.43:81/u01/tdr/files/KeyFrames/2015/11/27/fg_66/images/snowboard_0.jpg</ur
i>
Example of representation
<uri-list>
<uri>http://10.0.0.43:81/u01/tdr/files/KeyFrames/2015/11/27/fg_66/images/snowboard_0.jpg</
uri>
</uri-list>
The second authentication method use token to give temporary access to REST API. Firstly, token need
to be generated by authenticating via password credentials. Then, user can use this token in
Authorization header to authenticate itself in the system. After some time (more details in Tokens)
22
Tibigen Digital Repository - REST API
token will expire and to continue using REST API, user have to request for new token.
TDR stores password credentials in own database, which is default source for authentication.
Additionally TDR supports LDAP protocol and can use external LDAP server as second source for
authentication. In this case every LDAP user, that is member of configured LDAP group, can
successfully authenticate in TDR. System, in LDAP synchronization process, adds roles based on
configured LDAP groups and assigns LDAP users this this roles.
REST API uses role based authorization mechanism. The roles contain permissions, that define what
functions of TDR can be executed by users having these roles. Permission can be dynamically added
and removed from roles. Multiple users can have multiple roles and multiple roles can be attached to
multiple users. If one user has multiple roles, he/she effectively has sum of all permissions contained
in individual roles.
Due to the extensive customization options of TDR content, REST API introduced additional level in
authorization mechanism - permission requirements. In most cases, permission gives access to some
set of functionality. This access can be narrowed down by adding requirements to it. If user wants to
access object in the system, the requirement is checked for that object and when requirement is met,
permission will be granted. For more information about permission requirements see Permission
Requirements.
2.1. Tokens
Tokens in REST API take part in authentication process. For now, there is only one type of token -
access token which, when generated, gives ability to authenticate for a limited period of time without
revealing a password. The access token is closely attached to the user for whom token was generated.
To generate token, client must authenticate via password credentials (login and password) to endpoint
POST /tokens. In return, system will send Access Token object that contains token string and a number
of seconds, after which this token will no longer be valid. The token can be used by the client, which
generated it, for subsequent requests to minimize exchange of plain text password through the
network or can be passed to another, potentially insecure client.
To authenticate via token, client has to send Authorization header with value Bearer TOKEN, where
TOKEN is previously acquired access token string e.g.:
23
Tibigen Digital Repository - REST API
Example of representation
<access-token expires-in="86400">55417b4f-c643-43b9-b4df-38be5d5c5bad</access-token>
Request
POST /tokens
Authorization
This request requires authentication via login and password credentials.
Response
If successful, the response status code is 200 OK and body contains Access Token object wrapped in
Response object.
Errors
Request
DELETE /tokens
24
Tibigen Digital Repository - REST API
Headers
Authorization string A value of this header should contain Bearer TOKEN where
TOKEN is token to delete.
Authorization
This request requires authentication via token.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
2.2. Roles
The role object represents some set of system functionality, that can be dynamically modified by
adding or removing role’s permissions. The system comes with two predefined roles: admin and
system. These roles contain every possible permission and are attached to corresponding predefined
users.
2.2.1. Role
Example of representation
<role name="super-admin"
description="super admin role"
version="0"
prototype="admin" />
prototype string A name of a prototype role. The prototype role can be specified
on role creation - newly created role will have all permissions
copied from the prototype role.
25
Tibigen Digital Repository - REST API
Example of representation
<roles>
<role name="admin" description="default admin role" version="0"/>
<role name="test" description="test role" version="3"/>
</roles>
Request
GET /roles
Authorization
This request requires authentication only.
Response
If successful, the response status code is 200 OK and body contains Role List object wrapped in
Response object.
Request
GET /roles/{name}
Path parameters
Authorization
This request requires authentication only.
26
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains Role object wrapped in Response
object.
Errors
Request
POST /roles
In the request body, supply a Role object with at least required properties.
Authorization
This request requires authorization with permission manage.permission.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
Request
27
Tibigen Digital Repository - REST API
PUT /roles/{name}
Path parameters
In the request body, supply a Role object with updated properties. A name property cannot be updated
and therefore is ignored.
Authorization
This request requires authorization with permission manage.permission.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
OptimisticLockingException 409 The role’s version does not match current version.
Someone already modified the role.
Request
DELETE /roles/{name}
Path parameters
Authorization
This request requires authorization with permission manage.permission.
28
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
Request
GET /roles/{name}/permissions?detailed={detailed}
Path parameters
Query parameters
Authorization
This request requires authentication only.
Response
If successful, the response status code is 200 OK and body contains Permission List object wrapped in
Response object.
Errors
29
Tibigen Digital Repository - REST API
Request
POST /roles/{name}/permissions
Path parameters
In the request body, supply a Permission object with at least required properties.
Authorization
This request requires authorization with permission manage.permission.
Response
If successful, the response status code is 200 OK and body contains Value object with id of newly
created permission wrapped in Response object.
Errors
2.3. Users
A user object represents person or system which communicates with REST API. The user object has
basic personal data properties and properties related to authentication mechanism such as password.
Each user can have multiple roles, which define what user can do in the system.
In many places, TDR refers to the user using its login i.e. in a property created-by of Job Queue object.
2.3.1. User
30
Tibigen Digital Repository - REST API
<user
login="john"
password="secret"
first-name="John"
last-name="Doe"
email="[email protected]"
created="2013-11-09 23:14:48"
last-active="2015-08-18 10:15:54"
blocked="false"
ldap="false"
version="1">
<properties>
<property name="search.results" value="10"/>
</properties>
</user>
login string The unique identifier of this user. The login must conform to
regex [a-zA-Z][\\w]+. Required.
email string An email address, which will be used to send notifications from
TDR. Required.
31
Tibigen Digital Repository - REST API
roles Role List A list of roles to which this user belongs. See Role object.
properties Property List A list of user specific configuration properties. See User Property
object.
Example of representation
Example of representation
<users>
<user login="john"/>
</users>
Request
GET /users?page={page}&size={size}&detailed={detailed}
Query parameters
32
Tibigen Digital Repository - REST API
page integer The number of page of results to return. If not specified, web-service
returns all users.
size integer The size of the page of results. Default value is 10.
detailed boolean If true, web-service returns detailed representation of each user in a list.
Default value is false.
Authorization
If detailed query parameter is true, this request requires authorization with permission view.user.
Otherwise, authorization with list.user is required.
Response
If successful, the response status code is 200 OK and body contains User List object wrapped in
Response object.
Response
GET /users/{login}
Path parameters
Authorization
This request requires authorization with permission view.user.
Response
If successful, the response status code is 200 OK and body contains User object wrapped in Response
object.
33
Tibigen Digital Repository - REST API
Request
POST /users
In the request body, supply a User object with at least required properties.
Authorization
This request requires authorization with permission add.user.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
InvalidUserLoginException 400 The user’s login is not set or does not conform to regex
[a-zA-Z][\\w]+.
Request
PUT /users/{login}
Path parameters
The password property can be omitted, if client does not want to update user’s password.
Authorization
This request requires authorization with permission update.user.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
34
Tibigen Digital Repository - REST API
Request
DELETE /users/{login}
Path parameters
Authorization
This request requires authorization with permission delete.user.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Request
GET /users/{login}/roles
Path parameters
Authorization
This request requires authorization with permission view.user.
Response
If successful, the response status code is 200 OK and body contains Role List object wrapped by
Response object.
35
Tibigen Digital Repository - REST API
Request
POST /users/{login}/roles
Path parameters
login string A login of the user who will receive new role.
Authorization
This request requires authorization with permission update.user.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Request
DELETE /users/{login}/roles/{role-name}
Path parameters
login string A login of the user from whom role will be detached.
Authorization
This request requires authorization with permission update.user.
36
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Request
GET /users/{login}/permissions?detailed={detailed}
Path parameters
Query parameters
Authorization
This request requires authorization with permission view.user.
Response
If successful, the response status code is 200 OK and body contains Permission List object wrapped in
Response object.
2.4. Permissions
A permission defines action that can be executed on one object or set of objects over REST API. The
type of action and information about object are coded into permission’s name. The name may consist
of three segments separated by dots:
<action>.<object-type>.<object-id>
<object-id> can be ommited if permission applies to all objects of given type. The permission can be
also generalized by setting <action> to *, and therefore applied to all actions on given type. The name
of the permission is context specific and thus is described in Authorization sections of individual web-
37
Tibigen Digital Repository - REST API
2.4.1. Permission
Example of simple representation
<permission id="1"
name="manage.field.title"
created="2015-12-04 15:35:31" />
<permission id="1"
name="manage.field.title"
created="2015-12-04 15:35:31">
<permission-requirements />
</permission>
Example of representation
<permissions>
<permission id="1"
name="manage.group.permission_group"
created="2015-12-04 15:35:31" />
</permissions>
38
Tibigen Digital Repository - REST API
Request
GET /permissions/{id}
Path parameters
Authorization
This request requires authentication only.
Response
If successful, the response status code is 200 OK and body contains Permission object wrapped in
Response object.
Errors
Request
DELETE /permissions/{id}
Path parameters
Authorization
This request requires authorization with permission manage.permission.
39
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
Request
GET /permissions/{id}/requirements
Path parameters
Authorization
This request requires authentication only.
Response
If successful, the response status code is 200 OK and body contains Permission Requirement List object
wrapped in Response object.
Errors
40
Tibigen Digital Repository - REST API
Request
POST /permissions/{id}/requirements
Path parameters
In the request body, supply a Permission Requirement object with at least required properties.
Authorization
This request requires authorization with permission manage.permission.
Response
If successful, the response status code is 200 OK and body contains Value object with id of newly
created requirement wrapped in Response object.
Errors
1. User wants to view some object of specific type and id. The action in this case is view.
2. System loads roles of that user and from these roles retrieves all permissions.
3. System iterates over permissions and if it finds permission with requirements, it tries to verify that
41
Tibigen Digital Repository - REST API
requirement using verification mechanism specific for the context of web-service call. The
verification mechanism are described later.
4. When all permissions are verified, system checks if there is at least one permission giving access to
view previously mentioned object. If found, permission is granted.
1. Asset Type Requirement Verifier - verifies requirements concerning only the files and is used
mostly in web-services operation on files.
2. Metadata Content Based Requirement Verifier - verifies requirements concerning only metadata
entries i.e. items, groups and fields.
3. Process Requirement Verifier - verifies requirements concerning processes and objects on which
those processes operate on. Used in web-services managing processes and jobs.
<permission-requirement id="1"
required-entity-type="field"
required-entity-id="status"
required-value="open"
inverted="false" />
required-entity-type string The type part of entity selector that selects entities for
requirement verification. A value of this property depends on
requirement verification mechanism used:
- for Asset Type Requirement Verifier allowed value is asset
which checks asset types,
- for Metadata Content Based Requirement Verifier allowed
values are item-attribute which checks metadata item attribute
and field which checks field value,
- for Process Requirement Verifier allowed values are asset which
checks type of asset participating in process and item which
checks type of item participating in process.
Required.
42
Tibigen Digital Repository - REST API
required-entity-id string The id part of entity selector that selects entities for requirement
verification. A value of this property depends on required-entity-
type and can be for example concrete asset type id, field value,
item attribute value or item type. Required.
required-value string The expected value of selected entity. If any of the selected
entities have this value, permission requirement is considered as
met. If this value is not specified, requirement is met if at least
one entity was selected.
Example of representation
<permission-requirements>
<permission-requirement id="1"
required-entity-type="field"
required-entity-id="status"
required-value="open"
inverted="false" />
</permission-requirements>
Request
DELETE /requirements/{id}
Path parameters
43
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission manage.permission.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
3. Metadata
In TDR, to add textual data you need to create an item, which is set of metadata based on schema
configured in the system. Schema defines internal structure of item and external relationships
between items. Structure of item can consist of fields and groups, where field contains single value and
group can contain fields and other groups. This means that item can represent any hierarchical
metadata. Furthermore, system allows to create hierarchy of items based on parent-child relationships
defined in schema. Each item can have only one parent item and unlimited number of children items.
Items, groups and fields can have various properties, which are included in their metadata types.
These types can be treated as classes in Object Oriented Programming. For example, a field type
defines whether field is multi-value or not.
Fields are the most important part of metadata because they include actual data. TDR supports couple
of data kinds in the field, such as: textual value, reference to item or reference to term in dictionary
which is supported as a common data structure. The system allows to define any number of
dictionaries and freely use them in fields.
Apart from item hierarchy, the system allows also to create collections of items, which can be used to
execute batch processes on multiple items such as deleting of items or exporting of files from items.
3.1. Dictionaries
A dictionary object represents dictionary data structure which can contain any number of terms. The
dictionaries can be used later in metadata schemas to limit set of possible field values.
Dictionaries are multilingual structures and therefore can contain terms in any language defined in
TDR.
44
Tibigen Digital Repository - REST API
3.1.1. Dictionary
Example of simple representation
<dictionary uuid="7012f478-82cf-4165-bd9e-1a9a389c6f7e"
name="countries" />
<dictionary uuid="7012f478-82cf-4165-bd9e-1a9a389c6f7e"
name="countries"
auto-sorted="true"
version="1">
<labels>
<label id="1" lang="EN">Countries</label>
<label id="2" lang="PL">Kraje</label>
</labels>
<terms>
<term uuid="d655d035-a44b-4336-abcc-885db4a78f03">
<entry id="1" lang="EN" value="Poland">Republic of Poland</entry>
<entry id="2" lang="PL" value="Polska">Rzeczpospolita Polska</entry>
</term>
</terms>
</dictionary>
auto-sorted boolean If true, system will sort terms in natural order. The sorting
occur only if client will be retrieving dictionary in one
specific language version. Default value is false.
45
Tibigen Digital Repository - REST API
Example of representation
<dictionaries total="138">
<dictionary name="countries" uuid="eb357001-0ec7-4990-8017-be5c458971cc"/>
</dictionaries>
3.1.3. Term
A term object is an abstract representation of word. Technically speaking, term is a container of Term
Entry objects, which represent actual word in specific languages.
Example of representation
<term uuid="d655d035-a44b-4336-abcc-885db4a78f03">
<entry id="1" lang="EN" value="Poland">Republic of Poland</entry>
<entry id="2" lang="PL" value="Polska">Rzeczpospolita Polska</entry>
</term>
46
Tibigen Digital Repository - REST API
Example of representation
<terms>
<term uuid="d655d035-a44b-4336-abcc-885db4a78f03">
<entry id="1" lang="EN" value="Poland">Republic of Poland</entry>
<entry id="2" lang="PL" value="Polska">Rzeczpospolita Polska</entry>
</term>
</terms>
Example of representation
Request
GET /dictionaries?name={name}&page={page}&size={size}&detailed={detailed}
Query parameters
name string If specified, returns only dictionaries with specified name. Due to the
fact that the name of the dictionary is unique, returned list will always
contain zero or one element.
47
Tibigen Digital Repository - REST API
page integer The number of page of results to return. If not specified, web-service
returns all dictionaries.
size integer The size of the page of results. Default value is 10.
Authorization
This request requires authorization with permission list.dictionary.
Response
If successful, the response status code is 200 OK and body contains Dictionary List object wrapped in
Response object.
Request
GET /dictionaries/{uuid}
Path parameters
Headers
Authorization
This request requires authorization with permission view.dictionary.UUID where UUID is UUID of the
dictionary to get.
48
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains Dictionary object wrapped in
Response object.
Errors
Request
POST /dictionaries
In the request body, supply a Dictionary object with at least required properties.
Authorization
This request requires authorization with permission add.dictionary.
Response
If successful, the response status code is 200 OK and body contains Value object with UUID of newly
added dictionary wrapped in Response object.
Errors
DuplicatedTermEntryExcepti 400 There are multiple term entries in the same language.
on
49
Tibigen Digital Repository - REST API
DuplicatedTermException 400 There are at least two terms with equal value.
Request
PUT /dictionaries/{uuid}
Path parameters
Authorization
This request requires authorization with permission update.dictionary.UUID where UUID is UUID of
the dictionary to update.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
50
Tibigen Digital Repository - REST API
DuplicatedTermException 400 There are at least two terms with equal value.
Request
DELETE /dictionaries/{uuid}
Path parameters
Authorization
This request requires authorization with permission delete.dictionary.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
51
Tibigen Digital Repository - REST API
Errors
DictionaryInUseException 400 There are metadata field types that reference this dictionary
and therefore dictionary cannot be deleted.
Request
POST /dictionaries/{uuid}/terms
Path parameters
In the request body, supply a Term object with at least required properties.
Authorization
This request requires authorization with permission update.dictionary.UUID where UUID is UUID of
dictionary to update.
Response
If successful, the response status code is 200 OK and body contains Value object with UUID of newly
created term wrapped in Response object.
Errors
DuplicatedTermEntryExcepti 400 There are multiple term entries in the same language.
on
52
Tibigen Digital Repository - REST API
TermEntryNotFoundExceptio 404 A term does not contain entry in system default language.
n
Request
PUT /terms/{uuid}
Path parameters
Authorization
This request requires authorization with permission update.dictionary.UUID where UUID is UUID of
dictionary containing term to update.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
53
Tibigen Digital Repository - REST API
Request
DELETE /terms/{uuid}
Path parameters
Authorization
This request requires authorization with permission update.dictionary.UUID where UUID is UUID of
the dictionary that contains term to delete.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
<item-type name="programme"
family="METADATA_ITEM"
indexed="true"
repeatable="false"
root-item="true"
sequence="false"
version="0" />
54
Tibigen Digital Repository - REST API
<item-type name="programme"
family="METADATA_ITEM"
indexed="true"
repeatable="false"
root-item="true"
sequence="false"
version="0">
<labels>
<label lang="EN" value="Programme" />
</labels>
</item-type>
name string A name of this item type. The name is string identifier and thus has to
comply to naming convention described in String Identifier. Also, the
name has to be unique among other item types. Required.
indexed boolean If true, item of this type will be indexed by search engine and can be
then searched. Default value is true.
repeatable boolean If true, only single item of this type can occur under its parent. Default
value is false.
root-item boolean If true, item of this type can be root or any other item in metadata tree.
Otherwise, item cannot be root - has to have parent item. Default value
is false.
sequence boolean If true, item of this type can be attached to specific timecode interval in
a video or audio timeline. Technically speaking, system allows to set
item’s timecode-start and timecode-stop properties. Default value is
false.
55
Tibigen Digital Repository - REST API
version integer A version of this item type for optimistic locking purposes.
labels Label List A list of labels in languages defined in TDR. TDR requires at least one
label in system default language. If label is not specified, system will
generate default label, identical to item type name.
Example of representation
<item-types>
<item-type name="programme"
family="METADATA_ITEM"
indexed="true"
repeatable="false"
root-item="true"
sequence="false"
version="0" />
</item-types>
<group-type name="prog_directors"
repeatable="false"
sequence="false"
version="0" />
56
Tibigen Digital Repository - REST API
<group-type name="prog_directors"
repeatable="false"
sequence="false"
version="0">
<labels>
<label lang="EN" value="Directors" />
</labels>
</group-type>
name string A name of this group type. The name is string identifier and
thus has to comply to naming convention described in String
Identifier. Also, the name has to be unique among other
group types. Required.
repeatable boolean If true, the container object (item or other group) can
contain multiple groups of this type. Default value is false.
version integer A version of this group type for optimistic locking purposes.
labels Label List A list of labels in languages defined in TDR. TDR requires at
least one label in system default language. If label is not
specified, system will generate default label, identical to
group type name.
57
Tibigen Digital Repository - REST API
Example of representation
<group-types>
<group-type name="prog_directors"
repeatable="false"
sequence="false"
version="0" />
</group-types>
Field types have been classified into couple of groups called families. Currently, there are six families:
• VALUE_FIELD - fields of this family are the simplest field types in the system. They do not have
complicated logic associated with them. They just store textual value, which can be validated with
provided regular expression or primitive type.
• VIRTUAL_FIELD - the most advanced field type family. Values for fields of this family are created
automatically based on supplied formula. They are virtual, because they are not stored in the
system, but instead created only when item is being retrieved. This family is commonly used in
cases where some information exists in one item and is also relevant to other item. Administrative
user can configure virtual field to copy that value from one item to another, and thus free other
users from having to view two separate items. To learn more about virtual field capabilities, see
Virtual Field Formula.
For the purpose of this documentation, following naming convention is used: field types having
VALUE_FIELD family are simply called value field types, field types having DICTIONARY_FIELD family
are called dictionary field types and so on.
58
Tibigen Digital Repository - REST API
<field-type name="prog_title"
family="VALUE_FIELD"
indexed="true"
merge="false"
primitive-type="STRING"
pattern="[A-Z]"
repeatable="true"
required="true"
sequence="false"
sorted="false"
translatable="true"
unique="false"
version="0" />
<field-type name="prog_title"
family="VALUE_FIELD"
indexed="true"
merge="false"
primitive-type="STRING"
pattern="[A-Z]"
repeatable="true"
required="true"
sequence="false"
sorted="false"
translatable="true"
unique="false"
version="0">
<labels>
<label lang="EN" value="Title" />
</labels>
</field-type>
Detailed representation for field types of all families adds labels to the simple representation. In case
of virtual field types, also virtual field formula is added.
59
Tibigen Digital Repository - REST API
name string A name of this field type. The name is string identifier and
thus has to comply to naming convention described in String
Identifier. Also, the name has to be unique among other field
types. Required.
required boolean If true, at least one field of this type must occur in item.
Default value is false.
repeatable boolean The flag that indicates if fields based on this type can be
repeatable (if metadata tree can have multiple instances of
the same field type). Default value is false.
sorted boolean If true and multiple fields of this type exist in item, fields
will be sorted by value in natural order. Default value is
false.
indexed boolean If true, fields of this type will be indexed by search engine
and then can be searched. Default value is true.
version integer A version of this field type for optimistic locking purposes.
Starting value is 0.
sequence boolean If true, field of this type can be attached to specific timecode
interval in a video or audio timeline. Technically speaking,
system allows to set field’s timecode-start and timecode-stop
properties. Default value is false.
unique boolean If true, each value of field of this type must be unique among
other fields of this type in the entire system. Default value is
false.
60
Tibigen Digital Repository - REST API
primitive-type string Defines what type of data will be stored in the field value.
That information is later used in TDR to optimize certain
operations. Allowed values are:
- STRING - string value e.g. sample value,
- INT - integer value e.g. 43,
- DOUBLE - floating point number e.g. 43.789,
- DATE - date in format yyyy-MM-dd e.g. 2015-12-10,
- DATE_TIME - date and time in format yyyy-MM-dd
HH:mm:ss e.g. 2015-12-10 15:05:20.
Default value is STRING.
<field-type name="prog_channel"
family="DICTIONARY_FIELD"
dictionary="7012f478-82cf-4165-bd9e-1a9a389c6f7e"
indexed="true"
repeatable="false"
required="true"
sequence="false"
sorted="false"
unique="false"
version="0" />
61
Tibigen Digital Repository - REST API
<field-type name="prog_guest"
family="MANUAL_REFERENCE_FIELD"
query="attr.item_type:person"
indexed="true"
repeatable="true"
required="false"
sequence="true"
sorted="false"
unique="false"
version="0" />
<field-type name="prog_guest"
family="AUTO_REFERENCE_FIELD"
query="attr.item_type:(person) AND attr.reference:{this.uuid}"
indexed="true"
repeatable="true"
required="false"
sequence="true"
sorted="false"
unique="false"
version="0" />
62
Tibigen Digital Repository - REST API
<field-type name="prog_editor"
family="USER_REFERENCE_FIELD"
indexed="true"
repeatable="true"
required="false"
sequence="true"
sorted="false"
unique="false"
version="0" />
<field-type name="prog_video_format"
family="VIRTUAL_FIELD"
indexed="true"
repeatable="false"
required="false"
sequence="false"
sorted="false"
unique="false"
version="0" >
<formula field-source="DEFAULT_CHILD" operation="COPY">
<field-type name="file_video_format" pattern=".*"/>
</formula>
<labels>
<label lang="PL" value="Video Format"/>
</labels>
</field-type>
63
Tibigen Digital Repository - REST API
and enrich the item with new fields. The purpose of a virtual field formula object is to provide
instruction for virtual field processor, needed for creation of virtual fields.
The following algorithm is used when creating fields from virtual field types:
1. Virtual field processor searches for source fields in item/items designated by field-source property.
It can be parent item, children items or default child. The types of fields that are looked for, are
defined with Formula Source Field objects.
2. If designated items do not exist or non of the source fields were found, virtual field processor will
end its job.
3. If at least one source field was found, virtual field processor depending on operation property
executes next step.
a. If operation is COPY, processor for each source field will create virtual field having identical
value (or fragment of that value if pattern has been specified) and reference as source field.
b. If operation is JOIN, processor will retrieve all source field’s values (optionally cropping them
with pattern) and will join them together. The values will be separated by string defined in
separator property. Next, processor will create new virtual field type with value being that
concatenation.
c. If operation is ADD, processor will parse all source field’s values as numbers (or fragments of
them matching pattern) and will add them together. Next, processor will create virtual field
with value being that sum.
After creation, each virtual field is inserted into item in place where its type resides in schema.
Example of representation
64
Tibigen Digital Repository - REST API
field-types Formula Source A list of objects designating what type of fields virtual field
Field list processor should look for. At least one required.
Example of representation
pattern string A pattern which will be used on found field value in order to
extract only specific part of the field value.
65
Tibigen Digital Repository - REST API
Example of representation
<field-types>
<field-type name="prog_title"
family="VALUE_FIELD"
indexed="true"
merge="false"
primitive-type="STRING"
pattern="[A-Z]"
repeatable="true"
required="true"
sequence="false"
sorted="false"
translatable="true"
unique="false"
version="0" />
</field-types>
Request
GET /metadata-item-
types?root={root}&family={family}&indexed={indexed}&detailed={detailed}
Query parameters
root boolean If true, returns root item types. If false, returns non-root
item types.
indexed boolean If true, returns indexed item types. If false, returns non-
indexed item types.
66
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission view.schema.
Response
If successful, the response status code is 200 OK and body contains Item Type List object wrapped in
Response object.
Request
GET /metadata-item-types/{name}&detailed={detailed}
Path parameters
Query parameters
Authorization
This request requires authorization with permission view.schema.
Response
If successful, the response status code is 200 OK and body contains Item Type object wrapped in
Response object.
Errors
67
Tibigen Digital Repository - REST API
Request
POST /metadata-item-types
In the request body, supply a Item Type object with at least required properties.
Authorization
This request requires authorization with permission manage.schema.
Response
If successful, the response status code is 200 OK and body contains Value object wrapped in Response
object.
Errors
InvalidItemTypeNameExcepti 400 A name of the item type is invalid. The name must conform
on to rules described in String Identifier.
LanguageNotFoundException 404 Language specified in label does not exist in the system.
OptimisticLockingException 409 Other user just updated this version of item type.
68
Tibigen Digital Repository - REST API
Request
PUT /metadata-item-types/{name}
Path parameters
In the request body, supply an Item Type object with updated properties.
Authorization
This request requires authorization with permission manage.schema.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
InvalidItemTypeNameExcepti 400 A name of the item type is invalid. The name must conform
on to rules described in String Identifier.
LanguageNotFoundException 404 Language specified in label does not exist in the system.
OptimisticLockingException 409 Other user just updated this version of item type.
69
Tibigen Digital Repository - REST API
Request
DELETE /metadata-item-types/{name}
Path parameters
Authorization
This request requires authorization with permission manage.schema.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
ItemTypeInUseException 400 The item type is used by other components and therefore
cannot be deleted.
Request
GET /metadata-group-types&detailed={detailed}
Query parameters
Authorization
This request requires authorization with permission view.schema.
70
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains Group Type List object wrapped in
Response object.
Request
GET /metadata-group-types/{name}&detailed={detailed}
Path parameters
Query parameters
Authorization
This request requires authorization with permission view.schema.
Response
If successful, the response status code is 200 OK and body contains Group Type object wrapped in
Response object.
Errors
71
Tibigen Digital Repository - REST API
Request
POST /metadata-group-types
In the request body, supply a Group Type object with at least required properties.
Authorization
This request requires authorization with permission manage.schema.
Response
If successful, the response status code is 200 OK and body contains Value object with id of newly added
group type wrapped in Response object.
Errors
InvalidGroupTypeNameExce 400 A name of the group type is invalid. The name must conform
ption to regex ^[a-zA-Z_0-9]+$.
OptimisticLockingException 409 Other user just updated this version of group type.
Request
PUT /metadata-group-types/{name}
Path parameters
72
Tibigen Digital Repository - REST API
In the request body, supply a Group Type object with updated properties.
Authorization
This request requires authorization with permission manage.schema.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
InvalidGroupTypeNameExce 400 A name of the group type is invalid. The name must conform
ption to regex ^[a-zA-Z_0-9]+$.
OptimisticLockingException 409 Other user just updated this version of group type.
Request
DELETE /metadata-group-types/{name}
Path parameters
73
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission manage.schema.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
GroupTypeInUseException 400 The group type is used by other components and therefore
cannot be deleted.
Request
GET /metadata-field-types?family={family}&referenced-field-
type={type}&page={page}&size={size}&detailed={detailed}
Query parameters
referenced-field-type string The name of the field type which is used in formulas of
virtual field types.
size integer The size of the page of results. Default value is 10.
74
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission view.schema.
Response
If successful, the response status code is 200 OK and body contains Field Type List object wrapped in
Response object.
Request
GET /metadata-field-types/{name}?detailed={detailed}
Path parameters
Query parameters
Authorization
This request requires authorization with permission view.schema.
Response
If successful, the response status code is 200 OK and body contains Field Type object wrapped in
Response object.
Errors
75
Tibigen Digital Repository - REST API
Request
POST /metadata-field-types
In the request body, supply a Field Type object at least with required properties.
Authorization
This request requires authorization with permission manage.schema.
Response
If successful, the response status code is 200 OK and body contains Value object with id of newly added
field type, wrapped in Response object.
Errors
InvalidFieldTypeNameExcept 400 A name of the field type is invalid. The name must conform
ion to rules described in String Identifier.
InvalidFieldTypeSearchQuer 400 Search query is not specified in case of auto and manual
yException reference fields.
InvalidFieldTypeDefaultValu 400 There is too many default values. Only value field allows to
eNumberException define multiple default values.
76
Tibigen Digital Repository - REST API
DuplicatedDefaultValuesExce 400 There are multiple default values for the same language in
ption case of value field.
InvalidRegexException 400 Regular expression has invalid format in case of value field.
RecursiveFormulaDetectedEx 400 Formula contains field type of this field in case of virtual
ception field.
FieldTypeNotFoundException 404 One of the field types used in formula of virtual field does
not exist.
Request
PUT /metadata-field-types/{name}
Path parameters
In the request body, supply a Field Type object with updated properties.
77
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission manage.schema.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
78
Tibigen Digital Repository - REST API
Request
POST /metadata-field-types/{name}
Path parameters
Authorization
This request requires authorization with permission manage.schema.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
FieldTypeInUseException 400 The field type is used by other components and therefore
cannot be deleted.
79
Tibigen Digital Repository - REST API
Schema can be modified during a lifetime of the system. When new metadata entry type will be added
to schema, system will allow for entries of that type in items. On the other hand, when metadata entry
will be deleted from schema, all metadata entries of that type will remain intact. However, at the next
item update, system will do not let for that operation until all obsolete metadata entries will be
removed. This behavior let user to migrate data that are no longer consistent with the schema.
Metadata schema also has so-called title formula which is used during metadata item creation or
update to recreate item’s title. For more details, see Title Formula.
3.3.1. Schema
Example of simple representation
80
Tibigen Digital Repository - REST API
children Item Type list A list of item types, which can be children of item type that
this schema defines.
title-formula Title Formula The definition of title formula for this schema. If not
specified, default title formula will be generated i.e. default
title formula will generate title identical to schema name.
Example of representation
<schemas>
<schema name="tv_series" version="0" />
</schemas>
A value property defines above mentioned static template. This template can contain any character
besides curly braces {}, which indicate the beginning and the end of placeholder parameter. The
placeholder parameters are numbered starting from 1 and can occur in any order.
To bind actual field to the placeholder, a parameter should be defined. A field-type property of the
parameter points to the type of field, that will be used to resolve template. When there will be multiple
fields of this type in item, all values will be separated with separator defined in separator property and
concatenated to create final replacement of placeholder.
The order in which parameters are defined is important and should correspond to numbering of
placeholders in template.
Example
Lets assume we have a title formula:
81
Tibigen Digital Repository - REST API
<item>
<field type="title">Foo</field>
<field type="subtitle">Bar1</field>
<field type="subtitle">Bar2</field>
</item>
Example of representation
value string The static title template, which can contain any number of
placeholders in form of {N}, where N is a sequential number
of parameter starting from 1.
parameters Title Formula A list of parameters which bind placeholders with field
Parameter list types.
Example of representation
82
Tibigen Digital Repository - REST API
field-type string A type of field that will be searched in item in order to get its
value and replace placeholder.
separator string A string which will separate multiple values of field, in case
of property field-type pointing to repeatable field type.
Example of representation
<metadata-types>
<field-type family="VALUE_FIELD" indexed="true" merge="false" name="prog_actor"
pattern=""
primitive-type="STRING" repeatable="true" required="false" sequence="false"
sorted="false"
translatable="false" unique="false" version="2"/>
Request
83
Tibigen Digital Repository - REST API
GET /metadata-schemas?item-type={type}&item-type-family={family}&item-type-
root={root}&page={page}&size={size}&detailed={detailed}
Query parameters
item-type string If specified, returns schema for given item type. An item
type can have only one schema, and thus returned list will
always contain zero or one element.
item-type-family string If specified, returns schemas for item types having given
family. Allowed values are METADATA_ITEM and
FILE_ITEM.
item-type-root boolean If specified, returns schemas for item types being root item
types.
size integer The size of the page of results. Default value is 10.
Authorization
This request requires authorization with permission view.schema.
Response
If successful, the response status code is 200 OK and body contains Schema List object wrapped in
Response object.
Request
GET /metadata-schemas/{name}
84
Tibigen Digital Repository - REST API
Path parameters
Authorization
This request requires authorization with permission view.schema.
Response
If successful, the response status code is 200 OK and body contains Schema object wrapped in
Response object.
Errors
Request
POST /metadata-schemas
In the request body, supply a Schema object with at least required properties.
Authorization
This request requires authorization with permission manage.schema.
Response
If successful, the response status code is 200 OK and body contains Value object with id of newly added
schema wrapped in Response object.
Errors
85
Tibigen Digital Repository - REST API
SchemaRelationshipNotAllow 400 Schema contains forbidden relation e.g. group type contains
edException item type.
InvalidTitleFormulaParamete 400 The title formula value contains more placeholders than
rNumberException number of parameters specified.
InvalidTitleFormulaFieldTyp 400 The title formula is using entry types which do not occur in
eException schema.
Request
PUT /metadata-schema/{name}
86
Tibigen Digital Repository - REST API
Path parameters
Authorization
This request requires authorization with permission manage.schema.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
SchemaRelationshipNotAllow 400 Schema contains forbidden relation e.g. group type contains
edException item type.
InvalidTitleFormulaParamete 400 The title formula value contains more placeholders than
rNumberException number of parameters specified.
InvalidTitleFormulaFieldTyp 400 The title formula is using entry types which do not occur in
eException schema.
87
Tibigen Digital Repository - REST API
Request
DELETE /metadata-schemas/{name}
Path parameters
Authorization
This request requires authorization with permission manage.schema.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
ReferencingSchemasExistExc 400 Other schemas referencing the schema, and therefore the
eption schema cannot be deleted.
88
Tibigen Digital Repository - REST API
Request
GET /metadata-schemas/{name}/types
Path parameters
Query parameters
Authorization
This request requires authorization with permission view.schema.
Response
If successful, the response status code is 200 OK and body contains Metadata Types object wrapped in
Response object.
Errors
In TDR, user can attach files to items through asset objects. Also, selected items can be indexed for
searching purposes. Each item includes basic information about time of creation and modification and
89
Tibigen Digital Repository - REST API
also logins of users which performed these operations. Items have unique identifiers (UUIDs). These
UUIDs can be assigned by user or generated automatically upon creation. Each item has title created
by the system based on title formula defined in schema.
3.4.1. Item
Example of simple representation
90
Tibigen Digital Repository - REST API
retention-policy="17dca7e3-5bff-4524-a69b-f163abafb343"
version="0" >
<field created="2015-07-24 11:33:48"
language="PL"
modified="2015-07-24 11:33:48"
owner-item="291aa91c-9f13-46e2-bcfc-c66471703edf"
reference="7623f849-6f76-4469-8bb6-1a64fbfe9267"
type="prog_title"
type-version="0"
uuid="34834695-bac1-4385-82b4-943d5208af3b"
version="0">News</field>
<group language="PL"
type="prog_length"
type-version="0"
uuid="3481014e-c861-437a-bc34-6cea4da8262e"
version="0">
<field created="2016-01-25 10:54:44"
language="PL" modified="2016-01-25 10:54:44"
owner-item="291aa91c-9f13-46e2-bcfc-c66471703edf"
type="prog_length_units"
type-version="0"
uuid="a1666883-88fa-4df5-8922-969ea68f272e"
version="0">minutes</field>
<field created="2016-01-25 10:54:44"
language="PL"
modified="2016-01-25 10:54:44"
owner-item="291aa91c-9f13-46e2-bcfc-c66471703edf"
type="prog_length_value"
type-version="0"
uuid="ea281148-6017-4066-8345-0225e2d3087d"
version="0">12</field>
</group>
</item>
91
Tibigen Digital Repository - REST API
default-item boolean A flag designating if this item is default item among its
siblings. By default first added child item becomes default.
index-valid boolean If true, item has created valid index in search engine and
therefore can appear in search results.
last-modified-by string A login of the user who for the last time modified this item.
modified datetime A time when this item was modified for the last time.
schema-version integer A version of schema based on which this item has been
created or updated.
type-version integer A version of type based on which this item has been created
or updated.
uuid uuid An UUID of this item. If not specified, will be generated upon
creation.
version integer A version of this item. Used for optimistic locking purposes.
92
Tibigen Digital Repository - REST API
Example of representation
<items>
<item created="2015-07-24 11:33:48"
creator="admin"
default-item="false"
files-attached="false"
index-valid="true"
language="PL"
last-modified-by="admin"
modified="2015-07-24 11:33:48"
root-uuid="dd7d9923-2b08-416f-bfe3-9d1b5787fa07"
schema-version="51"
title="News"
type="programme"
type-version="0"
uuid="dd7d9923-2b08-416f-bfe3-9d1b5787fa07"
retention-policy="17dca7e3-5bff-4524-a69b-f163abafb343"
version="0" />
</items>
3.4.3. Group
93
Tibigen Digital Repository - REST API
Example of representation
<group language="PL"
type="prog_length"
type-version="0"
uuid="3481014e-c861-437a-bc34-6cea4da8262e"
version="0">
<field created="2016-01-25 10:54:44"
language="PL" modified="2016-01-25 10:54:44"
owner-item="291aa91c-9f13-46e2-bcfc-c66471703edf"
type="prog_length_units"
type-version="0"
uuid="a1666883-88fa-4df5-8922-969ea68f272e"
version="0">minutes</field>
<field created="2016-01-25 10:54:44"
language="PL"
modified="2016-01-25 10:54:44"
owner-item="291aa91c-9f13-46e2-bcfc-c66471703edf"
type="prog_length_value"
type-version="0"
uuid="ea281148-6017-4066-8345-0225e2d3087d"
version="0">12</field>
</group>
type-version integer A version of type based on which this group has been
created or updated.
version integer A version of this group. Used for optimistic locking purposes.
3.4.4. Field
94
Tibigen Digital Repository - REST API
Example of representation
modified datetime A time when this field was modified for the last time.
type-version integer A version of type based on which this field has been created
or modified.
version integer A version of this field. Used for optimistic locking purposes.
95
Tibigen Digital Repository - REST API
Example of representation
All properties of archival item have the same meaning as for the item. The modified and last-modified-
by properties contain time when item has been archived and login of user who archived that item.
• for item it is view.item.ITEM_TYPE, where ITEM_TYPE is a name of type of item, which we want to
get,
• for fields it is view.field.FIELD_TYPE, where FIELD_TYPE is a name of type of field which is used in
schema for this item.
96
Tibigen Digital Repository - REST API
For each of above permissions, service verifies field permission requirements using Metadata Content
Based Requirement Verifier. For example, some field from item can be get only if other field has value
specified in permission requirement. For more information, see Permission Requirements.
• if there is permission to view item, then returned item will include its all descendants (fields and
groups),
• if there is permission to view field, then returned item will include this field and its all ancestors
(groups and item),
• if there is permission to view group, then returned item will include this group with all of its
descendants (fields and groups), and also its ancestors (groups and item),
• if there is no permission to view item or any field or any group in this item, then service won’t
return the item.
To explain exactly how permissions work for items we will use example of item with schema
presented below:
• item:movie
◦ field:title
◦ group:cast
▪ field:actor
▪ field:role
For this schema there are few possible scenarios based on above principles:
• if there is only permission view.item.movie, then returned item will include field title and whole
group cast with both fields: actor and role,
• if there is only permission view.group.cast, then returned item will include whole group cast with
both fields: actor and role,
• if there is only permission view.field.title, then returned item will include only one field title,
• if there is only permission view.field.actor, then returned item will include group cast, but with
only one field actor.
• if there is permission view.field.title and view.field.actor, then returned item will include field title
and group cast, but with only one field actor.
• if there is no permission for item of type movie or any field or group in schema movie, then error
will be returned.
Authorization in case of create and update operation on metadata entries works similar to rules
described in Get Item section. Operations like adding, updating and deleting individual fields and
97
Tibigen Digital Repository - REST API
groups are authorized with common permission action - manage. For example, user will need
manage.field.title permission to update field title. For item, action manage is not appropriate, because
item cannot be deleted (item is always archived in TDR with Archive Item Process). To create or update
item, permission with action save is needed. When user want to add, change or delete LOCAL
Retention Policy in item, permission with action manage-retention is needed.
• for item it is save.item.ITEM_TYPE, where ITEM_TYPE is a name of type of item, which we want to
create or update,
As in case of item retrieval, Metadata Content Based Requirement Verifier is used to verify permission
requirements in scope of metadata entries. So, it is possible to, for example, reject update of the field, if
some other field has unexpected value.
These are principles used for authorizing of create, update and delete operations:
• if there is permission to save item, then item can be created or update and all fields and groups
contained in the item can be created, updated or deleted,
• if there is permission to manage field, then field with all its group ancestors can be created,
updated and deleted. In this case, item which contains this field can be created or updated,
• if there is permission to manage group, then group with all its group ancestors and descendants
can be created, updated and deleted. In this case, item which contains this group can be created or
updated,
• if there is no permission to save item or manage any field or any group in this item, then service
will return error.
Create, update and delete operations are aware of view permissions. In a situation where there is no
view permission for given entry, any operation on that entry will be rejected.
Request
98
Tibigen Digital Repository - REST API
GET /metadata-items?field-type={type}&group-
type={type}&type={type}&page={page}&size={size}
Query parameters
field-type string If specified, only items having this type of fields will be
returned.
group-type string If specified, only items having this type of groups will be
returned.
type string If true, only items having this type will be returned.
size integer The size of the page of results. Default value is 10.
The query params field-type, group-type and type cannot be combined together.
Authorization
This request requires authorization with permission list.item.
Response
If successful, the response status code is 200 OK and body contains Item List object wrapped in
Response object.
Errors
Request
GET /metadata-items/{uuid}?detailed={detailed}
99
Tibigen Digital Repository - REST API
Path parameters
Headers
Query parameters
Authorization
Authorization of item operations is described in [Permission Checking for Metadata].
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
ItemLangVersionNotFoundEx 404 Cannot find language version of item with given UUID.
ception
100
Tibigen Digital Repository - REST API
Request
GET /metadata-items/{uuid}/children
Path parameters
Headers
Query parameters
type string If specified, only children having this type will be returned.
Authorization
Authorization of this request is based on rule: if user has permission to view an item, he is also
permitted to view the item’s children in simple representations. Therefore, this request requires
authorization the same as Get item service.
Response
If successful, the response status code is 200 OK and body contains Item List object wrapped in
Response object.
Errors
ItemLangVersionNotFoundEx 404 Cannot find language version of item with given UUID.
ception
101
Tibigen Digital Repository - REST API
Request
POST /metadata-items
Headers
In the request body, supply an Item object with at least required properties.
Authorization
Authorization of item operations is described in Permission Checking.
Response
If successful, the response status code is 200 OK and body contains Value object with UUID of newly
added item, wrapped in Response object.
Errors
InvalidTimecodeIntervalExce 400 Cannot set timecode interval wider than interval of parent
ption entry.
RepeatableItemNotAllowedE 400 Sibling with the same type already exists. Type of this item
xception has repeatable property set to false.
102
Tibigen Digital Repository - REST API
ParentItemExpectedExceptio 400 Cannot add item as root item. Type of this item has root-item
n property set to false.
InvalidParentItemException 400 Schema of parent item does not allow to add this type of
children.
RepeatableGroupNotAllowed 400 Sibling with the same type already exists. Type of this group
Exception has repeatable property set to false.
FieldRegexMatchingExceptio 400 Field’s value does not match to regular expression defined in
n its type.
InvalidTermReferenceExcepti 400 Field is a dictionary field and its reference leads to term that
on not exists.
ReferencedItemNotFoundExc 400 Field is a manual reference field and its reference leads to
eption item that not exists.
RepeatableFieldNotAllowedE 400 This field’s sibling with the same type already exists. Type of
xception this field has repeatable property set to false.
UniqueFieldAlreadyExistsExc 400 Other field of that type and the same value already exists in
eption the system. Type of this field has unique property set to true.
ItemLangVersionAlreadyExis 409 Item with given UUID and language already exists.
tsException
103
Tibigen Digital Repository - REST API
Request
PUT /metadata-items/{uuid}
Path parameters
Headers
Content-Language string The language of item to update. Default language is system default
language.
Authorization
Authorization of item operations is described in Permission Checking.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
InvalidTimecodeIntervalExce 400 Cannot set timecode interval wider than interval of parent
ption entry.
104
Tibigen Digital Repository - REST API
RepeatableItemNotAllowedE 400 Sibling with the same type already exists. Type of this item
xception has repeatable property set to false.
ParentItemExpectedExceptio 400 Cannot add item as root item. Type of this item has root-item
n property set to false.
InvalidParentItemException 400 Schema of parent item does not allow to add this type of
children.
RepeatableGroupNotAllowed 400 Sibling with the same type already exists. Type of this group
Exception has repeatable property set to false.
FieldRegexMatchingExceptio 400 Field’s value does not match to regular expression defined in
n its type.
InvalidTermReferenceExcepti 400 Field is a dictionary field and its reference leads to term that
on not exists.
ReferencedItemNotFoundExc 400 Field is a manual reference field and its reference leads to
eption item that not exists.
RepeatableFieldNotAllowedE 400 This field’s sibling with the same type already exists. Type of
xception this field has repeatable property set to false.
UniqueFieldAlreadyExistsExc 400 Other field of that type and the same value already exists in
eption the system. Type of this field has unique property set to true.
105
Tibigen Digital Repository - REST API
ItemLangVersionNotFoundEx 404 Cannot find given item or item specified as parent of this
ception item.
OptimisticLockingException 409 Versions do not match. Other request already modified this
version of item.
Request
GET /metadata-items/{uuid}/assets?type-id={id}
Path parameters
Query parameters
type-id integer Asset type id. If specified, only assets of this type will be
returned.
Authorization
This request requires authorization with permission view-files.item.ITEM_TYPE, where ITEM_TYPE is
name of type of the item, which has assets attached. Web service verifies asset type permission
requirements. Web service filters output list of assets and returns only that assets that user can view.
Response
If successful, the response status code is 200 OK and body contains Asset List object wrapped in
Response object.
106
Tibigen Digital Repository - REST API
Request
POST /metadata-items/{uuid}/assets
Path parameters
In the request body, supply a Asset object with at least required properties.
Authorization
This request requires authorization with permission manage-files.item.ITEM_TYPE where ITEM_TYPE
is name of the type of item to which asset will be added.
This service verifies asset type permission requirements. For more information see Permission
Requirement.
Response
If successful, the response status code is 200 OK and body contains Value object with id of newly
created asset, wrapped in Response object.
Errors
Request
107
Tibigen Digital Repository - REST API
GET /metadata-items/{uuid}/media/{media-type}
Path parameters
media-type string A media type of asset to find. The same as in Asset Type.
Authorization
This request requires authorization with permission view-files.item.ITEM_TYPE, where ITEM_TYPE is a
name of the type of item for which media should be returned.
Response
If successful, the response status code is 200 OK and body contains Asset object, wrapped in Response
object.
Errors
MediaAssetNotFoundExcepti 404 There is not asset able to store given media type attached to
on given item or its descendants.
Request
GET /metadata-archival-items/{uuid}
Path parameters
108
Tibigen Digital Repository - REST API
Headers
Authorization
This request requires authorization with permission list.item.
Response
If successful, the response status code is 200 OK and body contains Archival Item object, wrapped in
Response object.
Request
POST /metadata-items/{uuid}/edl
Path parameters
In the request body, supply a EDL object with at least required properties.
Authorization
This request requires authorization with permission manage-edl.item.ITEM_TYPE where ITEM_TYPE is
name of the type of item to which asset will be added.
Response
If successful, the response status code is 200 OK and body contains Value object with id of newly
created asset, wrapped in Response object.
Errors
109
Tibigen Digital Repository - REST API
Request
GET /metadata-items/{uuid}/edl
Path parameters
Authorization
This request requires authorization with permission view-edl.item.ITEM_TYPE, where ITEM_TYPE is
name of type of the item, which has EDL attached.
Response
If successful, the response status code is 200 OK and body contains EDL object wrapped in Response
object.
Errors
110
Tibigen Digital Repository - REST API
permissions to do so. At this moment, there is no possibility to share collection with specific user or
group of users. The collection has to be shared to all users, or kept as private.
Metadata collections are core components in REST API and can be used in combination with other
services to execute batch actions on items.
<collection id="1"
name="Sample collection"
access="PRIVATE"
creator="admin"
last-modified-by="admin"
total-entries="1" >
<item>a99a1455-fbbe-4594-ba95-cf32ef69ecd1</item>
</collection>
last-modified-by string A login of the user who modified collection for the last time.
111
Tibigen Digital Repository - REST API
Example of representation
<item>a99a1455-fbbe-4594-ba95-cf32ef69ecd1</item>
Example of representation
<collections total="1">
<collection access="PRIVATE" creator="admin" id="1" last-modified-by="admin" name=
"Sample collection"/>
</collections>
Request
GET /metadata-collections?access={access}&page={page}&size={size}
Query parameters
size integer The size of the page of results. Default value is 10.
112
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission view.collection.own.
Response
If successful, the response status code is 200 OK and body contains Metadata Collection Entry object
wrapped in Response object.
Request
GET /metadata-collections/{id}?page={page}&size={size}
Path parameters
Query parameters
size integer The size of the page of collection entries. Default value is 10.
Authorization
If creator of collection tries to get it or collection is public, authorization with permission
view.collection.own is required. Otherwise, required permission is view.collection.other-private.
Response
If successful, the response status code is 200 OK and body contains Metadata Collection object wrapped
in Response object.
Errors
113
Tibigen Digital Repository - REST API
Request
POST /metadata-collections
In the request body, supply a Metadata Collection object with at least required properties.
Authorization
This request requires authorization with permission manage.collection.own.
Response
If successful, the response status code is 200 OK and body contains Value object with id of newly
created collection, wrapped in Response object.
Errors
Request
PUT /metadata-collections/{id}
114
Tibigen Digital Repository - REST API
Path parameters
In the request body, supply a Metadata Collection object with updated properties. The entries are
ignored and can be omitted in order to save some data transfer.
Authorization
If creator of the collection tries to update it or collection is public, authorization with permission
manage.collection.own is required. Otherwise, required permission is manage.collection.other-private.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
Request
DELETE /metadata-collections/{id}
Path parameters
Authorization
If creator of the collection tries to delete it or collection is public, authorization with permission
manage.collection.own is required. Otherwise, required permission is manage.collection.other-private.
115
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
Request
POST /metadata-collections/{id}/items
Path parameters
In the request body, supply a Metadata Collection Entry object with UUID of item to add.
Authorization
If creator of the collection tries to add new item or collection is public, authorization with permission
manage.collection.own is required. Otherwise, required permission is manage.collection.other-private.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
116
Tibigen Digital Repository - REST API
Request
DELETE /metadata-collections/{id}/items/{uuid}
Path parameters
Authorization
If creator of the collection tries to delete item from it or collection is public, authorization with
permission manage.collection.own is required. Otherwise, required permission is
manage.collection.other-private.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
4. Search
TDR search API allows users to effectively search through all metadata items added to the system. It
provides an extensive query syntax which allows to construct multiple conditions on item’s attributes
117
Tibigen Digital Repository - REST API
and fields using different equality and join operators. Range queries and queries containing wildcards
are also possible. The query syntax and possible query operations are explained in Queries.
Queries can be easily saved for later use. Each user in TDR can have its own saved queries.
Furthermore, there is a possibility to save search result to a Metadata Collection object. This allows
users to flexibly define sets of metadata items, that will be later processed in some way in the system.
Besides saved queries, system allows to group multiple query conditions on metadata fields into
grouping criteria. Then, grouping criteria can be used in queries to simplify and increase readability of
queries in the user interface. Grouping criteria are described in Grouping Criteria.
The search API also provides faceting and suggestions for metadata fields and attributes.
4.1. Queries
TDR allows to create complex queries with multiple conditions and operators. It supports filter caching
mechanism which boost performance of certain queries. The search results can be sorted by metadata
item’s attributes and fields. There is also possibility to get suggestions for fields.
Query Syntax
TDR uses Solr as an internal index server and therefore query syntax is similar to Solr. However, there
are few changes that adapts query syntax to metadata model used in TDR.
attr|field|group.<name>:<value>
where attr, field and group specify a kind of data from metadata item that will be searched. attr is item
attribute, field is field contained in item, group is grouping criteria. If none of these will be specified,
an attr will be assumed. A <name> parameter further clarify what exactly attribute, field or grouping
criteria will be searched. After a colon, a search value need to be passed, for example:
field.title:Foo
will match items containing field title with value Foo. The searched value can contain wildcard
character in any place on the value (at the beginning, in the middle or at the end), replacing any
number of characters:
field.title:*oo
The above query matches title fields with values Foo, Goo, Bamboo and so on. If searched value
consists of multiple keywords separated by whitespaces, it should be enclosed with double quotes:
118
Tibigen Digital Repository - REST API
field.title:"Foo Bar"
Conditions can be joined together with AND and OR operators (upper case only). To define order in
which conditions are resolved, curved brackets should be used. Query syntax supports range queries:
field.length:[2 TO 4]
The above query matches all fields named length having values 2, 3 or 4. TDR reuses Solr’s date time
format which looks like below:
attr.created:2015-01-02T09\:03\:25.543Z
As colons (:) are special characters in query (they are separating field name and field value), they need
to be escaped when used in field value. In the date format millisecond part is optional and can be
removed. Below query is also valid:
attr.created:2015-01-02T09\:03\:25Z
These are valid attributes of metadata item that can be searched: lang, item_type, created, uuid,
modified, root_uuid, title, created_by, hierarchy, modified_by, item_type_label, file_type. Field names
corresponds to field type names defined in TDR. Groups are named just like defined grouping criteria.
Sort Syntax
attr|field.<value> [<direction>]
where attr and field have the same meaning as in a query syntax - value can be metadata item’s
attribute name or field name. The direction is sort ordering which can be asc for ascending ordering
and desc for descending ordering. When direction is not specified, default value is asc.
119
Tibigen Digital Repository - REST API
To boost your queries performance, logical query to the system should be split into two sub-queries:
query and filter query. All items that match filter query will be cached by search engine. If user will
execute another query with exactly the same filter query, there will be cache hit and results will be
immediately returned from the cache instead of searching them in an index.
Filter query should only be used for static or rarely changing conditions. All frequently changing filters
should be applied directly to plain query.
Example of representation
<facets>
<facet>2013</facet>
<facet>2014</facet>
<facet>2010</facet>
<facet>2015</facet>
<facet>2011</facet>
<facet>2012</facet>
<facet>1986</facet>
<facet>2005</facet>
<facet>2007</facet>
</facets>
1. For each field find list of values with the biggest number of occurrences.
120
Tibigen Digital Repository - REST API
Example of representation
<suggestions>
<suggestion word="2014"/>
<suggestion word="2013"/>
<suggestion word="2015"/>
<suggestion word="2011"/>
<suggestion word="2012"/>
<suggestion word="2010"/>
<suggestion word="2009"/>
<suggestion word="2008"/>
<suggestion word="2007"/>
<suggestion word="2006"/>
</suggestions>
4.1.3. Search
Get results of search.
Request
GET /search?q={query}&fq={filter-query}&sort={sort}&start={start}&rows={rows}&fl={field-
list}
Query parameters
fq string A query that restricts set of all items. Then, items can be
narrowed down be q parameter. Results of this query are
internally cached to boost search performance. Format of
the query is described in Queries.
start integer The first result to return. If not specified, results will be
returned beginning from result 0.
121
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission query.index.
Response
If successful, the response status code is 200 OK and body contains Item List wrapped in Response
object.
Errors
Request
POST /search?q={query}&fq={filter-query}
Query parameters
fq string A query that restricts set of all items. Then, items can be
narrowed down by q parameter. Results of this query are
internally cached to boost search performance. Format of
the query is described in Queries.
122
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permissions query.index and manage.collection.own.
Response
If successful, the response status code is 200 OK and body contains Value object with id of newly
created collection, wrapped in Response object.
Errors
Request
GET /search/facets?q={query}&fq={filter-query}&limit={limit}&field={field}&prefix={prefix}
Query parameters
fq string A query that restricts set of all items. Then, items can be
narrowed down be q parameter. Results of this query are
internally cached to boost search performance. Format of
the query is described in Queries section.
123
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission query.index.
Response
If successful, the response status code is 200 OK and body contains Facet List wrapped in Response
object.
Errors
Request
GET /search/suggestions?prefix={prefix}&fields={fields}&language={language}
Query parameters
prefix string Only suggestions starting with this prefix will be returned.
Authorization
This request requires authorization with permission query.index.
124
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains Suggestion List wrapped in
Response object.
<saved-query id="1"
name="All episodes produced after 2000" />
<saved-query id="1"
name="All episodes produced after 2000"
query="attr.item_type:episode AND attr.hierarchy:"true""
filter-query="field.year_of_production:[2000 TO *]"
user="admin" />
user string A login of the user who owns this saved query.
125
Tibigen Digital Repository - REST API
Example of representation
<saved-queries>
<saved-query id="1" name="All episodes produced after 2000" />
</saved-queries>
Request
GET /saved-queries?login={login}&page={page}&size={size}
Query parameters
Authorization
If user tries to get saved queries for himself, only authentication is required. Otherwise, request
requires authorization with permission view.saved-query.
Response
If successful, the response status code is 200 OK and body contains Saved Query List object wrapped in
Response object.
Request
GET /saved-queries/{id}
126
Tibigen Digital Repository - REST API
Path parameters
Authorization
If creator of saved query tries to get it, only authentication is required. Otherwise, request requires
authorization with permission view.saved-query.
Response
If successful, the response status code is 200 OK and body contains Saved Query object wrapped in
Response object.
Errors
Request
POST /saved-queries
In the request body, supply a Saved Query object with at least required properties.
Authorization
This request requires authentication.
Response
If successful, the response status code is 200 OK and body contains Value object with id of newly crated
saved query, wrapped in Response object.
Errors
127
Tibigen Digital Repository - REST API
SavedQueryAlreadyExistsExc 409 Saved query with given name and user already exists.
eption
Request
DELETE /saved-queries/{id}
Path parameters
Authorization
If creator of this saved query tries to delete it, only authentication is required. Otherwise, request
requires authorization with permission manage.saved-query.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
128
Tibigen Digital Repository - REST API
common usage for grouping criteria is when multiple fields exist in an item and contain similar
information, for example different kinds of titles. If users frequently search in all of these titles, the
grouping criterion should be created to simplify that process. Let’s take a look at an example.
item: feature_film
field: original_title
field: english_title
field: serie_title
In order to search for items like above by values of all title fields, user has to create query similar to
this below:
If all conditions have equal right operands (e.g. foo*), a new grouping criterion can be created. Let’s
name it titles. After that we can use this grouping criterion in later queries:
group.titles:foo*
129
Tibigen Digital Repository - REST API
field-types list A list of field type names which this grouping criterion
contains. Required.
Example of representation
<grouping-criteria>
<grouping-criterion id="1" name="titles"/>
<grouping-criterion id="2" name="people"/>
</grouping-criteria>
Request
GET /grouping-criteria?detailed={detailed}
130
Tibigen Digital Repository - REST API
Query parameters
Authorization
This request requires authorization with permission query.index.
Response
If successful, the response status code is 200 OK and body contains Grouping Criterion List wrapped in
Response object.
Request
GET /grouping-criteria/{id}?detailed={detailed}
Path parameters
Query parameters
Authorization
This request requires authorization with permission query.index.
Response
If successful, the response status code is 200 OK and body contains Grouping Criterion object wrapped
in Response object.
131
Tibigen Digital Repository - REST API
Errors
Request
POST /grouping-criteria
In the request body, supply a Grouping Criterion object with at least required properties.
If label is not specified, service will generate default label identical to criterion’s name.
Authorization
This request requires authorization with permission manage.grouping-criterion.
Response
If successful, the response status code is 200 OK and body contains Value object with id of newly
created grouping criterion, wrapped in Response object.
Errors
Request
132
Tibigen Digital Repository - REST API
PUT /grouping-criteria/{id}
Path parameters
In the request body, supply a Grouping Criterion object with updated properties.
Authorization
This request requires authorization with permission manage.grouping-criterion.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
Request
DELETE /grouping-criteria/{id}
Path parameters
133
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission manage.grouping-criterion.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
4.4. Indexes
TDR, while indexing metadata items, creates separate index for each language defined in the system.
Besides Rebuild Index Process, Synchronize Index Process and Clear Index Process processes, REST API
provides web-services for item-level index management. There is web-service which allows to reindex
individual items. The indexing procedure is the same as in Rebuild Index process. Other web-service
gives possibility to delete index for individual item.
Request
PUT /search-indexes/{name}/documents/{uuid}
Path parameters
Authorization
This request requires authorization with permission manage.index.
134
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Request
DELETE /search-indexes/{name}/documents/{uuid}
Path parameters
name string A name of the index which contains document to delete. The
name is equal to name of the language, in which data are
stored in this particular index.
Authorization
This request requires authorization with permission manage.index.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
5. Files
TDR system is able to track files imported to its internal storages. It uses three-level hierarchy to record
information about files and theirs locations.
At the top of hierarchy is the most general unit - an asset. Asset stores multiple files that have common
feature. For example, video represented in a file system as individual frames will be single asset in
TDR. Assets cannot exist without metadata item to which there are attached. The relationship, from the
perspective of item, is one to many, which means that single item can have multiple assets attached
and asset can be attached to only one metadata item.
Each asset is created based on some asset type. The asset type, represented by Asset Type object,
delivers information needed to properly handle files inside an asset. It describes structure of the files
(single file, directory), assigns media type to them (used for selecting adequate file viewer and
technical metadata retrival) and stores file name validation rules in form of regular expressions. Any
135
Tibigen Digital Repository - REST API
number of assets having the same asset type can be attached to item. However, one of these assets can
be selected as default. This information is later used in some processes to properly locate source files
attached to given item.
The middle level in hierarchy is file. File object represents abstract file which is not related to any
storage location. It stores information about file name, size and check sum - things that should not
change during migration of file from storage to storage. Each file can have multiple instances which
are represented by File Instance objects, the lowest of three-level hierarchy. Instances point to exact
locations where file is stored on the file system or on storage pool in tape library. Instance tracking is
required to deliver hierarchical storage management features.
Asset types can be freely added or removed by authorized user. An example layout consists of High
Resolution Video, Low Resolution Video and Key Frame asset types.
<asset-type id="1"
name="Low Res"
media-type="VIDEO"
metadata-reader="MEDIA_INFO"
structure="SINGLE" />
136
Tibigen Digital Repository - REST API
<asset-type id="1"
name="Low Res"
media-type="VIDEO"
metadata-reader="MEDIA_INFO"
structure="SINGLE" >
<extensions>
<extension>mp4</extension>
</extensions>
<regular-expressions>
<regular-expression>^lowres_.*[.]\w+$</regular-expression>
</regular-expressions>
</asset-type>
media-type string An indicator that tells what can be done with this type of assets in TDR.
Possible values are:
- AUDIO - asset can be played in audio player,
- VIDEO - asset can be played in video player,
- VIDEO_DESCRIPTOR - asset keeps video index for video search
purposes,
- KEYFRAMES - images represent content of video file,
- DCP - Digital Cinema Package. When importing, TDR uses special
module for grabbing technical metadata from package name,
- NOT_SUPPORTED - asset with this media-type are just stored. No
special action are performed.
Required.
metadata-reader string The tool that will be used to retrieve technical metadata for each asset
of that type. Supported values are:
- MEDIA_INFO - MediaInfo software. Good for multimedia files.
- IMAGE_MAGICK - Identify software from Image Magick package.
Good for graphical files.
- DCP - embedded Digital Cinema Package name reader.
137
Tibigen Digital Repository - REST API
structure string Describes representation of asset in file system. Possible values are:
- SINGLE - single file,
- SEQUENCE - sequence of files where order matters. This kind of
structure can be seen on videos represented as a set of subsequent
frames,
- PACKAGE - deprecated,
- FOLDER - single folder with any content.
Required.
extensions list A list of allowed extensions for validation purposes. Each extension
must conform to regular expression ^\w{2,6}$.
regular- list A list of regular expressions validating file name (with extension).
expressions
Example of representation
<asset-types>
<asset-type id="1"
name="Low Res"
media-type="VIDEO"
metadata-reader="MEDIA_INFO"
structure="SINGLE" />
</asset-types>
Request
GET /asset-types?media-type={type}&detailed={detailed}
Query parameters
media-type string If specified, only asset types having this media type will be
returned.
138
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission view.asset.
Response
If successful, the response status code is 200 OK and body contains Asset Type List wrapped in
Response object.
Request
GET /asset-types/{id}
Path parameters
Query parameters
Authorization
This request requires authorization with permission view.asset.
Response
If successful, the response status code is 200 OK and body contains Asset Type wrapped in Response
object.
Errors
139
Tibigen Digital Repository - REST API
Request
POST /asset-types
In the request body, supply an Asset Type object with at least required properties.
Authorization
This request requires authorization with permission manage.asset.
Response
If successful, the response status code is 200 OK and body contains Value object with id of newly
created asset type, wrapped in Response object.
Errors
InvalidAssetTypeExtensionEx 400 One of the file extensions does not match regular expression
ception ^\w{2,6}$.
140
Tibigen Digital Repository - REST API
Request
PUT /asset-types/{id}
Path parameters
In the request body, supply an Asset Type object with updated properties.
Authorization
This request requires authorization with permission manage.asset.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
InvalidAssetTypeExtensionEx 400 One of the file extensions does not match regular expression
ception ^\w{2,6}$.
Request
DELETE /asset-types/{id}
141
Tibigen Digital Repository - REST API
Path parameters
Authorization
This request requires authorization with permission manage.asset.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
5.2. Assets
Asset is group of files linked with common feature. Each asset in TDR is created based on Asset Type
and has to be attached to metadata item. Under metadata item, only one asset from assets of common
types can be marked as default.
5.2.1. Asset
142
Tibigen Digital Repository - REST API
Example of representation
<asset id="1"
name="stream"
type-id="2"
item-uuid="a99a1455-fbbe-4594-ba95-cf32ef69ecd1"
technical-metadata-uuid="e50badc5-0c19-4c7b-903f-854a9e8dc4d9"
size="2399937876"
date-path="2015/05/05/fg_1/"
inserted="2015-05-05 11:27:01"
default="true"
last-accessed="2015-12-15 14:46:28"
/>
date-path string The path of this asset on file system. Asset is represented in
file system as directory.
last-accessed datetime The time when this asset had been used for the last time. On
asset update current time is set.
source-video-asset- integer Identifier of video source asset used to create this asset in
id transcoding process.
source-audio-asset- integer Identifier of audio source asset used to create this asset in
id transcoding process.
source-image-asset- integer Identifier of image source asset used to create this asset in
id transcoding process.
143
Tibigen Digital Repository - REST API
Example of representation
<assets total="10">
<asset id="1" name="stream" type-id="2" item-uuid="a99a1455-fbbe-4594-ba95-
cf32ef69ecd1"
technical-metadata-uuid="e50badc5-0c19-4c7b-903f-854a9e8dc4d9" size="2399937876"
date-path="2015/05/05/fg_1/" inserted="2015-05-05 11:27:01" last-accessed="2015-12-15
14:46:28" default="true"/>
</assets>
Request
GET /assets/{id}?detailed={detailed}
Path parameters
Query parameters
Authorization
This request requires authorization with permission view-files.item.ITEM_TYPE, where ITEM_TYPE is a
name of type of item to which asset is attached. Web service verifies asset type requirements.
144
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains Asset object, wrapped in Response
object.
Errors
Request
PUT /assets/{id}
Path parameters
Authorization
This request requires authorization with permission manage-files.item.ITEM_TYPE, where ITEM_TYPE
is a name of type of item, to which asset is attached.
This service verifies asset type permission requirements using Asset Type Requirement Verifier. For
more information, see Permission Requirements.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
145
Tibigen Digital Repository - REST API
Request
DELETE /assets/{id}
Path parameters
Authorization
This request requires authorization with permission manage-files.item.ITEM_TYPE, where ITEM_TYPE
is a name of type of item to which asset is attached.
This service verifies asset type permission requirements using Asset Type Requirement Verifier. For
more information, see Permission Requirements.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
TechnicalMetadataExistExcep 400 Asset has technical metadata item attached and cannot be
tion deleted.
146
Tibigen Digital Repository - REST API
Request
GET /assets/{id}/files?directory={directory}&detailed={detailed}&page={page}&size={size}
Path parameters
Query parameters
size integer The size of the page of results. Default value is 10.
Authorization
This request requires authorization with permission view-files.item.ITEM_TYPE, where ITEM_TYPE is a
name of type of item to which asset is attached. Web service verifies asset type requirements.
Response
If successful, the response status code is 200 OK and body contains File List object, wrapped in
Response object.
Request
GET /assets/{id}/files/uris?protocol={protocol}
Path parameters
147
Tibigen Digital Repository - REST API
Query parameters
protocol string The protocol for which URIs should be built. Available
protocols can be retrieved using List available protocols.
Authorization
This request requires authorization with permission download-files.item.ITEM_TYPE, where
ITEM_TYPE is a name of type of item to which asset is attached.
This service verifies asset type permission requirements using Asset Type Requirement Verifier. For
more information, see Permission Requirements.
Response
If successful, the response status code is 200 OK and body contains URI List object wrapped in
Response object.
Errors
Request
GET /assets?storage-id={storage-id}&asset-type-id={asset-type-id}&with-copies={with-
copies}&sort={sort}&direction={direction}&page={page}&size={size}&detailed={detailed}
Query parameters
148
Tibigen Digital Repository - REST API
asset-type-id integer The id of asset type. Can be set multiple times. REQUIRED.
with-copies boolean When true returns assets that have at least one file with at
last two file instances. Default value false.
sort string The asset parameter, that will be used to sort results.
direction string Direction of sorting. Allowed values asc (ascending) and desc
(descending). Default value desc.
size integer The size of the page of results. Default value is 10.
Authorization
This request requires authorization with permission view.file.
Response
If successful, the response status code is 200 OK and body contains Asset List object, wrapped in
Response object.
Errors
Request
POST /assets/{id}/files
Path parameters
149
Tibigen Digital Repository - REST API
In the request body, supply a File object with at least required properties.
Authorization
This request requires authorization with permission manage-files.item.ITEM_TYPE, where ITEM_TYPE
is a name of type of item to which asset is attached.
This service verifies asset type permission requirements using Asset Type Requirement Verifier. For
more information, see Permission Requirements.
Response
If successful, the response status code is 200 OK and body contains Value object with id of newly added
file, wrapped in Response object.
Errors
5.3. Files
File object represents abstract file which is not related to any store location. It stores information
about file name, size and check sum - things that should not change during migration of files from
storage to storage.
5.3.1. File
150
Tibigen Digital Repository - REST API
Example of representation
<file id="1"
access-path="2015/05/05/fg_1/stream.ts"
original-path="2015/05/05/fg_1/stream.ts"
asset-id="1"
asset-type-id="1"
directory="false"
inserted="2015-05-05 11:27:03"
md5="3a5ff29d4f73c0ee91c545b5700d9190"
size="2399937876" >
<file-instance file-id="1" growing="false" id="1" inserted="2015-05-05 11:27:03"
last-checked="2015-05-05 11:28:29"
name="2015/05/05/fg_1/stream.ts" size="2399937876"
storage-id="1" storage-name="High-res Video Storage" />
</file>
inserted datetime The time when this file had been created.
md5 string The MD5 control sum of physical file on a file system.
151
Tibigen Digital Repository - REST API
Example of representation
<files total="1">
<file id="1"
access-path="2015/05/05/fg_1/stream.ts"
original-path="2015/05/05/fg_1/stream.ts"
asset-id="1"
asset-type-id="1"
directory="false"
inserted="2015-05-05 11:27:03"
md5="3a5ff29d4f73c0ee91c545b5700d9190"
size="2399937876" />
</files>
Request
GET /files/{id}
Path parameters
Authorization
This request requires authorization with permission view-files.item.ITEM_TYPE, where ITEM_TYPE is a
name of type of item to which file is attached (through asset).
This service verifies asset type permission requirements using Asset Type Requirement Verifier. For
more information, see Permission Requirements.
152
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains File object wrapped in Response
object.
Errors
Request
GET /files/{id}/uris
Path parameters
Query parameters
protocol string The protocol for which URI should be built. Available
protocols can be retrieved using List available protocols.
Authorization
This request requires authorization with permission download-files.item.ITEM_TYPE, where
ITEM_TYPE is a name of type of item to which file is attached (through asset).
This service verifies asset type permission requirements using Asset Type Requirement Verifier. For
more information, see Permission Requirements.
Response
If successful, the response status code is 200 OK and body contains URI object wrapped in Response
object.
153
Tibigen Digital Repository - REST API
Errors
Request
PUT /files/{id}
Path parameters
Authorization
This request requires authorization with permission manage-files.item.ITEM_TYPE, where ITEM_TYPE
is a name of type of item to which file is attached (through asset).
This service verifies asset type permission requirements using Asset Type Requirement Verifier. For
more information, see Permission Requirements.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
154
Tibigen Digital Repository - REST API
Request
DELETE /files/{id}
Path parameters
Authorization
This request requires authorization with permission manage-files.item.ITEM_TYPE, where ITEM_TYPE
is a name of type of item to which file is attached (through asset).
This service verifies asset type permission requirements using Asset Type Requirement Verifier. For
more information, see Permission Requirements.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
Request
GET /files/{id}/instances?detailed={detailed}
Path parameters
155
Tibigen Digital Repository - REST API
Query parameters
Authorization
This request requires authorization with permission view-files.item.ITEM_TYPE, where ITEM_TYPE is a
name of type of item to which file is attached (through asset).
This service verifies asset type permission requirements using Asset Type Requirement Verifier. For
more information, see Permission Requirements.
Response
If successful, the response status code is 200 OK and body contains File Instance List wrapped in
Response object.
Errors
Request
GET /files/{id}/instances/optimal
156
Tibigen Digital Repository - REST API
Path parameters
Authorization
This request requires authorization with permission view-files.item.ITEM_TYPE, where ITEM_TYPE is a
name of type of item to which file is attached (through asset).
This service verifies asset type permission requirements using Asset Type Requirement Verifier. For
more information, see Permission Requirements.
Response
If successful, the response status code is 200 OK and body contains detailed representation of File
Instance object wrapped in Response object.
Errors
Request
POST /files/{id}/instances
Path parameters
In the request body, supply a File Instance object with at least required properties.
Authorization
This request requires authorization with permission manage-files.item.ITEM_TYPE, where ITEM_TYPE
is a name of type of item to which file is attached (through asset).
157
Tibigen Digital Repository - REST API
This service verifies asset type permission requirements using Asset Type Requirement Verifier. For
more information, see Permission Requirements.
Response
If successful, the response status code is 200 OK and body contains Value object with id of newly added
file instance, wrapped in Response object.
Errors
File instances are registered by TDR before they appear on target storage. This allows to work on
growing files. The growing property informs about actual state of instance creation.
<file-instance id="1938320"
name="2015/05/05/fg_906879/TVN_24_20150501031500-20150501034500.ts"
file-id="1938320"
growing="false"
size="2399937876"
inserted="2015-05-05 11:27:03"
last-checked="2015-05-05 11:28:29"
storage-id="24"
library="TSM"
storage-name="High-res Video Storage /u08" />
158
Tibigen Digital Repository - REST API
growing boolean If true, file on file system, represented by this file instance, is
currently being written. Default value is false.
inserted datetime The time when file instance had been created.
last-checked datetime The time when file instance had been checked for the last
time.
storage-name string The name of the storage on which file instance is stored.
Example of representations
<file-instances>
<file-instance id="1"
name="2015/05/05/fg_1/video.mp4"
file-id="1"
growing="false"
size="2399937876"
inserted="2015-05-05 11:27:03"
last-checked="2015-05-05 11:28:29"
storage-id="1"
library="TSM"
storage-name="High-res Video Storage" />
</file-instances>
Request
159
Tibigen Digital Repository - REST API
GET /file-instances?growing={growing}&detailed={detailed}&page={page}&size={size}
Query parameters
size integer The size of the page of results. Default value is 10.
Authorization
This request requires authorization with permission view.file.
Response
If successful, the response status code is 200 OK and body contains File Instance List wrapped in
Response object.
Request
GET /file-instances/{id}
Path parameters
Authorization
This request requires authorization with permission view-files.item.ITEM_TYPE, where ITEM_TYPE is a
name of type of item to which file instance is attached (through asset and file). Web service verifies
asset type requirements.
160
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains detailed representation File
Instance object wrapped in Response object.
Errors
Request
PUT /file-instances/{id}
Path parameters
In the request body, supply a File Instance object with updated properties.
Authorization
This request requires authorization with permission manage-files.item.ITEM_TYPE, where ITEM_TYPE
is a name of type of item to which file instance is attached (through asset and file).
This service verifies asset type permission requirements using Asset Type Requirement Verifier. For
more information, see Permission Requirements.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
161
Tibigen Digital Repository - REST API
Request
DELETE /file-instances/{id}
Path parameters
Authorization
This request requires authorization with permission manage-files.item.ITEM_TYPE, where ITEM_TYPE
is a name of type of item to which file instance is attached (through asset and file).
This service verifies asset type permission requirements using Asset Type Requirement Verifier. For
more information, see Permission Requirements.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
162
Tibigen Digital Repository - REST API
5.5. EDLs
EDL is an entity representing Edition Decision List. EDLs can be used in integration with various NLE.
Each EDL has to be attached to metadata item. Only one EDL can be assigned to single metadata item.
5.5.1. EDL
Example of representation
<edl uuid="97414fb4-4478-43a6-91d9-acb7a8ad96af"
fps="29.97"
width="1920"
height="1080"
version="2"
item-uuid="15105deb-702c-4b89-b1c1-02dc5ac153ce"
creator="admin"
modified-by="admin"
created="2017-01-24 13:07:33"
modified="2017-01-24 13:08:34">
<clips>
<clip uuid="2c09da06-82f3-495d-8768-1b850947179d"
item-uuid="15105deb-702c-4b89-b1c1-02dc5ac153ce"
asset-id="261"
source-tcin="00:00:22:27"
source-tcout="00:00:38:11"
target-tcin="00:00:14:18"
target-tcout="00:00:30:02"/>
<clip uuid="1c450d7a-dfd8-4d6a-a773-9e743e04084f"
item-uuid="42df506d-824e-46a5-b8e5-1f5290f145aa"
asset-id="265"
source-tcin="00:00:50:09"
source-tcout="00:00:58:05"
target-tcin="00:00:45:15"
target-tcout="00:00:53:11"/>
</clips>
</edl>
163
Tibigen Digital Repository - REST API
fps double FPS (Frames Per Second) value for this EDL. Required
item-uuid uuid UUID of the item, which owns this EDL. Required
modified-by string A login of the user who lately modified this item.
Example of representation
<edls total="8">
<edl uuid="e2fbc099-a6c6-457c-94f4-613fc2d68f4d"/>
<edl uuid="6c491f16-c2b1-4e92-b4f1-df56a957cf7f"/>
<edl uuid="f0d48f10-ead5-42bb-ad97-916300a6b9db"/>
</edls>
5.5.3. Clip
164
Tibigen Digital Repository - REST API
Example of representation
<clip uuid="2c09da06-82f3-495d-8768-1b850947179d"
item-uuid="15105deb-702c-4b89-b1c1-02dc5ac153ce"
asset-id="261"
source-tcin="00:00:22:27"
source-tcout="00:00:38:11"
target-tcin="00:00:14:18"
target-tcout="00:00:30:02"/>
source-tcin timecode Beginning of the part of source clip used in EDL. Required
source-tcout timecode End of the part of source clip used in EDL. Required
target-tcin timecode Position in EDL, where the beginning of the clip is placed.
Required
target-tcout timecode Position in EDL, where the end of the clip is placed.
Required
Request
GET /edls/{uuid}
Path parameters
Authorization
This request requires authorization with permission view-edl.item.ITEM_TYPE, where ITEM_TYPE is a
name of type of item to which EDL is attached.
165
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains EDL object, wrapped in Response
object.
Errors
Request
PUT /edls/{uuid}
Path parameters
Authorization
This request requires authorization with permission manage-edl.item.ITEM_TYPE, where ITEM_TYPE
is a name of type of item to which EDL is attached.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
166
Tibigen Digital Repository - REST API
Request
DELETE /edls/{uuid}
Path parameters
Authorization
This request requires authorization with permission manage-edl.item.ITEM_TYPE, where ITEM_TYPE
is a name of type of item to which EDL is attached.
Response
If successful, the response status code is 200 OK and contains empty Response object.
Errors
Request
GET /edls&detailed={detailed}&page={page}&size={size}
Query parameters
size integer The size of the page of results. Default value is 10.
167
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission view-edls.item.ITEM_TYPE, where ITEM_TYPE is a
name of type of item to which EDL is attached.
Response
If successful, the response status code is 200 OK and body contains EDL List object, wrapped in
Response object.
6. Storages
TDR defines hierarchical, three-level object structure which is used to describe data storage space in
the system. A Storage object specifies logical space on which files will be stored. Each storage has to be
part of Storage Group. Groups define boundaries in which storages operate. One group can be IMPORT
group containing storages with files intended for importing to the system. Other group can be EXPORT
group with storages being places where files exported from the system will be saved. There is also
INTERNAL group consisting of all storages containing files currently residing inside the system. The
last and special storage group type is REPORT which is used to bind together storages containing
reports generated with the system. The other function of the storage group is to specify what kind of
file types can be written on storages contained in that group.
Due to the fact that storages are abstract objects representing some logical space for data and do not
contain information needed to physically access to them, an additional objects were added - Storage
Access objects. Storage access represents method of accessing storage to which it is attached on. Single
storage can have multiple access methods, mostly varying in access protocol. When system needs to
access to storage and storage has multiple access method, system will try to select optimal access in
context which is currently working on.
<storage-group id="1"
name="High-res Video"
type="INTERNAL" />
168
Tibigen Digital Repository - REST API
<storage-group id="1"
name="High-res Video"
type="INTERNAL">
<asset-types>
<asset-type id="1"
name="Raw Stream"
media-type="NOT_SUPPORTED"
metadata-reader="MEDIA_INFO"
structure="SINGLE" />
</asset-types>
<storages>
<storage id="1"
name="High-res Video /u01"
updated="2015-07-16 01:26:19"
size="644245094400"
used-space="90831074068"
low-watermark="0"
high-watermark="0"
priority="76"
permission="READWRITE"
path="/u01/rc/resources/HighRes/" >
<storage-accesses>
<storage-access id="1"
protocol="LOCAL"
path="/u01/rc/resources/HighRes"
host="10.0.0.71"
priority="50"
available="false" />
</storage-accesses>
</storage>
</storages>
</storage-group>
169
Tibigen Digital Repository - REST API
asset-types Asset Type List A list of asset types which this storage group can store.
<storage-groups>
<storage-group id="1" name="Import Group" type="IMPORT"/>
<storage-group id="2" name="High-res Video Group" type="INTERNAL"/>
</storage-groups>
170
Tibigen Digital Repository - REST API
<storage-groups>
<storage-group id="1" name="Import Group" type="IMPORT">
<storages>
<storage id="1" name="Import" updated="2015-12-16 01:00:01" size="1099511627776"
used-space="33607671858" low-watermark="0" high-watermark="0" priority="100"
permission="READWRITE" path="/u01/rc/resources/Import/">
<storage-accesses>
<storage-access id="1" protocol="LOCAL" path="/u01/rc/resources/Import" host=
"10.0.0.71" port=""
login="" password="" priority="50" available="true"/>
</storage-accesses>
</storage>
</storages>
</storage-group>
<storage-group id="2" name="High-res Video Group" type="INTERNAL">
<asset-types>
<asset-type id="2" media-type="NOT_SUPPORTED" name="Raw Stream" metadata-
reader="MEDIA_INFO"
structure="SINGLE"/>
</asset-types>
<storages>
<storage id="2" name="High-res Video Storage /u01" updated="2015-07-16 01:09:43"
size="37383395344384"
used-space="34697601958984" low-watermark="60" high-watermark="90"
priority="80"
permission="READWRITE" path="/u01/rc/resources/HiResVideo/">
<storage-accesses>
<storage-access id="36" protocol="LOCAL" path="/u01/rc/resources/HiResVideo"
host="10.0.0.71"
port="" login="" password="" priority="50" available="false"/>
</storage-accesses>
</storage>
</storages>
</storage-group>
</storage-groups>
171
Tibigen Digital Repository - REST API
Request
GET /storage-groups
Query parameters
Authorization
This request requires authorization with permission view.storage.
Response
If successful, the response status code is 200 OK and body contains Storage Group List object wrapped
in Response object.
Request
GET /storage-groups/{id}
Path parameters
Authorization
This request requires authorization with permission view.storage.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
172
Tibigen Digital Repository - REST API
Errors
Request
POST /storage-groups
In the request body, supply a Storage Group object with at least required properties.
Authorization
This request requires authorization with permission manage.storage.
Response
If successful, the response status code is 200 OK and body contains Value object with id of newly
created storage group, wrapped in Response object.
Errors
InvalidStorageGroupNameEx 400 Name of this storage group was empty or not specified.
ception
Request
PUT /storage-groups/{id}
173
Tibigen Digital Repository - REST API
Path parameters
In the request body, supply a Storage Group object with updated properties.
Authorization
This request requires authorization with permission manage.storage.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
Request
DELETE /storage-groups/{id}
Path parameters
Authorization
This request requires authorization with permission manage.storage.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
174
Tibigen Digital Repository - REST API
Errors
Request
GET /storage-groups/{id}/storages
Path parameters
Authorization
This request requires authorization with permission view.storage.
Response
If successful, the response status code is 200 OK and body contains Storage List wrapped in Response
object.
Request
POST /storage-groups/{id}/storages
Path parameters
175
Tibigen Digital Repository - REST API
In the request body, supply a Storage object with at least required properties.
Authorization
This request requires authorization with permission manage.storage.
Response
If successful, the response status code is 200 OK and body contains Value object wrapped in Response
object.
Errors
6.2. Storages
Storage is a virtual file space. It can be either a local directory, as well as a remote directory accessible
through one of supported protocols, such as: FTP, FTPS, CIFS or HTTP.
6.2.1. Storage
Storage is a virtual file space. It can be either a local directory, as well as a remote directory accessible
through one of supported protocols, such as: FTP, FTPS, CIFS or HTTP.
176
Tibigen Digital Repository - REST API
<storage id="1"
name="High-res Video Storage /u01"
updated="2015-07-16 01:09:43"
size="37383395344384"
used-space="34697601958984"
low-watermark="60"
high-watermark="90"
priority="80"
permission="READWRITE"
path="/u01/rc/resources/HiResVideo/" />
<storage id="1"
name="High-res Video Storage /u01"
updated="2015-07-16 01:09:43"
size="37383395344384"
used-space="34697601958984"
low-watermark="60"
high-watermark="90"
priority="80"
permission="READWRITE"
path="/u01/rc/resources/HiResVideo/" >
<storage-accesses>
<storage-access id="36" protocol="LOCAL" path="/u01/rc/resources/HiResVideo" host=
"10.0.0.71"
port="" login="" password="" priority="50" available="false"/>
</storage-accesses>
</storage>
updated datetime The time when storage was updated for the last time.
177
Tibigen Digital Repository - REST API
used-space integer The size of files currently stored in this storage in bytes.
priority integer A value between 1 and 100 used for selecting optimal
storage. The higher the value, the storage is more promoted
to be optimal.
permission string The permission of operation allowed on this storage. One of:
- READWRITE - read and write operation are allowed,
- READONLY - read operation are allowed,
- DENY - read and write operation are forbidden. The storage
is disabled.
Example of representation
<storages>
<storage id="1" name="High-res Video Storage /u01" updated="2015-12-16 01:00:01" size=
"28587302322176"
used-space="95510965964" low-watermark="60" high-watermark="90" priority="100"
permission="READWRITE"
path="/u01/rc/resources/HiResVideo/" />
</storages>
178
Tibigen Digital Repository - REST API
Example of representation
<storage-content total="2">
<path directory="true">test_directory</path>
<path directory="false">test_file.mp4</path>
</storage-content>
6.2.4. Path
Path object represents single path (to file or directory) on storage.
Example of representation
<path directory="true">test_directory</path>
Example of representation
from string In case of MISSING error, contains name of the first file in
missing sequence. In case of INVALID_SIZE error, contains
name of the file with invalid size.
179
Tibigen Digital Repository - REST API
Example of representation
<sequence-errors>
<sequence-error from="file_3.txt" to="file_5.txt" type="MISSING"/>
<sequence-error from="file_1.txt" type="INVALID_SIZE"/>
</sequence-errors>
Request
GET /storages
Query parameters
group-type string If specified, storages from groups with this type will be
returned.
Authorization
This request requires authorization with permission list.storage.
180
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains Storage List object wrapped in
Response object.
Request
GET /storages/{id}
Path parameters
Authorization
This request requires authorization with permission view.storage.
Response
If successful, the response status code is 200 OK and body contains Storage object wrapped in Response
object.
Errors
Request
GET /storages/optimal
181
Tibigen Digital Repository - REST API
Query parameters
asset-type-id integer Only storages able to store this asset type will be found.
Required.
min-free-space integer Only storages having at least this free space will be found.
Required.
protocol string If specified, only storages having access method through this
protocol will be found.
Authorization
This request requires authorization with permission view.storage.
Response
If successful, the response status code is 200 OK and body contains Storage object wrapped in Response
object.
Errors
OptimalStorageNotFoundExc 404 Cannot find storage which meets the required conditions:
eption - belongs to storage group associated with given asset-type-
id
- has size of used space
- has at least one active access method
- has free space >= min-free-space
OptimalStorageWithRequired 404 Cannot find storage which meets the required conditions:
AccessNotFoundException - belongs to storage group associated with given asset-type-
id
- has size of used space
- has at least one active access method
- has free space >= min-free-space
- has access method for given protocol
Request
182
Tibigen Digital Repository - REST API
PUT /storages/{id}
Path parameters
Authorization
This request requires authorization with permission manage.storage.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
InvalidStorageSizeException 400 Cannot reduce storage size below current usage level.
Request
DELETE /storages/{id}
183
Tibigen Digital Repository - REST API
Path parameters
Authorization
This request requires authorization with permission manage.storage.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
StorageNotEmptyException 400 Instances of files exist on this storage and therefore storage
cannot be deleted.
StorageAccessesExistExceptio 400 Accesses to this storage exist and therefore storage cannot
n be deleted.
Request
GET /storages/{id}/accesses
Path parameters
Query parameters
184
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission view.storage.
Response
If successful, the response status code is 200 OK and body contains Storage Access List object wrapped
in Response object.
Request
GET /storages/{id}/accesses/optimal
Path parameters
Authorization
This request requires authorization with permission view.storage.
Response
If successful, the response status code is 200 OK and body contains Storage Access object wrapped in
Response object.
Errors
185
Tibigen Digital Repository - REST API
Request
POST /storages/{id}/accesses
Path parameters
In the request body, supply a Storage Access object with at least required properties.
Authorization
This request requires authorization with permission manage.storage.
Response
If successful, the response status code is 200 OK and body contains Value object wrapped in Response
object.
Errors
InvalidStorageAccessPriority 400 The priority is not between 1 and 100 or is not specified.
Exception
Request
GET /storages/{id}/file-instances
186
Tibigen Digital Repository - REST API
Path parameters
Authorization
This request requires authorization with permission view.file.
Response
If successful, the response status code is 200 OK and body contains File Instance List object wrapped in
Response object.
Request
GET /storages/{id}/content
Path parameters
Query parameters
uri string If id parameter has value undefined, uri should contain all
information needed to establish connection with remote
storage and list it. Otherwise, web-service uses path part of
the URI for navigation and one of the storage accesses for
establishing connection to storage defined in the system.
size integer The size of the page of results. Default value is 10.
Authorization
This request requires authorization with permission explore.storage.
187
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains Storage Content object wrapped in
Response object.
Errors
UriListingException 400 Failed to list storages. This can be related to file permissions
or URI given in query parameter leads to non-existing
resource.
OperationNotPermittedExcep 403 Due to security reasons, web-service does not allow to list
tion URIs beginning with file://
• name validation - checks if all names of the files have equal length and contain sequential number
at the end of name (excluding extension). Files have to follow sequence beginning with the smallest
sequential number found and increasing by one with every subsequent file. Any file with
inconsistent name will be reported within MISSING errors.
• size validation - checks if all files have equal sizes. Any file with inconsistent size will be reported
within INVALID_SIZE error. If more than half files have different sizes, then validation will exit
with error SEQUENCE_NOT_FOUND.
By default, both modes are used while checking sequence. Concrete mode can be selected by specifying
what type of errors web-service should return (type query parameter).
Movie_reel1_0010001.dpx
Movie_reel1_0010002.dpx
Movie_reel1_0010003.dpx
Movie_reel1_0010004.dpx
188
Tibigen Digital Repository - REST API
Movie_reel1_0000001.dpx
Movie_reel1_0000002.dpx
Movie_reel1_0000003.dpx
Movie_reel1_0010000.dpx
Request
GET /storages/{id}/content/sequence/errors?path={path}&type={type}
Path parameters
Query parameters
type string If specified, returns errors of given type. Possible values are:
- SEQUENCE_NOT_FOUND - indicates that there is no
sequence in given directory,
- MISSING - indicates files missing in sequence,
- INVALID_SIZE - indicates file that has size different than
other files in sequence.
Authorization
This request requires authorization with permission explore.storage.
Response
If successful, the response status code is 200 OK and body contains Sequence Error List wrapped in
Response object.
Errors
189
Tibigen Digital Repository - REST API
2. Get storage accesses having best protocol. Protocols are ordered as follows (from best to worst):
LOCAL, CIFS, FTP, FTPS, HTTP.
3. If there are multiple storage accesses with the same protocol, select these with the highest priority.
4. If there are multiple storage accesses with the same priority, return any of them.
To not allow system to select random storage access, as in the last step of above algorithm, user should
remember to always set different priority for different storage accesses.
<storage-access id="2"
protocol="LOCAL"
path="/u01/rc/resources/HiResVideo"
host="10.0.0.71"
port=""
login=""
password=""
priority="50"
available="true" />
190
Tibigen Digital Repository - REST API
protocol string The name of the protocol that will be used to connect with
storage service. One of:
- LOCAL - the storage is accessible as path on local file
system, allows reads and writes,
- UNC - SMB/CIFS protocol, allows reads and writes,
- FTP - FTP protocol, allows reads and writes,
- FTPS - FTP over SSL protocol, allows reads and writes,
- HTTP - HTTP protocol, allows reads.
Required.
priority integer The value between 1 and 100 used for selecting optimal
access to storage. The higher the value, the access is more
promoted to be optimal. Required.
Example of representation
<storage-accesses>
<storage-access id="2" protocol="LOCAL" path="/u01/rc/resources/HiResVideo" host=
"10.0.0.71" port="" login=""
password="" priority="50" available="true"/>
</storage-accesses>
191
Tibigen Digital Repository - REST API
Example of representation
<protocols>
<protocol>LOCAL</protocol>
<protocol>UNC</protocol>
<protocol>FTP</protocol>
<protocol>FTPS</protocol>
<protocol>HTTP</protocol>
</protocols>
Request
PUT /storage-accesses/{id}
Path parameters
In the request body, supply a Storage Access object with updated properties.
Authorization
This request requires authorization with permission manage.storage.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
InvalidStorageAccessPriority 400 The priority is not between 1 and 100 or is not specified.
Exception
192
Tibigen Digital Repository - REST API
Request
DELETE /storage-accesses/{id}
Path parameters
Authorization
This request requires authorization with permission manage.storage.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Request
GET /storage-accesses/protocols
Authorization
This request requires authentication.
193
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains Protocol List object wrapped in
Response object.
7. Processes
Tibigen Digital Repository has infrastructure specially designed to execute simple instant processes as
well as long-term heavy tasks. Some of the available processes are embedded into the system and
therefore cannot be changed. However, most of the processes are based on processes definitions - XML
like files containing jobs to execute within the process. That format allows you to rearrange jobs or add
completely new jobs to the processes.
The processes interface is divided into multiple levels depending on levels of abstractions. The
processes web-services are on the top-level of API. They allow you to execute single process as well as
multiple processes operating on items from common metadata collection. Processes are identified by
name. User, in web-servies call, can provide required and optional parameters needed to execute that
process.
After successful web-service call, system tries to find process with given name. There are two places
were processes are defined. First is a set of processes embedded in the application code. This
processes, when executed, run within TDR process in operating system. The other place is a directory
with process definitions. By default, directory is located under /etc/tdr/queues and contains definitions
in .vm files which are Apache Velocity template files. You can learn more about process definition
syntax in section Process Definitions. Processes known as embedded processes are invoked
immediately after web-service call. On the other hand, processes created from definitions are
scheduled in Job Daemon to later execution.
Second level of processes API abstraction focuses on queues and jobs. These web-services allow to
monitor and manage job queue executions. Job queues are containers of jobs. By default, jobs
contained in queues are executed sequentially, but nothing stands in the way to modify that behavior
and introduce parallel job execution. When all of the jobs inside job queue had been executed, the
queue will be considered as executed too. Job Daemon can execute finite number of jobs at one time,
so it is possibility to prioritize execution order on job queue level by manipulating job queue’s priority.
There are also other services on that abstraction level - services used to manage workers and
execution routes. Workers play important role in jobs ecosystem because they are responsible for
actual execution of specific jobs. Workers are separate application installed on different nodes. They
are communicating with Job Daemon - Job Daemon delegates them jobs to do, workers respond with
execution state. A worker configuration gives you possibility to very accurately define responsibility of
that worker by specifying worker’s capabilities. Capabilities are nothing more than job types that
worker can execute. Along with the system, we provides standard worker implementation that knows
how to execute generic TDR jobs. However, other workers can be created and registered in Job
Daemon to serve more specific, custom tasks.
Capabilities provide elastic approach to workers responsibility configuration, but when more fine-
194
Tibigen Digital Repository - REST API
grained control is needed, routes are solution for that problem. By defining route, user creates
additional contract that Job Daemon must comply during determination of what worker should do
next job. For example, route can tell that all jobs having specific input with specific value have to be
executed on worker installed on host NODE1. User can manage routes in runtime - routes will be
immediately taken into account.
At the lowest level of abstraction, the concrete job types are placed. Job type tells what operations
should be executed as the job runs. For example, there are job types like COPY_FILES or UNZIP which
do various operation on file system - in this case copying of files and unpacking a ZIP packages. More
sophisticated operation are also available like IMPORT which knows how to copy files to TDR internal
storages and register them in the system. Each job type available in current version of system is
described in Job Types section.
7.1. Processes
In TDR, there are two types of processes. The first type is embedded processes which when started,
execute in the same operating system process as TDR application. There are limited set of these
processes implemented in the application. They cannot be changed. On the other side, there are
processes based on a definition files. These processes are actually job queues parameterized with
process parameters. User can freely modify definition files. Definition based processes are scheduled
by TDR in Job Daemon to later execution as queues. When Job Daemon has suitable resources to
execute queues, it will handle over individual jobs from queue to proper workers. Definition based
processes may contain heavy tasks, so they are executed in separate operation system processes
(worker processes), possibly on other machines.
The API allows you to execute single process - embedded or definition based - from the API perspective
this is transparent. There is also possible to execute the same process as many times as number of
items in metadata collection. The only requirement is process to have itemUuid parameter, so that
system could automatically set that parameter for each collection entry. The last web-service in
processes API allows you to get all processes names that system currently knows.
Each process request, besides parameters defined by the user, receives implicit parameters. One of
that parameters is user which value is login of the user who sent process request. Other implicit
parameter is itemUuid and it is provided by the system for each metadata collection’s item when
process is executed on collection.
195
Tibigen Digital Repository - REST API
Example of representation
name string A name of the process to execute. This is a name of file with
process definition or name of embedded process. Required.
Example of representation
Example of representation
<execution-results>
<execution-result item-uuid="9718d3d0-bbb9-47c0-bfcc-6cae50e1a8a8" value="1"/>
<execution-result item-uuid="17de1126-81d9-48ae-970a-7f044ec50647" error=
"AuthorizationFailedException"/>
</execution-results>
196
Tibigen Digital Repository - REST API
item-uuid uuid An UUID of item from the metadata collection for which
process was executed.
In web-service call, system tries to locate process of given name. It searches set of embedded processes
and if no process was found, searches processes definition.
The web-service returns id of scheduled queue or 0 in case of embedded process, which executes
immediately.
Request
POST /processes/single
In the request body, supply a Process Request object with at least process name and required process
parameters.
197
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission execute.process.PROCESS_NAME, where
PROCESS_NAME is a name of the process which should be executed.
Response
If successful, the response status code is 200 OK and body contains Value object wrapped in Response
object. This value object contains id of scheduled job queue or if process executed immediately as
embedded process, value 0.
Errors
Request
POST /processes/batch
Query parameters
In the request body, supply a Process Request object with at least required properties and process
parameters. In order to locate valid collection, process request object has to have collection-id property
specified.
198
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission execute.process.PROCESS_NAME, where
PROCESS_NAME is a name of the process which should be executed.
This request verifies process permission requirements individually for each item in collection.
Response
If successful, the response status code is 200 OK and body contains Execution Result List object
wrapped in Response object. This execution result list contains ids of scheduled job queues or error
messages if scheduling failed.
Errors
Request
GET /processes
Authorization
This request requires authentication.
Response
If successful, the response status code is 200 OK and body contains Value List object wrapped in
Response object. Value List object contains names of all processes currently known to the system.
199
Tibigen Digital Repository - REST API
This process should be executed before Rebuild Index Process in order to rebuild index from scratch.
The process reads solr.url TDR configuration property to access to Solr server.
Name
clear_index
Parameters
This process does not take any parameters.
The only data that process indexes is metadata items and theirs content. Due to the fact that Solr is
document database and documents have flat structure, indexing process need to transform tree-
structured data to valid Solr format. The transformation is called flattening and it involves removing
all groups from metadata item so that all fields can be direct children of item. Moreover, process
indexes items in two forms - with and without hierarchy. An item indexed with hierarchy appears in
Solr as document containing all fields for that item and all fields from its ancestors and descendants.
The second form - item without hierarchy - appears as item with fields form this item only.
These two forms allow to more flexible queries. You should always specify an attr.hierarchy condition
in your queries. The attr.hierarchy attribute is boolean attribute which tells search engine what type of
indexed item to retrieve - with hierarchy (true) or without (false). If you do not pass attr.hierarchy
condition, search engine will return doubled results, which can be confusing.
When indexing process finishes transforming item and has the document in Solr format, it will replace
existing document is Solr server. The important note here is Rebuild Index Process does not remove
documents from Solr when theirs counterpart items are no longer in TDR. To get that behavior, you
need first execute process Clear Index Process.
At the beginning, process invalidates indexes for all metadata items. This can be observed by checking
index-valid item property. After that, web-service running the process returns. The actual indexing is
done in the background and it gradually sets index-valid properties to true.
200
Tibigen Digital Repository - REST API
Items based on types with indexed property set to false, are not added to Solr, but their index-valid
properties are managed the same way as indexed items. So, after successful index rebuild all items
should have index-valid set to true.
Name
rebuild_index
Parameters
This process does not take any parameters.
Name
synchronize_index
Parameters
Process does not take any parameters.
When user launch archive item process, system will remove given item and all its descendants from
search indexes.
Name
archive_item
Parameters
201
Tibigen Digital Repository - REST API
After successful restore, given item and its ancestors will be visible in search results and can be used
as parameters for other processes.
Name
restore_item
Parameters
In detail, process reads item in default language version (a template item) and creates new item with
the same UUID and language given for the new version. The newly created item contains equal content
as it’s template - groups and fields are also copied. Next step is to remove language dependant field
values, which affect all value field having translatable set to true in their types.
Since adding new language version, system will manage both or more of them. After updating one of
the versions, system will automatically apply changes on other language versions.
Name
create_language_version
Parameters
itemUuid uuid An UUID of item for which new language version will be
created. Required.
202
Tibigen Digital Repository - REST API
first-name givenName
last-name sn
Name
ldap_synchronize_user
Parameters
login string Login of user to synchronize with LDAP. User must be LDAP
user. Required.
Synchronization of users will be done with Synchronize LDAP User Process. It will be executed for
each user that has ldap field set to true.
Name
ldap_synchronize_user
203
Tibigen Digital Repository - REST API
Parameters
Process does not take any parameters.
The file content conforms to syntax rules of Apache Velocity template engine. To learn about powerful
features which Velocity have, you should visit its documentation at http://velocity.apache.org/.
Following description focuses only on features commonly used while writing process definition for
TDR.
Above example defines process which is job queue consisting two jobs: TRANSCODE and EXPORT. For
now, this file contains special Velocity directives like #if or #foreach, but after processing it will be a
valid XML file representing Job Queue object. Names starting with dollar sign $ are also special
identifiers for Velocity - they are variables. While processing, Apache Velocity reads variables from
204
Tibigen Digital Repository - REST API
context passed to processing and based on values of these variables executes directives.
In TDR process definition, context variables are always arrays, to support multi-value process
parameters. Therefore, in the example if single value is needed, variables are accessed by index.
Additionally, TDR introduced logic that validates variables presence. Variables can be required or
optional - this must be specified before variable names. All variables defined in process definition will
be parameters of that process. #if directive inserts its body to final file only if variable in parenthesis is
true. #foreach directive repeats its body for each variable present in an array.
There are two type of job queues in TDR: single and cyclic. Single queues are added directly to main
execution queue and are executed only once. On the other hand, cyclic queues can be executed
multiple time. They are like templates for the single queues. TDR creates single queues based on cyclic
queue at intervals defined by cron-expression property.
TDR orders queues by theirs priority property. Jobs from queues with bigger priority will be executed
earlier.
205
Tibigen Digital Repository - REST API
Example of representation
<job-queue id="2731"
type="SINGLE"
name="Check access"
status="FINISHED"
priority="50"
cron-expression="
created="2016-01-26 13:40:00"
created-by="admin"
updated="2016-01-26 13:40:00">
<job id="2741"
type="CHECK_ACCESS"
status="FINISHED"
progress="100"
sequence="0"
approved="true"
worker-id="12"
scheduled="2016-01-26 13:40:00"
started="2016-01-26 13:40:08"
finished="2016-01-26 13:40:08"
queue-id="2731">
<message/>
</job>
</job-queue>
priority integer The execution priority of job queue. Queues with higher
priority will be executed before other queues with lower
priorities. Priority can by any number between 1 and 100.
206
Tibigen Digital Repository - REST API
created-by datetime A login of the user, who created this job queue.
207
Tibigen Digital Repository - REST API
Example of representation
<job-queues total="1632">
<job-queue id="2731"
type="SINGLE"
name="Check access"
status="FINISHED"
priority="50"
created="2016-01-26 13:40:00"
created-by="admin"
updated="2016-01-26 13:40:00">
<job id="2741"
type="CHECK_ACCESS"
status="FINISHED"
progress="100"
sequence="0"
approved="true"
worker-id="12"
scheduled="2016-01-26 13:40:00"
started="2016-01-26 13:40:08"
finished="2016-01-26 13:40:08"
queue-id="2731">
<message/>
</job>
</job-queue>
<job-queues>
• <field-name> can be name of the one of the object’s property as described in a table bellow,
• <operator> can be one of the operators: EQ (equal), NE (not equal), LE (less than or equal), GE
(greater than or equal); operator is optional; default operator is EQ,
• <field-value> value of field, can be multiple values separated by commas, the values are implicitly
joined with OR operator.
208
Tibigen Digital Repository - REST API
For example, to search for queues with jobs started after 2015-01-01 00:00:00 you should pass such a
query param: job.started=GE:2015-01-01 00:00:00.
The query params allow to fiter by queue or job properties. If job property field has been used, web-
service still returns job queues, but only these containing jobs matching filter criteria. Query params
can be repeated for the same field - all occurrences will be joined with AND logical operator.
Request
GET /queues?queue.id={id}
&queue.name={name}
&queue.status={status}
&queue.type={type}
&queue.created={created}
&queue.created-by={user}
&queue.last-modified-by={user}
&queue.priority={priority}
&job.id={id}
&job.type={type}
&job.status={status}
&job.scheduled={date}
&job.started={date}
&job.expired={date}
&job.finished={date}
&job.approved={approved}
&job.worker-id={id}
&page={page}
&size={size}
Query parameters
209
Tibigen Digital Repository - REST API
queue.last-modified-by string A login of the user who updated job queue for the last time.
job.finished datetime The time when job finished either with success or failure.
size integer The size of the page of results. Default value is 10.
Authorization
This request requires authorization with permission view.process.
Response
If successful, the response status code is 200 OK and body contains Job Queue List object wrapped in
Response object.
Request
GET /queues/{id}
Path parameters
210
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission view.process.
Response
If successful, the response status code is 200 OK and body contains Job object wrapped in Response
object.
Errors
Request
PUT /queues/{id}
Path parameters
In the request body, supply a Job Queue object with updated priority property.
Authorization
This request requires authorization with permission manage.process.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
211
Tibigen Digital Repository - REST API
Errors
Request
DELETE /queues/{id}
Path parameters
Authorization
This request requires authorization with permission manage.process.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
JobDaemonException 403 Job queue is running and therefore queue cannot be deleted.
7.5. Jobs
Job represents consistent operation which is executed on various resources of TDR. The kind of this
operation is designated by type property. Job has its own lifecycle, which is managed by Job Daemon
component. After scheduling, the job waits for execution. Job can be executed only if suitable worker
exists.
212
Tibigen Digital Repository - REST API
7.5.1. Job
Example of representation
<job id="1"
type="IMPORT"
name="importer"
status="FINISHED"
progress="100"
sequence="0"
approved="true"
worker-id="323"
scheduled="2015-12-04 12:03:51"
started="2015-12-04 13:47:12"
finished="2015-12-04 13:47:28"
queue-id="518647">
<message></message>
</job>
name string A name of job. Required, if jobs after this job in queue
reference this job’s outputs.
progress integer A percentage number designating how many work has been
already executed.
213
Tibigen Digital Repository - REST API
approved boolean Must be true in order to start executing job. Default value is
true.
started datetime A time when job was sent to worker for execution.
expired datetime A time after which job will expire and will never run.
finished datetime A time when job successfully finished or ended with failure.
214
Tibigen Digital Repository - REST API
215
Tibigen Digital Repository - REST API
Example of representation
<jobs>
<job id="1"
type="IMPORT"
name="importer"
status="FINISHED"
progress="100"
sequence="0"
approved="true"
worker-id="323"
scheduled="2015-12-04 12:03:51"
started="2015-12-04 13:47:12"
finished="2015-12-04 13:47:28"
queue-id="518647">
<message></message>
</job>
</jobs>
<asset index="0"
name="targetItemUuid"
rel="item"
value="076c4fc8-a1b3-40b9-befd-772a91d1ffe5" />
<asset index="0"
name="targetItemUuid"
rel="item"
ref="itemCreator.uuid" />
216
Tibigen Digital Repository - REST API
index integer A number indicating order of assets with the same name.
Example of representation
<assets>
<asset index="0" name="sourceStorageId" value="1"/>
<asset index="0" name="targetItemUuid" rel="item" value="076c4fc8-a1b3-40b9-befd-
772a91d1ffe5"/>
<asset index="0" name="fileTypeId" value="2"/>
<asset index="0" name="inputFile" value="video.mpeg"/>
<asset index="0" name="deleteInputFiles" value="false"/>
<asset index="0" name="fileGroupName" value="video"/>
</assets>
Request
GET /jobs/{id}
217
Tibigen Digital Repository - REST API
Path parameters
Authorization
This request requires authorization with permission view.process.
Response
If successful, the response status code is 200 OK and body contains Job object wrapped in Response
object.
Errors
Request
GET /jobs/{id}/input?page={page}&size={size}
Path parameters
Query parameters
size integer The size of the page of results. If not specified, returns all
assets.
218
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission view.process.
Response
If successful, the response status code is 200 OK and body contains Job Asset List object wrapped in
Response object.
Errors
Request
GET /jobs/{id}/output?page={page}&size={size}
Path parameters
Query parameters
size integer The size of the page of results. If not specified, returns all
assets.
Authorization
This request requires authorization with permission view.process.
Response
If successful, the response status code is 200 OK and body contains Job Asset List object wrapped in
219
Tibigen Digital Repository - REST API
Response object.
Errors
For status property, valid values depend on current job status. The job’s status transition diagram is
depicted in Job section. Furthermore, possible statuses to set are limited to those values:
The other usage of this web-service is to allow workers to inform TDR about completed jobs. Worker,
which want to complete the job, have to send job object with status property having values FINISHED
or FAILED and message and output properties if present.
Request
PUT /jobs/{id}
Path parameters
Authorization
If user tries to change approved property, authorization with permission
accept.process.PROCESS_NAME is required, where PROCESS_NAME is a name of job queue which
contains job to update. In this situation, service verifies process permission requirements.
220
Tibigen Digital Repository - REST API
Otherwise, this request requires authorization with permission manage.process. The permission
requirements are not verified.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
Type
CALLBACK
Inputs
221
Tibigen Digital Repository - REST API
Check Access Job by default is configured in cyclic queue that runs every 10 minutes. That frequent
checking is needed for valid determination of optimal storage for other processes.
Type
CHECK_ACCESS
Inputs
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
Outputs
This job does not produce any output.
Type
CHECK_SPACE
Inputs
222
Tibigen Digital Repository - REST API
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
Outputs
This job does not produce any output.
Type
CLEAR_DIRECTORY
Inputs
Outputs
This job does not produce any output.
Type
COPY_FILES
Inputs
223
Tibigen Digital Repository - REST API
Outputs
This job does not produce any output.
Type
DELETE_FILE_COPIES
Inputs
assetTypeId integer List of ids of asset types that copies should be deleted.
Outputs
success string For each storage with exceed high watermark this output
will be set. Format of this output is as follows: Release space
on storage with id <storage id> and name <storage name>..
success string For each executed delete process this output will be set.
Format of this output is as follows: Execute delete process
with id <process id>. Files to delete <number of instances>
with size <summary size of instances>..
success string For each storage with enough copies to release usage to low
watermark this output will be set. Format of this output is as
follows: Released space on storage with id <storage id> and
name <storage name>. Usage <calculated storage usage>
Low watermark <storage low watermark>..
warning string For each storage with not enough copies to release usage to
low watermark this output will be set. Format of this output
is as follows: Cannot release space to low watermark
<storage low watermark> on storage with id <storage id>
and name <storage name>. Storage usage after files will be
deleted <calculated storage usage>..
224
Tibigen Digital Repository - REST API
By setting itemUuid and optionally assetTypeId, you can specify that this job will delete all assets
attached to item or assets with given asset type. Another way is to specify concrete asset id. There is
also possibility to delete specific files and specific instances of files.
Type
DELETE
Inputs
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
itemUuid uuid If specified, files attached to that item will be deleted. The
deletion can be narrowed down to specific asset type by
setting assetTypeId input.
assetTypeId integer If specified, narrows down types of files to delete from given
item.
assetId integer Id of asset to delete. All files contained in that asset will also
be deleted.
Outputs
success string For each deleted file this output will be set. Format of this
output is as follows: Deleted file path: <path>, where <path>
is absolute path of deleted file.
225
Tibigen Digital Repository - REST API
error string For each failure of file deletion this output will be set.
Format of this output is as follows: Could not delete file. File
path: <path>, where <path> is path of file which cannot be
deleted.
Type
DELETE_ITEM
Inputs
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
Outputs
This job does not produce any output.
Type
DELETE_OUTDATED_FILES
226
Tibigen Digital Repository - REST API
Outputs
success string For each executed deleting process this output will be set.
Format of this output is as follows: Execute delete process
with id <proces id> for asset with id <asset id>..
success string For each executed deleting archived files process this output
will be set. Format of this output is as follows: Execute tsm
delete process with id <proces id> for asset with id <asset
id>..
• new - add new field when field does not exist (create groups if it is necessary). For repeatable field
types, creates new field, when field with given value does not exist. If there is multiple groups
where field can be added, it adds field in each group.
• override - remove all fields of given field type and add field with given value. If there is multiple
groups where field can be added, it adds field in each group.
• condition - modify field only when condition determinated by condition value and condition
operator is satisfied.
Type
EDIT_ITEMS
Inputs
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
227
Tibigen Digital Repository - REST API
itemType string An item type name to edit. Items of other types will be
skipped. Required.
value string A new field value. For reference fields types value should be
valid uuid. Required.
Type
EXPORT
Inputs
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
228
Tibigen Digital Repository - REST API
itemUuid uuid An UUID of item. If specified, files attached to that item will
be exported. The list of files to export from item can be
narrowed down by specifying assetTypeId property.
outputName string A name of the output file, if only one file is exported. Specify
output name without file extension - file extension will be
copied from original file name. If not specified, job is using
original file name.
replaceExisting boolean If true, all files, existing on target storage and having names
exactly the same as exported files, will be overridden.
createTargetFolder boolean If true, export job will create additional folder, on target
storage, with the name of source Item title, where all
exported files will be placed. The default value is false.
Outputs
This job does not produce any output.
Job generates video descriptor using Video Analyzer software and attaches it to item designated with
itemUuid input.
Type
GENERATE_DESCRIPTOR
229
Tibigen Digital Repository - REST API
Inputs
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
itemUuid uuid An UUID of item with source video file attached to it.
Required.
sourceAssetTypeId integer An id of asset type representing source video e.g. low res
asset type. Required.
Outputs
Type
IMAGE_CONVERT
230
Tibigen Digital Repository - REST API
Inputs
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
lockWaitingTimeo integer A number of minutes after which job will stop trying to lock
utInMinutes source file instances to write. Default value is 1440 which is
24 hours.
Outputs
231
Tibigen Digital Repository - REST API
There are two ways to pass source location: through sourceStorageId and inputFile or inputUri inputs.
The first way assumes that source storage, which id is given in sourceStorageId input, already exists in
TDR and has valid access methods. By specifying that storage id and relative path to file or directory on
that storages, you identify resources to import. Other way gives possibility to connect through
supported protocol to remote location like FTP server. This is done by specifying inputUri input.
If input path leads to directory, this directory and all nested files and directories will be attached to
single asset.
Before copying files, job registers asset (if new is created), files and their instances. Registered
instances have growing properties set to true.
For all assets job will generate technical metadata item and attach it to target item as child.
Type
IMPORT
Inputs
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
232
Tibigen Digital Repository - REST API
deleteInputFiles boolean If true, source files will be deleted from source storage after
successful import.
assetName string Optional name of created asset. If not specified, new asset
will get name equal to name of given asset type in
assetTypeId input.
lockWaitingTimeo integer A maximum time to wait in minutes for target item, if item
utInMinutes has READ_WRITE lock.
failedPath string An relative path, within the sourceStorage where input file
will be moved in case of failure of IMPORT job.
Outputs
Type
NOTIFY_ABOUT_NEARLY_OUTDATED_FILES
Type
RENAME_FILE
233
Tibigen Digital Repository - REST API
Inputs
Outputs
This job does not produce any output.
Type
RESOLVE_PATH
Inputs
Outputs
absolutePath string Absolute path on storage i.e. storage local path + relative
path.
If technical metadata item is already attached to given asset, job will delete this item and create new
one.
234
Tibigen Digital Repository - REST API
• Identify software from Image Magick package, good for image files,
• DCP embedded reader, that extracts technical metadata from Digital Cinema Package name
following the rules of Digital Cinema Naming Convention.
Type
RETRIEVE_TECHNICAL_METADATA
Inputs
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
mediainfoPath string A path to the MediaInfo software that will be used to read
technical metadata.
Outputs
Job does not produce any output.
235
Tibigen Digital Repository - REST API
At the beginning, job locates video descriptor file attached to queryItem. Then, it narrows down
duration of query video with start and stop timecodes, specified in startTimecode and stopTimecode
inputs respectively. After that, for each index item, job finds video descriptor attached to it and
matches this descriptor with query video descriptor.
When matching for all index items complete, job saves result of matching in special item of type
video_search_results and attaches this item to query item as child.
Type
SEARCH_VIDEO
Inputs
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
indexItem uuid A list of UUID of items that will be searched (video search
mechanism will try to match video descriptors attached to
these items with query video descriptor). Required.
Outputs
Job does not produce output.
236
Tibigen Digital Repository - REST API
Type
SELECT_SPECIFICATION
Inputs
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
Outputs
Job only works on fields attached directly to item (item is parent entry for fields in metadata tree).
Fields contained in groups cannot be updated by this job.
Type
SET_FIELD
Inputs
237
Tibigen Digital Repository - REST API
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
value string A value which will be set in field. If not specified, old value
will be left.
reference string A reference which will be set in field. If not specified, old
reference will be left.
Outputs
Job does not produce output.
Transcode Job provides common interface for both transcoders. This interface is mainly based on
transcoding specification, which is instruction how to locate source files for transcoding operation and
where to save transcoding results. Transcoding specifications also have references to transcoding
profiles, which are transcoder specific. All options that can be specified in transcoding profiles are
described in sections FFmpeg Profiles and ProMedia Carbon Profiles.
Type
TRANSCODE
Inputs
238
Tibigen Digital Repository - REST API
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
itemUUid uuid An UUID of item which has attached source file for
transcoding and to which target file will be attached.
Required.
ffmpegPath string A path to FFmpeg software. If not specified, job assumes that
FFmpeg is in system PATH variable.
239
Tibigen Digital Repository - REST API
format string The format property from ProMedia Carbon Profile or the
format property from FFmpeg Profile.
videoFps float The video-fps property from ProMedia Carbon Profile or the
fps property from FFmpeg Video.
imageInterval integer The interval property from ProMedia Carbon Profile or the
interval property from FFmpeg Image.
240
Tibigen Digital Repository - REST API
Outputs
For each successfully archived file in TSM, job will register new file instance which is attached to TSM
archive.
Integration with TSM uses TSM client program: dsmc. This programs have to be available in PATH
environment variable.
Type
TSM_ARCHIVE
Inputs
Outputs
Job does not produce output.
TSM Archive Complex Job archives files attached to items based on archive policies. Archive policies
contain properties that define how archiving process should be launched and which files should be
241
Tibigen Digital Repository - REST API
included in that process. User can define archive policies using web-services described in Archive
Policies section.
The first step that job executes is to find archive policy for item passed as itemUuid input. Archive
policy is matched by item type. If there are no policy with given item type, job will finish with success
and the message property will contain appropriate warning. Next step is to locate files attached to
given item. Archive policy allows to specify files-from-descendants property. When it is set to true, files
attached to both given item and its descendants will be selected to archive.
When list of files to archive has been created, job need to locate tape storage pool which will be the
target of archive operation. Storage pools in TSM are logical groups of volumes, in this case magnetic
tapes. To locate proper tape storage pool, job reads storage-pool-name property from archive policy. If
it is defined, that storage pool will be used. Otherwise, job will create new storage pool with generated
name. The important note here: upon creation of new storage pool, TSM asks for device class. Job
responds with device class specified in tsm.device_class TDR property. Web-services able to set and
update this property are described in Properties section.
Job assumes that TSM in the first place archives files to disk storage pool, which acts as a cache. Then,
files are migrated to next storage pool, which is always tape storage pool. Before archiving, job will
make sure that disk storage pool is empty e.g. all files from previous archive process have been
successfully migrated to tapes. When job detects some files on disk storage pool, it will immediately fail
with appropriate error message. When this happens, manual TSM administrator intervention will be
required.
After selecting proper tape storage pool, job sets this storage pool as a next storage pool in TSM and at
the end of the archive process job sets back empty next storage pool. Depending on the size of all files
selected to archive, TSM can spawn automatic migration process, which copies data from disk storage
pool to tape storage pool. If this does not happen, job will spawn that process anyway. Then it waits for
migration process to complete. After that, archive process can be considered as finished.
Above workflow will be repeated for each copy, as configured in number-of-copies property in archive
policy.
For each successfully archived file in TSM, job will register new file instance which is attached to target
storage pool.
Integration with TSM uses two programs included within TSM installation: dsmc and dsmadmc. These
programs have to be available in PATH environment variable. Additionally, dsmadmc requires user
and password to admin account in TSM and library name to certain commands. Job will read these
configuration properties from TDR configuration from properties named tsm.user, tsm.password and
tsm.library.name respectively.
Type
TSM_ARCHIVE_COMPLEX
242
Tibigen Digital Repository - REST API
Inputs
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
Outputs
Job does not produce output.
Type
TSM_DELETE
Inputs
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
uuidId integer If specified, all assets and files attached to item with given
UUID will be deleted from TSM.
243
Tibigen Digital Repository - REST API
Outputs
Job does not produce output.
In order to properly manage tapes, TDR requires all operations of inserting tapes to be executed
through this job. The job launches in TSM checkin process which moves tapes inserted to I/O slot to
library internal slots. If tapes are inserted for the first time, job will launch additional label process.
Type
TSM_INSERT_TAPES
Inputs
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
Outputs
Job does not produce output.
Type
TSM_REMOVE_TAPES
Imports
244
Tibigen Digital Repository - REST API
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
storagePoolId integer An id of storage pool from which all tapes should be ejected
from library. Required.
location string A name of the location in which ejected tapes will be stored.
This information is only for user purposes. Required.
Outputs
Job does not produce output.
Type
TSM_RETRIEVE
Inputs
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
itemUuid uuid An UUID of item which files should be retrieved from tapes.
Outputs
Job does not produce output.
245
Tibigen Digital Repository - REST API
Type
TSM_SYNCHRONIZE
Inputs
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
Outputs
Job does not produce output.
Type
UNZIP
Inputs
outputDirectory string A path to output directory where files from ZIP package will
be saved. Required.
createOutputDirect boolean If true and output directory does not exist, job will create
ory entire directory structure as needed. Default value is false.
Outputs
246
Tibigen Digital Repository - REST API
outputFile string An absolute path to file extracted from ZIP package. This
output is repeated for each file in ZIP package.
Type
VALIDATE
Inputs
tdrApiLogin string A login of the user on whose behalf the job will be executed.
Required.
tdrApiPassword string A password of the user on whose behalf the job will be
executed. Required.
Outputs
247
Tibigen Digital Repository - REST API
Type
ZIP
Inputs
Outputs
Job does not produce output.
7.7. Workers
The main purpose of creating Job Daemon - workers architecture was to distribute load generated by
heavy tasks across multiple machines.
Workers in TDR are responsible for executing jobs. Before worker can do that, it needs to register to
Job Daemon which is manager software for all workers operating in the system. After successful
register, Job Daemon tracks workers and dispatches jobs to them. The communication between Job
Daemon and worker in both directions leverages REST API, so both Job Daemon and worker are HTTP
servers and clients.
This chapter and its subsections describes REST API on Job Daemon side. To learn more about worker’s
REST API, you should see Worker REST API chapter.
While registering, worker sends to Job Daemon list of all job types that it can handle. That list is known
as capabilities list. Job Daemon saves that information and uses it for proper dispatching of jobs.
When at least one worker is registered in Job Daemon, Job Daemon can start sending jobs to workers,
of course if workers capable to that jobs exist. To select the most suitable worker for the job, Job
Daemon uses worker election algorithm for that purpose, which performs following steps:
1. Job Daemon’s dispatcher selects workers having required capability to do awaiting job.
2. Dispatcher reads the routes (Routes). If non of them exist, dispatcher will skip this step. Otherwise,
dispatcher tries to match routes to the job. When some of the routes match, only the workers being
target of these routes participate in further election.
3. Dispatcher removes all workers matching following criteria: worker’s thread-pool is full, worker is
unstaged, worker has status NOT_RESPONDING.
4. Dispatcher sorts workers by host load - better worker has lower host load.
248
Tibigen Digital Repository - REST API
5. Dispatcher tries to send job to worker being first on the list. If connection cannot be established or
worker returned error, dispatcher gets next worker on the list and tries to send job to them.
After the worker receives the job, it uses idle thread from thread pool to execute the job. During
execute, job provides percentage progress. This progress is checked periodically by Job Daemon along
with worker state. When the job execution ends, whether with success or failure, worker informs Job
Daemon about that event, sending it status and outputs produced by the job.
TDR provides default implementation of worker, that is capable of doing job types needed for proper
operation of the system. Integrators can build theirs own custom workers as long as they conform to
REST API described in this chapter and in Worker REST API.
7.7.1. Worker
Example of representation
<worker id="1">
<capabilities>
<capability>SCHEDULE_RECORDING</capability>
<capability>LOAD_SUBTITLES</capability>
</capabilities>
<cores>2</cores>
<host>localhost</host>
<host-load>0.14</host-load>
<last-updated>2015-12-23 14:43:52</last-updated>
<name>custom-worker</name>
<not-responding-times>0</not-responding-times>
<os>Linux</os>
<port>9012</port>
<registered>2015-12-18 09:18:01</registered>
<running-threads>0</running-threads>
<status>OK</status>
<thread-pool>10</thread-pool>
<unstaged>false</unstaged>
<version>3.0</version>
</worker>
249
Tibigen Digital Repository - REST API
capabilities Capability List A list of job types that this worker can handle. Required at
least one capability.
last-updated datetime A time when Job Daemon for the last time successfully asked
for worker state.
250
Tibigen Digital Repository - REST API
unstaged boolean If true, Job Daemon will not dispatch new jobs to this
worker, but jobs which are already running on this worker,
will be properly tracked until finished. Otherwise, worker
behave normally accepting new jobs dispatched by Job
Daemon.
251
Tibigen Digital Repository - REST API
Example of representation
<workers>
<worker id="1">
<capabilities>
<capability>SCHEDULE_RECORDING</capability>
<capability>LOAD_SUBTITLES</capability>
</capabilities>
<cores>2</cores>
<host>localhost</host>
<host-load>0.14</host-load>
<last-updated>2015-12-23 14:43:52</last-updated>
<name>custom-worker</name>
<not-responding-times>0</not-responding-times>
<os>Linux</os>
<port>9012</port>
<registered>2015-12-18 09:18:01</registered>
<running-threads>0</running-threads>
<status>OK</status>
<thread-pool>10</thread-pool>
<unstaged>false</unstaged>
<version>3.0</version>
</worker>
</workers>
Example of representation
<capabilities>
<capability>DELETE_ITEM</capability>
<capability>EXPORT</capability>
<capability>IMPORT</capability>
</capabilities>
252
Tibigen Digital Repository - REST API
Request
GET /workers
Authorization
This request requires authorization with permission view.worker.
Response
If successful, the response status code is 200 OK and body contains Worker List object wrapped in
Response object.
Request
GET /workers/capabilities
Authorization
This request requires authorization with permission view.worker.
Response
If successful, the response status code is 200 OK and body contains Capability List object wrapped in
Response object.
Request
POST /workers
In the request body, supply a Worker object with at least required properties.
253
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission manage.worker.
Response
If successful, the response status code is 200 OK and body contains Value object with id of registered
worker, wrapped in Response object.
Errors
JobDaemonException 409 Worker with the same host and port is already registered.
Request
DELETE /workers/{id}
Path parameters
Authorization
This request requires authorization with permission manage.worker.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
254
Tibigen Digital Repository - REST API
7.8. Routes
Routes allow user to specify which jobs should be executed by which workers. A route object contains
properties used for matching jobs (condition-on, expected-name, expected-value) and properties
designating target worker (worker-host, worker-port). Matching is done for every new job added after
the route was applied. If job is matched, Job Daemon automatically dispatches it to target worker.
When multiple routes matches single job, a worker election algorithm takes over control.
Routes can be added at runtime and will be used to routing immediately after addition.
7.8.1. Route
Example of representation
<route id="1"
condition-on="INPUT"
expected-name="sourceStorageId"
expected-value="1"
worker-host="localhost"
worker-port="9013"
created="2015-07-23 08:52:41"
creator="admin" />
worker-host string The host of worker to which matched jobs will be routed.
Required.
worker-port integer The port of worker to which matched jobs will be routed.
Required.
255
Tibigen Digital Repository - REST API
Example of representation
<routes>
<route id="1"
condition-on="INPUT"
expected-name="sourceStorageId"
expected-value="1"
worker-host="localhost"
worker-port="9013"
created="2015-07-23 08:52:41"
creator="admin" />
</routes>
Request
GET /routes
Authorization
This request requires authorization with permission view.route.
Response
If successful, the response status code is 200 OK and body contains Route List object wrapped in
Response object.
256
Tibigen Digital Repository - REST API
Request
GET /routes/{id}
Path parameters
Authorization
This request requires authorization with permission view.route.
Response
If successful, the response status code is 200 OK and body contains Route object wrapped in Response
object.
Errors
Request
POST /routes
In the request body, supply a Route object with at least required properties.
Authorization
This request requires authorization with permission manage.route.
Response
If successful, the response status code is 200 OK and body contains Value object with id of newly
created route, wrapped in Response object.
257
Tibigen Digital Repository - REST API
Errors
Request
PUT /routes/{id}
Path parameters
Authorization
This request requires authorization with permission manage.route.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
Request
DELETE /routes/{id}
258
Tibigen Digital Repository - REST API
Path parameters
Authorization
This request requires authorization with permission manage.route.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
The API is composed of two domains: jobs and worker state. Jobs domain allows to add and manage
jobs in worker. Worker state domain, on the other hand, provides web-services to retrieve worker’s
state and shutdown worker.
Worker API operates on the same objects as TDR API e.g. Job, Job List, Job Asset, Job Asset List and
Worker. For now, API cannot be secured with authentication method.
Request
GET /jobs
Response
If successful, the response status code is 200 OK and body contains Job List object.
259
Tibigen Digital Repository - REST API
Request
GET /jobs/{id}
Path parameters
Response
If successful, the response status code is 200 OK and body contains Job object.
Errors
Request
GET /jobs/{id}/input
Path parameters
Response
If successful, the response status code is 200 OK and body contains Job Asset List object.
260
Tibigen Digital Repository - REST API
Errors
Request
POST /jobs
In the request body, Job Daemon will supply a Job object with following properties: id, type, input.
Response
If successful, the response status code is 204 No Content and body is empty.
Errors
400 Worker is not capable to do this type of jobs or job with this id is already being
executed.
429 Maximum number of jobs exceeded. Worker cannot execute another job.
Request
PUT /jobs/{id}
Path parameters
261
Tibigen Digital Repository - REST API
In the request body, Job Daemon will supply a Job object with status property.
Response
If successful, the response status code is 204 No Content and body is empty.
Errors
Request
DELETE /jobs/{id}
Path parameters
Response
If successful, the response status code is 204 No Content and body is empty.
Errors
262
Tibigen Digital Repository - REST API
Request
GET /state
Response
If successful, the response status code is 200 OK and body contains Worker object.
Request
POST /shutdown
Response
If successful, the response status code is 204 No Content and body is empty.
8. Transcoding
Transcoding is a process that allows to change one file format to another. A typical use case of
transcoding is to generate low resolution video or key frames from the video in high quality.
Transcoding is implemented as a process that can be executed by each user. More information about
transcoding process in section Transcode Job.
To execute transcoding process, system requires external transcoding software. TDR integrates with
three available transcoders:
• Transcoding profile - contains a set of transcoding parameters such as format and file name, or
fps and codec for video. For each supported transcoder is a separate type of profile. You can find
more information about profiles in sections ProMedia Carbon Profiles, FFmpeg Profiles,
263
Tibigen Digital Repository - REST API
ImageMagick Profiles.
• Transcoding specification - contains rules allowing automatically select inputs, defines output,
transcoder and profile for transcoding process. More information in section Transcoding
Specifications.
264
Tibigen Digital Repository - REST API
265
Tibigen Digital Repository - REST API
format string File format of output file generated by FFmpeg. With '*' will
take source file format.. *Required*.
override-output string If true, system will override file with the same name as
output file in output location. Default value is false.
Example of representation
<ffmpeg-profiles>
<ffmpeg-profile id="1" name="Generowanie klatek kluczowych - FFmpeg"/>
</ffmpeg-profiles>
266
Tibigen Digital Repository - REST API
Example of representation
<video>
<codec>libx264</codec>
<bitrate>1500000</bitrate>
<width>460</width>
<height>320</height>
<gop>1</gop>
<fps>25</fps>
<color-space>yuv420p</color-space>
</video>
color space string Color space (FFmpeg pixel format) of target video.
Example of representation
<audio>
<codec>libvo_aacenc</codec>
<bitrate>196608</bitrate>
<channels>2</channels>
</audio>
267
Tibigen Digital Repository - REST API
Example of representation
<image>
<count>10</count>
<interval>30</interval>
<skip-first-frame>false</skip-first-frame>
<width>460</width>
<height>320</height>
</image>
count integer Number of key frames that will be generated from the video.
interval integer Time interval (in seconds) between generated key frames. If
count parameter is specified, then this option is not used by
transcoding process.
skip-first-frame boolean If true, system will skip the first key frame of the generated
key frames. This option does not affect the overall number
of key frames. If a defined number of frames is 10, then after
selecting this option it still will be 10 frames. The system in
this case will generate 11 key frames and skips first frame.
This option is particularly useful in cases, when video begins
with a fade-in.
268
Tibigen Digital Repository - REST API
Example of representation
<filter>
<overlay>
<x>10</x>
<y>10</y>
</overlay>
<deinterlacing>false</deinterlacing>
</filter>
overlay x integer Distance (in pixels) from left side of video where logo will be
placed.
overlay y integer Distance (in pixels) from top side of video where logo will be
placed.
Request
GET /profiles/ffmpeg?page={page}&size={size}
Query parameters
page integer The number of page of results to return. If not specified, web-service
returns all FFmpeg profiles.
size integer The size of the page of results. Default value is 10.
Authorization
This request requires authorization with permission view.transcoding.
Response
If successful, the response status code is 200 OK and body contains FFmpeg Profile List object wrapped
269
Tibigen Digital Repository - REST API
in Response object.
Request
GET /profiles/ffmpeg/{id}
Path parameters
Authorization
This request requires authorization with permission view.transcoding.
Response
If successful, the response status code is 200 OK and body contains FFmpeg Profile object wrapped in
Response object.
Errors
Request
POST /profiles/ffmpeg
In the request body, supply a FFmpeg Profile object with at least required properties.
270
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission manage.transcoding.
Response
If successful, the response status code is 200 OK and body contains Value object with ID on newly
added FFmpeg profile wrapped in Response object.
Errors
Request
PUT /profiles/ffmpeg/{id}
Path parameters
In the request body, supply a FFmpeg Profile object with updated properties.
Authorization
This request requires authorization with permission manage.transcoding.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
271
Tibigen Digital Repository - REST API
Request
DELETE /profiles/ffmpeg/{id}
Path parameters
Authorization
This request requires authorization with permission manage.transcoding.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
272
Tibigen Digital Repository - REST API
Example of representation
<carbon-profile format="jpg"
guid="9E0F23AB-F324-4473-848D-70D8596C5E3D"
id="2"
image-count="20"
name="Generowanie klatek kluczowych"
output-name="%s"
override-output="false"
skip-first-frame="true"
timing-mode="0"
video-fps="25"
interval="5"
image-height="320"
image-width="460">
<filter>9E0F23AB-F324-4473-848D-70D8596C5E3D</filter>
<start-timecode>00:00:00:00</start-timecode>
<stop-timecode>00:11:11:11</stop-timecode>
<video-width>460</video-width>
<video-height>320</video-height>
</carbon-profile>
image-count integer Number of key frames that will be generated from the video.
If interval parameter is specified, then this option is not
used by transcoding process.
273
Tibigen Digital Repository - REST API
override-output boolean If true, system will override file with the same name as
output file in output location. Default value is false.
skip-first-frame boolean If true, system will skip the first key frame of the generated
key frames. This option does not affect the overall number
of key frames. If a defined number of frames is 10, then after
selecting this option it still will be 10 frames. The system in
this case will generate 11 key frames and skips first frame.
This option is particularly useful in cases, when video begins
with a fade-in.
interval integer Time interval (in seconds) between generated key frames.
274
Tibigen Digital Repository - REST API
Example of representation
<carbon-profile-list>
<carbon-profile format="jpg"
guid="9E0F23AB-F324-4473-848D-70D8596C5E3D"
id="2"
image-count="20"
name="Generowanie klatek kluczowych"
output-name="%s"
override-output="false"
skip-first-frame="true"
timing-mode="0"
video-fps="25"
interval="5"
image-height="320"
image-width="460">
<filter>9E0F23AB-F324-4473-848D-70D8596C5E3D</filter>
<start-timecode>00:00:00:00</start-timecode>
<stop-timecode>00:11:11:11</stop-timecode>
<video-width>460</video-width>
<video-height>320</video-height>
</carbon-profile>
</carbon-profile-list>
Request
GET /profiles/carbon?page={page}&size={size}
Query parameters
page integer The number of page of results to return. If not specified, web-service
returns all ProMedia Carbon profiles.
size integer The size of the page of results. Default value is 10.
275
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission view.transcoding.
Response
If successful, the response status code is 200 OK and body contains ProMedia Carbon Profile List object
wrapped in Response object.
Request
GET /profiles/carbon/{id}
Path parameters
Authorization
This request requires authorization with permission view.transcoding.
Response
If successful, the response status code is 200 OK and body contains ProMedia Carbon Profile object
wrapped in Response object.
Errors
TranscodingProfileNotFound 404 Cannot find ProMedia Carbon profile with given id.
Exception
Request
276
Tibigen Digital Repository - REST API
POST /profiles/carbon
In the request body, supply a ProMedia Carbon Profile object with at least required properties.
Authorization
This request requires authorization with permission manage.transcoding.
Response
If successful, the response status code is 200 OK and body contains Value object with ID on newly
added ProMedia Carbon profile wrapped in Response object.
Errors
Request
PUT /profiles/carbon/{id}
Path parameters
In the request body, supply a ProMedia Carbon Profile object with updated properties.
Authorization
This request requires authorization with permission manage.transcoding.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
277
Tibigen Digital Repository - REST API
Errors
TranscodingProfileNotFound 404 Cannot find ProMedia Carbon profile with given id.
Exception
Request
DELETE /profiles/carbon/{id}
Path parameters
Authorization
This request requires authorization with permission manage.transcoding.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
TranscodingProfileNotFound 404 Cannot find ProMedia Carbon profile with given id.
Exception
278
Tibigen Digital Repository - REST API
<image-magick-profile id="1"
name="Image Preview Quality"
output-format="jpg"
output-name-template="%s"
quality="90"
resize-width="460"
resize-height="320"
logo-path="/etc/tdr/logo.png"
logo-x="10"
logo-y="10"
dpi="10x10"
gravity="NORTH_WEST"
preserve-print-size="false"/>
279
Tibigen Digital Repository - REST API
logo-x integer Distance (in pixels) from left side of image where logo will
be placed.
logo-y integer Distance (in pixels) from top side of image where logo will
be placed.
preserve-print-size boolean If true, system will calculate image width and height
depending on DPI change to preserve print size. Property
'resize-width' and 'resize-height' can not be set.
Example of representation
<image-magick-profiles>
<image-magick-profile id="1" name="Image Preview Quality"/>
</image-magick-profiles>
Request
GET /profiles/imagemagick?page={page}&size={size}
Query parameters
page integer The number of page of results to return. If not specified, web-service
returns all ImageMagick profiles.
size integer The size of the page of results. Default value is 10.
280
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission view.transcoding.
Response
If successful, the response status code is 200 OK and body contains ImageMagick Profile List object
wrapped in Response object.
Request
GET /profiles/imagemagick/{id}
Path parameters
Authorization
This request requires authorization with permission view.transcoding.
Response
If successful, the response status code is 200 OK and body contains ImageMagick Profile object
wrapped in Response object.
Errors
Request
281
Tibigen Digital Repository - REST API
POST /profiles/imagemagick
In the request body, supply a ImageMagick Profile object with at least required properties.
Authorization
This request requires authorization with permission manage.transcoding.
Response
If successful, the response status code is 200 OK and body contains Value object with ID of newly added
ImageMagick profile wrapped in Response object.
Errors
InvalidTranscodingProfilePro 400 Quality is lower than 1 or higher than 100. Format is not
pertyException specified or is empty. Name is not specified or is empty.
Request
PUT /profiles/imagemagick/{id}
Path parameters
In the request body, supply a ImageMagick Profile object with updated properties.
Authorization
This request requires authorization with permission manage.transcoding.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
282
Tibigen Digital Repository - REST API
Errors
InvalidTranscodingProfilePro 400 Quality is lower than 1 or higher than 100. Format is not
pertyException specified or is empty. Name is not specified or is empty.
Request
DELETE /profiles/imagemagick/{id}
Path parameters
Authorization
This request requires authorization with permission manage.transcoding.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
283
Tibigen Digital Repository - REST API
284
Tibigen Digital Repository - REST API
285
Tibigen Digital Repository - REST API
Example of representation
<transcoding-specifications>
<transcoding-specification id="1">
<name>Key Frames Generation</name>
<source>
<video>
<asset-type-id>1</asset-type-id>
</video>
</source>
<profile transcoder="PROMEDIA_CARBON">
<id>2</id>
</profile>
<target>
<asset-type-id>2</asset-type-id>
</target>
</transcoding-specification>
</transcoding-specifications>
Example of representation
<source>
<video>
<asset-type-id>1</asset-type-id>
</video>
<audio>
<asset-type-id>2</asset-type-id>
</audio>
<image>
<asset-type-id>3</asset-type-id>
</image>
</source>
286
Tibigen Digital Repository - REST API
Example of representation
<video>
<asset-type-id>1</asset-type-id>
</video>
asset-type-id integer The unique identifier of asset type which will be used to find
source video file.
Example of representation
<audio>
<asset-type-id>2</asset-type-id>
</audio>
287
Tibigen Digital Repository - REST API
asset-type-id integer The unique identifier of asset type which will be used to find
source audio file.
Example of representation
<image>
<asset-type-id>3</asset-type-id>
</image>
asset-type-id integer The unique identifier of asset type which will be used to find
source image file.
Example of representation
<profile transcoder="PROMEDIA_CARBON">
<id>2</id>
</profile>
288
Tibigen Digital Repository - REST API
Example of representation
<target>
<asset-type-id>4</asset-type-id>
</target>
asset-type-id integer The unique identifier of asset type which will be associated
with generated file.
Request
GET /transcoding/specifications?page={page}&size={size}
Query parameters
page integer The number of page of results to return. If not specified, web-service
returns all transcoding specifications.
size integer The size of the page of results. Default value is 10.
Authorization
This request requires authorization with permission view.transcoding.
289
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains Transcoding Specification List
object wrapped in Response object.
Request
GET /transcoding/specifications/{specification-id}
Path parameters
Authorization
This request requires authorization with permission view.transcoding.
Response
If successful, the response status code is 200 OK and body contains Transcoding Specification object
wrapped in Response object.
Errors
Request
POST /transcoding/specifications
In the request body, supply a Transcoding Specification object with at least required properties.
290
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission manage.transcoding.
Response
If successful, the response status code is 200 OK and body contains Value object with ID of newly added
transcoding specification wrapped in Response object.
Errors
Request
PUT /transcoding/specifications/{specification-id}
Path parameters
In the request body, supply a Transcoding Specification object with updated properties.
Authorization
This request requires authorization with permission manage.transcoding.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
291
Tibigen Digital Repository - REST API
Request
DELETE /transcoding/specifications/{specification-id}
Path parameters
Authorization
This request requires authorization with permission manage.transcoding.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
9. Archiving
The system has a module for integration with TSM - Tivoli Storage Manager. This module allows to
archive and restore files from tape library. It also provides basic information about the volumes in
TSM.
292
Tibigen Digital Repository - REST API
• whether the selected item should be archived alone or with its descendants.
These options can be configured per item type. Thereby, for example item type Feature Film can have
different number of copies than item type Documentary.
Each item type can have multiple archive policies defined, but only one can be active.
<archive-policy id="1"
name="Film - 2 copies"
active="true"
files-from-descendants="false"
item-type-name="film"
number-of-copies="2"
storage-pool-name="FILMSTGP"/>
active boolean If true, archive process will be using this archive policy to
archive item. For each item type, only one archive policy can
be active at any given time. Default value is false.
files-from- boolean If true, system will archive files from given item, as well as
descendants files from descendant items. In this way, files from the entire
tree of items will be archived in the same storage pool.
Default value is false.
293
Tibigen Digital Repository - REST API
item-type-name string The item type for which the policy will be applied.
Required.
storage-pool-name string The name of storage pool for archived files. If the name is
empty, then system will generate it automatically, based on
the options selected in archive policy. However, if the name
is not empty, then system will create new pool by this name
or use an existing one. In the case of automatic name
generation, there are two options: - When files-from-
descendants option is true, then the name will consist of
prefix IC, then the 27 first characters ( without dashes ) of
the item UUID, and number of copy, i.e.
IC-F4844531BE3D4B6EB63E3FE21C1 - this is a second copy
for item with UUID which begins with
F4844531BE3D4B6EB63E3FE21C ( without dashes). Files will
be archived from given item and it’s descendant items. -
When files-from-descendants option is false, then the name
will consist of prefix I, then the 27 first characters ( without
dashes ) of the item UUID, and number of copy, i.e.
I-F4844531BE3D4B6EB63E3FE21C0 - this is a first copy for
item with UUID which begins with
F4844531BE3D4B6EB63E3FE21C ( without dashes). Files will
be archived only from given item.
Example of representation
<archive-policies>
<archive-policy id="1" name="Film - 2 kopie"/>
</archive-policies>
Request
294
Tibigen Digital Repository - REST API
GET /tsm/policies?detailed={detailed}
Query parameters
detailed boolean If true, returns detailed representation of each archive policy in a list.
Default value is false.
Authorization
This request requires authorization with permission view.tsm.
Response
If successful, the response status code is 200 OK and body contains Archive Policy List object wrapped
in Response object.
Request
GET /tsm/policies/{policy-id}
Path parameters
Authorization
This request requires authorization with permission view.tsm.
Response
If successful, the response status code is 200 OK and body contains Archive Policy object wrapped in
Response object.
Errors
295
Tibigen Digital Repository - REST API
Request
POST /tsm/policies
In the request body, supply an Archive Policy object with at least required properties.
Authorization
This request requires authorization with permission manage.tsm.
Response
If successful, the response status code is 200 OK and body contains Value object with ID of newly added
archive policy wrapped in Response object.
Errors
ArchivePolicyAlreadyExistsE 409 There is another archive policy for the same item type.
xception
296
Tibigen Digital Repository - REST API
Request
PUT /tsm/policies/{policy-id}
Path parameters
In the request body, supply an Archive Policy object with updated properties.
Authorization
This request requires authorization with permission manage.tsm.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
ArchivePolicyAlreadyExistsE 409 There is another archive policy with the same item type.
xception
Request
297
Tibigen Digital Repository - REST API
DELETE /tsm/policies/{policy-id}
Path parameters
Authorization
This request requires authorization with permission manage.tsm.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
298
Tibigen Digital Repository - REST API
Example of representation
<tsm-volumes association-status="SCRATCH"
device-type="LTO"
id="136"
inserted="2015-01-01 00:01:19"
library-name="MHVTL"
location-inside-library=""1,024""
updated="2015-01-01 00:01:19"
volume-name="I00001L1"
library-status="MOUNTABLE_NOT_IN_LIB"
location-outside-library="Room 01 Drawer 17"
device-class-name="DISK"
estimated-capacity="157286400"
percentage-utilization="0.0"
fill-status="ONLINE"
storage-pool-id="3"/>
inserted datetime The time when TSM volume was created in TDR.
updated datetime The time when TSM volume was updated in TDR.
299
Tibigen Digital Repository - REST API
Example of representation
<tsm-volumes>
<tsm-volumes association-status="SCRATCH"
device-type="LTO"
id="136"
inserted="2015-01-01 00:01:19"
library-name="MHVTL"
location-inside-library=""1,024""
updated="2015-01-01 00:01:19"
volume-name="I00001L1"/>
</tsm-volumes>
Request
GET /tsm/volumes?page={page}&size={size}&detailed={detailed}
Query parameters
page integer The number of page of results to return. If not specified, web-service
returns all TSM volumes.
detailed boolean If true, returns detailed representation of each TSM volume in a list.
Default value is false.
300
Tibigen Digital Repository - REST API
Authorization
This request requires authorization with permission view.tsm.
Response
If successful, the response status code is 200 OK and body contains TSM Volume List object wrapped in
Response object.
Request
GET /tsm/volumes/{id}
Path parameters
Authorization
This request requires authorization with permission view.tsm.
Response
If successful, the response status code is 200 OK and body contains TSM Volume object wrapped in
Response object.
Errors
Request
301
Tibigen Digital Repository - REST API
POST /tsm/volumes
In the request body, supply a TSM Volume object with at least required properties.
Authorization
This request requires authorization with permission manage.tsm.
Response
If successful, the response status code is 200 OK and body contains Value object with ID of newly added
TSM volume wrapped in Response object.
Errors
Request
PUT /tsm/volumes/{id}
Path parameters
In the request body, supply a TSM Volume object with updated properties.
Authorization
This request requires authorization with permission manage.tsm.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
302
Tibigen Digital Repository - REST API
Errors
Request
DELETE /tsm/volumes/{id}
Path parameters
Authorization
This request requires authorization with permission manage.tsm.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
303
Tibigen Digital Repository - REST API
Example of representation
<tsm-storage-pool device-class-name="DISK"
estimated-capacity="157286400"
high-migration-percentage="90.0"
id="3"
inserted="2015-02-15 05:45:37"
low-migration-percentage="70.0"
percentage-migration="0.0"
storage-pool-name="SEQ_DISK"
updated="2015-01-01 00:01:16"
percentage-utilization="0.0"
next-storage-pool="4"/>
inserted datetime The time when TSM storage pool was created in TDR.
updated datetime The time when TSM storage pool was updated in TDR.
304
Tibigen Digital Repository - REST API
Example of representation
<tsm-storage-pools>
<tsm-storage-pool id="3"
device-class-name="DISK"
estimated-capacity="157286400"
high-migration-percentage="90.0"
inserted="2015-02-15 05:45:37"
low-migration-percentage="70.0"
percentage-migration="0.0"
storage-pool-name="SEQ_DISK"
updated="2015-01-01 00:01:16"
percentage-utilization="0.0"/>
</tsm-storage-pools>
Request
GET /tsm/storage-pools?name={name}&page={page}&size={size}&detailed={detailed}
Query parameters
page integer The number of page of results to return. If not specified, web-service
returns all TSM storage pools.
size integer The size of the page of results. Default value is 10.
detailed boolean If true, returns detailed representation of each TSM storage pool in a
list. Default value is false.
Authorization
This request requires authorization with permission view.tsm.
Response
If successful, the response status code is 200 OK and body contains TSM Storage Pool List object
wrapped in Response object.
305
Tibigen Digital Repository - REST API
Request
GET /tsm/storage-pools/{id}
Path parameters
Authorization
This request requires authorization with permission view.tsm.
Response
If successful, the response status code is 200 OK and body contains TSM Storage Pool object wrapped in
Response object.
Errors
StoragePoolNotFoundExcepti 404 Cannot find TSM storage pool with given id.
on
Request
POST /tsm/storage-pools
In the request body, supply a TSM Storage Pool object with at least required properties.
Authorization
This request requires authorization with permission manage.tsm.
306
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains Value object with ID of newly added
TSM storage pool wrapped in Response object.
Errors
Request
PUT /tsm/storage-pools/{id}
Path parameters
In the request body, supply a TSM Storage Pool object with updated properties.
Authorization
This request requires authorization with permission manage.tsm.
307
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
StoragePoolNotFoundExcepti 404 Cannot find TSM storage pool with given id.
on
Request
DELETE /tsm/storage-pools/{id}
Path parameters
Authorization
This request requires authorization with permission manage.tsm.
308
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
StoragePoolNotEmptyExcepti 400 Cannot delete TSM storage pool with files on it.
on
StoragePoolNotFoundExcepti 404 Cannot find TSM storage pool with given id.
on
<tsm-process process="Migration"
process-number="60"
start-time="2015-02-25 19:32:40"
status=""Disk Storage Pool SEQ_DISK, Moved Files: 2, Moved Bytes: 93,724,672,
Unreadable Files: 0, Unreadable Bytes: 0. Current Physical File (bytes): 46,862,336 Waiting for
mount of scratch volume (0 seconds). ""/>
309
Tibigen Digital Repository - REST API
Example of representation
<tsm-processes>
<tsm-process process="Migration"
process-number="60"
start-time="2015-02-25 19:32:40"
status=""Disk Storage Pool SEQ_DISK, Moved Files: 2, Moved Bytes: 93,724,672,
Unreadable Files: 0, Unreadable Bytes: 0. Current Physical File (bytes): 46,862,336 Waiting for
mount of scratch volume (0 seconds). ""/>
</tsm-processes>
Request
GET /tsm/processes
Authorization
This request requires authorization with permission view.tsm.
Response
If successful, the response status code is 200 OK and body contains TSM Process List object wrapped in
Response object.
310
Tibigen Digital Repository - REST API
Example of representation
<retention-policy
uuid="c798f564-4bba-41fb-9ab8-54b8aa5b8f17"
period="24"
type="GLOBAL"
asset-type-id="1">
<labels>
<label lang="EN" value="High res - two years" />
</labels>
</retention-policy>
period integer Number of months that given asset type’s files should be
stored in TDR.
type string The type of Retention Policy. It can be LOCAL (policies with
this type can be chosen per item and affects its files) or
GLOBAL (policies with this type affects files of defined asset
type).
labels Label List A list of labels in languages defined in TDR. TDR requires at
least one label in system default language.
311
Tibigen Digital Repository - REST API
Example of representation
<retention-policies>
<retention-policy
uuid="c798f564-4bba-41fb-9ab8-54b8aa5b8f17"
period="24"
type="GLOBAL"
asset-type-id="1">
<labels>
<label lang="EN" value="High res - two years" />
</labels>
</retention-policy>
</retention-policies>
Request
GET /retention-policies?type={type}&page={page}&size={size}&detailed={detailed}
Query parameters
type string The type of retention policy. Only retention policies with given type
will be returned. If not set, all retention policies will be returned.
size integer The size of the page of results. Default value is 10.
Authorization
This request requires authorization with permission view.retention-policy.
Response
If successful, the response status code is 200 OK and body contains Retention Policies List object
wrapped in Response object.
312
Tibigen Digital Repository - REST API
Request
GET /retention-policies/{uuid}
Path parameters
Authorization
This request requires authorization with permission view.retention-policy.
Response
If successful, the response status code is 200 OK and body contains Retention Policy object wrapped in
Response object.
Errors
Request
POST /retention-policies
In the request body, supply a Retention Policy object with at least required properties.
Authorization
This request requires authorization with permission manage.retention-policy.
313
Tibigen Digital Repository - REST API
Response
If successful, the response status code is 200 OK and body contains Value object with UUID on newly
added Retention Policy wrapped in Response object.
Errors
Request
PUT /retention-policies/{uuid}
Path parameters
In the request body, supply a Retention Policy object with updated properties.
Authorization
This request requires authorization with permission manage.retention-policy.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
314
Tibigen Digital Repository - REST API
Request
DELETE /retention-policies/{uuid}
Path parameters
Authorization
This request requires authorization with permission manage.retention-policy.
Response
If successful, the response status code is 200 OK and body contains empty Response object.
Errors
• TDR checks that authenticated user is allowed to login in TDR (it must have at last one group that
match ldap.groups property).
315
Tibigen Digital Repository - REST API
▪ If user with given NameID not exist in TDR database it will be added to it, otherwise it will
be updated.
▪ TDR redirects to referrer of <TDR api>/sso/login service with path <Referrer>/sso_error with
query parameters code with error code and description with error description.
• TDR redirects to referrer of <TDR api>/sso/login service with path <Referrer>/sso and query
parameters token with created user’s token and login with logged in user’s login.
• On successfully logout TDR returns text/html response with javascript window.close() function
assigned to onLoad event on BODY tag.
11.3. Services
11.3.1. SSO Login
Redirects to IdP login page. Saves referrer header value in session.
Request
GET /sso/login
Authorization
This request requires no authorization.
Response
If successful, the response redirects to IdP login form page.
Errors
If referer is not null TDR redirects to <Referrer>/sso_error with query parameters code with error code
and description with error description.
316
Tibigen Digital Repository - REST API
Request
GET /sso/logout
Authorization
This request requires no authorization.
Response
If successful, the response returns text/html response with javascript window.close() function assigned
to onLoad event on BODY tag.
Errors
Request
GET /sso/landing
Authorization
This request requires no authorization.
317
Tibigen Digital Repository - REST API
Response
If successful, the response redirects to <referrer_header_value_saved_in_/sso/login_request>/sso with
query parameters token and login where token is created authenticated user token and login is
authenticated user login.
Errors
If referer saved in session is not null TDR redirects to <Referrer>/sso_error with query parameters
code with error code and description with error description.
/saml/logout/** Logout filter leveraging SAML 2.0 Single Logout profile. Upon invocation of the
filter URL it is determined whether global (termination of all participating
sessions) or local (termination of only session running within Spring Security)
logout is requested based on request attribute. In case global logout is in question
a LogoutRequest is sent to the IDP.
/saml/metadata/** The filter expects calls on configured URL and presents user with SAML2
metadata representing this application deployment. In case the application is
configured to automatically generate metadata, the generation occurs upon first
invocation of this filter (first request made to the server).
318
Tibigen Digital Repository - REST API
/saml/SSOHoK/** Filter processes messages sent from IDP as part of the WebSSO Holder-of-Key
profile.
/saml/SingleLogout/ Filter processes arriving SAML Single Logout messages by delegating to the
** LogoutProfile.
319