001package org.kuali.ole.select.keyvalue; 002 003import org.kuali.ole.select.bo.OLERequestPriority; 004import org.kuali.rice.core.api.util.ConcreteKeyValue; 005import org.kuali.rice.core.api.util.KeyValue; 006import org.kuali.rice.krad.keyvalues.KeyValuesBase; 007import org.kuali.rice.krad.service.KRADServiceLocator; 008 009import java.util.ArrayList; 010import java.util.Collection; 011import java.util.List; 012 013/** 014 * Created with IntelliJ IDEA. 015 * User: srinivasane 016 * Date: 6/26/13 017 * Time: 3:22 PM 018 * To change this template use File | Settings | File Templates. 019 */ 020public class OLERequestPriorityKeyValues extends KeyValuesBase { 021 022 @Override 023 public List getKeyValues() { 024 List<KeyValue> keyValues = new ArrayList<KeyValue>(); 025 Collection<OLERequestPriority> oleRequestPriorities = KRADServiceLocator.getBusinessObjectService().findAll(OLERequestPriority.class); 026 for (OLERequestPriority oleRequestPriority : oleRequestPriorities) { 027 if (oleRequestPriority.isActive()) { 028 keyValues.add(new ConcreteKeyValue(oleRequestPriority.getOleRequestPriorityId(), oleRequestPriority.getOleRequestPriorityName())); 029 } 030 } 031 return keyValues; 032 } 033}