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.sys.OLEConstants;
19 import org.kuali.rice.core.api.util.ConcreteKeyValue;
20 import org.kuali.rice.kew.doctype.ApplicationDocumentStatus;
21 import org.kuali.rice.kew.doctype.bo.DocumentType;
22 import org.kuali.rice.kew.service.KEWServiceLocator;
23 import org.kuali.rice.krad.keyvalues.KeyValuesBase;
24
25 import java.util.ArrayList;
26 import java.util.List;
27
28 public class OlePurchaseOrderStatusFinder extends KeyValuesBase {
29 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(OlePurchaseOrderStatusFinder.class);
30
31 @Override
32 public List getKeyValues() {
33 LOG.debug("Inside getKeyValues of OlePurchaseOrderStatusFinder");
34 DocumentType documentType = KEWServiceLocator.getDocumentTypeService().findByNameCaseInsensitive(
35 OLEConstants.FinancialDocumentTypeCodes.PURCHASE_ORDER);
36 List<ApplicationDocumentStatus> applicationDocumentStatus = documentType.getValidApplicationStatuses();
37 List labels = new ArrayList();
38 labels.add(new ConcreteKeyValue("", ""));
39 for (ApplicationDocumentStatus status : applicationDocumentStatus) {
40 labels.add(new ConcreteKeyValue(status.getStatusName(), status.getStatusName()));
41 }
42 return labels;
43 }
44
45 }