use of org.kuali.kfs.kim.impl.group.Group in project cu-kfs by CU-CommunityApps.
the class OrgReviewRoleServiceImpl method getDelegationMembersToSave.
protected List<KfsKimDocDelegateMember> getDelegationMembersToSave(OrgReviewRole orr) {
KfsKimDocDelegateMember delegationMember = null;
if (orr.isEdit() && StringUtils.isNotBlank(orr.getDelegationMemberId())) {
delegationMember = new KfsKimDocDelegateMember(KimApiServiceLocator.getRoleService().getDelegationMemberById(orr.getDelegationMemberId()));
}
if (delegationMember == null) {
delegationMember = new KfsKimDocDelegateMember();
if (StringUtils.isNotEmpty(orr.getRoleMemberRoleNamespaceCode()) && StringUtils.isNotEmpty(orr.getRoleMemberRoleName())) {
String roleId = KimApiServiceLocator.getRoleService().getRoleIdByNamespaceCodeAndName(orr.getRoleMemberRoleNamespaceCode(), orr.getRoleMemberRoleName());
delegationMember.setMemberId(roleId);
delegationMember.setType(MemberType.ROLE);
} else if (StringUtils.isNotEmpty(orr.getGroupMemberGroupNamespaceCode()) && StringUtils.isNotEmpty(orr.getGroupMemberGroupName())) {
Group groupInfo = KimApiServiceLocator.getGroupService().getGroupByNamespaceCodeAndName(orr.getGroupMemberGroupNamespaceCode(), orr.getGroupMemberGroupName());
delegationMember.setMemberId(groupInfo.getId());
delegationMember.setType(MemberType.GROUP);
} else if (StringUtils.isNotEmpty(orr.getPrincipalMemberPrincipalName())) {
Principal principal = KimApiServiceLocator.getIdentityService().getPrincipalByPrincipalName(orr.getPrincipalMemberPrincipalName());
delegationMember.setMemberId(principal.getPrincipalId());
delegationMember.setType(MemberType.PRINCIPAL);
}
}
delegationMember.setDelegationType(DelegationType.fromCode(orr.getDelegationTypeCode()));
delegationMember.setAttributes(getAttributes(orr, orr.getKimTypeId()));
if (orr.getActiveFromDate() != null) {
delegationMember.setActiveFromDate(new DateTime(orr.getActiveFromDate()));
}
if (orr.getActiveToDate() != null) {
delegationMember.setActiveToDate(new DateTime(orr.getActiveToDate()));
}
delegationMember.setRoleMemberId(orr.getRoleMemberId());
return Collections.singletonList(delegationMember);
}
use of org.kuali.kfs.kim.impl.group.Group in project cu-kfs by CU-CommunityApps.
the class ActionItemActionListExtension method initializeGroupName.
private void initializeGroupName() {
if (!groupNameInitialized) {
if (getGroupId() != null) {
Group group = super.getGroup();
this.groupName = group.getName();
}
groupNameInitialized = true;
}
}
use of org.kuali.kfs.kim.impl.group.Group in project cu-kfs by CU-CommunityApps.
the class ActionListFilterAction method getUserWorkgroupsDropDownList.
private List<? extends KeyValue> getUserWorkgroupsDropDownList(String principalId) {
List<String> userWorkgroups = KimApiServiceLocator.getGroupService().getGroupIdsByPrincipalId(principalId);
// note that userWorkgroups is unmodifiable so we need to create a new list that we can sort
List<String> userGroupsToSort = new ArrayList<String>(userWorkgroups);
List<KeyValue> sortedUserWorkgroups = new ArrayList<KeyValue>();
KeyValue keyValue = null;
keyValue = new ConcreteKeyValue(KewApiConstants.NO_FILTERING, KewApiConstants.NO_FILTERING);
sortedUserWorkgroups.add(keyValue);
if (userGroupsToSort != null && userGroupsToSort.size() > 0) {
Collections.sort(userGroupsToSort);
Group group;
for (String groupId : userGroupsToSort) {
group = KimApiServiceLocator.getGroupService().getGroup(groupId);
keyValue = new ConcreteKeyValue(groupId, group.getName());
sortedUserWorkgroups.add(keyValue);
}
}
return sortedUserWorkgroups;
}
Aggregations