本文整理汇总了Java中org.kuali.rice.kim.bo.ui.RoleDocumentDelegationMemberQualifier类的典型用法代码示例。如果您正苦于以下问题:Java RoleDocumentDelegationMemberQualifier类的具体用法?Java RoleDocumentDelegationMemberQualifier怎么用?Java RoleDocumentDelegationMemberQualifier使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RoleDocumentDelegationMemberQualifier类属于org.kuali.rice.kim.bo.ui包,在下文中一共展示了RoleDocumentDelegationMemberQualifier类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDelegationMemberRoleMemberId
import org.kuali.rice.kim.bo.ui.RoleDocumentDelegationMemberQualifier; //导入依赖的package包/类
/**
* @param delegationMemberRoleMemberId the delegationMemberRoleMemberId to set
*/
public void setDelegationMemberRoleMemberId(String delegationMemberRoleMemberId) {
this.delegationMemberRoleMemberId = delegationMemberRoleMemberId;
getDelegationMember().setRoleMemberId(delegationMemberRoleMemberId);
KimDocumentRoleMember roleMember = getRoleDocument().getMember(delegationMemberRoleMemberId);
if(roleMember!=null){
delegationMember.setRoleMemberId(roleMember.getRoleMemberId());
delegationMember.setRoleMemberName(roleMember.getMemberName());
delegationMember.setRoleMemberNamespaceCode(roleMember.getMemberNamespaceCode());
RoleDocumentDelegationMemberQualifier delegationMemberQualifier;
for(KimDocumentRoleQualifier roleQualifier: roleMember.getQualifiers()){
delegationMemberQualifier = getDelegationMember().getQualifier(roleQualifier.getKimAttrDefnId());
delegationMemberQualifier.setAttrVal(roleQualifier.getAttrVal());
}
}
}
示例2: figureOutUniqueQualificationSetForDelegation
import org.kuali.rice.kim.bo.ui.RoleDocumentDelegationMemberQualifier; //导入依赖的package包/类
/**
* Finds the names of the unique qualification attributes which this role should be checking against
*
* @param memberships the memberships (we take the qualification from the first)
* @param attributeDefinitions information about the attributeDefinitions
* @return a Set of unique attribute ids (with their indices, for error reporting)
*/
protected Set<String> figureOutUniqueQualificationSetForDelegation(List<RoleDocumentDelegationMember> memberships, List<KimAttributeField> attributeDefinitions) {
Set<String> uniqueAttributeIds = new HashSet<String>();
if (memberships != null && memberships.size() > 1) { // if there aren't two or more members, doing this whole check is kinda silly
RoleDocumentDelegationMember membership = memberships.get(0);
for (RoleDocumentDelegationMemberQualifier qualifier : membership.getQualifiers()) {
if (qualifier != null && qualifier.getKimAttribute() != null && !StringUtils.isBlank(qualifier.getKimAttribute().getAttributeName())) {
final KimAttributeField relatedDefinition = DataDictionaryTypeServiceHelper.findAttributeField(
qualifier.getKimAttribute().getAttributeName(), attributeDefinitions);
if (relatedDefinition.isUnique()) {
uniqueAttributeIds.add(qualifier.getKimAttrDefnId()); // it's unique - add it to the Set
}
}
}
}
return uniqueAttributeIds;
}
示例3: addDelegationMember
import org.kuali.rice.kim.bo.ui.RoleDocumentDelegationMemberQualifier; //导入依赖的package包/类
public ActionForward addDelegationMember(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
IdentityManagementPersonDocumentForm personDocumentForm = (IdentityManagementPersonDocumentForm) form;
IdentityManagementPersonDocument personDocument = personDocumentForm.getPersonDocument();
RoleDocumentDelegationMember newDelegationMember = personDocumentForm.getNewDelegationMember();
KimTypeAttributesHelper attrHelper = newDelegationMember.getAttributesHelper();
if (getKualiRuleService().applyRules(new AddPersonDelegationMemberEvent("", personDocumentForm.getPersonDocument(), newDelegationMember))) {
//RoleImpl roleBo = (RoleImpl)getUiDocumentService().getMember(KimApiConstants.KimUIConstants.MEMBER_TYPE_ROLE_CODE, newDelegationMember.getRoleDao().getRoleId());
Role role;
role = KimApiServiceLocator.getRoleService().getRole(newDelegationMember.getRoleBo().getId());
if (role != null) {
if(!validateRole(newDelegationMember.getRoleBo().getId(),role, PersonDocumentRoleRule.ERROR_PATH, "Person")){
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
newDelegationMember.setRoleBo(RoleBo.from(role));
}
KimAttributeField attrDefinition;
RoleMemberBo roleMember = KIMServiceLocatorInternal.getUiDocumentService().getRoleMember(newDelegationMember.getRoleMemberId());
Map<String, String>
roleMemberAttributes = (new AttributeValidationHelper()).convertAttributesToMap(roleMember.getAttributeDetails());
for (KimAttributeField key: attrHelper.getDefinitions()) {
RoleDocumentDelegationMemberQualifier qualifier = new RoleDocumentDelegationMemberQualifier();
attrDefinition = key;
qualifier.setKimAttrDefnId(attrHelper.getKimAttributeDefnId(attrDefinition));
qualifier.setAttrVal(attrHelper.getAttributeValue(roleMemberAttributes, attrDefinition.getAttributeField().getName()));
newDelegationMember.setMemberTypeCode(MemberType.PRINCIPAL.getCode());
newDelegationMember.getQualifiers().add(qualifier);
}
//newDelegationMember.setAttributeEntry(getUiDocumentService().getAttributeEntries(newDelegationMember.getAttributesHelper().getDefinitions())));
newDelegationMember.setMemberId(personDocument.getPrincipalId());
personDocument.getDelegationMembers().add(newDelegationMember);
personDocumentForm.setNewDelegationMember(new RoleDocumentDelegationMember());
}
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
示例4: changeDelegationMemberTypeCode
import org.kuali.rice.kim.bo.ui.RoleDocumentDelegationMemberQualifier; //导入依赖的package包/类
public ActionForward changeDelegationMemberTypeCode(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
IdentityManagementRoleDocumentForm roleDocumentForm = (IdentityManagementRoleDocumentForm) form;
KimDocumentRoleMember roleMember = roleDocumentForm.getRoleDocument().getMember(roleDocumentForm.getDelegationMember().getRoleMemberId());
if (roleMember != null) {
RoleDocumentDelegationMemberQualifier delegationMemberQualifier;
for (KimDocumentRoleQualifier roleQualifier : roleMember.getQualifiers()) {
delegationMemberQualifier = roleDocumentForm.getDelegationMember().getQualifier(roleQualifier.getKimAttrDefnId());
delegationMemberQualifier.setAttrVal(roleQualifier.getAttrVal());
}
}
return refresh(mapping, roleDocumentForm, request, response);
}
示例5: validateUniquePersonRoleQualifiersUniqueForRoleDelegation
import org.kuali.rice.kim.bo.ui.RoleDocumentDelegationMemberQualifier; //导入依赖的package包/类
/**
* Checks all the qualifiers for the given membership, so that all qualifiers which should be unique are guaranteed to be unique
*
* @param delegationMembershipToCheck the membership to check
* @param membershipToCheckIndex the index of the person's membership in the role (for error reporting purposes)
* @param validationErrors Map<String, String> of errors to report
* @return true if all unique values are indeed unique, false otherwise
*/
protected boolean validateUniquePersonRoleQualifiersUniqueForRoleDelegation(RoleDocumentDelegationMember delegationMembershipToCheck, int membershipToCheckIndex, List<RoleDocumentDelegationMember> delegationMemberships, Set<String> uniqueQualifierIds, List<RemotableAttributeError> validationErrors) {
boolean foundError = false;
int count = 0;
for (RoleDocumentDelegationMember delegationMembership : delegationMemberships) {
if (membershipToCheckIndex != count) {
if (sameDelegationMembership(delegationMembershipToCheck, delegationMembership)) {
if (sameUniqueDelegationMembershipQualifications(delegationMembershipToCheck, delegationMembership, uniqueQualifierIds)) {
foundError = true;
// add error to each qualifier which is supposed to be unique
int qualifierCount = 0;
for (RoleDocumentDelegationMemberQualifier qualifier : delegationMembership.getQualifiers()) {
if (qualifier != null && uniqueQualifierIds.contains(qualifier.getKimAttrDefnId())) {
validationErrors.add(RemotableAttributeError.Builder.create("document.delegationMembers["+membershipToCheckIndex+"].qualifiers["+qualifierCount+"].attrVal", RiceKeyConstants.ERROR_DOCUMENT_IDENTITY_MANAGEMENT_PERSON_QUALIFIER_VALUE_NOT_UNIQUE+":"+qualifier.getKimAttribute().getAttributeName()+";"+qualifier.getAttrVal()).build());
}
qualifierCount += 1;
}
}
}
}
count += 1;
}
return foundError;
}
示例6: sameUniqueDelegationMembershipQualifications
import org.kuali.rice.kim.bo.ui.RoleDocumentDelegationMemberQualifier; //导入依赖的package包/类
/**
* Given two memberships which represent the same member, do they share qualifications?
*
* @param membershipA the first membership to check
* @param membershipB the second membership to check
* @param uniqueAttributeIds the Set of attribute definition ids which should be unique
* @return
*/
protected boolean sameUniqueDelegationMembershipQualifications(RoleDocumentDelegationMember membershipA, RoleDocumentDelegationMember membershipB, Set<String> uniqueAttributeIds) {
boolean equalSoFar = true;
for (String kimAttributeDefinitionId : uniqueAttributeIds) {
final RoleDocumentDelegationMemberQualifier qualifierA = membershipA.getQualifier(kimAttributeDefinitionId);
final RoleDocumentDelegationMemberQualifier qualifierB = membershipB.getQualifier(kimAttributeDefinitionId);
if (qualifierA != null && qualifierB != null) {
equalSoFar &= (qualifierA.getAttrVal() == null && qualifierB.getAttrVal() == null) || (qualifierA.getAttrVal() == null || qualifierA.getAttrVal().equals(qualifierB.getAttrVal()));
}
}
return equalSoFar;
}
示例7: addDelegationMember
import org.kuali.rice.kim.bo.ui.RoleDocumentDelegationMemberQualifier; //导入依赖的package包/类
public ActionForward addDelegationMember(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
IdentityManagementPersonDocumentForm personDocumentForm = (IdentityManagementPersonDocumentForm) form;
IdentityManagementPersonDocument personDocument = personDocumentForm.getPersonDocument();
RoleDocumentDelegationMember newDelegationMember = personDocumentForm.getNewDelegationMember();
KimTypeAttributesHelper attrHelper = newDelegationMember.getAttributesHelper();
if (getKualiRuleService().applyRules(new AddPersonDelegationMemberEvent("", personDocumentForm.getPersonDocument(), newDelegationMember))) {
//RoleImpl roleBo = (RoleImpl)getUiDocumentService().getMember(KimApiConstants.KimUIConstants.MEMBER_TYPE_ROLE_CODE, newDelegationMember.getRoleDao().getRoleId());
Role role;
role = KimApiServiceLocator.getRoleService().getRole(newDelegationMember.getRoleBo().getId());
if (role != null) {
if(!validateRole(newDelegationMember.getRoleBo().getId(),role, PersonDocumentRoleRule.ERROR_PATH, "Person")){
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
newDelegationMember.setRoleBo(RoleBo.from(role));
}
KimAttributeField attrDefinition;
RoleMemberBo roleMember = KIMServiceLocatorInternal.getUiDocumentService().getRoleMember(newDelegationMember.getRoleMemberId());
Map<String, String>
roleMemberAttributes = (new AttributeValidationHelper()).convertAttributesToMap(roleMember.getAttributeDetails());
for (KimAttributeField key: attrHelper.getDefinitions()) {
RoleDocumentDelegationMemberQualifier qualifier = new RoleDocumentDelegationMemberQualifier();
attrDefinition = key;
qualifier.setKimAttrDefnId(attrHelper.getKimAttributeDefnId(attrDefinition));
qualifier.setAttrVal(attrHelper.getAttributeValue(roleMemberAttributes, attrDefinition.getAttributeField().getName()));
newDelegationMember.setMemberId(personDocument.getPrincipalId());
newDelegationMember.setMemberTypeCode(MemberType.PRINCIPAL.getCode());
newDelegationMember.getQualifiers().add(qualifier);
}
//newDelegationMember.setAttributeEntry(getUiDocumentService().getAttributeEntries(newDelegationMember.getAttributesHelper().getDefinitions())));
personDocument.getDelegationMembers().add(newDelegationMember);
personDocumentForm.setNewDelegationMember(new RoleDocumentDelegationMember());
}
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
示例8: setAttrDefnIdForDelMemberQualifier
import org.kuali.rice.kim.bo.ui.RoleDocumentDelegationMemberQualifier; //导入依赖的package包/类
protected void setAttrDefnIdForDelMemberQualifier(RoleDocumentDelegationMemberQualifier qualifier, KimAttributeField definition) {
qualifier.setKimAttrDefnId(definition.getId());
}
示例9: setAttrDefnIdForDelMemberQualifier
import org.kuali.rice.kim.bo.ui.RoleDocumentDelegationMemberQualifier; //导入依赖的package包/类
protected void setAttrDefnIdForDelMemberQualifier(RoleDocumentDelegationMemberQualifier qualifier,KimAttributeField definition) {
qualifier.setKimAttrDefnId(definition.getId());
}