1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.select.businessobject.options;
17
18 import org.kuali.ole.select.businessobject.OleReceiptStatus;
19 import org.kuali.ole.sys.OLEConstants;
20 import org.kuali.ole.sys.context.SpringContext;
21 import org.kuali.rice.core.api.util.ConcreteKeyValue;
22 import org.kuali.rice.core.api.util.KeyValue;
23 import org.kuali.rice.krad.keyvalues.KeyValuesBase;
24 import org.kuali.rice.krad.service.KeyValuesService;
25
26 import java.util.*;
27
28 public class OleLineItemReceivingReceiptStatusValuesFinder extends KeyValuesBase {
29
30 @Override
31 public List<KeyValue> getKeyValues() {
32
33 List labels = new ArrayList();
34 Map<String, Object> receiptStatusDocTypMap = new HashMap<String, Object>();
35 receiptStatusDocTypMap.put(OLEConstants.RCPT_STS_DOC_TYP, OLEConstants.RCV_RCPT_STS_DOC_TYP);
36 KeyValuesService boService = SpringContext.getBean(KeyValuesService.class);
37 Collection receiptStatusCollection = boService.findMatching(OleReceiptStatus.class, receiptStatusDocTypMap);
38 labels.add(new ConcreteKeyValue("", ""));
39 for (Iterator iter = receiptStatusCollection.iterator(); iter.hasNext(); ) {
40 OleReceiptStatus oleReceiptStatus = (OleReceiptStatus) iter.next();
41 labels.add(new ConcreteKeyValue(oleReceiptStatus.getReceiptStatusId().toString(), oleReceiptStatus
42 .getReceiptStatus()));
43 }
44 return labels;
45 }
46
47 }