6.3.1 GetList

GetList is used to retrieve the information about available calendar databases or calendar entries. It takes a set of input parameters that define the type of information to return, and how to filter the returned list. It is available only in synchronous.

The following is an example for using GetList:

meeting_list = calendar_handle.call('GetList', {'Type': u'CalendarEntry', 'Filter': {'CalendarName': u'C:Calendar', 'Type': u'Meeting'}})

The following table summarizes the specification of GetList:

Interface IDataSource
Description Returns a list of available calendars or calendar entries.
Response Model Synchronous
Pre-condition IDataSource interface is loaded.
Post-condition Nil
Note The calendar file must be present to get a list of entries from a specific calendar.

Input Parameters for Calendar

Input parameter specifies the Type and Filter to perform GetList service.

Table 6.14: Input parameters for Calendar Getlist
Name Type Range Description
Type unicode string Calendar Indicates that the GetList service is to be performed on a calendar.
[Filter] map DefaultCalendar: bool This is an optional parameter. If DefaultCalendar is set to True, GetList returns the list with one element (default calendar) else, it returns a list of all calendars.


Output Parameters for Calendar

Output parameters contain the requested information. It also contains ErrorCode, and an ErrorMessage if the operation fails. ReturnValue contains an array of all Calendars.

Table 6.15: Output parameters for Calendar Getlist
Name Type Range Description
ErrorCode int NA Service specific error code on failure of the operation.
ErrorMessage string NA Error description in Engineering English.
ReturnValue ScriptextIterableWrapper This is an Iterable list of available calendars in the format : Drivexxx:FileNamexxx.  


Input Parameters for Calendar Entry

Input parameter specifies the Type and Filter to perform GetList service.

Table 6.16: Input parameters for Calendar Entry Getlist
Name Type Range Description
Type unicode string CalendarEntry Indicates that the GetList service is performed on calendar entries.
[Filter] map [CalendarName]: unicode string
[id]: unicode string
[LocalId]: unicode string
[StartRange]: datetime
[EndRange]: datetime
[SearchText]: unicode string
[Type]: unicode string
where, [Type] is one of the following:
Meeting
ToDo
Anniversary
Reminder
DayEvent
IncludeAll
All instances are fetched if Filter is not present.
CalendarName specifies the calendar used in the format Drivexxx:Filenamexxx. If this parameter is not specified then, the default calendar is used. GetList returns the entries matching with id or LocalId, if only id or LocalId is specified. In case of id, the first entry is the parent entry. This case ignores the other fields in the input map.

If any of the Ids (id and LocalId) are not specified then, GetList interprets the input as follows:

Returns the instances falling within StartRange and EndRange, if they are specified.
Returns all instances present in Calendar, if StartRange and EndRange are not specified.
Returns all instances present on or after the specified date if only StartRange is specified.
Returns all instances present on or before the specified date if only EndRange is specified.
Matches the string with the summary field of the entry if Search Text is specified. The match is not case sensitive.
Includes only entries of the Type specified in the output if Type parameter is present else, includes all entry types.


Output Parameters for Calendar Entry

Output parameter contains ReturnValue. It also contain ErrorCode, and an ErrorMessage if the operation fails.

ReturnValue of Calendar Entry is an iterable list of entries, which contains all relevant fields of the calendar entry based on the Entry Type (Meeting, To-Do, Reminder, DayEvent, Anniversary).

Table 6.17: Output parameters for Calendar Entry Getlist
Name Type Range Description
ErrorCode int NA Service specific error code on failure of the operation.
ErrorMessage string NA Error description in Engineering English.
ReturnValue ScriptextIterableWrapper For specific information on Types, refer to the following tables:
Meeting: 6.18
To-Do: 6.19
Anniversary: 6.20
DayEvent: 6.21
Reminder: 6.22
ReturnValue of Calendar Entry is an iterable list of entries, which contains all relevant fields of the calendar entry based on the Entry Type (Meeting, To-Do, Reminder, DayEvent, Anniversary).

The output is an Iterable list of instances if id and LocalId are not specified in filter.

For more information on keys, refer to the section Key Values 6.3.7.



Table 6.18: Entry type: Meeting
Type string Meeting
id string NA
LocalId string NA
Summary string NA
SeqNum 32-bit int NA
StartTime datetime NA
EndTime datetime NA
InstanceStartTime datetime (Valid only for instance list) NA
InstanceEndTime datetime (Valid only for instance list) NA
Replication string Open
Private
Restricted
Description string NA
Priority 32-bit int NA
AlarmTime datetime NA
Location string NA
Status string Tentative
Confirmed
Cancelled
NullStatus
RepeatDates List of dates NA
ExDates List of dates NA
Method string NA
PhoneOwner string NA
Organizer CommonName: string
Address: string
NA
Attendees List of maps NA
RepeatRule map NA



Table 6.19: Entry type: ToDo
Type string ToDo
id string NA
LocalId string NA
Summary string NA
EndTime datetime NA
Replication string Open
Private
Restricted
Description string NA
Priority 32-bit int NA
AlarmTime datetime NA
Status string TodoNeedsAction
TodoCompleted
TodoInProcess
Cancelled
NullStatus



Table 6.20: Entry type: Anniversary
Type string Anniversary
id string NA
LocalId string NA
Summary string NA
StartTime datetime NA
Replication string Open
Private
Restricted
Description string NA
Priority 32-bit int NA
AlarmTime datetime NA



Table 6.21: Entry type: DayEvent
Type string DayEvent
id string NA
LocalId string NA
Summary string NA
StartTime datetime NA
EndTime datetime NA
Replication string Open
Private
Restricted
Description string NA
Priority 32-bit int NA
AlarmTime datetime NA



Table 6.22: Entry type: Reminder
Type string Reminder
id string NA
LocalId string NA
Summary string NA
StartTime datetime NA
Replication string Open
Private
Restricted
Description string NA
Priority 32-bit int NA
AlarmTime datetime NA


Errors

The following table lists the errors and their values:

Table 6.23: Error codes
Error code value Description
1000 Invalid service argument
1012 Item not found


Error Message

The following table lists the error messages and their description:


Table 6.24: Error messages
Error messages Description
Calendar:GetList:Type is invalid Type is missing or invalid Type is passed
Calendar:GetList:Filter is invalid Type of Filter parameter is invalid
Calendar:GetList:DefaultCalendar is invalid Type passed for DefaultCalendar is invalid
Calendar:GetList:Id is invalid Type passed for Id is invalid
Calendar:GetList:LocalId is invalid Type passed for LocalId is invalid
Calendar:GetList:StartRange is invalid Type passed for StartRange is invalid
Calendar:GetList:EndRange is invalid Type passed for EndRange is invalid
Calendar:GetList:SearchText is invalid Type passed for SearchText is invalid
Calendar:GetList:CalendarName is invalid Type passed for CalendarName is invalid


Example

The following sample code illustrates how to display all calendar entries:

import scriptext

# Load Calendar service
calendar_handle = scriptext.load('Service.Calendar', 'IDataSource')
meeting_list = calendar_handle.call('GetList', {'Type': u'CalendarEntry', 'Filter':  {'CalendarName': u'C:Calendar', 'Type': u'Meeting'}})
for meeting in meeting_list:
	print 'Id = ' + meeting['id']
        print 'Description = ' + meeting['Description']

        value = meeting['StartTime']
        print "Meeting starting time is ", value.day, value.month, value.year, value.hour, ":", value.minute, ":", value.second

        value = meeting['EndTime']
        print "Meeting End time is ", value.day, value.month, value.year, value.hour, ":", value.minute, ":", value.second

See About this document... for information on suggesting changes.