1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.sys.businessobject.options;
17
18 import java.util.ArrayList;
19 import java.util.Collections;
20 import java.util.Iterator;
21 import java.util.List;
22
23 import org.kuali.ole.sys.businessobject.SystemOptions;
24 import org.kuali.ole.sys.context.SpringContext;
25 import org.kuali.rice.core.api.util.ConcreteKeyValue;
26 import org.kuali.rice.krad.keyvalues.KeyValuesBase;
27 import org.kuali.rice.krad.service.KeyValuesService;
28
29
30
31
32 public class FiscalYearValuesFinder extends KeyValuesBase {
33
34
35
36
37 public List getKeyValues() {
38
39 KeyValuesService boService = SpringContext.getBean(KeyValuesService.class);
40 FiscalYearComparator fiscalYearComparator = new FiscalYearComparator();
41 List optionList = (List) boService.findAll(SystemOptions.class);
42
43 if ( optionList == null ) {
44 optionList = new ArrayList(0);
45 } else {
46 optionList = new ArrayList( optionList );
47 }
48 Collections.sort(optionList, fiscalYearComparator);
49 List labels = new ArrayList();
50 labels.add(new ConcreteKeyValue("", ""));
51 for (Iterator iter = optionList.iterator(); iter.hasNext();) {
52 SystemOptions options = (SystemOptions) iter.next();
53 labels.add(new ConcreteKeyValue(options.getUniversityFiscalYear().toString(), options.getUniversityFiscalYear().toString()));
54 }
55
56 return labels;
57 }
58
59 }