]>
git.argeo.org Git - gpl/argeo-suite.git/blob - swt/org.argeo.app.ui/src/org/argeo/app/ui/people/UserColumn.java
1 package org
.argeo
.app
.ui
.people
;
3 import org
.argeo
.api
.acr
.Content
;
4 import org
.argeo
.api
.acr
.ldap
.LdapAttr
;
5 import org
.argeo
.api
.acr
.ldap
.LdapObj
;
6 import org
.argeo
.api
.cms
.ux
.CmsIcon
;
7 import org
.argeo
.app
.ui
.SuiteIcon
;
8 import org
.argeo
.cms
.auth
.UserAdminUtils
;
9 import org
.argeo
.cms
.ux
.widgets
.Column
;
10 import org
.osgi
.service
.useradmin
.User
;
12 public class UserColumn
implements Column
<Content
> {
14 public String
getText(Content role
) {
15 if (role
.hasContentClass(LdapObj
.inetOrgPerson
))
16 return UserAdminUtils
.getUserDisplayName(role
.adapt(User
.class));
17 else if (role
.hasContentClass(LdapObj
.organization
))
18 return role
.attr(LdapAttr
.o
);
19 else if (role
.hasContentClass(LdapObj
.groupOfNames
))
20 return role
.attr(LdapAttr
.cn
);
26 public CmsIcon
getIcon(Content role
) {
27 if (role
.hasContentClass(LdapObj
.posixAccount
))
28 return SuiteIcon
.user
;
29 else if (role
.hasContentClass(LdapObj
.inetOrgPerson
))
30 return SuiteIcon
.person
;
31 else if (role
.hasContentClass(LdapObj
.organization
))
32 return SuiteIcon
.organisationContact
;
33 else if (role
.hasContentClass(LdapObj
.groupOfNames
))
34 return SuiteIcon
.group
;