Live export
General architecture
The Content and Product Manager (CPM) provides a Content Exporter (CEX) interface allowing exporting scheduled broadcast events to an external system. The interface takes the form of XML files.
The CPM supports the definition of channels and broadcasted events.
Processing logic
The file generation for this interface will be triggered automatically at regular intervals as defined by a CRON expression present in the configuration of the export.
When triggered, the export algorithm will calculate a period of extraction based on an offset from the current date and time and a duration that are defined in the configuration file of the export. The target system should not make any assumptions about the period supplied in the file, for example they cannot assume the period is an exact multiple of 24 hours nor that the period is aligned to midnight.
There will be as many export files as the number of editorial channels defined in the database. Each file will contain the definition of the current editorial channels, all events related to that editorial channel for the current extraction period and all related technical channels.
The windows of consecutive periodic extractions are normally configured to overlap, as shown in the diagram below:
For example, with a daily activation and an extraction period of 7 days, each successive file will contain 6 days of data that overlap that contained in the previous file plus one new day’s worth of data, one week in the future. The data of the first 6 days will reflect any updates that have been made since the previous execution of the algorithm. It is left to the target system to compare the contents of successive files (or contents of a new file with its database) if it needs to identify data changes.
File name
The names of the generated files will have the following form:
ExportBtv-<ecid>-<now>.xml
where:
ExportBtv | is a fixed value |
<ecid> | is the editorial channel id |
<now> | the current date and time of the algorithm’s execution, using GMT time zone. The format is yyyyMMddHHmmss |
Each run of the export will create a file per editorial channel.
The file name can be customized in the APS, by using the exportFileName
property. For example:
exportFileName=CustomPrefix-{CHANNELID}-{TIMESTAMP}.xml
{CHANNELID}
will be replaced by the editorial channel id.{TIMESTAMP}
will be replaced by the timestamp in formatyyyyMMddHHmmss
.
File transfer mechanism
The ftp transfer is done in two steps, first the file is copied into the remote target directory with a temporary file extension suffix. Then secondly, once the file transfer is complete, the file is renamed by removing the temporary suffix. This two-step process ensures that the file consumer does not try to access the file before it has been fully transferred.
For the FTP transfer, the CEX acts as an FTP client, with the FTP server role taken by the target system.
The target system is responsible for deleting the transferred XML files once it has processed them, either successfully or not.
If a network error occurs during the file copy, the transfer will be aborted. The CPM relies on the FTP server to clean up any partially copied files when such errors occur.
XML file format
The whole XML schema of this interface is available as reference document Nagravision-Common-Export-Specification-v5.x.xsd.
The CPM will validate all generated export files using the referenced schema file located within the application resources.
The XSD does not enforce any minimum or maximum lengths for string values.
The XML files built by the CPM will be encoded in UTF-8.
Related documents
The supporting documents are as follows:
File description | Filename |
---|---|
XML grammar definition for the Common Export BTV interface | Nagravision-Common-Types-Export-Specification-v5.x.xsd |
XML grammar definition for the Export BTV interface | Nagravision-Live-Export-Specification-v5.x.xsd |
Live export sample | Nagravision-Live-Export-Sample-5.x.xml |