1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.select.keyvalue;
17
18 import org.kuali.ole.select.bo.OleLicenseRequestLocation;
19 import org.kuali.rice.core.api.util.ConcreteKeyValue;
20 import org.kuali.rice.core.api.util.KeyValue;
21 import org.kuali.rice.krad.keyvalues.KeyValuesBase;
22 import org.kuali.rice.krad.service.KRADServiceLocator;
23
24 import java.util.ArrayList;
25 import java.util.Collection;
26 import java.util.List;
27
28
29
30
31 public class OleLicenseRequestLocationKeyValues extends KeyValuesBase {
32
33 private boolean blankOption;
34
35
36
37
38
39
40 public boolean isBlankOption() {
41 return this.blankOption;
42 }
43
44
45
46
47
48
49 public void setBlankOption(boolean blankOption) {
50 this.blankOption = blankOption;
51 }
52
53
54
55
56
57
58 @Override
59 public List getKeyValues() {
60 List<KeyValue> keyValues = new ArrayList<KeyValue>();
61 Collection<OleLicenseRequestLocation> licenseRequestCodes = KRADServiceLocator.getBusinessObjectService().findAll(OleLicenseRequestLocation.class);
62 keyValues.add(new ConcreteKeyValue("", ""));
63 for (OleLicenseRequestLocation licenseRequestCode : licenseRequestCodes) {
64 if (licenseRequestCode.isActive()) {
65 keyValues.add(new ConcreteKeyValue(licenseRequestCode.getId(), licenseRequestCode.getName()));
66 }
67 }
68 return keyValues;
69 }
70
71 }