1 package org.kuali.ole.select.keyvalue;
2
3 import org.kuali.ole.OLEConstants;
4 import org.kuali.ole.batch.bo.OLEBatchProcessProfileBo;
5 import org.kuali.rice.core.api.util.ConcreteKeyValue;
6 import org.kuali.rice.core.api.util.KeyValue;
7 import org.kuali.rice.krad.keyvalues.KeyValuesBase;
8 import org.kuali.rice.krad.service.KRADServiceLocator;
9 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
10
11 import java.util.ArrayList;
12 import java.util.HashMap;
13 import java.util.List;
14 import java.util.Map;
15
16
17
18
19 public class OLEGOKbProfileKeyValueFinder extends KeyValuesBase {
20
21 @Override
22 public List<KeyValue> getKeyValues() {
23
24
25 List<KeyValue> options = new ArrayList<KeyValue>();
26
27 Map map = new HashMap();
28 map.put("batchProcessProfileType", OLEConstants.OLEBatchProcess.GOKB_IMPORT);
29
30 List<OLEBatchProcessProfileBo> oleBatchProcessProfileBos = (List<OLEBatchProcessProfileBo>) KRADServiceLocator.getBusinessObjectService().findMatching(OLEBatchProcessProfileBo.class, map);
31
32 for (OLEBatchProcessProfileBo oleBatchProcessProfileBo : oleBatchProcessProfileBos) {
33 options.add(new ConcreteKeyValue(String.valueOf(oleBatchProcessProfileBo.getBatchProcessProfileId()), oleBatchProcessProfileBo.getBatchProcessProfileName()));
34 }
35
36
37 return options;
38 }
39 }