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


Java KimFrameworkServiceLocator类代码示例

本文整理汇总了Java中org.kuali.rice.kim.framework.services.KimFrameworkServiceLocator的典型用法代码示例。如果您正苦于以下问题:Java KimFrameworkServiceLocator类的具体用法?Java KimFrameworkServiceLocator怎么用?Java KimFrameworkServiceLocator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


KimFrameworkServiceLocator类属于org.kuali.rice.kim.framework.services包,在下文中一共展示了KimFrameworkServiceLocator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDefinitions

import org.kuali.rice.kim.framework.services.KimFrameworkServiceLocator; //导入依赖的package包/类
public List<KimAttributeField> getDefinitions() {
    if (definitions == null || definitions.isEmpty()) {
        KimTypeService kimTypeService = KimFrameworkServiceLocator.getKimTypeService(KimTypeBo.to(this.getKimRoleType()));
        //it is possible that the the roleTypeService is coming from a remote application                        
        // and therefore it can't be guarenteed that it is up and working, so using a try/catch to catch this possibility.                       
        try {
            if (kimTypeService != null) {
                definitions = kimTypeService.getAttributeDefinitions(getKimTypeId());
            } else {
                definitions = Collections.emptyList();
            }
        } catch (Exception ex) {
            LOG.warn("Not able to retrieve KimTypeService from remote system for KIM Role Type: " + this.getKimRoleType(), ex);
        }
    }
    return definitions;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:PersonDocumentRole.java

示例2: validateGroupQualifier

import org.kuali.rice.kim.framework.services.KimFrameworkServiceLocator; //导入依赖的package包/类
protected boolean validateGroupQualifier(List<GroupDocumentQualifier> groupQualifiers, KimType kimType){
List<RemotableAttributeError> validationErrors = new ArrayList<RemotableAttributeError>();

List<RemotableAttributeError> errorsTemp;
Map<String, String> mapToValidate;
      KimTypeService kimTypeService = KimFrameworkServiceLocator.getKimTypeService(kimType);
      GlobalVariables.getMessageMap().removeFromErrorPath(KRADConstants.DOCUMENT_PROPERTY_NAME);
mapToValidate = attributeValidationHelper.convertQualifiersToMap(groupQualifiers);
errorsTemp = kimTypeService.validateAttributes(kimType.getId(), mapToValidate);
validationErrors.addAll(attributeValidationHelper.convertErrors("",
              attributeValidationHelper.convertQualifiersToAttrIdxMap(groupQualifiers), errorsTemp));
GlobalVariables.getMessageMap().addToErrorPath(KRADConstants.DOCUMENT_PROPERTY_NAME);

  	if (validationErrors.isEmpty()) {
  		return true;
  	} 
  	attributeValidationHelper.moveValidationErrorsToErrorMap(validationErrors);
  	return false;
  }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:IdentityManagementGroupDocumentRule.java

示例3: getDefinitions

import org.kuali.rice.kim.framework.services.KimFrameworkServiceLocator; //导入依赖的package包/类
public List<KimAttributeField> getDefinitions() {
	if (definitions == null || definitions.isEmpty()) {
        KimTypeService kimTypeService = KimFrameworkServiceLocator.getKimTypeService(KimTypeBo.to(
                   this.getKimRoleType()));
        //it is possible that the the roleTypeService is coming from a remote application 
        // and therefore it can't be guarenteed that it is up and working, so using a try/catch to catch this possibility.
        try {
   	        if ( kimTypeService != null ) {
   	        	definitions = kimTypeService.getAttributeDefinitions(getKimTypeId());
   	        } else {
   	        	definitions = Collections.emptyList();
   	        }
   		} catch (Exception ex) {
               LOG.warn("Not able to retrieve KimTypeService from remote system for KIM Role Type: " + this.getKimRoleType(), ex);
           }
	}
	
	return definitions;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:20,代码来源:PersonDocumentRole.java

示例4: getKeyValues

import org.kuali.rice.kim.framework.services.KimFrameworkServiceLocator; //导入依赖的package包/类
/**
 * @see KeyValuesFinder#getKeyValues()
 */
@Override
public List<KeyValue> getKeyValues() {
       KimType kimType = KimApiServiceLocator.getKimTypeInfoService().getKimType(kimTypeId);
       if ( kimType != null ) {
        KimTypeService service = KimFrameworkServiceLocator.getKimTypeService(kimType);
        if ( service != null ) {
			return getAttributeValidValues(kimTypeId,kimAttributeName);
        }
        LOG.error( "Unable to get type service " + kimType.getServiceName() );
       } else {
       	LOG.error( "Unable to obtain KIM type for kimTypeId=" + kimTypeId );
       }
       return Collections.emptyList();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:KimAttributeValuesFinder.java

示例5: getAttributeDefinitionsForRole

import org.kuali.rice.kim.framework.services.KimFrameworkServiceLocator; //导入依赖的package包/类
protected List<KimAttributeField> getAttributeDefinitionsForRole(PersonDocumentRole role) {
   	KimTypeService kimTypeService = KimFrameworkServiceLocator.getKimTypeService(KimTypeBo.to(
               role.getKimRoleType()));
   	//it is possible that the the kimTypeService is coming from a remote application
       // and therefore it can't be guarenteed that it is up and working, so using a try/catch to catch this possibility.
       try {
       	if ( kimTypeService != null ) {
       		return kimTypeService.getAttributeDefinitions(role.getKimTypeId());
       	}
       } catch (Exception ex) {
           LOG.warn("Not able to retrieve KimTypeService from remote system for KIM Role Type: " + role.getKimRoleType(), ex);
       }
   	return Collections.emptyList();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:15,代码来源:UiDocumentServiceImpl.java

示例6: getReturnHref

import org.kuali.rice.kim.framework.services.KimFrameworkServiceLocator; //导入依赖的package包/类
@Override
    protected String getReturnHref(Properties parameters, LookupForm lookupForm, List returnKeys) {
    	KimType kimType = KimApiServiceLocator.getKimTypeInfoService().getKimType(parameters.getProperty(KimConstants.PrimaryKeyConstants.KIM_TYPE_ID));
    	String href = "";
    	//TODO: clean this up.
    	boolean showReturnHref = true;
    	boolean refreshMe = false;
    	String docTypeName = "";
    	String docTypeAction = "";
    	if(KimConstants.KimUIConstants.KIM_ROLE_DOCUMENT_SHORT_KEY.equals(lookupForm.getFormKey())){
    		docTypeName = KimConstants.KimUIConstants.KIM_ROLE_DOCUMENT_TYPE_NAME;
    		docTypeAction = KimConstants.KimUIConstants.KIM_ROLE_DOCUMENT_ACTION;
    		// show the create link when there is a type service AND
    		//    it has no service (default assignable role)
    		// OR it is not an application role
    		showReturnHref = kimType!=null && 
    			( StringUtils.isBlank( kimType.getServiceName() )
    					|| KimFrameworkServiceLocator.getKimTypeService(kimType) instanceof RoleTypeService
    					);
    	} else{
    		docTypeName = KimConstants.KimUIConstants.KIM_GROUP_DOCUMENT_TYPE_NAME;
    		docTypeAction = KimConstants.KimUIConstants.KIM_GROUP_DOCUMENT_ACTION;
//    		showReturnHref = kimType!=null;
    		refreshMe = true;
    	}
    	if(showReturnHref){
    		if (!refreshMe){
    			parameters.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.DOC_HANDLER_METHOD);
    			parameters.put(KRADConstants.PARAMETER_COMMAND, KewApiConstants.INITIATE_COMMAND);
    			parameters.put(KRADConstants.DOCUMENT_TYPE_NAME, docTypeName);
    	        if (StringUtils.isNotBlank(getReturnLocation())) {
    	        	parameters.put(KRADConstants.RETURN_LOCATION_PARAMETER, getReturnLocation());
    			}
    		}
	    	href = UrlFactory.parameterizeUrl(KimCommonUtilsInternal.getKimBasePath()+docTypeAction, parameters);
    	}
        return href;
    }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:39,代码来源:KimTypeLookupableHelperServiceImpl.java

示例7: getTypeService

import org.kuali.rice.kim.framework.services.KimFrameworkServiceLocator; //导入依赖的package包/类
protected KimTypeService getTypeService( String typeId ) {
   	KimTypeService typeService = typeServices.get(typeId);
   	if ( typeService == null ) {       		
       	KimType typeInfo = getKimTypeInfoService().getKimType(typeId);
       	if ( typeInfo != null ) {
       		typeService = KimFrameworkServiceLocator.getKimTypeService(typeInfo);
       		typeServices.put(typeId, typeService);
       	} else {
       		LOG.warn( "Unable to retrieve KIM Type Info object for id: " + typeId );
       	}
   	}
   	return typeService;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:14,代码来源:KimTypeQualifierResolver.java

示例8: processAddPersonDocumentRoleQualifier

import org.kuali.rice.kim.framework.services.KimFrameworkServiceLocator; //导入依赖的package包/类
@Override
   public boolean processAddPersonDocumentRoleQualifier(IdentityManagementPersonDocument document, PersonDocumentRole role, KimDocumentRoleMember kimDocumentRoleMember, int selectedRoleIdx) {
	boolean dateValidationSuccess = validateActiveDate("document.roles[" + selectedRoleIdx + "].newRolePrncpl.activeFromDate", kimDocumentRoleMember.getActiveFromDate(), kimDocumentRoleMember.getActiveToDate());
	String errorPath = "roles[" + selectedRoleIdx + "].newRolePrncpl";
	List<RemotableAttributeError> validationErrors = new ArrayList<RemotableAttributeError>();
       GlobalVariables.getMessageMap().removeFromErrorPath(KRADConstants.DOCUMENT_PROPERTY_NAME);
       KimTypeService kimTypeService = KimFrameworkServiceLocator.getKimTypeService(KimTypeBo.to(role.getKimRoleType()));

	List<RemotableAttributeError> errorsAttributesAgainstExisting;
    boolean rulePassed = true;
    Map<String, String> newMemberQualifiers = attributeValidationHelper.convertQualifiersToMap(kimDocumentRoleMember.getQualifiers());
    Map<String, String> oldMemberQualifiers;
    List<String> roleIds = new ArrayList<String>();
    roleIds.add(role.getRoleId());
    for(KimDocumentRoleMember member: role.getRolePrncpls()){
    	oldMemberQualifiers = member.getQualifierAsMap();
    	errorsAttributesAgainstExisting = kimTypeService.validateUniqueAttributes(
    			role.getKimRoleType().getId(), newMemberQualifiers, oldMemberQualifiers);
    	validationErrors.addAll(
				attributeValidationHelper.convertErrors(errorPath, attributeValidationHelper
                           .convertQualifiersToAttrIdxMap(kimDocumentRoleMember.getQualifiers()),
                           errorsAttributesAgainstExisting));
    }

       if ( kimTypeService != null ) {
       	List<RemotableAttributeError> localErrors = kimTypeService.validateAttributes( role.getKimRoleType().getId(), newMemberQualifiers );
   	    validationErrors.addAll( attributeValidationHelper.convertErrors(errorPath,
                   attributeValidationHelper.convertQualifiersToAttrIdxMap(kimDocumentRoleMember.getQualifiers()),
                   localErrors));
       }

       GlobalVariables.getMessageMap().addToErrorPath(KRADConstants.DOCUMENT_PROPERTY_NAME);
   	if (validationErrors.isEmpty()) {
   		rulePassed = dateValidationSuccess;
   	} else {
   		attributeValidationHelper.moveValidationErrorsToErrorMap(validationErrors);
   		rulePassed = false;
   	}
   	return rulePassed;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:41,代码来源:IdentityManagementPersonDocumentRule.java

示例9: validateDelegationMemberRoleQualifier

import org.kuali.rice.kim.framework.services.KimFrameworkServiceLocator; //导入依赖的package包/类
protected boolean validateDelegationMemberRoleQualifier(List<RoleDocumentDelegationMember> delegationMembers){
List<RemotableAttributeError> validationErrors = new ArrayList<RemotableAttributeError>();
boolean valid = false;
int memberCounter = 0;
      GlobalVariables.getMessageMap().removeFromErrorPath(KRADConstants.DOCUMENT_PROPERTY_NAME);
for(RoleDocumentDelegationMember delegationMember: delegationMembers) {
    KimType kimType = KimTypeBo.to(delegationMember.getRoleBo().getKimRoleType());
    KimTypeService kimTypeService = KimFrameworkServiceLocator.getKimTypeService(kimType);
	String errorPath = "delegationMembers["+memberCounter+"]";
       Map<String, String> mapToValidate = attributeValidationHelper.convertQualifiersToMap(delegationMember.getQualifiers());
       List<RemotableAttributeError> errorsTemp = kimTypeService.validateAttributes(kimType.getId(), mapToValidate);
	validationErrors.addAll(
			attributeValidationHelper.convertErrors(errorPath,
                          attributeValidationHelper.convertQualifiersToAttrIdxMap(delegationMember.getQualifiers()),
                          errorsTemp));

	List<RoleMember> roleMembers = getRoleService().findRoleMembers(QueryByCriteria.Builder.fromPredicates(equal(KimConstants.PrimaryKeyConstants.ID, delegationMember.getRoleMemberId()))).getResults();
	if(roleMembers.isEmpty()){
		valid = false;
		GlobalVariables.getMessageMap().putError("document."+errorPath, RiceKeyConstants.ERROR_DELEGATE_ROLE_MEMBER_ASSOCIATION, new String[]{});
	} else{
		kimTypeService.validateUnmodifiableAttributes(kimType.getId(), roleMembers.get(0).getAttributes(), mapToValidate);
		validationErrors.addAll(
				attributeValidationHelper.convertErrors(errorPath, attributeValidationHelper
                              .convertQualifiersToAttrIdxMap(delegationMember.getQualifiers()), errorsTemp));
	}
       memberCounter++;
  	}
GlobalVariables.getMessageMap().addToErrorPath(KRADConstants.DOCUMENT_PROPERTY_NAME);
  	if (validationErrors.isEmpty()) {
  		valid = true;
  	} else {
  		attributeValidationHelper.moveValidationErrorsToErrorMap(validationErrors);
  		valid = false;
  	}
  	return valid;
  }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:38,代码来源:IdentityManagementPersonDocumentRule.java

示例10: testGetKimTypeService_KimType

import org.kuali.rice.kim.framework.services.KimFrameworkServiceLocator; //导入依赖的package包/类
@Test
public void testGetKimTypeService_KimType() {
	
	// test by passing null
	try {
	    KimTypeService typeService1 = KimFrameworkServiceLocator.getKimTypeService((KimType) null);
           assertTrue("should have thrown exception and never got here", false);
       } catch (IllegalArgumentException e) {
       }
	
	// test by passing a KimType with a null service name
	
	KimType.Builder nullKimType = KimType.Builder.create();
	nullKimType.setServiceName(null);
	KimTypeService typeService2 = KimFrameworkServiceLocator.getKimTypeService(nullKimType.build());
	assertNotNull("type service shoudl have been found", typeService2);
	assertEquals("should be the default kim type", DataDictionaryTypeServiceBase.class, typeService2.getClass());
	
	// test by passing a KimType with an empty service name
	
	KimType.Builder emptyKimType = KimType.Builder.create();
	nullKimType.setServiceName("");
	KimTypeService typeService3 = KimFrameworkServiceLocator.getKimTypeService(emptyKimType.build());
	assertNotNull("type service should have been found", typeService3);
	assertEquals("should be the default kim type", DataDictionaryTypeServiceBase.class, typeService3.getClass());
	
	// test by passing a KimType that refers to the Permission TypeService
	
	KimType permissionKimType = KimApiServiceLocator.getKimTypeInfoService().findKimTypeByNameAndNamespace(
               KimConstants.NAMESPACE_CODE, "Permission");
	assertNotNull("The KR-IDM:Permission KimType should exist.", permissionKimType);
	
	KimTypeService typeService4 = KimFrameworkServiceLocator.getKimTypeService(permissionKimType);
	assertNotNull("type service should have been found", typeService4);
	
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:37,代码来源:KIMServiceLocatorInternalTest.java

示例11: getReturnHref

import org.kuali.rice.kim.framework.services.KimFrameworkServiceLocator; //导入依赖的package包/类
@Override
    protected String getReturnHref(Properties parameters, LookupForm lookupForm, List returnKeys) {
    	KimType kimType = KimApiServiceLocator.getKimTypeInfoService().getKimType(parameters.getProperty(KimConstants.PrimaryKeyConstants.KIM_TYPE_ID));
    	String href = "";
    	//TODO: clean this up.
    	boolean showReturnHref = true;
    	boolean refreshMe = false;
    	String docTypeName = "";
    	String docTypeAction = "";
    	if(KimConstants.KimUIConstants.KIM_ROLE_DOCUMENT_SHORT_KEY.equals(lookupForm.getFormKey())){
    		docTypeName = KimConstants.KimUIConstants.KIM_ROLE_DOCUMENT_TYPE_NAME;
    		docTypeAction = KimConstants.KimUIConstants.KIM_ROLE_DOCUMENT_ACTION;
    		// show the create link when there is a type service AND
    		//    it has no service (default assignable role)
    		// OR it is not an application role
    		showReturnHref = kimType!=null && 
    			( StringUtils.isBlank( kimType.getServiceName() )
    					|| (KimFrameworkServiceLocator.getKimTypeService(kimType) instanceof RoleTypeService
    						&&!((RoleTypeService) KimFrameworkServiceLocator.getKimTypeService(kimType)).isDerivedRoleType() )
    					);
    	} else{
    		docTypeName = KimConstants.KimUIConstants.KIM_GROUP_DOCUMENT_TYPE_NAME;
    		docTypeAction = KimConstants.KimUIConstants.KIM_GROUP_DOCUMENT_ACTION;
//    		showReturnHref = kimType!=null;
    		refreshMe = true;
    	}
    	if(showReturnHref){
    		if (!refreshMe){
    			parameters.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.DOC_HANDLER_METHOD);
    			parameters.put(KRADConstants.PARAMETER_COMMAND, KewApiConstants.INITIATE_COMMAND);
    			parameters.put(KRADConstants.DOCUMENT_TYPE_NAME, docTypeName);
    	        if (StringUtils.isNotBlank(getReturnLocation())) {
    	        	parameters.put(KRADConstants.RETURN_LOCATION_PARAMETER, getReturnLocation());
    			}
    		}
	    	href = UrlFactory.parameterizeUrl(KimCommonUtilsInternal.getKimBasePath()+docTypeAction, parameters);
    	}
        return href;
    }
 
开发者ID:kuali,项目名称:rice,代码行数:40,代码来源:KimTypeLookupableHelperServiceImpl.java

示例12: getReturnHref

import org.kuali.rice.kim.framework.services.KimFrameworkServiceLocator; //导入依赖的package包/类
@SuppressWarnings("unchecked")
	@Override
    protected String getReturnHref(Properties parameters, LookupForm lookupForm, List returnKeys) {
    	KimType kimType = KimApiServiceLocator.getKimTypeInfoService().getKimType(parameters.getProperty(KimConstants.PrimaryKeyConstants.KIM_TYPE_ID));
    	String href = "";
    	//TODO: clean this up.
    	boolean showReturnHref = true;
    	boolean refreshMe = false;
    	String docTypeName = "";
    	String docTypeAction = "";
    	if(KimConstants.KimUIConstants.KIM_ROLE_DOCUMENT_SHORT_KEY.equals(lookupForm.getFormKey())){
    		docTypeName = KimConstants.KimUIConstants.KIM_ROLE_DOCUMENT_TYPE_NAME;
    		docTypeAction = KimConstants.KimUIConstants.KIM_ROLE_DOCUMENT_ACTION;
    		// show the create link when there is a type service AND
    		//    it has no service (default assignable role)
    		// OR it is not an application role
    		showReturnHref = kimType!=null && 
    			( StringUtils.isBlank( kimType.getServiceName() )
    					|| (KimFrameworkServiceLocator.getKimTypeService(kimType) instanceof RoleTypeService
    						&&!((RoleTypeService) KimFrameworkServiceLocator.getKimTypeService(kimType)).isDerivedRoleType() )
    					);
    	} else{
    		docTypeName = KimConstants.KimUIConstants.KIM_GROUP_DOCUMENT_TYPE_NAME;
    		docTypeAction = KimConstants.KimUIConstants.KIM_GROUP_DOCUMENT_ACTION;
//    		showReturnHref = kimType!=null;
    		refreshMe = true;
    	}
    	if(showReturnHref){
    		if (!refreshMe){
    			parameters.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.DOC_HANDLER_METHOD);
    			parameters.put(KRADConstants.PARAMETER_COMMAND, KewApiConstants.INITIATE_COMMAND);
    			parameters.put(KRADConstants.DOCUMENT_TYPE_NAME, docTypeName);
    	        if (StringUtils.isNotBlank(getReturnLocation())) {
    	        	parameters.put(KRADConstants.RETURN_LOCATION_PARAMETER, getReturnLocation());
    			}
    		}
	    	href = UrlFactory.parameterizeUrl(KimCommonUtilsInternal.getKimBasePath()+docTypeAction, parameters);
    	}
        return href;
    }
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:41,代码来源:KimTypeLookupableHelperServiceImpl.java

示例13: processAddMember

import org.kuali.rice.kim.framework.services.KimFrameworkServiceLocator; //导入依赖的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

示例14: setupAttributeRows

import org.kuali.rice.kim.framework.services.KimFrameworkServiceLocator; //导入依赖的package包/类
private List<Row> setupAttributeRows(Map fieldValues) {
	List<Row> returnRows = new ArrayList<Row>();
	for (Row row : getGrpRows()) {
		Field field = row.getFields().get(0);
		if (field.getPropertyName().equals(KIM_TYPE_ID_PROPERTY_NAME) && StringUtils.isNotBlank(field.getPropertyValue())) {
			if (!StringUtils.isBlank(getTypeId()) || !getTypeId().equals(field.getPropertyValue())) {
				setTypeId(field.getPropertyValue());
				setAttrRows(new ArrayList<Row>());
				KimType kimType = getTypeInfoService().getKimType( field.getPropertyValue() );
				KimTypeService kimTypeService = KimFrameworkServiceLocator.getKimTypeService(kimType);
		        List<KimAttributeField> definitions = kimTypeService.getAttributeDefinitions(kimType.getId());
		        setAttrDefinitions(definitions);
	            for (KimAttributeField d  : definitions) {
			        final AttributeDefinition definition  = DataDictionaryTypeServiceHelper
                               .toKimAttributeDefinition(d);
                       List<Field> fields = new ArrayList<Field>();
					Field typeField = new Field();

					String attrDefnId = d.getId();
					typeField.setFieldLabel(definition.getLabel());
					typeField.setPropertyName("attributes(" + definition.getName()+")");
					typeField.setPropertyValue(fieldValues.get(typeField.getPropertyName()));
					if (definition.getControl().isSelect()) {
                           typeField.setFieldValidValues(definition.getOptionsFinder().getKeyValues());
                           typeField.setFieldType(Field.DROPDOWN);
					} else if (definition.getControl().isText()){
						typeField.setMaxLength(definition.getMaxLength());
						if (definition.getControl().getSize() != null) {
						    typeField.setSize(definition.getControl().getSize());
						}
					    typeField.setFieldType(Field.TEXT);
					} else if (definition.getControl().isRadio()) {
                           typeField.setFieldValidValues(definition.getOptionsFinder().getKeyValues());
                           typeField.setFieldType(Field.RADIO);
					} else if (definition.getControl().isCheckbox()) {
					    KeyValuesFinder finder = new IndicatorValuesFinder();
                           typeField.setFieldValidValues(finder.getKeyValues());
                           typeField.setFieldType(Field.RADIO);
					    //typeField.setFieldType(Field.CHECKBOX);
					} else if (definition.getControl().isHidden()) {
					    typeField.setFieldType(Field.HIDDEN);
					} else if (definition.getControl().isLookupReadonly()) {
					    typeField.setFieldType(Field.LOOKUP_READONLY);
					} else if (definition.getControl().isTextarea()) {
					    typeField.setMaxLength(definition.getMaxLength());
                           if (definition.getControl().getSize() != null) {
                               typeField.setSize(definition.getControl().getSize());
                           }
                           typeField.setFieldType(Field.TEXT_AREA);
					}
					fields.add(typeField);
					returnRows.add(new Row(fields));
	            }
			} else {
				return getAttrRows();
			}
		} else if (field.getPropertyName().equals(KIM_TYPE_ID_PROPERTY_NAME) && StringUtils.isBlank(field.getPropertyValue())) {
			setTypeId("");
		}
	}
	return returnRows;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:63,代码来源:GroupLookupableHelperServiceImpl.java

示例15: getKimTypeService

import org.kuali.rice.kim.framework.services.KimFrameworkServiceLocator; //导入依赖的package包/类
protected KimTypeService getKimTypeService(KimType kimType){
	if( kimTypeService==null){
    	kimTypeService = KimFrameworkServiceLocator.getKimTypeService(kimType);
	}
	return kimTypeService;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:7,代码来源:IdentityManagementTypeAttributeTransactionalDocument.java


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