1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.module.purap.document.validation.impl;
17
18 import org.kuali.ole.module.purap.businessobject.PurApItem;
19 import org.kuali.ole.sys.context.SpringContext;
20 import org.kuali.ole.sys.document.validation.GenericValidation;
21 import org.kuali.ole.sys.document.validation.event.AttributedDocumentEvent;
22 import org.kuali.rice.coreservice.framework.parameter.ParameterService;
23 import org.kuali.rice.kew.api.doctype.DocumentTypeService;
24 import org.kuali.rice.kns.service.DataDictionaryService;
25
26 public class PurchasingAccountsPayableNewIndividualItemValidation extends GenericValidation {
27
28 private DataDictionaryService dataDictionaryService;
29 private ParameterService parameterService;
30 private PurApItem itemForValidation;
31 private PurchasingAccountsPayableBelowTheLineValuesValidation belowTheLineValuesValidation;
32
33 public boolean validate(AttributedDocumentEvent event) {
34 boolean valid = true;
35 if (itemForValidation.getItemType().isAdditionalChargeIndicator()) {
36 belowTheLineValuesValidation.setItemForValidation(itemForValidation);
37 valid &= belowTheLineValuesValidation.validate(event);
38 }
39 return valid;
40 }
41
42 protected String getDocumentTypeLabel(String documentTypeName) {
43 return SpringContext.getBean(DocumentTypeService.class).getDocumentTypeByName(documentTypeName).getLabel();
44 }
45
46 public ParameterService getParameterService() {
47 return parameterService;
48 }
49
50 public void setParameterService(ParameterService parameterService) {
51 this.parameterService = parameterService;
52 }
53
54 public PurApItem getItemForValidation() {
55 return itemForValidation;
56 }
57
58 public void setItemForValidation(PurApItem itemForValidation) {
59 this.itemForValidation = itemForValidation;
60 }
61
62 public DataDictionaryService getDataDictionaryService() {
63 return dataDictionaryService;
64 }
65
66 public void setDataDictionaryService(DataDictionaryService dataDictionaryService) {
67 this.dataDictionaryService = dataDictionaryService;
68 }
69
70 public PurchasingAccountsPayableBelowTheLineValuesValidation getBelowTheLineValuesValidation() {
71 return belowTheLineValuesValidation;
72 }
73
74 public void setBelowTheLineValuesValidation(PurchasingAccountsPayableBelowTheLineValuesValidation belowTheLineValuesValidation) {
75 this.belowTheLineValuesValidation = belowTheLineValuesValidation;
76 }
77
78
79 }