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.purap.lookup.keyvalues;
17:
18: import java.util.ArrayList;
19: import java.util.List;
20:
21: import org.kuali.core.lookup.keyvalues.KeyValuesBase;
22: import org.kuali.core.web.ui.KeyLabelPair;
23: import org.kuali.kfs.KFSConstants;
24: import org.kuali.kfs.context.SpringContext;
25: import org.kuali.module.purap.bo.PurchaseOrderQuoteStatus;
26: import org.kuali.module.purap.service.PurchaseOrderService;
27:
28: /**
29: * Value Finder for Purchase Order Vendor Quote Statuses.
30: *
31: * THIS CODE IS NOT USED IN RELEASE 2 BUT THE CODE WAS LEFT IN TO
32: * FACILITATE TURNING IT BACK ON EARLY IN THE DEVELOPMENT CYCLE OF RELEASE 3.
33: *
34: */
35: public class PurchaseOrderVendorQuoteStatusCodeValuesFinder extends
36: KeyValuesBase {
37:
38: /**
39: * Returns code/description pairs of all Purchase Order Vendor Quote Statuses.
40: *
41: * @see org.kuali.core.lookup.keyvalues.KeyValuesFinder#getKeyValues()
42: */
43: public List getKeyValues() {
44: List keyValues = new ArrayList();
45: keyValues.add(new KeyLabelPair(KFSConstants.EMPTY_STRING,
46: KFSConstants.EMPTY_STRING));
47: ArrayList<PurchaseOrderQuoteStatus> poQuoteStatuses = SpringContext
48: .getBean(PurchaseOrderService.class)
49: .getPurchaseOrderQuoteStatusCodes();
50: for (PurchaseOrderQuoteStatus status : poQuoteStatuses) {
51: keyValues.add(new KeyLabelPair(status
52: .getPurchaseOrderQuoteStatusCode(), status
53: .getPurchaseOrderQuoteStatusDescription()));
54: }
55: return keyValues;
56: }
57: }
|