Skip to content

OGo Docs

Sections
Personal tools
You are here: Home » Members » whitemice's Home » Objective-C Development » appoinment::conflicts

appoinment::conflicts

Document Actions
How to use the appointment::conflicts command.
Getting conflict information from the schedular
Conflict information is retrieved from the schedular application using the appointment::conflicts command. In all the examples below conflictInfo is a dictionary that looks like:


Get conflicts for a specific appointment
conflictList = [[[self commandContext]
  runCommand:@"appointment::conflicts",
    @"appointment", tmp,
    @"fetchConflictInfo", @"YES",
    @"fetchGlobalIDs", @"YES",
    @"conflictInfoAttributes", conflictAttrs,
    nil] copy];

tmp is an NSDictionary/EOGeneric record of an appointment. See the appointment::get-by-globalid documentation for how to retrieve an appointment.

Get conflicts for a date range
conflictInfo = [[self commandContext]
  runCommand:@"appointment::conflicts",
    @"begin", _startDate,
    @"end", _endDate,
    @"staffList", participants,
    @"fetchGlobalIDs", @"YES",
    @"fetchConflictInfo", @"YES",
    nil ];

_startDate and _endDate are both instances of NSCalendarDate.
participants is an NSArray of EOKeyGlobalIDs (handles) of the participants you are interested in.

You can also include detection for resource conflicts by adding the resourceList key:
  conflictInfo = [[self commandContext]
    runCommand:@"appointment::conflicts",
    @"begin", _startDate,
    @"end", _endDate,
    @"staffList", participants,
    @"fetchGlobalIDs", @"YES",
    @"fetchConflictInfo", @"YES",
    @"resourceList",
        [NSArray arrayWithObject:[[NSString alloc] initWithString:@"North Conference Room"]],
    nil ];

As you can see resourceList is an NSArray of resource names. Yep, names not pkeys or EOGlobalIDs; pretty wierd. This stems from the fact that resources allocated to an appointment are actually stored as a comma delimited list of, again, resource names. And, yes, resource names are unique; there is a unique index applied to the database concerning resource names.

The result of the search will be an array of dictionary of conflicts. The key of the dictionary is the EOGlobalID of the appointments with which there are conflicts and the contents of reach key an array of the objects in conflict.
<0x0x85acfac[EOKeyGlobalID]: Date 496450> = (
  {
    companyId = 10160;
    dateId = 496450;
    globalID = <0x0x867c844[EOKeyGlobalID]: Person 10160>;
    partStatus = "";
    role = "REQ-PARTICIPANT";
  }
);
<0x0x87b0474[EOKeyGlobalID]: Date 496315> = (
  {
  companyId = 10003;
  dateId = 496315;
  isTeam = 1;
  partStatus = "";
  role = "REQ-PARTICIPANT";
  },
  {
  dateId = 496315;
  partStatus = ACCEPTED;
  resourceName = "South Conference Roomt";
  role = "REQ-PARTICIPANT";
  }
);
Created by whitemice
Last modified 2007-06-04 03:27 PM
 

Powered by Plone

This site conforms to the following standards: