View Javadoc
1   package org.kuali.ole.describe.keyvalue;
2   
3   import org.kuali.ole.describe.bo.ImportBibUserPreferences;
4   import org.kuali.rice.core.api.util.ConcreteKeyValue;
5   import org.kuali.rice.core.api.util.KeyValue;
6   import org.kuali.rice.krad.service.KRADServiceLocator;
7   import org.kuali.rice.krad.uif.control.UifKeyValuesFinderBase;
8   import org.kuali.rice.krad.uif.view.ViewModel;
9   
10  import java.util.ArrayList;
11  import java.util.Collection;
12  import java.util.List;
13  
14  /**
15   * Created with IntelliJ IDEA.
16   * User: PJ7789
17   * Date: 30/11/12
18   * Time: 5:12 PM
19   * To change this template use File | Settings | File Templates.
20   */
21  public class ImportBibKeyValueFinder
22          extends UifKeyValuesFinderBase {
23      @Override
24      public List<KeyValue> getKeyValues(ViewModel viewModel) {
25          List<KeyValue> options = new ArrayList<KeyValue>();
26          Collection<ImportBibUserPreferences> importBibUserPreferences = KRADServiceLocator.getBusinessObjectService()
27                  .findAll(
28                          ImportBibUserPreferences.class);
29          for (ImportBibUserPreferences userPref : importBibUserPreferences) {
30              options.add(new ConcreteKeyValue(String.valueOf(userPref.getPrefId()), userPref.getPrefName()));
31          }
32          return options;
33      }
34  }