iconik Portal Sync

As of Cantemo Portal 3.3, Portal comes with an iconik Portal Sync. Read more about iconik here.

Installation

iconik Portal Sync is installed via the following yum command:

yum install iconik_portal_sync

Configuration

The default iconik configuration is located in /etc/cantemo/iconik_portal_sync/config.ini and looks like this, please change it according to your settings:

[main]
bind = 0.0.0.0:8000
workers = 1
timeout = 60
graceful_timeout = 30


[app]
DEBUG = true

DEFAULT_LOCALE = en/us
DEFAULT_TIMEZONE = Europe/Stockholm

PORTAL_ICONIK_METADATA_MAPPING = /etc/cantemo/iconik_portal_sync/iconik_metadata_mapping.json
DATA_DIRECTORY = /opt/cantemo/iconik_portal_sync/data

SERVICE_HOST = http://localhost
SERVICE_PORT = 8000

POSTGRES_DATABASE = portal
POSTGRES_USER = portal
POSTGRES_PASSWORD = p0rtal
POSTGRES_HOST = localhost
POSTGRES_PORT = 5432
POSTGRES_ECHO_QUERIES = true

VIDISPINE_URL = http://localhost:8080
VIDISPINE_USER = admin
VIDISPINE_PASSWORD = admin

ICONIK_APP_ID = 36580dee-268e-11e7-81b3-6c4008b85488
ICONIK_TOKEN = eyJhbGciOiJIUzI1NiIsImlhdCI6MTQ5MTQ2OTcyNSwiZXhwIjoxNTIzMDA1NzI1fQ.eyJpZCI6IjYyMTg3MGY1LTExZDEtNDE4Ny1hNTQ0LTM1NTgzYzAxNWMyYSJ9.PdotZJLe1mt0gD_tf7UBmsRnyp6inWRv-V-qykqc92w
ICONIK_URL = http://iconik.io
ICONIK_ADMIN_VIEW_ID = 09454ba6-271f-43dd-8ca9-40b628aec3ec
ICONIK_GROUP_ID = f7165fe7-f2a1-4146-a49f-c01a04750174
ICONIK_PORTAL_STORAGE_ID = 59006d4a-af51-11e7-b849-0242ac110011

Service configuration block

  • SERVICE_HOST is host name for the iconik_portal_sync service itself.
  • SERVICE_PORT port for the iconik_portal_sync service itself.

Postgres configuration block

  • POSTGRES_DATABASE name of the postgres DB (to store sync queue)
  • POSTGRES_USER DB user
  • POSTGRES_PASSWORD DB password
  • POSTGRES_HOST PostgreSQL host
  • POSTGRES_PORT PostgreSQL port
  • POSTGRES_ECHO_QUERIES Enable SQL queries logging

Portal configuration block

  • VIDISPINE_URL url (Host and port) to Vidispine API
  • VIDISPINE_USER Vidispine user
  • VIDISPINE_PASSWORD Vidispine password

iconik configuration block

  • ICONIK_APP_ID Generate a new Application in Iconik under Admin / Settings / Application Tokens, and select a user which will act on Portal syncs behalf in Iconik. Copy the Application ID.
  • ICONIK_TOKEN Copy the generated Token from above in this field.
  • ICONIK_ADMIN_VIEW_ID ID of a metadata view which includes all fields you want to sync from Portal to Iconik (All fields used in the Metadata mapping configuration below must be in this view).
  • ICONIK_URL Iconik URL
  • ICONIK_GROUP_ID ID of the iconik group that iconik_portal_sync will give an access to for each asset and collection that created in portal.
  • ICONIK_PORTAL_STORAGE_ID ID of the PORTAL type storage in Iconik (You will get the ID from the URL).

Metadata mapping configuration

The metadata mapping file needs to be edited at /opt/cantemo/iconik_portal_sync/iconik_metadata_mapping.json. It’s just a simple key value json which might look like this:

{
  "portal_mf201890": "season",
  "portal_mf551902": "episode",
  "portal_mf619153": "description",
  "portal_mf257027": "language",
  "portal_mf268857": "release_date",
  "portal_mf793831": "first_name",
  "portal_mf731740": "last_name",
  "portal_mf913516": "date_born"
}

Where the key is an ID of portal metadata field and the value is a name of iconik metadata field.

Also metadata field for storing iconik URL could to be configured if it’s needed through config.ini block [app]

PORTAL_ICONIK_LINK_FIELD = portal_mf237240

where portal_mf237240 is a read only portal metadata field that will be used to store a link to an asset or collection in iconik after it was synced. This field could be added to a portal metadata form and users can see or click on this link and open corresponding asset / collection in iconik

Setup DB

Start by creating the database:

iconik_portal_sync_ctl create_db

Verify and Test

Verify if iconik_portal_sync can access vidispine and iconik:

iconik_portal_sync_ctl verify

Create Vidispine Notifications

Create vidispine notifications:

iconik_portal_sync_ctl create_vs_notifications

Running

CentOS 7

Installation for Centos7 will add system user cantemo that will be used to run systemd service. After installation you can start service with:

sudo systemctl enable iconik_portal_sync
sudo systemctl start iconik_portal_sync

You can run systemd service from your custom user providing it to /usr/lib/systemd/system/iconik_portal_sync.service

After editing configuration file you should run:

sudo systemctl daemon-reload
sudo systemctl restart iconik_portal_sync

CentOS 6

Installation for Centos6 will add system user cantemo``that will be used to run `iconik_portal_sync through supervisor >= 3.0b1. Config located at path /etc/supervisor/conf.d/iconik_portal_sync.conf. After installation you can start ìconik_portal_sync` with:

supervisorctl restart iconik_portal_sync