本文整理匯總了Java中org.kuali.rice.kim.rule.event.ui.AddRoleEvent類的典型用法代碼示例。如果您正苦於以下問題:Java AddRoleEvent類的具體用法?Java AddRoleEvent怎麽用?Java AddRoleEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AddRoleEvent類屬於org.kuali.rice.kim.rule.event.ui包,在下文中一共展示了AddRoleEvent類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processAddRole
import org.kuali.rice.kim.rule.event.ui.AddRoleEvent; //導入依賴的package包/類
public boolean processAddRole(AddRoleEvent addRoleEvent) {
PersonDocumentRole newRole = addRoleEvent.getRole();
IdentityManagementPersonDocument document = (IdentityManagementPersonDocument)addRoleEvent.getDocument();
boolean rulePassed = true;
// List<String> roleIds = KimImplServiceLocator.getUiDocumentService().getAssignableRoleIds();
if (newRole == null || StringUtils.isBlank(newRole.getRoleId())) {
rulePassed = false;
GlobalVariables.getMessageMap().putError(ERROR_PATH, RiceKeyConstants.ERROR_EMPTY_ENTRY, new String[] {"Role"});
// } else if (roleIds.isEmpty() || !roleIds.contains(newRole.getRoleId())) {
// errorMap.putError(ERROR_PATH, RiceKeyConstants.ERROR_ASSIGN_ROLE, new String[] {newRole.getRoleId()});
// rulePassed = false;
} else {
for (PersonDocumentRole role : document.getRoles()) {
if (role.getRoleId().equals(newRole.getRoleId())) {
rulePassed = false;
GlobalVariables.getMessageMap().putError(ERROR_PATH, RiceKeyConstants.ERROR_DUPLICATE_ENTRY, new String[] {"Role"});
}
}
}
// KULRICE-7930 Check for field validation errors
if(!CollectionUtils.isEmpty(GlobalVariables.getMessageMap().getErrorMessagesForProperty("newRole.*", true))) {
rulePassed = false;
}
return rulePassed;
}
示例2: addRole
import org.kuali.rice.kim.rule.event.ui.AddRoleEvent; //導入依賴的package包/類
public ActionForward addRole(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
IdentityManagementPersonDocumentForm personDocumentForm = (IdentityManagementPersonDocumentForm) form;
PersonDocumentRole newRole = personDocumentForm.getNewRole();
if (getKualiRuleService().applyRules(new AddRoleEvent("",personDocumentForm.getPersonDocument(), newRole))) {
Role role = KimApiServiceLocator.getRoleService().getRole(newRole.getRoleId());
if(!validateRole(newRole.getRoleId(), role, PersonDocumentRoleRule.ERROR_PATH, "Person")){
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
newRole.setRoleName(role.getName());
newRole.setNamespaceCode(role.getNamespaceCode());
newRole.setKimTypeId(role.getKimTypeId());
KimDocumentRoleMember roleMember = new KimDocumentRoleMember();
roleMember.setMemberId(personDocumentForm.getPrincipalId());
roleMember.setMemberTypeCode(MemberType.PRINCIPAL.getCode());
roleMember.setRoleId(newRole.getRoleId());
newRole.setNewRolePrncpl(roleMember);
if(!validateRoleAssignment(personDocumentForm.getPersonDocument(), newRole)){
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
KimTypeService kimTypeService = getKimTypeService(KimTypeBo.to(newRole.getKimRoleType()));
//AttributeDefinitionMap definitions = kimTypeService.getAttributeDefinitions();
// role type populated from form is not a complete record
if ( kimTypeService != null ) {
newRole.setDefinitions(kimTypeService.getAttributeDefinitions(newRole.getKimTypeId()));
}
KimDocumentRoleMember newRolePrncpl = newRole.getNewRolePrncpl();
for (KimAttributeField key : newRole.getDefinitions()) {
KimDocumentRoleQualifier qualifier = new KimDocumentRoleQualifier();
//qualifier.setQualifierKey(key);
setAttrDefnIdForQualifier(qualifier,key);
newRolePrncpl.getQualifiers().add(qualifier);
}
if (newRole.getDefinitions().isEmpty()) {
List<KimDocumentRoleMember> rolePrncpls = new ArrayList<KimDocumentRoleMember>();
setupRoleRspActions(newRole, newRolePrncpl);
rolePrncpls.add(newRolePrncpl);
newRole.setRolePrncpls(rolePrncpls);
}
//newRole.setNewRolePrncpl(newRolePrncpl);
newRole.setAttributeEntry( getUiDocumentService().getAttributeEntries( newRole.getDefinitions() ) );
personDocumentForm.getPersonDocument().getRoles().add(newRole);
personDocumentForm.setNewRole(new PersonDocumentRole());
}
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
示例3: processAddRole
import org.kuali.rice.kim.rule.event.ui.AddRoleEvent; //導入依賴的package包/類
@Override
public boolean processAddRole(AddRoleEvent addRoleEvent) {
return getAddRoleRule().processAddRole(addRoleEvent);
}
示例4: addRole
import org.kuali.rice.kim.rule.event.ui.AddRoleEvent; //導入依賴的package包/類
public ActionForward addRole(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
IdentityManagementPersonDocumentForm personDocumentForm = (IdentityManagementPersonDocumentForm) form;
PersonDocumentRole newRole = personDocumentForm.getNewRole();
if (getKualiRuleService().applyRules(new AddRoleEvent("",personDocumentForm.getPersonDocument(), newRole))) {
Role role = KimApiServiceLocator.getRoleService().getRole(newRole.getRoleId());
if(!validateRole(newRole.getRoleId(), role, PersonDocumentRoleRule.ERROR_PATH, "Person")){
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
newRole.setRoleName(role.getName());
newRole.setNamespaceCode(role.getNamespaceCode());
newRole.setKimTypeId(role.getKimTypeId());
KimDocumentRoleMember roleMember = new KimDocumentRoleMember();
roleMember.setMemberId(personDocumentForm.getPrincipalId());
roleMember.setMemberTypeCode(MemberType.PRINCIPAL.getCode());
roleMember.setRoleId(newRole.getRoleId());
newRole.setNewRolePrncpl(roleMember);
if(!validateRoleAssignment(personDocumentForm.getPersonDocument(), newRole)){
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
KimTypeService kimTypeService = getKimTypeService(KimTypeBo.to(newRole.getKimRoleType()));
//AttributeDefinitionMap definitions = kimTypeService.getAttributeDefinitions();
// role type populated from form is not a complete record
if ( kimTypeService != null ) {
newRole.setDefinitions(kimTypeService.getAttributeDefinitions(newRole.getKimTypeId()));
}
KimDocumentRoleMember newRolePrncpl = newRole.getNewRolePrncpl();
newRole.refreshReferenceObject("assignedResponsibilities");
for (KimAttributeField key : newRole.getDefinitions()) {
KimDocumentRoleQualifier qualifier = new KimDocumentRoleQualifier();
//qualifier.setQualifierKey(key);
setAttrDefnIdForQualifier(qualifier,key);
newRolePrncpl.getQualifiers().add(qualifier);
}
if (newRole.getDefinitions().isEmpty()) {
List<KimDocumentRoleMember> rolePrncpls = new ArrayList<KimDocumentRoleMember>();
setupRoleRspActions(newRole, newRolePrncpl);
rolePrncpls.add(newRolePrncpl);
newRole.setRolePrncpls(rolePrncpls);
}
//newRole.setNewRolePrncpl(newRolePrncpl);
newRole.setAttributeEntry( getUiDocumentService().getAttributeEntries( newRole.getDefinitions() ) );
personDocumentForm.getPersonDocument().getRoles().add(newRole);
personDocumentForm.setNewRole(new PersonDocumentRole());
}
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
示例5: processAddRole
import org.kuali.rice.kim.rule.event.ui.AddRoleEvent; //導入依賴的package包/類
public boolean processAddRole(AddRoleEvent addRoleEvent) {
return getAddRoleRule().processAddRole(addRoleEvent);
}
示例6: processAddRole
import org.kuali.rice.kim.rule.event.ui.AddRoleEvent; //導入依賴的package包/類
boolean processAddRole(AddRoleEvent addRoleEvent);