Inserts an event into the list using the event’s XML document to initialize event properties.

Namespace:  GrassValley.Mseries.ScheduleEditor
Assembly:  GrassValley.Mseries.ScheduleEditor (in GrassValley.Mseries.ScheduleEditor.dll) Version: 1.0.0.0

Syntax

C#
public string CreateEventFromXml(
	string xml,
	string afterEventId
)
Visual Basic (Declaration)
Public Function CreateEventFromXml ( _
	xml As String, _
	afterEventId As String _
) As String
Visual C++
public:
virtual String^ CreateEventFromXml(
	String^ xml, 
	String^ afterEventId
) sealed

Parameters

xml
Type: System..::.String
The XML.
afterEventId
Type: System..::.String
Insert new event after this EventID. Used only for Follow events.

Return Value

Event ID used to reference the event.

Implements

IScheduleEditor..::.CreateEventFromXml(String, String)

Remarks

These are the fields to set in the xml. If a event is a play event, it will likely need a PlayEventData node. If the Event has secondary events (Gpi Outputs), you will need a SecondaryEvents node.

XML NodeDescription
"eventType" Either "Play", "Record", or "Switch".
"channel" Must be a valid channel number between 0 and the max number of channels on the K2, usually 0-3 is a valid range. If no channel is specified, the default value will be set to the current IController interface channel.
"name" Event Name.
"userName" user name for event.
"trafficId" User generated ID for event that is not used internally by Event Scheduler.
"parentUUid" Parent Event ID. Use this if you want to create a follow event. The parent Event ID would then be the ID of the event to follow after. This parameter is equivalent to the afterEventID parameter in the CreateEventFromXml() function.
"childUUid" event id for child event.
"strUri" Uri of clip in the event. IE: "edl/cmf//local/V:/default/Clip2". see: [!:http://www.gvgdevelopers.com/K2DevGuide/K2DevGuide.html#%5B%5BK2%20URIs%5D%5D]
"trigger" Either "Absolute", "Approximate", or "Follow" (Case-Sensitive).
"startDate" A required value and must be in "YYYY-MM-DD" format (length of 10 only).
"startTime" A required value and must be in "HH:MM:SS:FF" format (length of 11 only).
"duration" A required value and must be in "HH:MM:SS:FF" format (length of 11 only).
"purgeDate" An optional value and must be in "YYYY-MM-DD" format (length of 10 only).
"purgeTime" A required value value and must be in "HH:MM:SS:FF" format (length of 11 only).
"purgeCount" A int value.
"repeatMode" Indicates whether event repeats. Values can be "None", "Hourly", "Daily", "Weekly", "Random" and are case-sensitive. If not present, defaults to "None". If repeat random is set, then provide repeatDate and repeatTime nodes to specify repeat occurences.
"comment" A comment field. Provided by user, not used by Event Scheduler.
"PlayEventData/markIn" String representation of a mark in in the form of "hh:mm:ss:ff". If not present, defaults to "00:00:00:00".
"PlayEventData/isMarkInAbs" Boolean value where true indicates the mark in is absolute. It is case insensitive and if not present, defaults to false.
"PlayEventData/altUri" Uri of clip to alternate clip to play in the event of an issue with the primary clip. IE: "edl/cmf//local/V:/default/Clip2"
"PlayEventData/altMarkIn" String representation of a mark in for the Alternate Clip in the form of "hh:mm:ss:ff". If not present, defaults to "00:00:00:00".
"PlayEventData/isAltMarkInAbs" Boolean value where true indicates the Alternate Clip mark in is absolute. It is case insensitive and if not present, defaults to false.
"SecondaryEvents/SecondaryEvent/type" Describes the type of secondary event information that will follow. 'GpiOutput' is currently the only type supported.
"SecondaryEvents/SecondaryEvent/GpiOutput/name" A GPI name to identify which GPI output to trigger. This must match a configured gpi on the K2 client. If not, the secondary event will raise an error during validation, and it will not evecute the secondary event. GPI outputs are configurable via the K2 AppServer API.
"SecondaryEvents/SecondaryEvent/GpiOutput/position" A position relative to the primary event (startminus, startplus, endminus, or endplus). Essentially describes what the 'offset' value means.
"SecondaryEvents/SecondaryEvent/GpiOutput/offset"
"SecondaryEvents/SecondaryEvent/GpiOutput/type" GPI output type: assert, deassert, or trigger
"SecondaryEvents/SecondaryEvent/GpiOutput/duration" Duration in fields, which only applies to the trigger type (can be omitted or zero for assert or de-assert types).

This is a basic sample of the xml needed to insert an event.

CopyC#
<?xml version="1.0"?>
<XML xmlns="EventInfo__1.0">
<EventInfo>
<EventData uuid="" childUuid=""
eventType="Play" channel="0" strUri="edl/cmf//local/C:/default/Clip"
trigger="Absolute" parentUuid="" eventStatus="Ready" error="100"
name="" userName="" trafficId="" startDate="2009-03-27T00:00:00"
startTime="09:20:10:00" duration="00:00:03:00" repeatMode="None"
purgeDate="2019-03-29T00:00:00" purgeTime="00:00:00:00" purgeCount="0"
completed="0"/>
<PlayEventData markIn="00:00:00:00" isMarkInAbs="FALSE"
altUri="" altMarkIn="00:00:00:00" isAltMarkInAbs="FALSE"/>
</EventInfo>
</XML>

A Change notice will be generated of type NoticeInsertEvent for the new event. If the event is cued during insertion, a NoticeEventCued notice will generated as well. For each child event under the new event, a NoticeUpdateEvent will be generated.

Examples

CopyC#
//Call helper function CreateIScheduleEditor which creates editor object
IScheduleEditor schEditor = CreateIScheduleEditor();
string event1XML = "some xml"; //see sample xml for formats.
string event1ID = schEditor.CreateEventFromXml(event1XML));
string event2XML = "some xml"; //see sample xml for formats.
string event2ID = schEditor.CreateEventFromXml(event2XML, event1ID));

See Also