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


Java KRADServiceLocatorWeb.DEFAULT_INACTIVATION_BLOCKING_DETECTION_SERVICE属性代码示例

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


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

示例1: processInactivationBlockChecking

/**
 * Given a InactivationBlockingMetadata, which represents a relationship that may block inactivation of a BO, it
 * determines whether there
 * is a record that violates the blocking definition
 *
 * @param maintenanceDocument
 * @param inactivationBlockingMetadata
 * @return true iff, based on the InactivationBlockingMetadata, the maintenance document should be allowed to route
 */
protected boolean processInactivationBlockChecking(MaintenanceDocument maintenanceDocument,
        InactivationBlockingMetadata inactivationBlockingMetadata) {
    String inactivationBlockingDetectionServiceBeanName =
            inactivationBlockingMetadata.getInactivationBlockingDetectionServiceBeanName();
    if (StringUtils.isBlank(inactivationBlockingDetectionServiceBeanName)) {
        inactivationBlockingDetectionServiceBeanName =
                KRADServiceLocatorWeb.DEFAULT_INACTIVATION_BLOCKING_DETECTION_SERVICE;
    }
    InactivationBlockingDetectionService inactivationBlockingDetectionService =
            KRADServiceLocatorWeb.getInactivationBlockingDetectionService(
                    inactivationBlockingDetectionServiceBeanName);

    boolean foundBlockingRecord = inactivationBlockingDetectionService.detectBlockingRecord(
            newDataObject, inactivationBlockingMetadata);

    if (foundBlockingRecord) {
        putInactivationBlockingErrorOnPage(maintenanceDocument, inactivationBlockingMetadata);
    }

    return !foundBlockingRecord;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:30,代码来源:MaintenanceDocumentRuleBase.java

示例2: processInactivationBlockChecking

/**
 * Given a InactivationBlockingMetadata, which represents a relationship that may block inactivation of a BO, it
 * determines whether there
 * is a record that violates the blocking definition
 *
 * @param maintenanceDocument
 * @param inactivationBlockingMetadata
 * @return true iff, based on the InactivationBlockingMetadata, the maintenance document should be allowed to route
 */
protected boolean processInactivationBlockChecking(MaintenanceDocument maintenanceDocument,
        InactivationBlockingMetadata inactivationBlockingMetadata) {
    if (newBo instanceof PersistableBusinessObject) {
        String inactivationBlockingDetectionServiceBeanName =
                inactivationBlockingMetadata.getInactivationBlockingDetectionServiceBeanName();
        if (StringUtils.isBlank(inactivationBlockingDetectionServiceBeanName)) {
            inactivationBlockingDetectionServiceBeanName =
                    KRADServiceLocatorWeb.DEFAULT_INACTIVATION_BLOCKING_DETECTION_SERVICE;
        }
        InactivationBlockingDetectionService inactivationBlockingDetectionService = KRADServiceLocatorWeb
                .getInactivationBlockingDetectionService(inactivationBlockingDetectionServiceBeanName);

        boolean foundBlockingRecord = inactivationBlockingDetectionService
                .hasABlockingRecord((PersistableBusinessObject) newBo, inactivationBlockingMetadata);

        if (foundBlockingRecord) {
            putInactivationBlockingErrorOnPage(maintenanceDocument, inactivationBlockingMetadata);
        }

        return !foundBlockingRecord;
    }

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

示例3: listAllBlockerRecords

@Override
public List<String> listAllBlockerRecords(BusinessObject blockedBo, InactivationBlockingMetadata inactivationBlockingMetadata) {
       String inactivationBlockingDetectionServiceBeanName = inactivationBlockingMetadata.getInactivationBlockingDetectionServiceBeanName();
       if (StringUtils.isBlank(inactivationBlockingDetectionServiceBeanName)) {
           inactivationBlockingDetectionServiceBeanName = KRADServiceLocatorWeb.DEFAULT_INACTIVATION_BLOCKING_DETECTION_SERVICE;
       }
       InactivationBlockingDetectionService inactivationBlockingDetectionService = KRADServiceLocatorWeb
               .getInactivationBlockingDetectionService(inactivationBlockingDetectionServiceBeanName);

       Collection<BusinessObject> collection = inactivationBlockingDetectionService.listAllBlockerRecords(blockedBo, inactivationBlockingMetadata);

       Map<String, Formatter> formatters = getFormattersForPrimaryKeyFields(inactivationBlockingMetadata.getBlockingReferenceBusinessObjectClass());

       List<String> displayValues = new ArrayList<String>();
       List<String> pkFieldNames = getLegacyDataAdapter().listPrimaryKeyFieldNames(inactivationBlockingMetadata.getBlockingReferenceBusinessObjectClass());
       Person user = GlobalVariables.getUserSession().getPerson();

       for (BusinessObject element : collection) {
       	StringBuilder buf = new StringBuilder();

       	// the following method will return a restriction for all DD-defined attributes
       	BusinessObjectRestrictions businessObjectRestrictions = getBusinessObjectAuthorizationService().getLookupResultRestrictions(element, user);
       	for (int i = 0; i < pkFieldNames.size(); i++) {
       		String pkFieldName = pkFieldNames.get(i);
       		Object value = KradDataServiceLocator.getDataObjectService().wrap(element).getPropertyValueNullSafe(pkFieldName);

       		String displayValue = null;
       		if (!businessObjectRestrictions.hasRestriction(pkFieldName)) {
       			Formatter formatter = formatters.get(pkFieldName);
       			if (formatter != null) {
       				displayValue = (String) formatter.format(value);
       			}
       			else {
       				displayValue = String.valueOf(value);
       			}
       		}
       		else {
       			FieldRestriction fieldRestriction = businessObjectRestrictions.getFieldRestriction(pkFieldName);
       			if (fieldRestriction.isMasked() || fieldRestriction.isPartiallyMasked()) {
	    			MaskFormatter maskFormatter = fieldRestriction.getMaskFormatter();
					displayValue = maskFormatter.maskValue(value);
       			}
       			else {
       				// there was a restriction, but we did not know how to obey it.
       				LOG.warn("Restriction was defined for class: " + element.getClass() + " field name: " + pkFieldName + ", but it was not honored by the inactivation blocking display framework");
       			}
       		}

       		buf.append(displayValue);
       		if (i < pkFieldNames.size() - 1) {
       			buf.append(" - ");
       		}
       	}

       	displayValues.add(buf.toString());
       }
	return displayValues;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:58,代码来源:InactivationBlockingDisplayServiceImpl.java

示例4: displayAllBlockingRecords

@Override
public List<String> displayAllBlockingRecords(Object blockedBo, InactivationBlockingMetadata inactivationBlockingMetadata) {
    String inactivationBlockingDetectionServiceBeanName = inactivationBlockingMetadata.getInactivationBlockingDetectionServiceBeanName();
    if (StringUtils.isBlank(inactivationBlockingDetectionServiceBeanName)) {
        inactivationBlockingDetectionServiceBeanName = KRADServiceLocatorWeb.DEFAULT_INACTIVATION_BLOCKING_DETECTION_SERVICE;
    }
    InactivationBlockingDetectionService inactivationBlockingDetectionService = KRADServiceLocatorWeb
            .getInactivationBlockingDetectionService(inactivationBlockingDetectionServiceBeanName);

    Collection<?> collection = inactivationBlockingDetectionService.detectAllBlockingRecords(blockedBo, inactivationBlockingMetadata);

    Map<String, Formatter> formatters = getFormattersForPrimaryKeyFields(inactivationBlockingMetadata.getBlockingReferenceBusinessObjectClass());

    List<String> displayValues = new ArrayList<String>();
    List<String> pkFieldNames = getLegacyDataAdapter().listPrimaryKeyFieldNames(inactivationBlockingMetadata.getBlockingReferenceBusinessObjectClass());
    Person user = GlobalVariables.getUserSession().getPerson();

    for (Object element : collection) {
        StringBuilder buf = new StringBuilder();

        // the following method will return a restriction for all DD-defined attributes
        BusinessObjectRestrictions businessObjectRestrictions = getBusinessObjectAuthorizationService().getLookupResultRestrictions(element, user);
        for (int i = 0; i < pkFieldNames.size(); i++) {
            String pkFieldName = pkFieldNames.get(i);
            Object value = KradDataServiceLocator.getDataObjectService().wrap(element).getPropertyValueNullSafe(pkFieldName);

            String displayValue = null;
            if (!businessObjectRestrictions.hasRestriction(pkFieldName)) {
                Formatter formatter = formatters.get(pkFieldName);
                if (formatter != null) {
                    displayValue = (String) formatter.format(value);
                }
                else {
                    displayValue = String.valueOf(value);
                }
            }
            else {
                FieldRestriction fieldRestriction = businessObjectRestrictions.getFieldRestriction(pkFieldName);
                if (fieldRestriction.isMasked() || fieldRestriction.isPartiallyMasked()) {
                    MaskFormatter maskFormatter = fieldRestriction.getMaskFormatter();
                    displayValue = maskFormatter.maskValue(value);
                }
                else {
                    // there was a restriction, but we did not know how to obey it.
                    LOG.warn("Restriction was defined for class: " + element.getClass() + " field name: " + pkFieldName + ", but it was not honored by the inactivation blocking display framework");
                }
            }

            buf.append(displayValue);
            if (i < pkFieldNames.size() - 1) {
                buf.append(" - ");
            }
        }

        displayValues.add(buf.toString());
    }
    return displayValues;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:58,代码来源:InactivationBlockingDisplayServiceImpl.java


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