本文整理汇总了Java中org.kuali.rice.kns.document.MaintenanceDocument.getDocumentTitle方法的典型用法代码示例。如果您正苦于以下问题:Java MaintenanceDocument.getDocumentTitle方法的具体用法?Java MaintenanceDocument.getDocumentTitle怎么用?Java MaintenanceDocument.getDocumentTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kns.document.MaintenanceDocument
的用法示例。
在下文中一共展示了MaintenanceDocument.getDocumentTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateMaintenanceDocument
import org.kuali.rice.kns.document.MaintenanceDocument; //导入方法依赖的package包/类
/**
* This method checks to make sure the document is a valid maintenanceDocument, and has the necessary values
* populated such that
* it will not cause exceptions in later routing or business rules testing.
*
* This is not a business rules test.
*
* @param maintenanceDocument - document to be tested
* @return whether maintenance doc passes
* @throws org.kuali.rice.krad.exception.ValidationException
*
*/
protected boolean validateMaintenanceDocument(MaintenanceDocument maintenanceDocument) {
boolean success = true;
Maintainable newMaintainable = maintenanceDocument.getNewMaintainableObject();
// document must have a newMaintainable object
if (newMaintainable == null) {
throw new ValidationException(
"Maintainable object from Maintenance Document '" + maintenanceDocument.getDocumentTitle() +
"' is null, unable to proceed.");
}
// document's newMaintainable must contain an object (ie, not null)
if (newMaintainable.getDataObject() == null) {
throw new ValidationException("Maintainable's component data object is null.");
}
return success;
}
示例2: dataDictionaryValidate
import org.kuali.rice.kns.document.MaintenanceDocument; //导入方法依赖的package包/类
/**
* This method executes the DataDictionary Validation against the document.
*
* @param document
* @return true if it passes DD validation, false otherwise
*/
protected boolean dataDictionaryValidate(MaintenanceDocument document) {
LOG.debug("MaintenanceDocument validation beginning");
// explicitly put the errorPath that the dictionaryValidationService
// requires
GlobalVariables.getMessageMap().addToErrorPath("document.newMaintainableObject");
// document must have a newMaintainable object
Maintainable newMaintainable = document.getNewMaintainableObject();
if (newMaintainable == null) {
GlobalVariables.getMessageMap().removeFromErrorPath("document.newMaintainableObject");
throw new ValidationException(
"Maintainable object from Maintenance Document '" + document.getDocumentTitle() +
"' is null, unable to proceed.");
}
// document's newMaintainable must contain an object (ie, not null)
Object dataObject = newMaintainable.getDataObject();
if (dataObject == null) {
GlobalVariables.getMessageMap().removeFromErrorPath("document.newMaintainableObject.");
throw new ValidationException("Maintainable's component business object is null.");
}
// if the Maintainable object is a PBO and there is a legacy maintDefinition
// then use the old validation methods
if (newBo instanceof PersistableBusinessObject && CollectionUtils.isNotEmpty(maintDocDictionaryService
.getMaintainableSections(document.getDocumentHeader().getWorkflowDocument().getDocumentTypeName()))) {
BusinessObject businessObject = (BusinessObject) newBo;
// run required check from maintenance data dictionary
maintDocDictionaryService.validateMaintenanceRequiredFields(document);
//check for duplicate entries in collections if necessary
maintDocDictionaryService.validateMaintainableCollectionsForDuplicateEntries(document);
// run the DD DictionaryValidation (non-recursive)
dictionaryValidationService.validateBusinessObjectOnMaintenanceDocument(businessObject,
document.getDocumentHeader().getWorkflowDocument().getDocumentTypeName());
// do default (ie, mandatory) existence checks
dictionaryValidationService.validateDefaultExistenceChecks(businessObject);
} else {
GlobalVariables.getMessageMap().addToErrorPath("dataObject");
dictionaryValidationService.validate(newBo);
GlobalVariables.getMessageMap().removeFromErrorPath("dataObject");
}
// explicitly remove the errorPath we've added
GlobalVariables.getMessageMap().removeFromErrorPath("document.newMaintainableObject");
LOG.debug("MaintenanceDocument validation ending");
return true;
}