Search in sources :

Example 6 with RoleMember

use of org.kuali.kfs.kim.impl.role.RoleMember in project cu-kfs by CU-CommunityApps.

the class OrgReviewRoleServiceImpl method getRoleMemberToSave.

protected RoleMember getRoleMemberToSave(RoleLite role, OrgReviewRole orr) {
    RoleMember roleMember = null;
    if (orr.getPerson() != null) {
        roleMember = new RoleMember();
        roleMember.setRoleId(role.getId());
        roleMember.setType(MemberType.PRINCIPAL);
        roleMember.setMemberId(orr.getPerson().getPrincipalId());
    } else if (orr.getGroup() != null) {
        roleMember = new RoleMember();
        roleMember.setRoleId(role.getId());
        roleMember.setType(MemberType.GROUP);
        roleMember.setMemberId(orr.getGroup().getId());
    } else if (orr.getRole() != null) {
        roleMember = new RoleMember();
        roleMember.setRoleId(role.getId());
        roleMember.setType(MemberType.ROLE);
        roleMember.setMemberId(orr.getRole().getId());
    }
    if (roleMember != null) {
        if (orr.isEdit()) {
            roleMember.setId(orr.getRoleMemberId());
        }
        roleMember.setAttributes(getAttributes(orr, role.getKimTypeId()));
        if (orr.getActiveFromDate() != null) {
            roleMember.setActiveFromDateValue(new Timestamp(orr.getActiveFromDate().getTime()));
        }
        if (orr.getActiveToDate() != null) {
            roleMember.setActiveToDateValue(new Timestamp(orr.getActiveToDate().getTime()));
        }
    }
    return roleMember;
}
Also used : Timestamp(java.sql.Timestamp) RoleMember(org.kuali.kfs.kim.impl.role.RoleMember)

Example 7 with RoleMember

use of org.kuali.kfs.kim.impl.role.RoleMember in project cu-kfs by CU-CommunityApps.

the class ResponsibilityInternalServiceImpl method saveRoleMember.

@Override
public RoleMember saveRoleMember(RoleMember roleMember) {
    // need to find what responsibilities changed so we can notify interested clients.  Like workflow.
    List<RoleResponsibility> oldRoleResp = getRoleResponsibilities(roleMember.getRoleId());
    // add row to member table
    RoleMember member = businessObjectService.save(roleMember);
    // need to find what responsibilities changed so we can notify interested clients.  Like workflow.
    // the new member has been added
    List<RoleResponsibility> newRoleResp = getRoleResponsibilities(roleMember.getRoleId());
    updateActionRequestsForResponsibilityChange(getChangedRoleResponsibilityIds(oldRoleResp, newRoleResp));
    return member;
}
Also used : RoleResponsibility(org.kuali.kfs.kim.impl.role.RoleResponsibility) RoleMember(org.kuali.kfs.kim.impl.role.RoleMember)

Aggregations

RoleMember (org.kuali.kfs.kim.impl.role.RoleMember)7 ArrayList (java.util.ArrayList)2 OrgReviewRoleService (org.kuali.kfs.coa.service.OrgReviewRoleService)2 RoleService (org.kuali.kfs.kim.api.role.RoleService)2 Timestamp (java.sql.Timestamp)1 HashMap (java.util.HashMap)1 KfsKimDocDelegateMember (org.kuali.kfs.coa.identity.KfsKimDocDelegateMember)1 KimDocumentRoleMember (org.kuali.kfs.kim.bo.ui.KimDocumentRoleMember)1 DelegateMember (org.kuali.kfs.kim.impl.common.delegate.DelegateMember)1 DelegateType (org.kuali.kfs.kim.impl.common.delegate.DelegateType)1 Role (org.kuali.kfs.kim.impl.role.Role)1 RoleLite (org.kuali.kfs.kim.impl.role.RoleLite)1 RoleResponsibility (org.kuali.kfs.kim.impl.role.RoleResponsibility)1 RoleResponsibilityAction (org.kuali.kfs.kim.impl.role.RoleResponsibilityAction)1