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.service.OleUrlResolver;
19 import org.kuali.ole.service.impl.OleLocationWebServiceImpl;
20 import org.kuali.rice.core.api.config.property.ConfigContext;
21 import org.kuali.rice.core.api.util.ConcreteKeyValue;
22 import org.kuali.rice.krad.keyvalues.KeyValuesBase;
23
24 import java.util.ArrayList;
25 import java.util.Iterator;
26 import java.util.List;
27
28 public class OleLocationKeyValueFinder extends KeyValuesBase {
29
30 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
31 .getLogger(OleLocationKeyValueFinder.class);
32 private transient OleUrlResolver oleUrlResolver;
33
34
35
36
37
38
39 @Override
40 public List getKeyValues() {
41 LOG.debug("Inside getKeyValues of OleLocationKeyValueFinder");
42 OleLocationWebServiceImpl oleLocationWebService = new OleLocationWebServiceImpl();
43 List labels = new ArrayList();
44 List locations = oleLocationWebService.getItemLocation();
45 for (Iterator iter = locations.iterator(); iter.hasNext(); ) {
46 String location = (String) iter.next();
47 labels.add(new ConcreteKeyValue(location, location));
48 }
49 return labels;
50 }
51
52
53
54
55
56
57 public String getLocationURL() {
58 return ConfigContext.getCurrentContextConfig().getProperty("location.web.service.url");
59 }
60
61 }