1 package org.kuali.ole.describe.keyvalue;
2
3 import org.kuali.ole.describe.bo.OleShelvingScheme;
4 import org.kuali.ole.describe.bo.ExternalDataSourceConfig;
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
10
11 import java.util.ArrayList;
12 import java.util.Collection;
13 import java.util.List;
14
15
16
17
18
19
20
21
22 public class ExternalDataSourceKeyValue
23 extends KeyValuesBase {
24
25
26
27
28
29
30
31 @Override
32 public List<KeyValue> getKeyValues() {
33 List<KeyValue> options = new ArrayList<KeyValue>();
34 Collection<ExternalDataSourceConfig> externalDataSourceNames = KRADServiceLocator.getBusinessObjectService()
35 .findAll(
36 ExternalDataSourceConfig.class);
37 options.add(new ConcreteKeyValue("", ""));
38 for (ExternalDataSourceConfig type : externalDataSourceNames) {
39 options.add(new ConcreteKeyValue(type.getId().toString(), type.getName()));
40 }
41 return options;
42 }
43 }