The custom MOS object mapping is a setup which extracts field values from foreign MOS objects and translates these into Viz Mosart fields. This is done in the newsroomsettings.xml configuration file. This simplifies integration, as no new code needs to be deployed.
The Tool Set
Part of the file
newsroomsettings.xmlcontains default configurations.Select content from the XML using simple XPath 1.0 expressions.
Concatenate the XPath result using a separator.
Replace parts of the result using static or dynamic variables.
Apply conversion rules for the specific field type.
What to Configure
Reuse or modify existing MOS field mapping in
newsroomsettings.xml.Add MOS Id map entry using the Newsroom Settings Editor.
Newsroom alias: MOS ID of foreign item.
value: Field mapping entry name.
appendContent: Appends the complete MOS object to the internal Viz Mosart <item /> as a _<content /> _sub child.
embeddedMosartItem: Signal if the item has a Viz Mosart item embedded.
Target Fields
Target fields is a list of the fields used when controlling a video server or graphics elements.
Video Server
clip_hirespath: The name or ID of the video file.
clip_description: A human-readable description of the video file (optional).
clip_dur: The duration of the video file.
clip_mark_in: The start frame of the video file (optional).
Graphics Systems
graphics_id: The ID of the graphics item.
graphics_description: A human-readable description of the graphics item.
tc_in: Planned in-time for the item, relative to the parent item.
tc_dur: Planned duration for the item.
graphics_profile: The graphics concept context that this item should be forced to play in.
This value is forwarded to graphics systems supporting concepts for graphics when cueing and playing an item.graphics_category: Used in overlay graphics Take Out Logic to identify graphics that should be kept at story item transitions. If not set, graphics_id is used for identification.
channel: The channel to play the item, i.e. DSK, WALL etc.
take: MANUAL or AUTO. If MANUAL then tc_in is 0 and only tc_dur is used.
outBehaviour:
TIMECODE = the element is taken out relative to the current primary element using tc_dur.
BACKGROUNDEND = the element is taken out when switching primary story element.
STORYEND = the element is taken out when switching from one story to the next.
OPENEND = the element is taken out when reloading the rundown or by manually taking the element out.
auto_continue: true/false (only for Orad, to send PlayWithoutPause command).
Mapping Source Fields to Target Fields
The following mapping <mosmap id=”VENDOR” elementtype=”CLIP”> </mosmap> contains the attribute descriptions:
Id: Value used in the MOS map section of the newsroomsettings.xml.
Elementtype: CLIP for video servers, GRAPHICS for graphics systems.
And <fieldmapping /> contains the attribute descriptions:
fieldname: Viz Mosart target field name.
mospath: A simple XPath 1.0 expression to the location of the source value.
separator: Value used for joining multiple returned values for the mospath.
fieldtype:
FIELDS – the source value is in video fields.
FRAMES – the source value is in video fields.
TIMECODE – the source value is in time code format. Use mask attribute to identify format.
STATIC – the value for the fieldname has no mospaths and should be as defined in the value attribute.
REPLACE
ADJUST
value: The value to use if fieldtype is STATIC.
valuetype: TEXT, TIMECODE.
mask: Value on time code format. hh:mm:ss or hh:mm:ss:ff.
mustexist: Set to true if the Viz Mosart field should only be added if a non-empty value exists.
regex: Regular expression applied to the extracted value. Can be used in two modes:
(1) with matchindex to extract a specific capture group
(2) with replacepattern to perform regex substitution using capture group references.
matchindex: Selects which capture group to extract from the regex result.
0 returns the entire match.
1 returns the first capture group.
2 the second, etc.
If omitted (defaults to -1), the entire match is returned. Ignored when replacepattern is specified.replacepattern: A replacement string used with regex to perform regular expression (regex) substitution. Supports capture group back-references (
$1,$2, etc.).
When specified, instead of extracting a single match, the code uses the regex pattern to extract values from the MOS object and apply the regex matches in the replacepattern string.
This is useful for constructing new values by recombining captured parts with static text.overwrite: Overwrites if a field already exists if set to true. Default is false.
Examples
Video Server Item
The example below is of a Quantel video item:
Source MOS XML (Quantel MOS item)
<mos> <itemID>3</itemID> <itemSlug>New Row 3 CVD 1-3</itemSlug> <objID>15160::559</objID> <mosID>QUANTEL</mosID> <mosAbstract>Flug über die Alpen fertig2 1:00</mosAbstract> <abstract>Flug über die Alpen fertig2 1:00</abstract> <objDur>1500</objDur> <objTB>25</objTB> <objSlug>Flug über die Alpen fertig2</objSlug></mos>Info: The objID is constructed from two numbers where the first is the Quantel clip id. The second number is the Quantel zone.
Viz Mosart MOS mapping
<mosmap id = "QUANTEL" elementtype = "CLIP" idasindex = "false"> <fieldmapping fieldname = "clip_hirespath" mospath = "//objID" regex = "^\d+"/> <fieldmapping fieldname = "clip_description" mospath = "//objSlug"/> <fieldmapping fieldname = "clip_mark_in" fieldtype = "static" value = "00:00:00:00" valuetype = "TIMECODE"/> <fieldmapping fieldname = "clip_dur" fieldtype = "FIELDS" mospath = "//objDur" valuetype = "TEXT"/></mosmap>Target Viz Mosart XML
<fields> <field name = "clip_hirespath" value = "15160"/> <field name = "clip_description" value = "Flug über die Alpen fertig2 1:00"/> <field name = "clip_mark_in" value = "00:00:00:00"/> <field name = "clip_dur" value = "750"/></fields>Graphics Item
The example below is of an XPression graphics item:
Source MOS XML (XPression MOS item (modified and stripped to fit screen))
<mos> <itemID>11</itemID> <objID>{01E4E214-2414-4C71-956F-6587E3FD1E4B}</objID> <mosID>XPRESSION</mosID> <mosAbstract>MAIN KEY Name (B2B): This is a test | Test</mosAbstract> <itemChannel>1</itemChannel> <itemEdStart>0</itemEdStart> <itemEdDur>0</itemEdDur> <itemTrigger>CHAINED</itemTrigger> <macroOut>NONE</macroOut> <mosExternalMetadata> <mosPayload> <gfxtype>CG</gfxtype> <itcTimeIn>500</itcTimeIn> <itcTimeDur>250</itcTimeDur> </mosPayload> </mosExternalMetadata></mos>Viz Mosart MOS mapping
<mosmap id = "XPRESSION" elementtype = "GRAPHICS"> <fieldmapping fieldname = "graphics_id" mospath = "(//itemID | //objID)" separator = "-" fieldtype = "REPLACE" value = "{STORYID}-{MOSPATH}"/> <fieldmapping fieldname = "graphics_description" mospath = "//mosAbstract"/> <fieldmapping fieldname = "tc_in" fieldtype = "FRAMES" mospath = "//itcTimeIn" valuetype = "TEXT"/> <fieldmapping fieldname = "tc_dur" fieldtype = "FRAMES" mospath = "//itcTimeDur[text()!='0']" valuetype = "TEXT"/> <fieldmapping fieldname = "outBehaviour" mospath = "//macroOut"/> <fieldmapping fieldname = "channel" fieldtype = "STATIC" mospath = "//gfxtype[text()='CG']" value = "DSK" valuetype = "TEXT" mustexist = "true"/> <fieldmapping fieldname = "channel" fieldtype = "STATIC" mospath = "//gfxtype[text()='OTS']" value = "WALL" valuetype = "TEXT" mustexist = "true"/> <fieldmapping fieldname = "channel" fieldtype = "STATIC" mospath = "//gfxtype[text()='FS']" value = "FULL" valuetype = "TEXT" mustexist = "true"/> <fieldmapping fieldname = "channel" fieldtype = "STATIC" mospath = "//gfxtype[text()='OTHER']" value = "FULL" valuetype = "TEXT" mustexist = "true"/></mosmap>Target Viz Mosart XML
<item> <fields> <field name = "graphics_id" value = "VER7ENPS1;P_VANLAB\W\R_F3144D55-78F2-494B-863ED060A74D92F7;D02D7434-58BB-43D6-B03601E7B7BBC1E7-4-{1ECA795F-101D-4301-A559-2A1392F3AA2D}" fieldtype = "TEXT"/> <field name = "graphics_description" value = "BANNER:Chan1: | Manual | Timed(---):TIMED" fieldtype = "TEXT"/> <field name = "tc_in" value = "" fieldtype = "TEXT" inputmask = "ff" default = "00:00"/> <field name = "tc_dur" value = "125" fieldtype = "TEXT" inputmask = "ff" default = "00:00"/> <field name = "outBehaviour" value = "TIMED" fieldtype = "TEXT"/> <field name = "channel" value = "DSK" fieldtype = "TEXT"/> </fields></item>Harris Video Objects in Octopus
How to configure MOS mapping of a Harris video object in Octopus:
Source MOS XML
<storyItem> <itemID>2-1</itemID> <itemSlug>0406 ZN MUNDE 5 WIN 3 PM NEW</itemSlug> <octext_elemLabel>VO</octext_elemLabel> <objID>0406 ZN MUNDE 5 WIN 3 PM NEW</objID> <mosID>ZEE.HARRIS.MOS</mosID> <itemTrigger>MANUAL</itemTrigger> <octext_elemType>vo</octext_elemType></storyItem>Update the
newsroomsettings.xmlfile by opening it in a text editor and adding the below mosmap XML entry in the<mosmaps />section (as a child to the<mosmaps />element node)
Viz Mosart MOS mapping
<mosmap id="HARRIS" elementtype="CLIP" idasindex="false"> <fieldmapping fieldname="clip_hirespath" mospath="//objID" /> <fieldmapping fieldname="clip_description" mospath="//itemSlug" /> <fieldmapping fieldname="clip_mark_in" fieldtype="static" value="00:00:00:00" valuetype="TIMECODE" /><!-- <fieldmapping fieldname="clip_dur" fieldtype="FIELDS" mospath="//itemEdDur" valuetype="TEXT" />--></mosmap>Open the newsroomsettings.xml file in Mosart Server application using the ns command.
Open Edit -> MOS Id mapping from the menu and add an entry where the value in Newsroom alias is the MOS ID of the Harris item, (in the above example ZEE.HARRIS.MOS), and the Value column is set to HARRIS (the id of the mosmap above). If the columns appendContent and embeddedMosartItem are shown, they should both have the value false.
Regex: Extracting and Transforming Values
Example A: Extracting a capture group with matchindex
This example extracts just the numeric ID from a backslash-delimited objID:
Source MOS XML
<storyItem> <itemID>test-item-3</itemID> <objID>FOLDER\99999</objID> <mosID>TESTMOS</mosID> <mosAbstract>Test Description</mosAbstract> <mosExternalMetadata> <mosScope>PLAYLIST</mosScope> <mosSchema>http://www.mosartmedialab.no/schema/mositem.dtd</mosSchema> <mosPayload> <mosarttemplate> <type name="LOWERTHIRD"> <variant name="TEST"/> </type> </mosarttemplate> </mosPayload> </mosExternalMetadata></storyItem>Viz Mosart MOS mapping
<mosmap id="TEST" elementtype="GRAPHICS"> <fieldmapping fieldname="graphics_id" mospath="//objID" regex="^(\w+)\\(\d+)$" matchindex="2" /> <fieldmapping fieldname="graphics_description" mospath="//mosAbstract" /></mosmap>The regex ^(\w+)\\(\d+)$ defines two capture groups. matchindex="2" selects the second group (the digits after the backslash).
Target Viz Mosart XML
<fields> <field name="graphics_id" value="99999" /> <field name="graphics_description" value="Test Description" /></fields>Example B: Building a path with replacepattern
This example extracts parts from an objID and constructs a full file path using the replacepattern attribute:
Source MOS XML (Chyron/CAMIO item)
<storyItem> <itemID>ee294520-db64-11f0-94cc-c70081fe9c41:SPEC_NEWS_FL_TB-00010309</itemID> <itemSlug> - 00010309(Monitor Plasma Horizontal HMON) GENERIC SINGLE BOTTOM LINE</itemSlug> <objID>SPEC_NEWS_FL_TB\00010309</objID> <mosID>CHYRONMOS</mosID> <mosAbstract>(Monitor Plasma Horizontal HMON) GENERIC SINGLE BOTTOM LINE</mosAbstract> <mosExternalMetadata> <mosScope>PLAYLIST</mosScope> <mosSchema>http://www.mosartmedialab.no/schema/mositem.dtd</mosSchema> <mosPayload> <mosarttemplate> <type name="LOWERTHIRD"> <variant name="CHYRON"/> </type> </mosarttemplate> </mosPayload> </mosExternalMetadata></storyItem>Viz Mosart MOS mapping
<mosmap id="CHYRON" elementtype="GRAPHICS"> <fieldmapping fieldname="graphics_id" mospath="//objID" regex="^(.*?)\\(.*)$" replacepattern="I:\CAMIO4\$1\Messages\$2" /> <fieldmapping fieldname="graphics_description" mospath="//mosAbstract" /></mosmap>The regex ^(.*?)\\(.*)$ captures SPEC_NEWS_FL_TB as $1 and 00010309 as $2. The replacepattern recombines them into a full path.
Target Viz Mosart XML
<fields> <field name="graphics_id" value="I:\CAMIO4\SPEC_NEWS_FL_TB\Messages\00010309" /> <field name="graphics_description" value="(Monitor Plasma Horizontal HMON) GENERIC SINGLE BOTTOM LINE" /></fields>Note: When replacepattern is specified, the matchindex attribute is ignored. The two approaches are mutually exclusive -- use matchindex to extract a single capture group, or replacepattern to construct a new value from multiple groups.