当前位置: 首页>>代码示例>>Java>>正文


Java IdentityManagementRoleDocument.getMembers方法代码示例

本文整理汇总了Java中org.kuali.rice.kim.document.IdentityManagementRoleDocument.getMembers方法的典型用法代码示例。如果您正苦于以下问题:Java IdentityManagementRoleDocument.getMembers方法的具体用法?Java IdentityManagementRoleDocument.getMembers怎么用?Java IdentityManagementRoleDocument.getMembers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.kim.document.IdentityManagementRoleDocument的用法示例。


在下文中一共展示了IdentityManagementRoleDocument.getMembers方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadRoleMembersBasedOnSearch

import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入方法依赖的package包/类
@Override
public void loadRoleMembersBasedOnSearch(IdentityManagementRoleDocument identityManagementRoleDocument,
                                                String memberSearchValue){

    List<KimDocumentRoleMember> roleMembersRestricted = new ArrayList<KimDocumentRoleMember>();
    List<KimDocumentRoleMember> members = identityManagementRoleDocument.getMembers();
    for (KimDocumentRoleMember roleMember : members){
        String memberName = roleMember.getMemberName().toLowerCase();
        if (memberName.startsWith(memberSearchValue.toLowerCase())) {
            roleMembersRestricted.add(roleMember);
        }
    }

    identityManagementRoleDocument.setSearchResultMembers(roleMembersRestricted);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:16,代码来源:UiDocumentServiceImpl.java

示例2: clearRestrictedRoleMembersSearchResults

import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入方法依赖的package包/类
@Override
public void clearRestrictedRoleMembersSearchResults(IdentityManagementRoleDocument identityManagementRoleDocument) {
    List<KimDocumentRoleMember> roleMembersRestricted =  new ArrayList<KimDocumentRoleMember>();
    List<KimDocumentRoleMember> members = identityManagementRoleDocument.getMembers();
    identityManagementRoleDocument.setSearchResultMembers(roleMembersRestricted);
    identityManagementRoleDocument.setMembers(members);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:8,代码来源:UiDocumentServiceImpl.java

示例3: loadMemberRoleRspActions

import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入方法依赖的package包/类
protected void loadMemberRoleRspActions(IdentityManagementRoleDocument identityManagementRoleDocument){
	if(CollectionUtils.isNotEmpty(identityManagementRoleDocument.getMembers())){
		for(KimDocumentRoleMember member: identityManagementRoleDocument.getMembers()){
			member.getRoleRspActions().addAll(loadKimDocumentRoleRespActions(
					getRoleMemberResponsibilityActionImpls(member.getRoleMemberId()) ) );
		}
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:9,代码来源:UiDocumentServiceImpl.java

示例4: getSearchResultsHelper

import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
protected List<? extends BusinessObject> getSearchResultsHelper(Map<String, String> fieldValues, boolean unbounded) {
    List<KimDocumentRoleMember> searchResults = new ArrayList<KimDocumentRoleMember>();
    IdentityManagementRoleDocument roleDocument = (IdentityManagementRoleDocument) GlobalVariables.getUserSession().retrieveObject(KimConstants.KimUIConstants.KIM_ROLE_DOCUMENT_SHORT_KEY);
    if (roleDocument != null) {
        String memberId = fieldValues.get(KimConstants.PrimaryKeyConstants.MEMBER_ID);
        String memberTypeCode = fieldValues.get(KIMPropertyConstants.KimMember.MEMBER_TYPE_CODE);
        String memberName = fieldValues.get(KimConstants.KimUIConstants.MEMBER_NAME);
        String memberNamespaceCode = fieldValues.get(KimConstants.KimUIConstants.MEMBER_NAMESPACE_CODE);
        String activeFromDate = fieldValues.get(KIMPropertyConstants.KimMember.ACTIVE_FROM_DATE);
        String activeToDate = fieldValues.get(KIMPropertyConstants.KimMember.ACTIVE_TO_DATE);
        List<KimDocumentRoleMember> currentRoleMembers = roleDocument.getMembers();
        if (currentRoleMembers != null && !currentRoleMembers.isEmpty()) {
            for (KimDocumentRoleMember currentRoleMember : currentRoleMembers) {
                if ((StringUtils.isEmpty(memberId) || (StringUtils.isNotEmpty(memberId) && memberId.equals(currentRoleMember.getMemberId())))
                        && (StringUtils.isEmpty(memberTypeCode) || (StringUtils.isNotEmpty(memberTypeCode) && memberTypeCode.equals(currentRoleMember.getMemberTypeCode())))
                        && (StringUtils.isEmpty(memberName) || (StringUtils.isNotEmpty(memberName) && memberName.equals(currentRoleMember.getMemberName())))
                        && (StringUtils.isEmpty(memberNamespaceCode) || (StringUtils.isNotEmpty(memberNamespaceCode) && memberNamespaceCode.equals(currentRoleMember.getMemberNamespaceCode())))
                        && (StringUtils.isEmpty(activeFromDate) || (StringUtils.isNotEmpty(activeFromDate) && activeFromDate.equals(currentRoleMember.getActiveFromDate())))
                        && (StringUtils.isEmpty(activeToDate) || (StringUtils.isNotEmpty(activeToDate) && activeToDate.equals(currentRoleMember.getActiveToDate())))) {
                    searchResults.add(currentRoleMember);
                }
            }
        }
    } else {
        searchResults = getUiDocumentService().getRoleMembers(fieldValues);
    }
    if (searchResults != null) {
        for (KimDocumentRoleMember roleMember : searchResults) {
            roleMember.setQualifiersToDisplay(getQualifiersToDisplay(roleMember));
        }
    }
    return searchResults;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:35,代码来源:KimDocumentRoleMemberLookupableHelperServiceImpl.java

示例5: handleRoleDocument

import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入方法依赖的package包/类
protected String handleRoleDocument( List<Map<String, String>> qualifiers, IdentityManagementRoleDocument roleDoc, String routeLevel ) {
        String customDocTypeName = null;

//        LOG.warn( "Role member data routing not implemented for the Role document yet!" );
    	// get the appropriate type service for the group being edited
    	String typeId = roleDoc.getRoleTypeId();
    	KimTypeService typeService = getTypeService(typeId);
    	if ( typeService != null ) {
    		// QUESTION: can roles be modified in a way which requires routing?
    		// get the existing role members
    		List<RoleMembership> currentRoleMembers = KimApiServiceLocator.getRoleService().getRoleMembers( Collections.singletonList( roleDoc.getRoleId() ),  Collections.<String, String>emptyMap() );
    		// loop over the role members on the document, check  if added or removed
    		for ( KimDocumentRoleMember rm : roleDoc.getMembers() ) {
    			boolean foundMember = false;
    			for ( RoleMembership rmi : currentRoleMembers ) {
    				if ( rmi.getId().equals( rm.getRoleMemberId() ) ) {
    					foundMember = true;
    					if ( !rm.isActive() ) { // don't need to check the role member information 
    											// - only active members are returned
    						// inactivated member, add a qualifier
    						qualifiers.add( getRoleQualifier(rm.getRoleId(), typeId, typeService, rm.getQualifierAsMap(), routeLevel) );
    					}
    					break;
    				}
    			}
    			if ( !foundMember ) {
    				qualifiers.add( getRoleQualifier(rm.getRoleId(), typeId, typeService, rm.getQualifierAsMap(), routeLevel) );
    			}
    		}
    		
    		customDocTypeName = typeService.getWorkflowDocumentTypeName();
    	}		
    	return customDocTypeName;
	}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:35,代码来源:KimTypeQualifierResolver.java

示例6: canUserAssignRoleMembers

import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入方法依赖的package包/类
protected boolean canUserAssignRoleMembers(IdentityManagementRoleDocument document){
       boolean rulePassed = true;
       Map<String,String> additionalPermissionDetails = new HashMap<String,String>();
       additionalPermissionDetails.put(KimConstants.AttributeConstants.NAMESPACE_CODE, document.getRoleNamespace());
       additionalPermissionDetails.put(KimConstants.AttributeConstants.ROLE_NAME, document.getRoleName());
	if((document.getMembers()!=null && document.getMembers().size()>0) ||
			(document.getDelegationMembers()!=null && document.getDelegationMembers().size()>0)){
		if(!getDocumentDictionaryService().getDocumentAuthorizer(document).isAuthorizedByTemplate(
				document, KimConstants.NAMESPACE_CODE, KimConstants.PermissionTemplateNames.ASSIGN_ROLE,
				GlobalVariables.getUserSession().getPrincipalId(), additionalPermissionDetails, null)){
            rulePassed = false;
		}
	}
	return rulePassed;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:16,代码来源:IdentityManagementRoleDocumentRule.java

示例7: loadRoleMembersBasedOnSearch

import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void loadRoleMembersBasedOnSearch(IdentityManagementRoleDocument identityManagementRoleDocument,
                                                String memberSearchValue){

    List<KimDocumentRoleMember> roleMembersRestricted = new ArrayList<KimDocumentRoleMember>();
    List<KimDocumentRoleMember> members = identityManagementRoleDocument.getMembers();
    for (KimDocumentRoleMember roleMember : members){
        String memberName = roleMember.getMemberName().toLowerCase();
        if (memberName.startsWith(memberSearchValue.toLowerCase())) {
            roleMembersRestricted.add(roleMember);
        }
    }

    identityManagementRoleDocument.setSearchResultMembers(roleMembersRestricted);
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:16,代码来源:UiDocumentServiceImpl.java

示例8: clearRestrictedRoleMembersSearchResults

import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void clearRestrictedRoleMembersSearchResults(IdentityManagementRoleDocument identityManagementRoleDocument) {
    List<KimDocumentRoleMember> roleMembersRestricted =  new ArrayList<KimDocumentRoleMember>();
    List<KimDocumentRoleMember> members = identityManagementRoleDocument.getMembers();
    identityManagementRoleDocument.setSearchResultMembers(roleMembersRestricted);
    identityManagementRoleDocument.setMembers(members);
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:8,代码来源:UiDocumentServiceImpl.java

示例9: validAssignRole

import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入方法依赖的package包/类
protected boolean validAssignRole(IdentityManagementRoleDocument document){
       boolean rulePassed = true;
       Map<String,String> additionalPermissionDetails = new HashMap<String,String>();
       additionalPermissionDetails.put(KimConstants.AttributeConstants.NAMESPACE_CODE, document.getRoleNamespace());
       additionalPermissionDetails.put(KimConstants.AttributeConstants.ROLE_NAME, document.getRoleName());
	if((document.getMembers()!=null && document.getMembers().size()>0) ||
			(document.getDelegationMembers()!=null && document.getDelegationMembers().size()>0)){
		if(!getDocumentDictionaryService().getDocumentAuthorizer(document).isAuthorizedByTemplate(
				document, KimConstants.NAMESPACE_CODE, KimConstants.PermissionTemplateNames.ASSIGN_ROLE,
				GlobalVariables.getUserSession().getPrincipalId(), additionalPermissionDetails, null)){
            rulePassed = false;
		}
	}
	return rulePassed;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:16,代码来源:IdentityManagementRoleDocumentRule.java

示例10: processAddMember

import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入方法依赖的package包/类
public boolean processAddMember(AddMemberEvent addMemberEvent){
	KimDocumentRoleMember newMember = addMemberEvent.getMember();
	IdentityManagementRoleDocument document = (IdentityManagementRoleDocument)addMemberEvent.getDocument();
    boolean rulePassed = true;

       if (newMember == null || StringUtils.isBlank(newMember.getMemberId())){
           GlobalVariables.getMessageMap().putError(ERROR_PATH, RiceKeyConstants.ERROR_EMPTY_ENTRY, new String[] {"Member"});
           return false;
       }
   	if(!validAssignRole(newMember, document)) {
   		return false;
       }
	List<RemotableAttributeError> validationErrors = new ArrayList<RemotableAttributeError>();
       KimTypeService kimTypeService = KimFrameworkServiceLocator.getKimTypeService(document.getKimType());
       
       Long newMemberFromTime = newMember.getActiveFromDate() == null ? 0L : newMember.getActiveFromDate().getTime();
       Long newMemberToTime = newMember.getActiveToDate() == null ? Long.MAX_VALUE : newMember.getActiveToDate().getTime();
       
	List<RemotableAttributeError> errorsAttributesAgainstExisting  = new ArrayList<RemotableAttributeError>();
       Map<String, String> newMemberQualifiers = attributeValidationHelper.convertQualifiersToMap(newMember.getQualifiers());

    Map<String, String> oldMemberQualifiers;
    for (KimDocumentRoleMember member: document.getMembers()){
    	Long memberFromTime = member.getActiveFromDate() == null ? 0L : member.getActiveFromDate().getTime();
           Long memberToTime = member.getActiveToDate() == null ? Long.MAX_VALUE : member.getActiveToDate().getTime();
    	oldMemberQualifiers = attributeValidationHelper.convertQualifiersToMap(member.getQualifiers());

           if ((member.getMemberId().equals(newMember.getMemberId()) &&
                   member.getMemberTypeCode().equals(newMember.getMemberTypeCode()))
                   && ((newMemberFromTime >= memberFromTime && newMemberFromTime < memberToTime)
                   || (newMemberToTime >= memberFromTime && newMemberToTime <= memberToTime)))  {

               errorsAttributesAgainstExisting = kimTypeService.validateAttributesAgainstExisting(
    			document.getKimType().getId(), newMemberQualifiers, oldMemberQualifiers);
		    validationErrors.addAll(
				attributeValidationHelper.convertErrorsForMappedFields(ERROR_PATH, errorsAttributesAgainstExisting));
    	    if (!errorsAttributesAgainstExisting.isEmpty()) {
                rulePassed = false;
                GlobalVariables.getMessageMap().putError(ERROR_PATH, RiceKeyConstants.ERROR_DUPLICATE_ENTRY, new String[] {"Member"});
                break;
    	    }
           }
    }

       boolean shouldNotValidate = newMember.isRole();
    if ( kimTypeService != null && KRADUtils.isNotNull(document.getKimType()) && StringUtils.isNotBlank(document.getKimType().getServiceName()) ) {
           VersionedService<RoleTypeService> versionedRoleTypeService = getVersionedRoleTypeService(document.getKimType());
           if (versionedRoleTypeService != null) {
               boolean versionOk = VersionHelper.compareVersion(versionedRoleTypeService.getVersion(), CoreConstants.Versions.VERSION_2_1_2)!=-1? true:false;
               if(versionOk) {
                   shouldNotValidate = versionedRoleTypeService.getService().shouldValidateQualifiersForMemberType( MemberType.fromCode(newMember.getMemberTypeCode()));
               } else {
                   shouldNotValidate = false;
               }
           }
       }
       if (kimTypeService !=null && !shouldNotValidate) {
   		List<RemotableAttributeError> localErrors = kimTypeService.validateAttributes( document.getKimType().getId(), attributeValidationHelper.convertQualifiersToMap( newMember.getQualifiers() ) );
        validationErrors.addAll( attributeValidationHelper.convertErrors("member",
                   attributeValidationHelper.convertQualifiersToAttrIdxMap(newMember.getQualifiers()), localErrors) );
       }
   	if (!validationErrors.isEmpty()) {
   		attributeValidationHelper.moveValidationErrorsToErrorMap(validationErrors);
   		rulePassed = false;
   	}

	return rulePassed;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:69,代码来源:KimDocumentMemberRule.java

示例11: processAddMember

import org.kuali.rice.kim.document.IdentityManagementRoleDocument; //导入方法依赖的package包/类
public boolean processAddMember(AddMemberEvent addMemberEvent){
	KimDocumentRoleMember newMember = addMemberEvent.getMember();
	IdentityManagementRoleDocument document = (IdentityManagementRoleDocument)addMemberEvent.getDocument();
    boolean rulePassed = true;

       if (newMember == null || StringUtils.isBlank(newMember.getMemberId())){
           GlobalVariables.getMessageMap().putError(ERROR_PATH, RiceKeyConstants.ERROR_EMPTY_ENTRY, new String[] {"Member"});
           return false;
       }
   	if(!validAssignRole(newMember, document)) {
   		return false;
       }
	List<RemotableAttributeError> validationErrors = new ArrayList<RemotableAttributeError>();
       KimTypeService kimTypeService = KimFrameworkServiceLocator.getKimTypeService(document.getKimType());
       
       Long newMemberFromTime = newMember.getActiveFromDate() == null ? 0L : newMember.getActiveFromDate().getTime();
       Long newMemberToTime = newMember.getActiveToDate() == null ? Long.MAX_VALUE : newMember.getActiveToDate().getTime();
       
	List<RemotableAttributeError> errorsAttributesAgainstExisting  = new ArrayList<RemotableAttributeError>();
       Map<String, String> newMemberQualifiers = attributeValidationHelper.convertQualifiersToMap(newMember.getQualifiers());

    Map<String, String> oldMemberQualifiers;
    for (KimDocumentRoleMember member: document.getMembers()){
    	Long memberFromTime = member.getActiveFromDate() == null ? 0L : member.getActiveFromDate().getTime();
           Long memberToTime = member.getActiveToDate() == null ? Long.MAX_VALUE : member.getActiveToDate().getTime();
    	oldMemberQualifiers = attributeValidationHelper.convertQualifiersToMap(member.getQualifiers());

           if ((member.getMemberId().equals(newMember.getMemberId()) &&
                   member.getMemberTypeCode().equals(newMember.getMemberTypeCode()))
                   && ((newMemberFromTime >= memberFromTime && newMemberFromTime < memberToTime)
                   || (newMemberToTime >= memberFromTime && newMemberToTime <= memberToTime)))  {

               errorsAttributesAgainstExisting = kimTypeService.validateAttributesAgainstExisting(
    			document.getKimType().getId(), newMemberQualifiers, oldMemberQualifiers);
		    validationErrors.addAll(
				attributeValidationHelper.convertErrorsForMappedFields(ERROR_PATH, errorsAttributesAgainstExisting));
    	    if (!errorsAttributesAgainstExisting.isEmpty()) {
                rulePassed = false;
                GlobalVariables.getMessageMap().putError(ERROR_PATH, RiceKeyConstants.ERROR_DUPLICATE_ENTRY, new String[] {"Member"});
                break;
    	    }
           }
    }

       boolean shouldNotValidate = newMember.isRole();
    if ( kimTypeService != null && ObjectUtils.isNotNull( document.getKimType() ) && StringUtils.isNotBlank(document.getKimType().getServiceName()) ) {
           VersionedService<RoleTypeService> versionedRoleTypeService = getVersionedRoleTypeService(document.getKimType());
           if (versionedRoleTypeService != null) {
               boolean versionOk = VersionHelper.compareVersion(versionedRoleTypeService.getVersion(), CoreConstants.Versions.VERSION_2_1_2)!=-1? true:false;
               if(versionOk) {
                   shouldNotValidate = versionedRoleTypeService.getService().shouldValidateQualifiersForMemberType( MemberType.fromCode(newMember.getMemberTypeCode()));
               } else {
                   shouldNotValidate = false;
               }
           }
       }
       if (kimTypeService !=null && !shouldNotValidate) {
   		List<RemotableAttributeError> localErrors = kimTypeService.validateAttributes( document.getKimType().getId(), attributeValidationHelper.convertQualifiersToMap( newMember.getQualifiers() ) );
        validationErrors.addAll( attributeValidationHelper.convertErrors("member",
                   attributeValidationHelper.convertQualifiersToAttrIdxMap(newMember.getQualifiers()), localErrors) );
       }
   	if (!validationErrors.isEmpty()) {
   		attributeValidationHelper.moveValidationErrorsToErrorMap(validationErrors);
   		rulePassed = false;
   	}

	return rulePassed;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:69,代码来源:KimDocumentMemberRule.java


注:本文中的org.kuali.rice.kim.document.IdentityManagementRoleDocument.getMembers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。