View Javadoc
1   package org.kuali.ole.select.keyvalue;
2   
3   import org.kuali.ole.select.bo.OLEPackageScope;
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: srinivasane
16   * Date: 6/26/13
17   * Time: 3:22 PM
18   * To change this template use File | Settings | File Templates.
19   */
20  public class OLEPackageScopeKeyValues extends KeyValuesBase {
21  
22      @Override
23      public List getKeyValues() {
24          List<KeyValue> keyValues = new ArrayList<KeyValue>();
25          Collection<OLEPackageScope> olePackageScopes = KRADServiceLocator.getBusinessObjectService().findAll(OLEPackageScope.class);
26          for (OLEPackageScope olePackageScope : olePackageScopes) {
27              if (olePackageScope.isActive()) {
28                  keyValues.add(new ConcreteKeyValue(olePackageScope.getOlePackageScopeId(), olePackageScope.getOlePackageScopeName()));
29              }
30          }
31          return keyValues;
32      }
33  }