View Javadoc

1   package org.kuali.ole.editor.keyvalue;
2   
3   import org.kuali.ole.catalog.bo.OleSeperateOrCompositeReport;
4   import org.kuali.rice.core.api.util.ConcreteKeyValue;
5   import org.kuali.rice.core.api.util.KeyValue;
6   import org.kuali.rice.krad.keyvalues.KeyValuesBase;
7   import org.kuali.rice.krad.service.KRADServiceLocator;
8   
9   import java.util.ArrayList;
10  import java.util.Collection;
11  import java.util.List;
12  
13  /**
14   * SeparateOrCompositeReport used to render the values for SeparateOrCompositeReport dropdown control.
15   */
16  public class SeparateOrCompositeReport extends KeyValuesBase {
17      /**
18       * This method returns the List of ConcreteKeyValue,
19       * ConcreteKeyValue has two arguments seperateOrCompositeReportCode and
20       * seperateOrCompositeReportName.
21       * @return   List<KeyValue>
22       */
23      @Override
24      public List<KeyValue> getKeyValues() {
25          List<KeyValue> options = new ArrayList<KeyValue>();
26          Collection<OleSeperateOrCompositeReport> oleSeperateOrCompositeReports = KRADServiceLocator.getBusinessObjectService().findAll(OleSeperateOrCompositeReport.class);
27          options.add(new ConcreteKeyValue("", ""));
28          for (OleSeperateOrCompositeReport type : oleSeperateOrCompositeReports) {
29              options.add(new ConcreteKeyValue(type.getSeperateOrCompositeReportCode(), type.getSeperateOrCompositeReportName()));
30          }
31          return options;
32      }
33  }