Notification Distrubutor Script - Distribution of notifications for multiple sites and a single Partner Id

Introduction

When working with server notifications, there is a single notification URL defined on the server side for a specific partner ID.
This situation makes it impossible to work with multiple sites and a single Partner ID.
The code here with the configuration adjustments listed below aims to work-around it.

Overview

Each site when uploading videos also ‘marks’ these videos as his. The notifications reach a neutral server that checks which site this video belongs to. The server then proceeds to forward the notification to the correct site. From here on it proceeds as the normal case of one partner with one site.

Integration details

  1. Install the files on a ‘neutral’ server.
  2. Update notification URL to the URL of the notification distributor .
  3. Change in settings.php:
    • PARTNER_ADMIN_SECRET to your Administrator Secret (could be found in the KMC)
    • Delimiters:
      • PARTNER_DATA_PAIRS_EXPLODE to what delimits between pairs in your CMS (in Drupal it is ‘|’)
      • PARTNER_DATA_KEY_VALUE_EXPLODE to what delimits the key and its value within pairs in your CMS (in Drupal it is ‘@’)
    • Change site names & notifications URLs – each site should be listed with its own notification URL.
  4. In each site’s Contribution Wizard append to flashVars in ( partner_data var)
    • targetSite:siteName;
    • Where:
      • ‘siteName’ is to be replaced with the appropriate site name as defined in the settings.php
      • The delimiters are as defined in settings.php
      • For example: if the site name in settings.php was defined “MySite1” and the sites are Drupal based, the flashVar in the CW of this site would be: "partner_data=user_id@12345678|targetSite@MySite1"

Disclaimers

  1. It is recommended to install it on a ‘neutral’ server. It would work on one of the sites as well, but it must be separated from the site’s own Kaltura notification handler.
  2. All sites must use same delimiters in partner_data.
  3. Partner cannot be set to multi-notification.
AttachmentSize
notification_distributor.zip2.43 KB