1 package org.kuali.ole.deliver.keyvalue;
2
3 import org.kuali.ole.select.service.impl.OleExposedWebServiceImpl;
4 import org.kuali.ole.sys.context.SpringContext;
5 import org.kuali.rice.core.api.config.property.ConfigContext;
6 import org.kuali.rice.core.api.util.ConcreteKeyValue;
7 import org.kuali.rice.core.api.util.KeyValue;
8 import org.kuali.rice.krad.keyvalues.KeyValuesBase;
9
10 import java.util.ArrayList;
11 import java.util.List;
12
13
14
15
16 public class OlePaymentMethodKeyValue extends KeyValuesBase {
17
18
19
20
21
22 @Override
23 public List getKeyValues() {
24 List<KeyValue> keyValues = new ArrayList<KeyValue>();
25 OleExposedWebServiceImpl oleExposedWebService = (OleExposedWebServiceImpl) SpringContext.getBean("oleExposedWebService");
26
27 String paymentMethod = oleExposedWebService.getPaymentMethod();
28 String methods = paymentMethod.substring(0, paymentMethod.length() - 1);
29 String[] method = methods.split(",");
30 keyValues.add(new ConcreteKeyValue("", ""));
31 for (int i = 0; i < method.length; i++) {
32 keyValues.add(new ConcreteKeyValue(method[i], method[i]));
33 }
34 return keyValues;
35 }
36
37
38
39
40
41
42 public String getURL() {
43 String url = ConfigContext.getCurrentContextConfig().getProperty("oleExposedWebService.url");
44 return url;
45 }
46 }