1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.vnd.businessobject.options;
17
18 import java.util.ArrayList;
19 import java.util.Collection;
20 import java.util.HashMap;
21 import java.util.Iterator;
22 import java.util.List;
23 import java.util.Map;
24
25 import org.kuali.ole.sys.context.SpringContext;
26 import org.kuali.ole.vnd.businessobject.ContractManager;
27 import org.kuali.rice.core.api.util.ConcreteKeyValue;
28 import org.kuali.rice.krad.keyvalues.KeyValuesBase;
29 import org.kuali.rice.krad.service.KeyValuesService;
30 import org.kuali.rice.krad.util.KRADPropertyConstants;
31
32
33
34
35
36
37 public class ContractManagerValuesFinder extends KeyValuesBase {
38
39
40
41
42 public List getKeyValues() {
43
44 KeyValuesService boService = SpringContext.getBean(KeyValuesService.class);
45 Map fieldValues = new HashMap();
46 fieldValues.put(KRADPropertyConstants.ACTIVE, true);
47 Collection codes = boService.findMatching(ContractManager.class, fieldValues);
48 List labels = new ArrayList();
49 labels.add(new ConcreteKeyValue("", ""));
50 for (Iterator iter = codes.iterator(); iter.hasNext();) {
51 ContractManager ContractManager = (ContractManager) iter.next();
52 labels.add(new ConcreteKeyValue(ContractManager.getContractManagerCode().toString(), ContractManager.getContractManagerName()));
53 }
54
55 return labels;
56 }
57
58 }