import org.argeo.api.acr.Content;
import org.argeo.api.acr.ContentSession;
+import org.argeo.api.acr.ldap.LdapAcrUtils;
import org.argeo.api.acr.ldap.LdapAttr;
import org.argeo.api.acr.ldap.LdapObj;
import org.argeo.api.acr.spi.ProvidedContent;
// title
// TODO localise at content level
- String title;
- if (context.hasContentClass(LdapObj.organization))
- title = SuiteMsg.org.lead() + " " + context.attr(LdapAttr.cn) + " ("
- + hierarchyUnit.getHierarchyUnitLabel(CurrentUser.locale()) + ")";
- else
- title = SuiteMsg.group.lead() + " " + context.attr(LdapAttr.cn) + " ("
- + hierarchyUnit.getHierarchyUnitLabel(CurrentUser.locale()) + ")";
+ String title = (context.hasContentClass(LdapObj.organization) ? SuiteMsg.org.lead() : SuiteMsg.group.lead())
+ + " " + LdapAcrUtils.getLocalized(context, LdapAttr.cn.qName(), CurrentUser.locale()) + " ("
+ + hierarchyUnit.getHierarchyUnitLabel(CurrentUser.locale()) + ")";
SuiteUiUtils.addFormLabel(area, title);
// toolbar
package org.argeo.app.ui.people;
import org.argeo.api.acr.Content;
+import org.argeo.api.acr.ldap.LdapAcrUtils;
import org.argeo.api.acr.ldap.LdapAttr;
import org.argeo.api.acr.ldap.LdapObj;
import org.argeo.api.cms.ux.CmsIcon;
import org.argeo.app.ui.SuiteIcon;
+import org.argeo.cms.CurrentUser;
import org.argeo.cms.auth.UserAdminUtils;
import org.argeo.cms.ux.widgets.Column;
import org.osgi.service.useradmin.User;
return UserAdminUtils.getUserDisplayName(role.adapt(User.class));
else if (role.hasContentClass(LdapObj.organization))
return role.attr(LdapAttr.o);
- else if (role.hasContentClass(LdapObj.groupOfNames))
- return role.attr(LdapAttr.cn);
- else
+ else if (role.hasContentClass(LdapObj.groupOfNames)) {
+ // TODO make it more generic at ACR level
+ Object label = LdapAcrUtils.getLocalized(role, LdapAttr.cn.qName(), CurrentUser.locale());
+ return label.toString();
+ } else
return null;
}