View Javadoc
1   package org.kuali.ole.deliver.keyvalue;
2   
3   import org.kuali.ole.deliver.bo.CopyFormat;
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.*;
10  
11  /**
12   * Created with IntelliJ IDEA.
13   * User: anithaa
14   * Date: 2/12/14
15   * Time: 4:28 PM
16   * To change this template use File | Settings | File Templates.
17   */
18  public class CopyFormatKeyValueFinder extends KeyValuesBase {
19      @Override
20      public List getKeyValues() {
21          List<KeyValue> keyValues = new ArrayList<KeyValue>();
22          Collection<CopyFormat> copyFormats = KRADServiceLocator.getBusinessObjectService().findAll(CopyFormat.class);
23          keyValues.add(new ConcreteKeyValue(" ", " "));
24          for (CopyFormat copyFormat : copyFormats) {
25              if (copyFormat.isActive()) {
26                  keyValues.add(new ConcreteKeyValue(copyFormat.getCopyFormatId(), copyFormat.getName()));
27              }
28          }
29          return keyValues;
30      }
31  }