1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.r2.common.datadictionary;
17
18 import java.util.List;
19 import org.kuali.rice.krad.service.DictionaryValidationService;
20 import org.kuali.rice.krad.datadictionary.validation.result.DictionaryValidationResult;
21 import org.kuali.student.r2.common.datadictionary.DataDictionaryValidator.ValidationType;
22 import org.kuali.student.r2.common.dto.ContextInfo;
23 import org.kuali.student.r2.common.dto.ValidationResultInfo;
24 import org.kuali.student.r2.common.exceptions.InvalidParameterException;
25 import org.kuali.student.r2.common.exceptions.MissingParameterException;
26 import org.kuali.student.r2.common.exceptions.OperationFailedException;
27 import org.kuali.student.r2.common.exceptions.PermissionDeniedException;
28
29
30
31
32
33
34
35
36
37 public class RiceDataDictionaryValidatorImplDoesNotWorkButShould implements DataDictionaryValidator {
38
39 private DictionaryValidationService riceService;
40
41 public RiceDataDictionaryValidatorImplDoesNotWorkButShould() {
42 }
43
44
45 public RiceDataDictionaryValidatorImplDoesNotWorkButShould(DictionaryValidationService riceService) {
46 this.riceService = riceService;
47 }
48
49 public DictionaryValidationService getRiceService() {
50 return riceService;
51 }
52
53 public void setRiceService(DictionaryValidationService riceService) {
54 this.riceService = riceService;
55 }
56
57 @Override
58 public List<ValidationResultInfo> validate(ValidationType validationType, Object info, ContextInfo context)
59 throws OperationFailedException, MissingParameterException, InvalidParameterException, PermissionDeniedException {
60 boolean doOptionalProcessing = true;
61
62
63 if (validationType.equals(DataDictionaryValidator.ValidationType.SKIP_REQUREDNESS_VALIDATIONS)) {
64 doOptionalProcessing = false;
65 }
66 DictionaryValidationResult dvr = riceService.validate(info);
67 Rice2ValidationResultConverter converter = new Rice2ValidationResultConverter ();
68 List<ValidationResultInfo> vrs = converter.convert(dvr);
69 return vrs;
70 }
71 }