グループメンバーのプロパティを取得します
-
13-12-2019 - |
質問
いくつかのグループのメンバーであるユーザーの私のJavaDelegateクラスプロパティを取得する必要があります。
ユーザーにノードREFを持っているとき、私はこの方法で彼のプロパティを取得することができます
QName PROP_QNAME_EMAIL = QName.createQName("http://www.alfresco.org/model/content/1.0", "email");
Map<QName, Serializable> properties = nodeService.getProperties(nodeRef);
properties.get(PROP_QNAME_EMAIL);
.
しかし、私はグループ名しか持っていないので、そのグループ内のユーザーのNoderefを取得する方法がわかりませんか。これについての助けは?
Aleksandar
解決
その間にこれを行うことに成功しました。解決策は:
ですSet<String> authorities = authorityService.getContainedAuthorities(AuthorityType.USER, p_groupName, false);
for (final String authority : authorities) {
final NodeRef person = personService.getPerson(authority);
final Map<QName, Serializable> properties = nodeService.getProperties(person);
properties.get(ContentModel.PROP_EMAIL).toString());
.
}
この例では、グループメンバーごとに電子メールを取得します。
Aleksandar
所属していません StackOverflow