View Javadoc
1   package org.kuali.ole.select.businessobject.options;
2   
3   import org.kuali.ole.sys.context.SpringContext;
4   import org.kuali.ole.vnd.businessobject.PaymentTermType;
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.KeyValuesService;
9   
10  import java.util.ArrayList;
11  import java.util.Collection;
12  import java.util.Iterator;
13  import java.util.List;
14  
15  /**
16   * Created with IntelliJ IDEA.
17   * User: anithaa
18   * Date: 7/25/13
19   * Time: 9:18 PM
20   * To change this template use File | Settings | File Templates.
21   */
22  public class OLEInvoicePaymentTermsValuesFinder extends KeyValuesBase {
23  
24      /*
25       * @see org.kuali.keyvalues.KeyValuesFinder#getKeyValues()
26       */
27      @Override
28      public List<KeyValue> getKeyValues() {
29          KeyValuesService boService = SpringContext.getBean(KeyValuesService.class);
30          Collection codes = boService.findAll(PaymentTermType.class);
31          List labels = new ArrayList();
32          labels.add(new ConcreteKeyValue("", ""));
33          for (Iterator iter = codes.iterator(); iter.hasNext(); ) {
34              PaymentTermType pm = (PaymentTermType) iter.next();
35              labels.add(new ConcreteKeyValue(pm.getVendorPaymentTermsCode().toString(), pm.getVendorPaymentTermsDescription()));
36          }
37  
38          return labels;
39      }
40  
41  }
42  
43  
44