01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.kuali.module.gl.lookup.keyvalues;
17:
18: import java.util.ArrayList;
19: import java.util.Collection;
20: import java.util.List;
21:
22: import org.kuali.core.lookup.keyvalues.KeyValuesBase;
23: import org.kuali.core.web.ui.KeyLabelPair;
24: import org.kuali.kfs.context.SpringContext;
25: import org.kuali.module.gl.bo.OriginEntryGroup;
26: import org.kuali.module.gl.service.OriginEntryGroupService;
27:
28: /**
29: * This class returns list origin entry groups that can be selected within the GLCP document
30: */
31: public class CorrectionPendingGroupEntriesFinder extends KeyValuesBase {
32:
33: /**
34: * Returns a list of origin entry group ids (as keys) and lengthy descriptions of the origin entry groups including source, date of creation, and count of entries for the display
35: *
36: * @return a List of all the origin entry groups in the database
37: * @see org.kuali.core.lookup.keyvalues.KeyValuesFinder#getKeyValues()
38: */
39: public List getKeyValues() {
40: List activeLabels = new ArrayList();
41:
42: OriginEntryGroupService originEntryGroupService = SpringContext
43: .getBean(OriginEntryGroupService.class);
44:
45: Collection<OriginEntryGroup> groupPendingList = originEntryGroupService
46: .getOriginEntryGroupsPendingProcessing();
47: // Collection groupPendingList = originEntryGroupService.getOriginEntryGroupsPendingProcessing();
48: for (OriginEntryGroup oeg : groupPendingList) {
49:
50: String sourceName = "";
51: if (oeg.getSource() != null) {
52: sourceName = oeg.getSource().getName();
53: }
54:
55: if (oeg.getValid()) {
56: activeLabels.add(new KeyLabelPair(oeg.getId()
57: .toString(), oeg.getSourceCode() + " - "
58: + sourceName + " - " + oeg.getId().toString()
59: + " - " + oeg.getDate().toString()));
60: }
61:
62: }
63:
64: return activeLabels;
65: }
66:
67: }
|