1 package org.kuali.ole.deliver.keyvalue;
2
3 import org.kuali.ole.deliver.bo.CopyFormat;
4 import org.kuali.rice.core.api.criteria.QueryByCriteria;
5 import org.kuali.rice.core.api.util.ConcreteKeyValue;
6 import org.kuali.rice.core.api.util.KeyValue;
7 import org.kuali.rice.kns.service.KNSServiceLocator;
8 import org.kuali.rice.krad.keyvalues.KeyValuesBase;
9 import org.kuali.rice.krad.service.KRADServiceLocator;
10
11 import java.util.*;
12
13
14
15
16
17
18
19
20 public class CopyFormatKeyValueFinder extends KeyValuesBase {
21 @Override
22 public List getKeyValues() {
23 List<KeyValue> keyValues = new ArrayList<KeyValue>();
24
25 Collection<CopyFormat> copyFormats = (Collection<CopyFormat>) KRADServiceLocator.getDataObjectService().findMatching(CopyFormat.class, QueryByCriteria.Builder.create().build()).getResults();
26 keyValues.add(new ConcreteKeyValue(" ", " "));
27 for (CopyFormat copyFormat : copyFormats) {
28 if (copyFormat.isActive()) {
29 keyValues.add(new ConcreteKeyValue(copyFormat.getCopyFormatId(), copyFormat.getName()));
30 }
31 }
32 return keyValues;
33 }
34 }