當前位置: 首頁>>代碼示例>>Java>>正文


Java AddRoleEvent類代碼示例

本文整理匯總了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;
	}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:31,代碼來源:PersonDocumentRoleRule.java

示例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);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:48,代碼來源:IdentityManagementPersonDocumentAction.java

示例3: processAddRole

import org.kuali.rice.kim.rule.event.ui.AddRoleEvent; //導入依賴的package包/類
@Override
public boolean processAddRole(AddRoleEvent addRoleEvent) {
    return getAddRoleRule().processAddRole(addRoleEvent);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:5,代碼來源:IdentityManagementPersonDocumentRule.java

示例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);
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:49,代碼來源:IdentityManagementPersonDocumentAction.java

示例5: processAddRole

import org.kuali.rice.kim.rule.event.ui.AddRoleEvent; //導入依賴的package包/類
public boolean processAddRole(AddRoleEvent addRoleEvent) {
    return getAddRoleRule().processAddRole(addRoleEvent);
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:4,代碼來源:IdentityManagementPersonDocumentRule.java

示例6: processAddRole

import org.kuali.rice.kim.rule.event.ui.AddRoleEvent; //導入依賴的package包/類
boolean processAddRole(AddRoleEvent addRoleEvent); 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:2,代碼來源:AddRoleRule.java


注:本文中的org.kuali.rice.kim.rule.event.ui.AddRoleEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。