- public String getText(Role role) {
- String txt = getProperty(role, LdapAttrs.o);
- if (txt != null && !txt.equals(""))
- return txt;
- txt = getProperty(role, LdapAttrs.cn);
- if (txt != null && !txt.equals(""))
- return txt;
- txt = UserAdminUtils.getUserDisplayName(role);
- return txt;
+ public String getText(Content role) {
+ if (role.isContentClass(LdapObjs.inetOrgPerson.qName()))
+ return UserAdminUtils.getUserDisplayName(role.adapt(User.class));
+ else if (role.isContentClass(LdapObjs.organization.qName()))
+ return role.attr(LdapAttrs.o.qName());
+ else if (role.isContentClass(LdapObjs.groupOfNames.qName()))
+ return role.attr(LdapAttrs.cn.qName());
+ else
+ return null;