Access Calendar
When an Access Calendar action (screenshot below) is added to the design, the $MT_CALENDAR page source tree is automatically added to the design. At run time, depending on what kind of calendar action was selected, either (i) information from the device's calendars are read and stored in the $MT_CALENDAR tree, or (ii) an entry for a calendar event is opened in the device's calendar app; the user can edit this entry and then save it.
Note: | Windows 8 client devices do not support calendar events. |
There are three kinds of calendar actions:
•Read Calendar Events: Reads event information in the calendars on the device, and saves this information to the $MT_CALENDAR tree. Each event is saved as a separate Event element (see screenshot of the $MT_CALENDAR tree structure below). Data in the tree can subsequently be used in the solution.
•Write Calendar Event: At run time, opens an event entry in the calendar app of the end user's device. This event entry will be filled with information that you entered in the action's settings. The end user can now edit and save the entry to the device's calendar.
•Read Calendars: Reads information about the calendars on the device, and saves this information to the $MT_CALENDAR tree. Each calendar is saved as a separate Calendar element (see screenshot of the $MT_CALENDAR tree structure below). Data in the tree can subsequently be used in the solution.
These three kinds of calendar action are described in more detail below.
Read Calendar Events
This action (see screenshot below) reads information about events in the calendars on the device. You can select only the relevant calendars on the device (see Read Calendars above), or you can specify calendars to read by their IDs (with multiple IDs being given as a sequence of strings). Each event is stored as an Event element in the $MT_CALENDAR tree.
You can select what data fields of the event to read:
•ID, Calendar ID: A string that is the calendar's identifier.
•Event ID: A string that is the event's identifier.
•Title: The name of the event.
•Location: The venue of the event.
•Start, End: The start and end times of the event.
•All Day: Whether the event is to last all day. All Day is set if no start/end times are specified; if set this property has a value of true(), otherwise it has a value of false().
•Availability: The availability of the calendar's user.
•Duration: Duration of the event in minutes.
•Recurring Date, Recurring Rule: The date on which the event recurs, and the recurrence rule (for example: weekly, on Thursdays).
•Description: A description of the event.
•Has Alarm: Whether the event has an alarm set: true for yes, false for no.
•Recurring: The start and end times of the period within which an event recurs.
•Attendee: The details of each attendee are stored in a separate Attendee item.
•Reminder: Details of the reminder, such as the reminder time interval and the method of the reminder.
Note: | If the calendar contains no information for a particular field, then nothing is returned for that field. |
Write Calendar Event
When this action (see screenshot below) is executed, it opens the device's calendar app and creates an event entry containing the data that you entered in the action. For example, an event entry created by the action shown in the screenshot below will contain the event's title, start and end times, description, and event location. Notice that in the screenshot below the values for Event is all day must be one of the Boolean values, true() or false().
When the action is triggered on the client device, the event will not be saved directly to any calendar. Instead, the event entry will be opened in the calendar app so that the user can immediately edit it and save it to the calendar they want.
Read Calendars
This action reads information about the calendars on the device. A device might have additional calendars, such as one for international holidays or for the trade fairs of a particular industry. These calendars are not normally used to add new events, and so are considered non-essential. When reading calendars, you can filter out these "non-essential" calendars (by selecting Only Relevant Calendars; see screenshot below). If the calendar selection is unfiltered, then all calendars on the device are read. Each calendar is stored as a Calendar element in the $MT_CALENDAR tree.
You can select what data fields of the calendar information to read:
•ID: A string that is the calendar's identifier.
•Names: These names can be used to disambiguate among calendars. Select one or more from among the calendar's display name, account name (since a device may have multiple accounts), and owner name.
•Allowed Attendee Type: A value such as Optional or Required.
•Color, Location, Time Zone: The calendar's color, location, and time zone (usually given as +/-HH:MM).
•Is Primary: Typically each device has one primary calendar and one or more secondary calendars. This value indicates whether the calendar is a primary calendar (true) or not (false).
•Is Visible: Whether the calendar is set to be visible (true) or not (false).
•Sync Events: Whether the calendar is set to sync down events (true) or not (false).
Note: | If the calendar contains no information for a particular field, then nothing is returned for that field. |
Simulating the device's calendar
There are two options for simulating the device's calendar app:
•Microsoft Outlook's calendar
•An XML file that has the structure of the $MT_CALENDAR tree
Select the option you want to use in the Simulation tab of the Options dialog (Tools | Options).
<?xml version="1.0" encoding="UTF-8"?> <Root> <Calendar Id="1" Name="Business"> <Event Id="1" Title="Quarterly Meeting" Start="2018-04-04" End="2018-04-04" AllDay="true()" Location="Meeting Room 2"> <Attendee Name="Bob" Status="Accepted" Type="Required" Relationship="Speaker"/> </Event> <Event Id="2" Title="New Customer Lunch" Start="2018-05-14T12:30:00" End="2018-05-14T14:00:00" Location="Sushi Restaurant"> <Attendee Name="Alice" Status="Accepted" Type="Optional" Relationship="Attendee"/> </Event> </Calendar> <Calendar Id="2" Name="Private"> <Event Id="1" Title="Family Dinner" Start="2018-05-18T19:00:00" End="2018-05-18T23:00:00" Location="Home"/> <Event Id="2" Title="Summer Vacation" Start="2018-07-09" End="2018-07-22" AllDay="true" Location="Home"/> </Calendar> </Root>
|
MobileTogether extension functions
MobileTogether provides a range of XPath extension functions that have been specifically created for use in MobileTogether designs. Some functions can be particularly useful with specific actions. For example, mt-available-languages() returns the languages in which the solution is available and could, for example, be used with the Message Box action. If a function is especially relevant to this action, it is listed below. For a full list of extension functions and their descriptions, see the topic MobileTogether Extension Functions.