X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.util%2Fsrc%2Forg%2Fargeo%2Futil%2Fdirectory%2Fldap%2FAbstractLdapDirectory.java;h=28d8d081ccdcfb875e5ce8941086f01cc3be3c00;hb=138e686fbf65683c3c94a52f1cfbaf8e02362e19;hp=54d9776b5fd15106bf6de8b560ef81f863f1d470;hpb=285c23f26c4d634cd139d393ebcb708187d5e960;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.util/src/org/argeo/util/directory/ldap/AbstractLdapDirectory.java b/org.argeo.util/src/org/argeo/util/directory/ldap/AbstractLdapDirectory.java index 54d9776b5..28d8d081c 100644 --- a/org.argeo.util/src/org/argeo/util/directory/ldap/AbstractLdapDirectory.java +++ b/org.argeo.util/src/org/argeo/util/directory/ldap/AbstractLdapDirectory.java @@ -10,6 +10,7 @@ import java.util.Dictionary; import java.util.Enumeration; import java.util.Hashtable; import java.util.List; +import java.util.Locale; import java.util.Optional; import java.util.StringJoiner; @@ -255,10 +256,6 @@ public abstract class AbstractLdapDirectory implements Directory, XAResourceProv } else { // user doesn't have the right to retrieve role, but we know it exists // otherwise memberOf would not work -// Attributes a = new BasicAttributes(); -// a.put(LdapNameUtils.getLastRdn(groupDn).getType(), -// LdapNameUtils.getLastRdn(groupDn).getValue()); -// a.put(LdapAttrs.objectClass.name(), LdapObjs.groupOfNames.name()); group = newGroup(groupDn); allRoles.add(group); } @@ -300,6 +297,16 @@ public abstract class AbstractLdapDirectory implements Directory, XAResourceProv return getName(); } + @Override + public String getHierarchyUnitLabel(Locale locale) { + String key = LdapNameUtils.getLastRdn(getBaseDn()).getType(); + Object value = LdapEntry.getLocalized(asLdapEntry().getProperties(), key, locale); + if (value == null) + value = getHierarchyUnitName(); + assert value != null; + return value.toString(); + } + @Override public HierarchyUnit getParent() { return null;