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.labor.web.lookupable;
17:
18: import java.util.Collection;
19: import java.util.Collections;
20: import java.util.List;
21: import java.util.Map;
22:
23: import org.kuali.core.bo.BusinessObject;
24: import org.kuali.core.lookup.AbstractLookupableHelperServiceImpl;
25: import org.kuali.core.lookup.CollectionIncomplete;
26: import org.kuali.core.service.KualiConfigurationService;
27: import org.kuali.core.util.BeanPropertyComparator;
28: import org.kuali.kfs.KFSConstants;
29: import org.kuali.module.gl.service.BalanceService;
30: import org.kuali.module.labor.bo.July1PositionFunding;
31: import org.kuali.module.labor.dao.LaborDao;
32: import org.kuali.module.labor.service.LaborInquiryOptionsService;
33: import org.kuali.module.labor.web.inquirable.July1PositionFundingInquirableImpl;
34: import org.springframework.transaction.annotation.Transactional;
35:
36: /**
37: * The July1PositionFundingLookupableHelperServiceImpl class is the front-end for all July 1 funds balance inquiry processing.
38: */
39: @Transactional
40: public class July1PositionFundingLookupableHelperServiceImpl extends
41: AbstractLookupableHelperServiceImpl {
42: private static org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
43: .getLog(July1PositionFundingLookupableHelperServiceImpl.class);
44:
45: private LaborDao laborDao;
46:
47: /**
48: * @see org.kuali.core.lookup.Lookupable#getInquiryUrl(org.kuali.core.bo.BusinessObject, java.lang.String)
49: */
50: @Override
51: public String getInquiryUrl(BusinessObject bo, String propertyName) {
52: return (new July1PositionFundingInquirableImpl())
53: .getInquiryUrl(bo, propertyName);
54: }
55:
56: /**
57: * @see org.kuali.core.lookup.Lookupable#getSearchResults(java.util.Map)
58: */
59: @Override
60: public List getSearchResults(Map<String, String> fieldValues) {
61: setBackLocation((String) fieldValues
62: .get(KFSConstants.BACK_LOCATION));
63: setDocFormKey((String) fieldValues
64: .get(KFSConstants.DOC_FORM_KEY));
65:
66: Collection<July1PositionFunding> searchResultsCollection = getLaborDao()
67: .getJuly1PositionFunding(fieldValues);
68:
69: // sort list if default sort column given
70: List searchResults = (List) searchResultsCollection;
71: List defaultSortColumns = getDefaultSortColumns();
72: if (defaultSortColumns.size() > 0) {
73: Collections.sort(searchResults, new BeanPropertyComparator(
74: defaultSortColumns, true));
75: }
76:
77: return new CollectionIncomplete(searchResults, new Long(0));
78: }
79:
80: /**
81: * Gets the laborDao attribute.
82: * @return Returns the laborDao.
83: */
84: public LaborDao getLaborDao() {
85: return laborDao;
86: }
87:
88: /**
89: * Sets the laborDao attribute value.
90: * @param laborDao The laborDao to set.
91: */
92: public void setLaborDao(LaborDao laborDao) {
93: this.laborDao = laborDao;
94: }
95: }
|