1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.datadictionary; |
17 | |
|
18 | |
import java.util.List; |
19 | |
import org.kuali.rice.kns.datadictionary.validation.result.DictionaryValidationResult; |
20 | |
import org.kuali.rice.kns.service.DictionaryValidationService; |
21 | |
import org.kuali.student.datadictionary.DataDictionaryValidatorInfc.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 DataDictionaryValidatorInfc { |
38 | |
|
39 | |
private DictionaryValidationService riceService; |
40 | |
|
41 | 0 | public RiceDataDictionaryValidatorImplDoesNotWorkButShould() { |
42 | 0 | } |
43 | |
|
44 | |
|
45 | 0 | public RiceDataDictionaryValidatorImplDoesNotWorkButShould(DictionaryValidationService riceService) { |
46 | 0 | this.riceService = riceService; |
47 | 0 | } |
48 | |
|
49 | |
public DictionaryValidationService getRiceService() { |
50 | 0 | return riceService; |
51 | |
} |
52 | |
|
53 | |
public void setRiceService(DictionaryValidationService riceService) { |
54 | 0 | this.riceService = riceService; |
55 | 0 | } |
56 | |
|
57 | |
@Override |
58 | |
public List<ValidationResultInfo> validate(ValidationType validationType, Object info, ContextInfo context) |
59 | |
throws OperationFailedException, MissingParameterException, InvalidParameterException, PermissionDeniedException { |
60 | 0 | boolean doOptionalProcessing = true; |
61 | |
|
62 | |
|
63 | 0 | if (validationType.equals(DataDictionaryValidatorInfc.ValidationType.SKIP_REQUREDNESS_VALIDATIONS)) { |
64 | 0 | doOptionalProcessing = false; |
65 | |
} |
66 | 0 | DictionaryValidationResult dvr = riceService.validate(info, doOptionalProcessing); |
67 | 0 | Rice2ValidationResultConverter converter = new Rice2ValidationResultConverter (); |
68 | 0 | List<ValidationResultInfo> vrs = converter.convert(dvr); |
69 | 0 | return vrs; |
70 | |
} |
71 | |
} |