View Javadoc
1   package org.kuali.ole.describe.keyvalue;
2   
3   import org.kuali.ole.describe.bo.OleShelvingScheme;
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   * Created with IntelliJ IDEA.
15   * User: srirams
16   * Date: 7/2/13
17   * Time: 4:07 PM
18   * To change this template use File | Settings | File Templates.
19   */
20  public class ShelvingSchemeSearch extends KeyValuesBase {
21  
22      @Override
23      public List<KeyValue> getKeyValues() {
24          List<KeyValue> options = new ArrayList<KeyValue>();
25          Collection<OleShelvingScheme> oleShelvingSchemes = KRADServiceLocator.getBusinessObjectService().findAll(OleShelvingScheme.class);
26          options.add(new ConcreteKeyValue("", ""));
27          for (OleShelvingScheme type : oleShelvingSchemes) {
28              if (type.isActive()) {
29                  options.add(new ConcreteKeyValue(type.getShelvingSchemeCode(), type.getShelvingSchemeName()));
30              }
31          }
32          return options;
33      }
34  }