本文整理汇总了Java中org.kuali.rice.kim.api.role.RoleResponsibility类的典型用法代码示例。如果您正苦于以下问题:Java RoleResponsibility类的具体用法?Java RoleResponsibility怎么用?Java RoleResponsibility使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RoleResponsibility类属于org.kuali.rice.kim.api.role包,在下文中一共展示了RoleResponsibility类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: saveRoleMember
import org.kuali.rice.kim.api.role.RoleResponsibility; //导入依赖的package包/类
@Override
public RoleMemberBo saveRoleMember(RoleMemberBo 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
RoleMemberBo member = dataObjectService.save( roleMember, PersistenceOption.FLUSH );
//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;
}
示例2: removeRoleMember
import org.kuali.rice.kim.api.role.RoleResponsibility; //导入依赖的package包/类
@Override
public void removeRoleMember(RoleMemberBo roleMember){
//need to find what responsibilities changed so we can notify interested clients. Like workflow.
List<RoleResponsibility> oldRoleResp = getRoleResponsibilities(roleMember.getRoleId());
// need to set end date to inactivate, not delete
roleMember.setActiveToDateValue(dateTimeService.getCurrentTimestamp());
roleMember = dataObjectService.save( roleMember, PersistenceOption.FLUSH );
// Notify the RoleTypeService for this role that the member was removed
KimApiServiceLocator.getRoleService().notifyOnMemberRemoval(RoleMemberBo.to(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));
}
示例3: setupRoleRspActions
import org.kuali.rice.kim.api.role.RoleResponsibility; //导入依赖的package包/类
protected void setupRoleRspActions(PersonDocumentRole role, KimDocumentRoleMember rolePrncpl) {
for (RoleResponsibility roleResp : getResponsibilityInternalService().getRoleResponsibilities(role.getRoleId())) {
if (getResponsibilityInternalService().areActionsAtAssignmentLevelById(roleResp.getResponsibilityId())) {
KimDocumentRoleResponsibilityAction roleRspAction = new KimDocumentRoleResponsibilityAction();
roleRspAction.setRoleResponsibilityId("*");
// not linked to a role responsibility - so we set the referenced object to null
roleRspAction.setRoleResponsibility(null);
roleRspAction.setDocumentNumber(role.getDocumentNumber());
if(rolePrncpl.getRoleRspActions()==null || rolePrncpl.getRoleRspActions().isEmpty()){
if(rolePrncpl.getRoleRspActions()==null) {
rolePrncpl.setRoleRspActions(new ArrayList<KimDocumentRoleResponsibilityAction>());
}
rolePrncpl.getRoleRspActions().add(roleRspAction);
}
}
}
}
示例4: saveRoleMember
import org.kuali.rice.kim.api.role.RoleResponsibility; //导入依赖的package包/类
@Override
public RoleMemberBo saveRoleMember(RoleMemberBo 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
RoleMemberBo member = getBusinessObjectService().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;
}
示例5: from
import org.kuali.rice.kim.api.role.RoleResponsibility; //导入依赖的package包/类
public static RoleResponsibilityBo from(RoleResponsibility immutable) {
if (immutable == null) {
return null;
}
RoleResponsibilityBo bo = new RoleResponsibilityBo();
bo.roleResponsibilityId = immutable.getRoleResponsibilityId();
bo.roleId = immutable.getRoleId();
bo.responsibilityId = immutable.getResponsibilityId();
bo.active = immutable.isActive();
bo.setVersionNumber(immutable.getVersionNumber());
return bo;
}
示例6: getRoleResponsibilities
import org.kuali.rice.kim.api.role.RoleResponsibility; //导入依赖的package包/类
@Override
public List<RoleResponsibility> getRoleResponsibilities(String roleId) throws RiceIllegalStateException {
incomingParamCheck(roleId, "roleId");
List<RoleResponsibilityBo> roleResponsibilityBos = getDataObjectService().findMatching(
RoleResponsibilityBo.class, QueryByCriteria.Builder.forAttribute(
KimConstants.PrimaryKeyConstants.SUB_ROLE_ID, roleId).build()).getResults();
List<RoleResponsibility> roleResponsibilities = new ArrayList<RoleResponsibility>();
for (RoleResponsibilityBo roleResponsibilityImpl : roleResponsibilityBos) {
roleResponsibilities.add(RoleResponsibilityBo.to(roleResponsibilityImpl));
}
return Collections.unmodifiableList(roleResponsibilities);
}
示例7: updateActionRequestsForRoleChange
import org.kuali.rice.kim.api.role.RoleResponsibility; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void updateActionRequestsForRoleChange(String roleId) {
List<RoleResponsibility> newRoleResp = getRoleResponsibilities(roleId);
updateActionRequestsForResponsibilityChange(getChangedRoleResponsibilityIds(Collections.EMPTY_LIST, newRoleResp));
}
示例8: getRoleResponsibilities
import org.kuali.rice.kim.api.role.RoleResponsibility; //导入依赖的package包/类
@Override
public List<RoleResponsibility> getRoleResponsibilities(String roleId){
List<RoleResponsibilityBo> rrBoList = dataObjectService.findMatching( RoleResponsibilityBo.class, QueryByCriteria.Builder.fromPredicates(
PredicateFactory.equal(KimConstants.PrimaryKeyConstants.SUB_ROLE_ID, roleId),
PredicateFactory.equal(KRADPropertyConstants.ACTIVE,Boolean.TRUE) ) ).getResults();
List<RoleResponsibility> result = new ArrayList<RoleResponsibility>( rrBoList.size() );
for ( RoleResponsibilityBo bo : rrBoList ) {
result.add( RoleResponsibilityBo.to(bo) );
}
return result;
}
示例9: updateDelegationRole
import org.kuali.rice.kim.api.role.RoleResponsibility; //导入依赖的package包/类
/**
* Updates the role that this delegate is part of, to account for the changes in this delegate
*/
@Override
@Transactional
public void updateDelegationRole() {
final RoleService roleManagementService = KimApiServiceLocator.getRoleService();
final String roleId = roleManagementService.getRoleIdByNamespaceCodeAndName(OLEConstants.CoreModuleNamespaces.OLE, OLEConstants.SysKimApiConstants.FISCAL_OFFICER_KIM_ROLE_NAME);
if (!StringUtils.isBlank(roleId)) {
List<RoleResponsibility> newRoleResp = roleManagementService.getRoleResponsibilities(roleId);
KEWServiceLocator.getActionRequestService().updateActionRequestsForResponsibilityChange(getChangedRoleResponsibilityIds(newRoleResp));
}
}
示例10: getChangedRoleResponsibilityIds
import org.kuali.rice.kim.api.role.RoleResponsibility; //导入依赖的package包/类
protected Set<String> getChangedRoleResponsibilityIds( List<RoleResponsibility> newRoleResp){
Set<String> lRet = new HashSet<String>();
if(ObjectUtils.isNotNull(newRoleResp)){
for(RoleResponsibility roleResp: newRoleResp){
lRet.add(roleResp.getResponsibilityId());
}
}
return lRet;
}
示例11: getNumberOfResponsibilitiesWithRoleMemberLevelActions
import org.kuali.rice.kim.api.role.RoleResponsibility; //导入依赖的package包/类
protected int getNumberOfResponsibilitiesWithRoleMemberLevelActions( Role role ) {
List<RoleResponsibility> roleResponsibilities = roleService.getRoleResponsibilities(role.getId());
assertNotNull( "There should have been responsibilities assigned to the role (was null)", roleResponsibilities );
assertFalse( "There should have been responsibilities assigned to the role", roleResponsibilities.isEmpty() );
int num = 0;
for ( RoleResponsibility rr : roleResponsibilities ) {
Responsibility r = responsibilityService.getResponsibility(rr.getResponsibilityId());
if ( Boolean.parseBoolean( r.getAttributes().get(KimConstants.AttributeConstants.ACTION_DETAILS_AT_ROLE_MEMBER_LEVEL) ) ) {
num++;
}
}
return num;
}
示例12: updateDelegationRole
import org.kuali.rice.kim.api.role.RoleResponsibility; //导入依赖的package包/类
/**
* Updates the role that this delegate is part of, to account for the changes in this delegate
*/
@Override
@Transactional
public void updateDelegationRole() {
final RoleService roleManagementService = KimApiServiceLocator.getRoleService();
final String roleId = roleManagementService.getRoleIdByNamespaceCodeAndName(KFSConstants.ParameterNamespaces.KFS, KFSConstants.SysKimApiConstants.FISCAL_OFFICER_KIM_ROLE_NAME);
if (!StringUtils.isBlank(roleId)) {
List<RoleResponsibility> newRoleResp = roleManagementService.getRoleResponsibilities(roleId);
KEWServiceLocator.getActionRequestService().updateActionRequestsForResponsibilityChange(getChangedRoleResponsibilityIds(newRoleResp));
}
}
示例13: addGroupToRole
import org.kuali.rice.kim.api.role.RoleResponsibility; //导入依赖的package包/类
public void addGroupToRole(EdoGroup group) {
// assign the group to a role
RoleMember roleMember = KimApiServiceLocator.getRoleService().assignGroupToRole(group.getKimGroupId(), EdoConstants.EDO_NAME_SPACE, group.getKimRoleName(), group.getGrpAttributes());
List<RoleResponsibility> kimRoleResponsibilities = KimApiServiceLocator.getRoleService().getRoleResponsibilities(roleMember.getRoleId());
for (RoleResponsibility kimRoleResp : kimRoleResponsibilities) {
Role kimRole = KimApiServiceLocator.getRoleService().getRole(kimRoleResp.getRoleId());
Responsibility kimResponsibility = KimApiServiceLocator.getResponsibilityService().getResponsibility(kimRoleResp.getResponsibilityId());
List<EdoRoleResponsibility> edoRoleResponsibilityList = EdoServiceLocator.getEdoRoleResponsibilityService().getEdoRoleResponsibilityByRoleAndResponsibility(kimRole.getName(),kimResponsibility.getName());
for (EdoRoleResponsibility edoRoleResp : edoRoleResponsibilityList) {
RoleResponsibilityAction.Builder roleRespActionBuilder = RoleResponsibilityAction.Builder.create();
roleRespActionBuilder.setRoleResponsibility(kimRoleResp);
roleRespActionBuilder.setRoleResponsibilityId(kimRoleResp.getRoleResponsibilityId());
roleRespActionBuilder.setRoleMemberId(roleMember.getId());
roleRespActionBuilder.setForceAction(edoRoleResp.isKimForceAction());
roleRespActionBuilder.setActionTypeCode(edoRoleResp.getKimActionTypeCode());
roleRespActionBuilder.setActionPolicyCode(edoRoleResp.getKimActionPolicyCode());
roleRespActionBuilder.setPriorityNumber(edoRoleResp.getKimPriority());
RoleResponsibilityAction roleResponsibilityAction = roleRespActionBuilder.build();
// and add it to the list
RoleResponsibilityAction foo = KimApiServiceLocator.getRoleService().createRoleResponsibilityAction(roleResponsibilityAction);
}
}
return;
}
示例14: getRoleResponsibilities
import org.kuali.rice.kim.api.role.RoleResponsibility; //导入依赖的package包/类
@Override
public List<RoleResponsibility> getRoleResponsibilities(String roleId) throws RiceIllegalStateException {
incomingParamCheck(roleId, "roleId");
Map<String, String> criteria = new HashMap<String, String>(1);
criteria.put(KimConstants.PrimaryKeyConstants.SUB_ROLE_ID, roleId);
List<RoleResponsibilityBo> roleResponsibilityBos = (List<RoleResponsibilityBo>)
getBusinessObjectService().findMatching(RoleResponsibilityBo.class, criteria);
List<RoleResponsibility> roleResponsibilities = new ArrayList<RoleResponsibility>();
for (RoleResponsibilityBo roleResponsibilityImpl : roleResponsibilityBos) {
roleResponsibilities.add(RoleResponsibilityBo.to(roleResponsibilityImpl));
}
return Collections.unmodifiableList(roleResponsibilities);
}
示例15: removeRoleMember
import org.kuali.rice.kim.api.role.RoleResponsibility; //导入依赖的package包/类
@Override
public void removeRoleMember(RoleMemberBo roleMember){
//need to find what responsibilities changed so we can notify interested clients. Like workflow.
List<RoleResponsibility> oldRoleResp = getRoleResponsibilities(roleMember.getRoleId());
// need to set end date to inactivate, not delete
roleMember.setActiveToDateValue(new java.sql.Timestamp(System.currentTimeMillis()));
getBusinessObjectService().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));
}