1 package org.kuali.ole.select.keyvalue;
2
3 import org.kuali.ole.select.bo.OLEMarcUpdateFrequency;
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
15
16 public class OLEMarcUpdateFrequencyKeyValues extends KeyValuesBase {
17
18 @Override
19 public List<KeyValue> getKeyValues() {
20 List<KeyValue> keyValues = new ArrayList<KeyValue>();
21 Collection<OLEMarcUpdateFrequency> oleMarcUpdateFrequencies = KRADServiceLocator.getBusinessObjectService().findAll(OLEMarcUpdateFrequency.class);
22 for (OLEMarcUpdateFrequency oleMarcUpdateFrequency : oleMarcUpdateFrequencies) {
23 if (oleMarcUpdateFrequency.isActive()) {
24 keyValues.add(new ConcreteKeyValue(oleMarcUpdateFrequency.getMarcUpdateFrequencyId(), oleMarcUpdateFrequency.getMarcUpdateFrequencyName()));
25 }
26 }
27 return keyValues;
28 }
29 }