Hi.
I'm dealing with an LDAP server that answers queries with data
that has the objectClass attribute in no particular order, i.e. and
had a question for you all.
Is there an easy way to get the values of:
$mesg->entry(0)->get_value('objectClass')
into hierarchical sorted value? I'm seeing returned values like:
iplanet-am-user-service, iplanet-am-managed-person, top, iPlanetPreferences,
person, inetuser, inetOrgPerson, inetAdmin, organizationalPerson
which clearly isn't correct. I figure that the Schema class probably
contains enough information in this to put things into the proper order
that the hierarchy implies.
(Of course, multiple inheritance makes things a little tricky...)
Reason is we want to be able to look at an object with a browser, and
go up the (objectClass) tree until we find a node on the tree that (mostly)
knows how to render this object.
For instance, if we don't know how to render a node as an 'inetOrgPerson',
well, we could render it as an 'organizationalPerson' instead, etc.
Does it make sense to add a convenience wrapper that handles this logic
for us (and perhaps caches the schema conveniently to avoid having to
pull it down multiple times)?
Thanks,
-Philip