Blackout Receiver
Version 10.3.000


1. Plugin installation procedure

The Blackout Publisher Plugin requires some manual configuration. The below section will guide you in the configuration
of it.

1.1 Configurable Properties (from the task "Format Properties" tab panel)

1.1.1 PRISMA_BASE_URL property

This property is the URL to use while communicating with Prisma.

PRISMA_BASE_URL = https://{XYZ:PORT}/api/esni/viewingPolicyManagers/{VPM_ID}
where
XYZ:PORT indicates the Prisma Host and port eg:- prisma:8443
VPM_ID indicates VPM service ID eg:- DirectTV_Global_VPM

1.1.2 PRISMA_INIT_FLAG property

This property can be used to disable the resource initialization done in Prisma.  The resource initialization is
required as it is setting the audience, the viewing policy and the policy used to blackout period of times on Medias.
However, these configurations do not need to be done every time and can be done once on a given Prisma instance. For
that reason, it's possible to disable configuration via this property by setting it to false.

(default value) PRISMA_INIT_FLAG = true;

1.1.3 MEDIA_TO_CHANNEL_MAP_PATH property

This property provide a file path to access a list of mediaId to channelId mappings. The file format respect the java
properties format. I.e. each line of the properties file is a "mediaId"="channelId" pair.  More details on getting the
mappings can be found in the below section 1.2

(default value) MEDIA_TO_CHANNEL_MAP_PATH=/opt/tandbergtv/cms/conf/watchfolder/MediaIdChannelIdMapping.properties

1.1.4 MEDIA_TO_CHANNEL_MAP

This property provide a list of mediaId to channelId mappings. Important note: This property is only used when property
"MEDIA_TO_CHANNEL_MAP_PATH" is not defined, not found, or do not provide any mapping. Each mapping is separated by a ";"
and a "=" sign is used as the name & value delimiter per mapping.

(default value) MEDIA_TO_CHANNEL_MAP=
(Example)       MEDIA_TO_CHANNEL_MAP=mediaId1=ChannelId1;mediaId2=ChannelId2


1.2  MediaId to ChannelId mappings configuration in CMS

The mapping between the CMS input GLF ChannelId and the Prisma MediaId is not available in CMS.   For that
reason, it was decided to provide the mappings in a file (or, for few mappings in a property value) to map such ids.
Note, only the needed mappings should be configured as each entry will result in an interaction with Prisma.

1.2.1  Getting all mappings from MF

MF, more specifically, catalog component, can provide such mappings and here is one way to get this information.

1.2.2  Precondition

It is assumed that the deployment we want to get these mapping includes MF as part of the solution.
You need to have access to the mongoDB instance of the catalog service of the MF deployment.  Specifically, on the
mongoDB sierra database.

1.2.3  Mongo script execution.

From the command line or NoSqlBooster UI, you should run the following script.  The output script will give you all
mappings and should be used as the input to configure and give access to these mappings in CMS.

1.2.3.1  Script (copy&paste to use it)

function PrintMappings(sierraDb) {
    print("##################################################################################################");
    print("# CMS Blackout Publisher Plugin - MediaId Mapping MongoDB Script");
    print("#");
    print("# Remove the '#' of a line to enable a mapping.");
    print("# Only the channels we want set blackout policies in Prisma should be enabled.");
    print("# Note: A channelId can be be found multiple times, all mappings of a channelId should be enabled.");
    print("##################################################################################################\n");

    print("# MediaId = ChannelId");
    print("#####################");
    sierraDb.services.find({}, { _id: 1, MediaId: 1 }).forEach(function(service) {
        var serviceId = service._id;
        var mediaId = service.MediaId;
        sierraDb.servicecollections.find({"ServiceItems.ServiceId":serviceId}, {_id: 1, StationId: 1 }).forEach(function(sc) {
            var stationId = sc.StationId;
            if (stationId != null){
                var station = sierraDb.stations.findOne({_id:stationId},{_id:1,OriginalStationId:1});
                var originalStationId = station.OriginalStationId;
                print("# " + mediaId + " = " + originalStationId);
            }
        });
    });
}
PrintMappings(db.getSiblingDB("sierra"));


1.2.4  Getting Operator input and configure mappings.

The script output gives all mappings currently configured in MF.   Using the blackout.xml (used by the CMS Blackout
Provider Plugin) and operator inputs, decide which mappings to enable.  This information must be used as input to edit
the file defined in MEDIA_TO_CHANNEL_MAP_PATH or to configure via MEDIA_TO_CHANNEL_MAP property as previously described.
Here is an example of the MediaIdChannelIdMapping.properties file content using the script output as a starting point
and where channelId "33105" and "13713" are enabled.


##################################################################################################
# CMS Blackout Publisher Plugin - MediaId Mapping MongoDB Script
#
# Remove the '#' of a line to enable a mapping.
# Only the channels we want set blackout policies in Prisma should be enabled.
# Note: A channelId can be be found multiple times, all mappings of a channelId should be enabled.
##################################################################################################

# MediaId = ChannelId
#####################
MDS2WI0008HD = 33105
MDS2WI0002HD = 13713
# MDS2WI0007SD = 25193
# MDS2WI0001SD = 3839
# MDS2WI0004SD = 9125
# MDS2WI0004HD = 13687
# MDS2WI0001HD = 13662


1.3.1  Future mapping impacts

Since this solution is based on a static list of mappings defined in CMS, it is possible to redo the same procedure to
enable or include new mappings as needed.  The "CMS Blackout Publisher Plugin" will use the updated properties at the
next task execution.  Such impacts may come from one of these actions done in MF:

    - Adding a Service Collection
    - Removing a Service Collection
    - Updating the Station of a Service Collection
    - Adding a Service association in a Service Collection.
    - Removing a Service association from a Service Collection.