| org.kuali.core.service.DictionaryValidationService
All known Subclasses: org.kuali.core.service.impl.DictionaryValidationServiceImpl,
DictionaryValidationService | public interface DictionaryValidationService (Code) | | Defines the API for the validating against the data dictionary.
|
Method Summary | |
public boolean | isBusinessObjectValid(PersistableBusinessObject businessObject) Encapsulates
DictionaryValidationService.validateBusinessObject(BusinessObject) and returns boolean so one doesn't need to check the ErrorMap.Validates the business object primitive attributes against the data dictionary. | public boolean | isBusinessObjectValid(PersistableBusinessObject businessObject, String prefix) Encapsulates
DictionaryValidationService.validateBusinessObject(BusinessObject) and returns boolean so one doesn't need to check the ErrorMap.Validates the business object primitive attributes against the data dictionary. | public boolean | validateApcRule(PersistableBusinessObject bo, ApcRuleDefinition apcRule) This method applies a specific rule against the given BusinessObject as defined in the MaintenanceDocument.xml file. | public boolean | validateApcRules(PersistableBusinessObject bo) This method applies all rules against the given BusinessObject as defined in the MaintenanceDocument.xml file. | public void | validateAttributeFormat(String entryName, String attributeName, String attributeValue, String errorKey) Validates an attribute of a given class for proper min, max length, syntax, and required. | public void | validateAttributeRequired(String entryName, String attributeName, Object attributeValue, Boolean forMaintenance, String errorKey) Validates an attribute of a given class for required check. | public void | validateBusinessObject(PersistableBusinessObject businessObject) Validates the business object primitive attributes against the data dictionary. | public void | validateBusinessObject(PersistableBusinessObject businessObject, boolean validateRequired) Validates the business object primitive attributes against the data dictionary. | public void | validateBusinessObjectsRecursively(PersistableBusinessObject businessObject, int depth) Validates the business object against the dictionary, uses reflection to get any child business objects, and recursively
calls back. | public boolean | validateDefaultExistenceChecks(PersistableBusinessObject bo) This method does an existence check against all references of a BusinessObject as defined in the MaintenanceDocument.xml file
for that business object. | public void | validateDocument(Document document) Validates the contents of a document (i.e. | public void | validateDocumentAndUpdatableReferencesRecursively(Document document, int maxDepth, boolean validateRequired) | public void | validateDocumentAttribute(Document document, String attributeName, String errorPrefix) Validates the specified attribute of the given document against the data dictionary. | public void | validateDocumentRecursively(Document document, int depth) Validates the contents of a document (i.e. | public boolean | validateReferenceExists(PersistableBusinessObject bo, ReferenceDefinition reference) This method examines the populated BusinessObject bo instance passed in for a member named by the referenceName. | public boolean | validateReferenceExists(PersistableBusinessObject bo, String referenceName) This method examines the populated BusinessObject bo instance passed in for a member named by the referenceName. | public boolean | validateReferenceExistsAndIsActive(PersistableBusinessObject bo, ReferenceDefinition reference) This method intelligently tests the designated reference on the bo for both existence and active status, where appropriate.
It will not test anything if the foreign-key fields for the given reference arent filled out with values, and it will not
test active status if the reference doesnt exist.
Further, it will only test active status where the correct flag is set.
On failures of either sort, it will put the relevant errors into the GlobalVariables errorMap, and return a false. | public boolean | validateReferenceExistsAndIsActive(PersistableBusinessObject bo, String referenceName, String activeIndicatorAttributeName, boolean activeIndicatorReversed, boolean activeIndicatorSet, String attributeToHighlightOnFail, String displayFieldName) This method intelligently tests the designated reference on the bo for both existence and active status, where appropriate.
It will not test anything if the foreign-key fields for the given reference arent filled out with values, and it will not
test active status if the reference doesnt exist.
Note that it will not fail or raise any error if all of the foreign-keys are filled with a value. | public boolean | validateReferenceIsActive(PersistableBusinessObject bo, ReferenceDefinition reference) This method retrieves the reference from the DB, and then tests whether the object is active. | public boolean | validateReferenceIsActive(PersistableBusinessObject bo, String referenceName, String activeIndicatorAttributeName, boolean activeIndicatorReversed) This method retrieves the reference from the DB, and then tests whether the object is active. |
isBusinessObjectValid | public boolean isBusinessObjectValid(PersistableBusinessObject businessObject, String prefix)(Code) | | Encapsulates
DictionaryValidationService.validateBusinessObject(BusinessObject) and returns boolean so one doesn't need to check the ErrorMap.Validates the business object primitive attributes against the data dictionary. Adds errors to the map as they areencountered.
Makes no error path adjustments Parameters: businessObject - - business object to validate Parameters: prefix - - error prefix boolean valid or not |
validateApcRule | public boolean validateApcRule(PersistableBusinessObject bo, ApcRuleDefinition apcRule)(Code) | | This method applies a specific rule against the given BusinessObject as defined in the MaintenanceDocument.xml file.
Appropriate errors will also be placed in the GlobalVariables.ErrorMap.
This method assumes that you already have the errorPath set exactly as desired, and adds new errors to the errorMap with no
prefix, other than what has already been pushed onto the errorMap.
Parameters: bo - Parameters: apcRule - true if rule passes |
validateApcRules | public boolean validateApcRules(PersistableBusinessObject bo)(Code) | | This method applies all rules against the given BusinessObject as defined in the MaintenanceDocument.xml file.
Appropriate errors will also be placed in the GlobalVariables.ErrorMap.
This method assumes that you already have the errorPath set exactly as desired, and adds new errors to the errorMap with no
prefix, other than what has already been pushed onto the errorMap.
Parameters: bo - true if rule passes |
validateAttributeFormat | public void validateAttributeFormat(String entryName, String attributeName, String attributeValue, String errorKey)(Code) | | Validates an attribute of a given class for proper min, max length, syntax, and required.
Parameters: entryName - - name of the dd entry Parameters: attributeName - - name of attribute in the bo class Parameters: attributeValue - - current value to validate Parameters: errorKey - - key to place to errors under |
validateAttributeRequired | public void validateAttributeRequired(String entryName, String attributeName, Object attributeValue, Boolean forMaintenance, String errorKey)(Code) | | Validates an attribute of a given class for required check.
Parameters: entryName - - name of the dd entry Parameters: attributeName - - name of attribute in the bo class Parameters: attributeValue - - current value to validate Parameters: errorKey - - key to place to errors under |
validateBusinessObject | public void validateBusinessObject(PersistableBusinessObject businessObject)(Code) | | Validates the business object primitive attributes against the data dictionary. Adds errors to the map as they are
encountered.
Parameters: businessObject - - business object to validate |
validateBusinessObject | public void validateBusinessObject(PersistableBusinessObject businessObject, boolean validateRequired)(Code) | | Validates the business object primitive attributes against the data dictionary. Adds errors to the map as they are
encountered.
Parameters: businessObject - - business object to validate Parameters: validateRequired - - whether to execute required field checks |
validateBusinessObjectsRecursively | public void validateBusinessObjectsRecursively(PersistableBusinessObject businessObject, int depth)(Code) | | Validates the business object against the dictionary, uses reflection to get any child business objects, and recursively
calls back. Adds errors to the map as they are encountered.
Parameters: businessObject - - business object to validate Parameters: depth - - Specify how deep the recrusion should go (0 based). If a negative number is supplied, it's infinite. |
validateDefaultExistenceChecks | public boolean validateDefaultExistenceChecks(PersistableBusinessObject bo)(Code) | | This method does an existence check against all references of a BusinessObject as defined in the MaintenanceDocument.xml file
for that business object.
Appropriate errors will also be placed in the GlobalVariables.ErrorMap.
This method assumes that you already have the errorPath set exactly as desired, and adds new errors to the errorMap with no
prefix, other than what has already been pushed onto the errorMap.
Parameters: bo - - BusinessObject instance that should be tested true if all passed existence tests, false if any failed |
validateDocument | public void validateDocument(Document document)(Code) | | Validates the contents of a document (i.e. attributes within a document) against the data dictionary.
Parameters: document - - document to validate |
validateDocumentAndUpdatableReferencesRecursively | public void validateDocumentAndUpdatableReferencesRecursively(Document document, int maxDepth, boolean validateRequired)(Code) | | Validates the contents of a document and recursively validates any of its updatable references
Parameters: document - the document Parameters: maxDepth - the maximum numbers of levels to recurse Parameters: validateRequired - whether to validate whether a field is required and is currently blank |
validateDocumentAttribute | public void validateDocumentAttribute(Document document, String attributeName, String errorPrefix)(Code) | | Validates the specified attribute of the given document against the data dictionary.
Parameters: document - Parameters: attributeName - Parameters: errorPrefix - |
validateReferenceExists | public boolean validateReferenceExists(PersistableBusinessObject bo, ReferenceDefinition reference)(Code) | | This method examines the populated BusinessObject bo instance passed in for a member named by the referenceName. If this
member exists, and if this member is a descendent of BusinessObject, then an existence check proceeds.
First the foreign keys for this reference are gathered, and then examined to see if they have values. If they do not have
values, the method ends with a true return value. If they all have values, then an object with those primary keys is retrieve
from the database. If one is retrieve, then the reference exists, and True is returned. Otherwise, false is returned.
This method assumes that you already have the errorPath set exactly as desired, and adds new errors to the errorMap with no
prefix, other than what has already been pushed onto the errorMap.
Parameters: bo - - The bo whose reference is being tested. Parameters: reference - - The ReferenceDefinition to be existence tested. True if no exceptions occur and the object exists in the db, false otherwise. |
validateReferenceExists | public boolean validateReferenceExists(PersistableBusinessObject bo, String referenceName)(Code) | | This method examines the populated BusinessObject bo instance passed in for a member named by the referenceName. If this
member exists, and if this member is a descendent of BusinessObject, then an existence check proceeds.
First the foreign keys for this reference are gathered, and then examined to see if they have values. If they do not have
values, the method ends with a true return value. If they all have values, then an object with those primary keys is retrieve
from the database. If one is retrieve, then the reference exists, and True is returned. Otherwise, false is returned.
This method assumes that you already have the errorPath set exactly as desired, and adds new errors to the errorMap with no
prefix, other than what has already been pushed onto the errorMap.
Parameters: bo - - The bo whose reference is being tested. Parameters: referenceName - - The name of the member to be existence tested. True if no exceptions occur and the object exists in the db, false otherwise. |
validateReferenceExistsAndIsActive | public boolean validateReferenceExistsAndIsActive(PersistableBusinessObject bo, ReferenceDefinition reference)(Code) | | This method intelligently tests the designated reference on the bo for both existence and active status, where appropriate.
It will not test anything if the foreign-key fields for the given reference arent filled out with values, and it will not
test active status if the reference doesnt exist.
Further, it will only test active status where the correct flag is set.
On failures of either sort, it will put the relevant errors into the GlobalVariables errorMap, and return a false. If there
are no failures, or nothing can be tested because the foreign-key fields arent fully filled out, it will return true and add
no errors.
This method assumes that you already have the errorPath set exactly as desired, and adds new errors to the errorMap with no
prefix, other than what has already been pushed onto the errorMap.
Parameters: bo - - the BusinessObject instance to be tested. Parameters: reference - - the ReferenceDefinition to control the nature of the testing. true or false as per the criteria above |
validateReferenceExistsAndIsActive | public boolean validateReferenceExistsAndIsActive(PersistableBusinessObject bo, String referenceName, String activeIndicatorAttributeName, boolean activeIndicatorReversed, boolean activeIndicatorSet, String attributeToHighlightOnFail, String displayFieldName)(Code) | | This method intelligently tests the designated reference on the bo for both existence and active status, where appropriate.
It will not test anything if the foreign-key fields for the given reference arent filled out with values, and it will not
test active status if the reference doesnt exist.
Note that it will not fail or raise any error if all of the foreign-keys are filled with a value. If this needs to be tested
(ie, the 'if any field is filled, then all must be filled' rule), you'll have to do that separately.
Further, it will only test active status where the correct flag is set.
On failures of either sort, it will put the relevant errors into the GlobalVariables errorMap, and return a false. If there
are no failures, or nothing can be tested because the foreign-key fields arent fully filled out, it will return true and add
no errors.
This method assumes that you already have the errorPath set exactly as desired, and adds new errors to the errorMap with no
prefix, other than what has already been pushed onto the errorMap.
Parameters: bo - - the BusinessObject instance to be tested. Parameters: referenceName - - the member name on the bo to be tested for existence and active-state Parameters: activeIndicatorAttributeName - - the name on the class of the referenceName member to indicate active status Parameters: activeIndicatorReversed - - a flag to indicate if the flag means closed or inactive, rather than active Parameters: activeIndicatorSet - - a flag to control whether active state testing happens at all Parameters: attributeToHighlightOnFail - - the fieldName to highlight with the error message on a failure Parameters: displayFieldName - - the human-readable display name of the failed field, to go in the error message true or false as per the criteria above |
validateReferenceIsActive | public boolean validateReferenceIsActive(PersistableBusinessObject bo, ReferenceDefinition reference)(Code) | | This method retrieves the reference from the DB, and then tests whether the object is active.
It will return false if there is no activeIndicator field on this object, if the object doesnt exist in the DB, if the field
doesnt exist or cannot be cast as a boolean, if the field value is null, or if the field value is false.
It will only return true if the reference bo is present, the field is present, it is a boolean and non-null, and the value is
true.
This method assumes that you already have the errorPath set exactly as desired, and adds new errors to the errorMap with no
prefix, other than what has already been pushed onto the errorMap.
Parameters: bo - Parameters: reference - |
validateReferenceIsActive | public boolean validateReferenceIsActive(PersistableBusinessObject bo, String referenceName, String activeIndicatorAttributeName, boolean activeIndicatorReversed)(Code) | | This method retrieves the reference from the DB, and then tests whether the object is active.
It will return false if there is no activeIndicator field on this object, if the object doesnt exist in the DB, if the field
doesnt exist or cannot be cast as a boolean, if the field value is null, or if the field value is false.
It will only return true if the reference bo is present, the field is present, it is a boolean and non-null, and the value is
true.
This method assumes that you already have the errorPath set exactly as desired, and adds new errors to the errorMap with no
prefix, other than what has already been pushed onto the errorMap.
Parameters: bo - Parameters: referenceName - Parameters: activeIndicatorAttributeName - Parameters: activeIndicatorReversed - |
|
|