001package org.kuali.ole.describe.keyvalue; 002 003import org.kuali.ole.describe.bo.OleSeperateOrCompositeReport; 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 * SeparateOrCompositeReport used to render the values for SeparateOrCompositeReport dropdown control. 015 */ 016public class SeparateOrCompositeReport extends KeyValuesBase { 017 /** 018 * This method returns the List of ConcreteKeyValue, 019 * ConcreteKeyValue has two arguments seperateOrCompositeReportCode and 020 * seperateOrCompositeReportName. 021 * 022 * @return List<KeyValue> 023 */ 024 @Override 025 public List<KeyValue> getKeyValues() { 026 List<KeyValue> options = new ArrayList<KeyValue>(); 027 Collection<OleSeperateOrCompositeReport> oleSeperateOrCompositeReports = KRADServiceLocator.getBusinessObjectService().findAll(OleSeperateOrCompositeReport.class); 028 options.add(new ConcreteKeyValue("", "")); 029 for (OleSeperateOrCompositeReport type : oleSeperateOrCompositeReports) { 030 options.add(new ConcreteKeyValue(type.getSeperateOrCompositeReportCode(), type.getSeperateOrCompositeReportName())); 031 } 032 return options; 033 } 034}