Search in sources :

Example 1 with RemotableAttributeError

use of org.kuali.rice.core.api.uif.RemotableAttributeError in project cu-kfs by CU-CommunityApps.

the class FinancialSystemSearchableAttribute method validateDocumentAttributeCriteria.

@Override
public List<RemotableAttributeError> validateDocumentAttributeCriteria(ExtensionDefinition extensionDefinition, DocumentSearchCriteria documentSearchCriteria) {
    if (LOG.isDebugEnabled()) {
        LOG.debug("validateDocumentAttributeCriteria( " + extensionDefinition + ", " + documentSearchCriteria + " )");
    }
    // this list is irrelevant. the validation errors are put on the stack in the validationService.
    List<RemotableAttributeError> errors = super.validateDocumentAttributeCriteria(extensionDefinition, documentSearchCriteria);
    DictionaryValidationService validationService = SpringContext.getBean(DictionaryValidationService.class);
    Map<String, List<String>> paramMap = documentSearchCriteria.getDocumentAttributeValues();
    for (String key : paramMap.keySet()) {
        List<String> values = paramMap.get(key);
        if (values != null && !values.isEmpty()) {
            for (String value : values) {
                if (!StringUtils.isEmpty(value)) {
                    if (magicFields.containsKey(key)) {
                        validationService.validateAttributeFormat(magicFields.get(key), key, value, key);
                    }
                }
            }
        }
    }
    retrieveValidationErrorsFromGlobalVariables(errors);
    return errors;
}
Also used : DictionaryValidationService(org.kuali.kfs.kns.service.DictionaryValidationService) RemotableAttributeError(org.kuali.rice.core.api.uif.RemotableAttributeError) List(java.util.List) ArrayList(java.util.ArrayList) DocumentAttributeString(org.kuali.rice.kew.api.document.attribute.DocumentAttributeString)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 DictionaryValidationService (org.kuali.kfs.kns.service.DictionaryValidationService)1 RemotableAttributeError (org.kuali.rice.core.api.uif.RemotableAttributeError)1 DocumentAttributeString (org.kuali.rice.kew.api.document.attribute.DocumentAttributeString)1