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

Adam Tauno Williams developer@opengroupware.org
Mon, 17 Sep 2007 08:43:46 -0400


--=-uW1+Fma4D9HZBEV2kAwa
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

> 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 -=20
>   personAttributes =3D
>     [[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",
>=20
>                        @"enterprises.description",
>                        @"enterprises.companyId",
>                        @"enterprises.globalID",
>                        nil];
>  - or is it OK to add "person.isAccount" and "person.imAddress"?

It works to just add "person.isAccount" and "person.imAddress"
http://bugzilla.opengroupware.org/bugzilla/show_bug.cgi?id=3D1913

> 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?
>=20
> ------ doesn't this check the existence of the attribute?-----
> entity  =3D [[self databaseModel] entityNamed:@"Person"];
> ....
>   while ((one =3D [e nextObject]) !=3D nil) {
>     if (_subKey !=3D nil) {
>       // key must have a prefix (i.e.: 'team.')
>       if (![one hasPrefix:_subKey]) continue;
>     }
>     if ([_maxAttr containsObject:one]) {
>       // key allowed
>       if (_subKey !=3D nil) one =3D [one substringFromIndex:[_subKey
> length]];
>       if (_entity !=3D nil) {
>         /* create a proper EOAttribute */
>         EOAttribute *a;
>=20
>         if ((a =3D [_entity attributeNamed:one]) =3D=3D nil) {
>           [self errorWithFormat:
>                   @"did not find attribute in entity %@: '%@'",
>                   _entity, one];
>         }
>         else
>           [ma addObject:a];
>       }
>=20
> ...
>=20

--=-uW1+Fma4D9HZBEV2kAwa
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBG7naCLRePpNle04MRApG1AJ9KwCPIUDwmG24nCPS7a4bRD1VFnACfSmXs
YLxhvjBSobG4khamMCX6oYc=
=E9EY
-----END PGP SIGNATURE-----

--=-uW1+Fma4D9HZBEV2kAwa--