LDAP: Conditionally use displayName for file-as
This entry:
$ ldapsearch -ZZLLLx -H ldap://ldap.aegee.org -b "uid=AEGEE Election Observation (Project),ou=bodies,o=AEGEE"
dn: uid=AEGEE Election Observation (Project),ou=bodies,o=AEGEE
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
cn: AEGEE Election Observation (Project)
departmentNumber: Project
departmentNumber: QEO
description: AEGEE Election Observation organises observation missions to elections in Europe. A typical mission lasts for 7 days and consists of 24 young European observers (any AEGEE member can apply to be an observer). During the mission, they meet politicians, institutions and youth organisations,on election day they observe the voting and vote-counting procedures on the ground. After the mission, they publish a report about the elections - and in particular about the participation of young people in these elections.
displayName: AEGEE Election Observation (Project)
sn: AEGEE Election Observation (Project)
labeledURI: https://my.aegee.eu/bodies/11 OMS page
mail: aeo@aegee.org
postalAddress: Notelaarsstraat 55
uid: AEGEE Election Observation (Project)
is rendered in the Address Card/Contact preview as:
As can be seen, the word “Election” is hardly visible and the term “Election Observation” appears together as whole only by accident (because it comes in displayName, which is mapped to Nickname). While the LDAP entry presents the object as inetOrgPerson, this is not a natural person, but (more or less) a juridical person. As jurudical person, it does not have givenname or surname, but has description, homepage, email and postal address. Presenting it as inetOrgPerson makes possible to show the entry in address books.
In this case, the “Full name” is “AEGEE Election Observation (Project)”, but the “File as” property is “Observation (Project), AEGEE”. That said, the full name is stripped and the stripped text is displayed in the contact preview.
I propose mapping displayname to the FileAs property, and use it both as Addressbook Card title and in the preview.