S4M Asset Scheduling
We have implemented a custom S4M asset scheduling process that reads data from the S4M data source and applies it to an Asset Schedule in Chameleon.
The main pieces are
Read S4M data
Create required assets
Schedule assets repeatedly and evenly through a 24 hour period.
but not during blackouts (scheduled in Flow)
S4M Data Source
The S4M data is stored in a SQL Server Database.
There are a couple tables that provide the data:
[COP_Uci].[uci].[available_s4m_spot_media]
[S4M_Schedule].[s4m].[dlevent]
We have built an ASP.Net Core minimal web API to access this data. This app is running in IIS. It has it’s own Application Pool and an Application in the Default Web Site. By using this type of access we can either pull the data live as json or use BLADE Runner to pull the data and post it somewhere else for access.
The published code is simply copied into the website folder to update it.
API Endpoints
Example endpoint to get the BC1 station’s data for Jan 6, 2023:
http://localhost/S4M/schedule/event/BC1?startDate=2023-01-06
To get to the details for a material:
http://localhost/S4M/material/00032512
All materials in Ad Zones
http://localhost/s4m/material/
Â
Asset Scheduler
Settings required include (with examples)
S4M Source Settings
Setting | Example Value | Notes |
---|---|---|
Station Id | BC1 | Â |
Live Url | http://localhost/s4m/ | URL where the live S4M data is accessible from |
Use Live Url | true/false | True pulls data from the live URL |
Alternate Url | https://www.bannisterlake.com/dl/Global/S4M/BC1.json | Alternate location where a data file has been made available to use instead - same json format as the live URL (saved output) |
Alternate Material Url | https://www.bannisterlake.com/dl/Global/S4M/adzoneMaterials.json | Alternate location where a data file has been saved with Material data pulled from the live URL. |
Chameleon and Schedule Settings
Setting | Example Value | Notes |
---|---|---|
First Hour of the Day | 5 | 5:00 am |
Repeat Count | 40 | Repeats each item this many times in the 24 hour period |
Content Group Name | BC | Â |
Channel Name | BC1 Test | Â |
Media Bin Name | BC1 Zone Ads | Location of S4M media |
Media Bin Content Group Name | BC | Â |
Project Content Group | Global | Â |
Project Name | L-Frame 2022 Ad Zones | Must have scenes named
|
Media Field Name | media.media | Â |
Database User Id | Updater | Â |
Database User Password | password is set in an environment variable
| Run as Admin: |
Flow Url | https://localhost/chameleon | URL of the Flow instance to populate the data into |
Â
Processing Steps
Make a connection to the Chameleon database.
Pull the S4M data for the given date
Find the given content group, channel, and media bin items each by name
Find or create assets based on the S4M Id
Looks for an asset whose name matches the S4M Id in the given content group
If not found
Creates a new asset with a template named Ad Zone 1-4 based on the S4M data in the given project (if it can find it)
Attaches the media with the name of the S4M Id to the media.media field (if it can find it)
Reads the blackout schedule for the channel
Calculates the total blackout time
Determines the amount of time between assets that is left
Loops through all the S4M assets, evenly adding each to the schedule in turn over the 24 hours minus the blackout times