[OGo-Developer] Attributes available via appointment::list-participants

Adam Tauno Williams developer@opengroupware.org
Sun, 16 Sep 2007 21:32:34 -0400


I enumerate the list of participants for an appointment with -
[[self getCTX] runCommand:@"appointment::list-participants",
    @"gid", [self _getEOForPKey:[date valueForKey:@"dateId"]],
    @"attributes", [NSArray arrayWithObjects: @"role", @"companyId",
                              @"partStatus", @"comment", @"rsvp",
                              @"team.isTeam", @"team.email",
                              @"team.description", @"team.companyId",
                              @"person.extendedAttributes",
                              @"dateId",
                              nil],
    nil];
 - but I'd like to have the person.isAccount an person.imAddress
attributes as well.  These don't appear to be supported by
LSListParticipantsCommand.

Is there a special reason only the subset of attributes available are
added to personAttributes - 
  personAttributes =
    [[NSArray alloc] initWithObjects:
                       @"person.companyId",
                       @"person.globalID",
                       @"person.firstname",
                       @"person.extendedAttributes",
                       @"person.telephones",
                       @"person.name",
                       @"person.salutation",
                       @"person.degree",
                       @"person.enterprises",
                       @"person.isPrivate",
                       @"person.isAccount",
                       @"person.imAddress",
                       @"person.ownerId",
                       @"person.isPerson",

                       @"enterprises.description",
                       @"enterprises.companyId",
                       @"enterprises.globalID",
                       nil];
 - or is it OK to add "person.isAccount" and "person.imAddress"?


As an aside (and there may be an obvious answer), but since
LSListParticipantsCommand verifies the existence of the specified
attribute in the specified entity,  why is there a guardian list?

------ doesn't this check the existence of the attribute?-----
entity  = [[self databaseModel] entityNamed:@"Person"];
....
  while ((one = [e nextObject]) != nil) {
    if (_subKey != nil) {
      // key must have a prefix (i.e.: 'team.')
      if (![one hasPrefix:_subKey]) continue;
    }
    if ([_maxAttr containsObject:one]) {
      // key allowed
      if (_subKey != nil) one = [one substringFromIndex:[_subKey
length]];
      if (_entity != nil) {
        /* create a proper EOAttribute */
        EOAttribute *a;

        if ((a = [_entity attributeNamed:one]) == nil) {
          [self errorWithFormat:
                  @"did not find attribute in entity %@: '%@'",
                  _entity, one];
        }
        else
          [ma addObject:a];
      }

...