• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java InactivationBlockingMetadata类的典型用法和代码示例

java 2次浏览

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

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

示例1: processInactivationBlockChecking

点赞 3

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
/**
 * Determines whether this document has been inactivation blocked
 *
 * @param maintenanceDocument
 * @return true iff there is NOTHING that blocks this record
 */
protected boolean processInactivationBlockChecking(MaintenanceDocument maintenanceDocument) {
    if (isDocumentInactivatingBusinessObject(maintenanceDocument)) {
        Class<?> dataObjectClass = maintenanceDocument.getNewMaintainableObject().getDataObjectClass();
        Set<InactivationBlockingMetadata> inactivationBlockingMetadatas =
                getDataDictionaryService().getAllInactivationBlockingDefinitions(dataObjectClass);

        if (inactivationBlockingMetadatas != null) {
            for (InactivationBlockingMetadata inactivationBlockingMetadata : inactivationBlockingMetadatas) {
                // for the purposes of maint doc validation, we only need to look for the first blocking record

                // we found a blocking record, so we return false
                if (!processInactivationBlockChecking(maintenanceDocument, inactivationBlockingMetadata)) {
                    return false;
                }
            }
        }
    }
    return true;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:26,
代码来源:MaintenanceDocumentRuleBase.java

示例2: hasABlockingRecord

点赞 3

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
/**
 * Note we are checking the active getting after retrieving potential blocking records instead of setting criteria on the
 * active field. This is because some implementations of {@link org.kuali.rice.core.api.mo.common.active.MutableInactivatable} might not have the active field, for example
 * instances of {@link org.kuali.rice.krad.bo.InactivatableFromTo}
 * 
 * @see org.kuali.rice.krad.service.InactivationBlockingDetectionService#hasABlockingRecord(org.kuali.rice.krad.bo.BusinessObject,
 *      org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata)
 * @see org.kuali.rice.core.api.mo.common.active.MutableInactivatable
 */
   @Deprecated
   @Override
public boolean hasABlockingRecord(BusinessObject blockedBo, InactivationBlockingMetadata inactivationBlockingMetadata) {
	boolean hasBlockingRecord = false;

	Map<String, String> queryMap = buildInactivationBlockerQueryMap(blockedBo, inactivationBlockingMetadata);
	if (queryMap != null) {
		Collection potentialBlockingRecords = legacyDataAdapter.findMatching(
				inactivationBlockingMetadata.getBlockingReferenceBusinessObjectClass(), queryMap);
		for (Iterator iterator = potentialBlockingRecords.iterator(); iterator.hasNext();) {
			MutableInactivatable businessObject = (MutableInactivatable) iterator.next();
			if (businessObject.isActive()) {
				hasBlockingRecord = true;
				break;
			}
		}
	}

	// if queryMap were null, means that we couldn't perform a query, and hence, need to return false
	return hasBlockingRecord;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:31,
代码来源:InactivationBlockingDetectionServiceImpl.java

示例3: detectBlockingRecord

点赞 3

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
/**
 * Implementation which calls the legacy {@link #hasABlockingRecord(org.kuali.rice.krad.bo.BusinessObject, org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata)}
 * if the given data object is a legacy object. Calls new code to make the equivalent check if the given object is
 * non-legacy.
 */
@Override
public boolean detectBlockingRecord(Object dataObject, InactivationBlockingMetadata inactivationBlockingMetadata) {
    if (LegacyUtils.useLegacyForObject(dataObject)) {
        return hasABlockingRecord((BusinessObject)dataObject, inactivationBlockingMetadata);
    }
    QueryByCriteria criteria = buildInactivationBlockerCriteria(dataObject, inactivationBlockingMetadata);
    if (criteria != null) {
        Class<?> blockingType = inactivationBlockingMetadata.getBlockingDataObjectClass();
        QueryResults<?> potentialBlockingRecords = getDataObjectService().findMatching(blockingType, criteria);
        for (Object result : potentialBlockingRecords.getResults()) {
            if (!(result instanceof Inactivatable)) {
                throw new IllegalStateException("Blocking records must implement Inactivatable, but encountered one which does not: " + result);
            }
            Inactivatable inactivatable = (Inactivatable)result;
            if (inactivatable.isActive()) {
                return true;
            }
        }
    }
    // if criteria is null, means that we couldn't perform a query, and hence, need to return false
    return false;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:28,
代码来源:InactivationBlockingDetectionServiceImpl.java

示例4: buildInactivationBlockerCriteria

点赞 3

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
protected QueryByCriteria buildInactivationBlockerCriteria(Object blockedObject, InactivationBlockingMetadata inactivationBlockingMetadata) {
    DataObjectMetadata blockingObjectMetadata =
            getDataObjectService().getMetadataRepository().getMetadata(inactivationBlockingMetadata.getBlockingDataObjectClass());
    DataObjectRelationship dataObjectRelationship =
            blockingObjectMetadata.getRelationship(inactivationBlockingMetadata.getBlockedAttributeName());

    // note, this method assumes that all PK fields of the blockedBo have a non-null and, for strings, non-blank values
    if (dataObjectRelationship != null && !dataObjectRelationship.getAttributeRelationships().isEmpty()) {
        DataObjectWrapper<?> wrap = getDataObjectService().wrap(blockedObject);
        List<Predicate> predicates = new ArrayList<Predicate>();
        for (DataObjectAttributeRelationship relationship : dataObjectRelationship.getAttributeRelationships()) {
            String fieldName = relationship.getParentAttributeName();
            Object fieldValue = wrap.getPropertyValue(relationship.getChildAttributeName());
            if (fieldValue != null && StringUtils.isNotBlank(fieldValue.toString())) {
                predicates.add(PredicateFactory.equal(fieldName, fieldValue));
            }
        }
        return QueryByCriteria.Builder.fromPredicates(predicates.toArray(new Predicate[predicates.size()]));
    }
    return null;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:22,
代码来源:InactivationBlockingDetectionServiceImpl.java

示例5: processInactivationBlockChecking

点赞 3

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
/**
 * Determines whether this document has been inactivation blocked
 *
 * @param maintenanceDocument
 * @return true iff there is NOTHING that blocks this record
 */
protected boolean processInactivationBlockChecking(MaintenanceDocument maintenanceDocument) {
    if (isDocumentInactivatingBusinessObject(maintenanceDocument)) {
        Class boClass = maintenanceDocument.getNewMaintainableObject().getDataObjectClass();
        Set<InactivationBlockingMetadata> inactivationBlockingMetadatas =
                ddService.getAllInactivationBlockingDefinitions(boClass);

        if (inactivationBlockingMetadatas != null) {
            for (InactivationBlockingMetadata inactivationBlockingMetadata : inactivationBlockingMetadatas) {
                // for the purposes of maint doc validation, we only need to look for the first blocking record

                // we found a blocking record, so we return false
                if (!processInactivationBlockChecking(maintenanceDocument, inactivationBlockingMetadata)) {
                    return false;
                }
            }
        }
    }
    return true;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:26,
代码来源:MaintenanceDocumentRuleBase.java

示例6: listAllBlockerRecords

点赞 3

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
/**
 * Overriding to let blocking records through
 * @see org.kuali.rice.krad.service.impl.InactivationBlockingDetectionServiceImpl#listAllBlockerRecords(org.kuali.rice.krad.bo.BusinessObject, org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata)
 */
public Collection<BusinessObject> listAllBlockerRecords(BusinessObject blockedBo, InactivationBlockingMetadata inactivationBlockingMetadata) {
    Collection<BusinessObject> blockingRecords = new ArrayList<BusinessObject>();

    Map<String, String> queryMap = buildInactivationBlockerQueryMap(blockedBo, inactivationBlockingMetadata);
    if (LOG.isDebugEnabled()) {
        LOG.debug("Checking for blocker records for object: " + blockedBo);
        LOG.debug("    With Metadata: " + inactivationBlockingMetadata);
        LOG.debug("    Resulting Query Map: " + queryMap);
    }

    if (queryMap != null) {
        Collection<? extends BusinessObject> potentialBlockingRecords = businessObjectService.findMatching(
                inactivationBlockingMetadata.getBlockingReferenceBusinessObjectClass(), queryMap);
        for (Iterator<? extends BusinessObject> iterator = potentialBlockingRecords.iterator(); iterator.hasNext();) {
            MutableInactivatable businessObject = (MutableInactivatable) iterator.next();
            blockingRecords.add((BusinessObject) businessObject);
        }
    }

    return blockingRecords;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:26,
代码来源:OffsetDefinitionInactivationBlockingDetectionServiceImpl.java

示例7: buildInactivationBlockerQueryMap

点赞 3

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
@Override
protected Map<String, String> buildInactivationBlockerQueryMap(BusinessObject blockedBo, InactivationBlockingMetadata inactivationBlockingMetadata) {
    Class<? extends BusinessObject> boClass = blockedBo.getClass();
    if (!(Account.class.isAssignableFrom(boClass) || SubAccount.class.isAssignableFrom(boClass) || ObjectCode.class.isAssignableFrom(boClass) || SubObjectCode.class.isAssignableFrom(boClass))) {
        throw new IllegalArgumentException("BO must be either an Account, SubAccount, ObjectCode, or SubObjectCode (was: " + boClass + ")");
    }
    
    // this code assumes that the PK field names in the BO are identical to the field names in the ICR Rate Detail BO
    Map<String, Object> fieldValues = persistenceService.getPrimaryKeyFieldValues(blockedBo);
    if (Account.class.isAssignableFrom(boClass)) {
        fieldValues.put(OLEPropertyConstants.ACCOUNT_ACTIVE_INDICATOR, OLEConstants.ParameterValues.NO);
    }
    else {
        fieldValues.put(OLEPropertyConstants.ACTIVE, OLEConstants.ParameterValues.YES);
    }
    return convertFieldValuesToStrings(fieldValues);
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:18,
代码来源:IndirectCostRecoveryRateDetailInactivationBlockingDetectionServiceImpl.java

示例8: processInactivationBlockChecking

点赞 3

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
protected boolean processInactivationBlockChecking(Maintainable maintainable, ObjectCode objectCode, int index) {
    Set<InactivationBlockingMetadata> inactivationBlockingMetadatas = ddService.getAllInactivationBlockingDefinitions(ObjectCode.class);
    for (InactivationBlockingMetadata inactivationBlockingMetadata : inactivationBlockingMetadatas) {
        String inactivationBlockingDetectionServiceBeanName = inactivationBlockingMetadata.getInactivationBlockingDetectionServiceBeanName();
        InactivationBlockingDetectionService inactivationBlockingDetectionService;
        if (StringUtils.isBlank(inactivationBlockingDetectionServiceBeanName)) {
            inactivationBlockingDetectionService = SpringContext.getBean(InactivationBlockingDetectionService.class);
        } else {
            inactivationBlockingDetectionService = SpringContext.getBean(InactivationBlockingDetectionService.class, inactivationBlockingDetectionServiceBeanName);
        }

        Collection<BusinessObject> blockingBusinessObjects = inactivationBlockingDetectionService.listAllBlockerRecords(objectCode, inactivationBlockingMetadata);
        blockingBusinessObjects = addAdditionalBlockingBusinessObjects(blockingBusinessObjects, objectCode);

        if (blockingBusinessObjects != null && !blockingBusinessObjects.isEmpty()) {
            final List<PersistableBusinessObject> persistingChanges = ((GlobalBusinessObject)maintainable.getBusinessObject()).generateGlobalChangesToPersist();
            if (!isOnlyPersistingChangesInBlockingBusinessObjects(blockingBusinessObjects, persistingChanges)) {
                putInactivationBlockingErrorOnPage(objectCode, inactivationBlockingMetadata, index);
                return false;
            }
        }
    }
    return true;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:25,
代码来源:ObjectCodeGlobalRule.java

示例9: putInactivationBlockingErrorOnPage

点赞 3

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
protected void putInactivationBlockingErrorOnPage(ObjectCode objectCode, InactivationBlockingMetadata inactivationBlockingMetadata, int index) {
    String objectCodeSummaryString = objectCode.getUniversityFiscalYear() + " - " + objectCode.getChartOfAccountsCode() + " - " + objectCode.getFinancialObjectCode();

    Properties parameters = new Properties();
    parameters.put(KRADConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, inactivationBlockingMetadata.getBlockedBusinessObjectClass().getName());
    parameters.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.METHOD_DISPLAY_ALL_INACTIVATION_BLOCKERS);
    parameters.put(OLEPropertyConstants.UNIVERSITY_FISCAL_YEAR, objectCode.getUniversityFiscalYear().toString());
    parameters.put(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE, objectCode.getChartOfAccountsCode());
    parameters.put(OLEPropertyConstants.FINANCIAL_OBJECT_CODE, objectCode.getFinancialObjectCode());
    String blockingUrl = UrlFactory.parameterizeUrl(KRADConstants.DISPLAY_ALL_INACTIVATION_BLOCKERS_ACTION, parameters);

    String errorPropertyPath = OLEConstants.MAINTENANCE_NEW_MAINTAINABLE + OLEPropertyConstants.OBJECT_CODE_GLOBAL_DETAILS + "[" + index + "]." + OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE;

    // post an error about the locked document
    GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(errorPropertyPath, OLEKeyConstants.ERROR_DOCUMENT_GLOBAL_OBJECTMAINT_INACTIVATION_BLOCKING, objectCodeSummaryString, blockingUrl);
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:17,
代码来源:ObjectCodeGlobalRule.java

示例10: buildInactivationBlockerQueryMap

点赞 3

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
@Override
protected Map<String, String> buildInactivationBlockerQueryMap(BusinessObject blockedBo, InactivationBlockingMetadata inactivationBlockingMetadata) {
    Class<? extends BusinessObject> boClass = blockedBo.getClass();
    if (!(Account.class.isAssignableFrom(boClass) || SubAccount.class.isAssignableFrom(boClass) || ObjectCode.class.isAssignableFrom(boClass) || SubObjectCode.class.isAssignableFrom(boClass))) {
        throw new IllegalArgumentException("BO must be either an Account, SubAccount, ObjectCode, or SubObjectCode (was: " + boClass + ")");
    }
    
    // this code assumes that the PK field names in the BO are identical to the field names in the ICR Rate Detail BO
    Map<String, Object> fieldValues = persistenceService.getPrimaryKeyFieldValues(blockedBo);
    if (Account.class.isAssignableFrom(boClass)) {
        fieldValues.put(KFSPropertyConstants.ACCOUNT_ACTIVE_INDICATOR, KFSConstants.ParameterValues.NO);
    }
    else {
        fieldValues.put(KFSPropertyConstants.ACTIVE, KFSConstants.ParameterValues.YES);
    }
    return convertFieldValuesToStrings(fieldValues);
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:18,
代码来源:IndirectCostRecoveryRateDetailInactivationBlockingDetectionServiceImpl.java

示例11: putInactivationBlockingErrorOnPage

点赞 3

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
protected void putInactivationBlockingErrorOnPage(ObjectCode objectCode, InactivationBlockingMetadata inactivationBlockingMetadata, int index) {
    String objectCodeSummaryString = objectCode.getUniversityFiscalYear() + " - " + objectCode.getChartOfAccountsCode() + " - " + objectCode.getFinancialObjectCode();

    Properties parameters = new Properties();
    parameters.put(KRADConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, inactivationBlockingMetadata.getBlockedBusinessObjectClass().getName());
    parameters.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.METHOD_DISPLAY_ALL_INACTIVATION_BLOCKERS);
    parameters.put(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR, objectCode.getUniversityFiscalYear().toString());
    parameters.put(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE, objectCode.getChartOfAccountsCode());
    parameters.put(KFSPropertyConstants.FINANCIAL_OBJECT_CODE, objectCode.getFinancialObjectCode());
    String blockingUrl = UrlFactory.parameterizeUrl(KRADConstants.DISPLAY_ALL_INACTIVATION_BLOCKERS_ACTION, parameters);

    String errorPropertyPath = KFSConstants.MAINTENANCE_NEW_MAINTAINABLE + KFSPropertyConstants.OBJECT_CODE_GLOBAL_DETAILS + "[" + index + "]." + KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE;

    // post an error about the locked document
    GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(errorPropertyPath, KFSKeyConstants.ERROR_DOCUMENT_GLOBAL_OBJECTMAINT_INACTIVATION_BLOCKING, objectCodeSummaryString, blockingUrl);
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:17,
代码来源:ObjectCodeGlobalRule.java

示例12: processInactivationBlockChecking

点赞 3

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
/**
 * Determines whether this document has been inactivation blocked
 *
 * @param maintenanceDocument
 * @return true iff there is NOTHING that blocks this record
 */
protected boolean processInactivationBlockChecking(MaintenanceDocument maintenanceDocument) {
    if (isDocumentInactivatingBusinessObject(maintenanceDocument)) {
        Class dataObjectClass = maintenanceDocument.getNewMaintainableObject().getDataObjectClass();
        Set<InactivationBlockingMetadata> inactivationBlockingMetadatas =
                getDataDictionaryService().getAllInactivationBlockingDefinitions(dataObjectClass);

        if (inactivationBlockingMetadatas != null) {
            for (InactivationBlockingMetadata inactivationBlockingMetadata : inactivationBlockingMetadatas) {
                // for the purposes of maint doc validation, we only need to look for the first blocking record

                // we found a blocking record, so we return false
                if (!processInactivationBlockChecking(maintenanceDocument, inactivationBlockingMetadata)) {
                    return false;
                }
            }
        }
    }
    return true;
}
 

开发者ID:aapotts,
项目名称:kuali_rice,
代码行数:26,
代码来源:MaintenanceDocumentRuleBase.java

示例13: listAllBlockerRecords

点赞 3

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
/**
    * Note we are checking the active getting after retrieving potential blocking records instead of setting criteria on the
 * active field. This is because some implementations of {@link org.kuali.rice.core.api.mo.common.active.MutableInactivatable} might not have the active field, for example
 * instances of {@link org.kuali.rice.krad.bo.InactivatableFromTo}
 * 
    * @see org.kuali.rice.krad.service.InactivationBlockingDetectionService#listAllBlockerRecords(org.kuali.rice.krad.datadictionary.InactivationBlockingDefinition)
    * @see org.kuali.rice.core.api.mo.common.active.MutableInactivatable
    */
   @SuppressWarnings("unchecked")
public Collection<BusinessObject> listAllBlockerRecords(BusinessObject blockedBo, InactivationBlockingMetadata inactivationBlockingMetadata) {
	Collection<BusinessObject> blockingRecords = new ArrayList<BusinessObject>();

	Map<String, String> queryMap = buildInactivationBlockerQueryMap(blockedBo, inactivationBlockingMetadata);
	if (LOG.isDebugEnabled()) {
		LOG.debug("Checking for blocker records for object: " + blockedBo);
		LOG.debug("    With Metadata: " + inactivationBlockingMetadata);
		LOG.debug("    Resulting Query Map: " + queryMap);
	}

	if (queryMap != null) {
		Collection potentialBlockingRecords = businessObjectService.findMatching(
				inactivationBlockingMetadata.getBlockingReferenceBusinessObjectClass(), queryMap);
		for (Iterator iterator = potentialBlockingRecords.iterator(); iterator.hasNext();) {
			MutableInactivatable businessObject = (MutableInactivatable) iterator.next();
			if (businessObject.isActive()) {
				blockingRecords.add((BusinessObject) businessObject);
			}
		}
	}

	return blockingRecords;
}
 

开发者ID:aapotts,
项目名称:kuali_rice,
代码行数:33,
代码来源:InactivationBlockingDetectionServiceImpl.java

示例14: hasABlockingRecord

点赞 3

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
/**
 * Note we are checking the active getting after retrieving potential blocking records instead of setting criteria on the
 * active field. This is because some implementations of {@link org.kuali.rice.core.api.mo.common.active.MutableInactivatable} might not have the active field, for example
 * instances of {@link org.kuali.rice.krad.bo.InactivatableFromTo}
 * 
 * @see org.kuali.rice.krad.service.InactivationBlockingDetectionService#hasABlockingRecord(org.kuali.rice.krad.bo.BusinessObject,
 *      org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata)
 * @see org.kuali.rice.core.api.mo.common.active.MutableInactivatable
 */
public boolean hasABlockingRecord(BusinessObject blockedBo, InactivationBlockingMetadata inactivationBlockingMetadata) {
	boolean hasBlockingRecord = false;

	Map<String, String> queryMap = buildInactivationBlockerQueryMap(blockedBo, inactivationBlockingMetadata);
	if (queryMap != null) {
		Collection potentialBlockingRecords = businessObjectService.findMatching(
				inactivationBlockingMetadata.getBlockingReferenceBusinessObjectClass(), queryMap);
		for (Iterator iterator = potentialBlockingRecords.iterator(); iterator.hasNext();) {
			MutableInactivatable businessObject = (MutableInactivatable) iterator.next();
			if (businessObject.isActive()) {
				hasBlockingRecord = true;
				break;
			}
		}
	}

	// if queryMap were null, means that we couldn't perform a query, and hence, need to return false
	return hasBlockingRecord;
}
 

开发者ID:aapotts,
项目名称:kuali_rice,
代码行数:29,
代码来源:InactivationBlockingDetectionServiceImpl.java

示例15: getAllInactivationBlockingDefinitions

点赞 2

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
/**
 * Returns all of the inactivation blocks registered for a particular business object
 *
 * @see org.kuali.rice.krad.service.DataDictionaryService#getAllInactivationBlockingDefinitions(java.lang.Class)
 */
@Override
public Set<InactivationBlockingMetadata> getAllInactivationBlockingDefinitions(
        Class inactivationBlockedBusinessObjectClass) {
    Set<InactivationBlockingMetadata> blockingClasses =
            dataDictionary.getAllInactivationBlockingMetadatas(inactivationBlockedBusinessObjectClass);
    if (blockingClasses == null) {
        return Collections.emptySet();
    }
    return blockingClasses;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:16,
代码来源:TestDataDictionaryService.java

示例16: getAllInactivationBlockingDefinitions

点赞 2

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
/**
    * Returns all of the inactivation blocks registered for a particular business object
    *
    * @see org.kuali.rice.krad.service.DataDictionaryService#getAllInactivationBlockingDefinitions(java.lang.Class)
    */
   @Override
public Set<InactivationBlockingMetadata> getAllInactivationBlockingDefinitions(
           Class inactivationBlockedBusinessObjectClass) {
       Set<InactivationBlockingMetadata> blockingClasses =
               dataDictionary.getAllInactivationBlockingMetadatas(inactivationBlockedBusinessObjectClass);
       if (blockingClasses == null) {
           return Collections.emptySet();
       }
       return blockingClasses;
   }
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:16,
代码来源:DataDictionaryServiceImpl.java

示例17: listAllBlockerRecords

点赞 2

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
/**
    * Note we are checking the active getting after retrieving potential blocking records instead of setting criteria on the
 * active field. This is because some implementations of {@link org.kuali.rice.core.api.mo.common.active.MutableInactivatable} might not have the active field, for example
 * instances of {@link org.kuali.rice.krad.bo.InactivatableFromTo}
 * 
    * @see org.kuali.rice.krad.service.InactivationBlockingDetectionService#listAllBlockerRecords(org.kuali.rice.krad.bo.BusinessObject, org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata)
    * @see org.kuali.rice.core.api.mo.common.active.MutableInactivatable
    */
   @SuppressWarnings("unchecked")
   @Deprecated
   @Override
public Collection<BusinessObject> listAllBlockerRecords(BusinessObject blockedBo, InactivationBlockingMetadata inactivationBlockingMetadata) {
	Collection<BusinessObject> blockingRecords = new ArrayList<BusinessObject>();

	Map<String, String> queryMap = buildInactivationBlockerQueryMap(blockedBo, inactivationBlockingMetadata);
	if (LOG.isDebugEnabled()) {
		LOG.debug("Checking for blocker records for object: " + blockedBo);
		LOG.debug("    With Metadata: " + inactivationBlockingMetadata);
		LOG.debug("    Resulting Query Map: " + queryMap);
	}

	if (queryMap != null) {
		Collection potentialBlockingRecords = legacyDataAdapter.findMatching(
				inactivationBlockingMetadata.getBlockingReferenceBusinessObjectClass(), queryMap);
		for (Iterator iterator = potentialBlockingRecords.iterator(); iterator.hasNext();) {
			MutableInactivatable businessObject = (MutableInactivatable) iterator.next();
			if (businessObject.isActive()) {
				blockingRecords.add((BusinessObject) businessObject);
			}
		}
	}

	return blockingRecords;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:35,
代码来源:InactivationBlockingDetectionServiceImpl.java

示例18: buildInactivationBlockerQueryMap

点赞 2

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
@Deprecated
protected Map<String, String> buildInactivationBlockerQueryMap(BusinessObject blockedBo, InactivationBlockingMetadata inactivationBlockingMetadata) {
	BusinessObject blockingBo = (BusinessObject) KRADUtils.createNewObjectFromClass(
               inactivationBlockingMetadata.getBlockingReferenceBusinessObjectClass());

	org.kuali.rice.krad.bo.DataObjectRelationship dataObjectRelationship = legacyDataAdapter
			.getDataObjectRelationship(blockingBo, blockedBo.getClass(),
                       inactivationBlockingMetadata.getBlockedReferencePropertyName(), "", true, false, false);

       RelationshipDefinition relationshipDefinition = KRADServiceLocatorWeb.getLegacyDataAdapter().getDictionaryRelationship(blockedBo.getClass(),inactivationBlockingMetadata.getBlockedReferencePropertyName());

	// note, this method assumes that all PK fields of the blockedBo have a non-null and, for strings, non-blank values
	if (dataObjectRelationship != null) {
		Map<String, String> parentToChildReferences = dataObjectRelationship.getParentToChildReferences();
		Map<String, String> queryMap = new HashMap<String, String>();
		for (Map.Entry<String, String> parentToChildReference : parentToChildReferences.entrySet()) {
			String fieldName = parentToChildReference.getKey();
			Object fieldValue = KradDataServiceLocator.getDataObjectService().wrap(blockedBo).getPropertyValueNullSafe(parentToChildReference.getValue());
			if (fieldValue != null && StringUtils.isNotBlank(fieldValue.toString())) {
				queryMap.put(fieldName, fieldValue.toString());
			} else {
				LOG.error("Found null value for foreign key field " + fieldName
						+ " while building inactivation blocking query map.");
				throw new RuntimeException("Found null value for foreign key field '" + fieldName
						+ "' while building inactivation blocking query map.");
			}
		}

		return queryMap;
	}

	return null;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:34,
代码来源:InactivationBlockingDetectionServiceImpl.java

示例19: detectAllBlockingRecords

点赞 2

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
/**
 * Implementation which calls the legacy {@link #listAllBlockerRecords(org.kuali.rice.krad.bo.BusinessObject, org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata)}
 * if the given data object is a legacy object. Calls new code to make the equivalent check if the given object is
 * non-legacy.
 */
@Override
public Collection<?> detectAllBlockingRecords(Object dataObject,
        InactivationBlockingMetadata inactivationBlockingMetadata) {
    if (LegacyUtils.useLegacyForObject(dataObject)) {
        return listAllBlockerRecords((BusinessObject) dataObject, inactivationBlockingMetadata);
    }
    List<Object> blockingRecords = new ArrayList<Object>();

    QueryByCriteria criteria = buildInactivationBlockerCriteria(dataObject, inactivationBlockingMetadata);
    if (LOG.isDebugEnabled()) {
        LOG.debug("Checking for blocker records for object: " + dataObject);
        LOG.debug("    With Metadata: " + inactivationBlockingMetadata);
        LOG.debug("    Resulting QueryByCriteria: " + criteria);
    }

    if (criteria != null) {
        Class<?> blockingType = inactivationBlockingMetadata.getBlockingDataObjectClass();
        QueryResults<?> potentialBlockingRecords = getDataObjectService().findMatching(blockingType, criteria);
        for (Object result : potentialBlockingRecords.getResults()) {
            if (!(result instanceof Inactivatable)) {
                throw new IllegalStateException("Blocking records must implement Inactivatable, but encountered one which does not: " + result);
            }
            Inactivatable inactivatable = (Inactivatable)result;
            if (inactivatable.isActive()) {
                blockingRecords.add(result);
            }
        }
    }

    return blockingRecords;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:37,
代码来源:InactivationBlockingDetectionServiceImpl.java

示例20: buildInactivationBlockerQueryMap

点赞 2

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
@Override
protected Map<String, String> buildInactivationBlockerQueryMap(BusinessObject blockedBo, InactivationBlockingMetadata inactivationBlockingMetadata) {
    ObjectCode blockedObjectCode = (ObjectCode) blockedBo;
    if (universityDateService.getCurrentFiscalYear().equals(blockedObjectCode.getUniversityFiscalYear())) {
        return super.buildInactivationBlockerQueryMap(blockedBo, inactivationBlockingMetadata);
    }
    return null;
    
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:10,
代码来源:ObjectCodeCurrentInactivationBlockingDetectionServiceImpl.java

示例21: hasABlockingRecord

点赞 2

import org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata; //导入依赖的package包/类
/**
 * Overriding to say that any record of the same PK is blocking..
 * @see org.kuali.rice.krad.service.impl.InactivationBlockingDetectionServiceImpl#hasABlockingRecord(org.kuali.rice.krad.bo.BusinessObject, org.kuali.rice.krad.datadictionary.InactivationBlockingMetadata)
 */
public boolean hasABlockingRecord(BusinessObject blockedBo, InactivationBlockingMetadata inactivationBlockingMetadata) {
    boolean hasBlockingRecord = false;

    Map<String, String> queryMap = buildInactivationBlockerQueryMap(blockedBo, inactivationBlockingMetadata);
    if (queryMap != null) {
        Collection<? extends BusinessObject> potentialBlockingRecords = businessObjectService.findMatching(
                inactivationBlockingMetadata.getBlockingReferenceBusinessObjectClass(), queryMap);
        return !potentialBlockingRecords.isEmpty();
    }

    // if queryMap were null, means that we couldn't perform a query, and hence, need to return false
    return hasBlockingRecord;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:18,
代码来源:OffsetDefinitionInactivationBlockingDetectionServiceImpl.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)