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.kra.routingform.service.impl;
17:
18: import java.util.ArrayList;
19: import java.util.Collection;
20: import java.util.HashMap;
21: import java.util.List;
22: import java.util.Map;
23:
24: import org.kuali.core.service.BusinessObjectService;
25: import org.kuali.kfs.KFSConstants;
26: import org.kuali.kfs.KFSPropertyConstants;
27: import org.kuali.module.kra.routingform.bo.Purpose;
28: import org.kuali.module.kra.routingform.service.PurposeService;
29:
30: public class PurposeServiceImpl implements PurposeService {
31:
32: private BusinessObjectService businessObjectService;
33:
34: /**
35: * @see org.kuali.module.kra.routingform.service.PurposeService#getPurposes()
36: */
37: public List<Purpose> getPurposes() {
38: Map fieldValues = new HashMap();
39: fieldValues
40: .put(
41: KFSPropertyConstants.DATA_OBJECT_MAINTENANCE_CODE_ACTIVE_INDICATOR,
42: KFSConstants.ACTIVE_INDICATOR);
43:
44: Collection col = businessObjectService.findMatchingOrderBy(
45: Purpose.class, fieldValues,
46: KFSPropertyConstants.USER_SORT_NUMBER, true);
47:
48: return new ArrayList(col);
49: }
50:
51: public void setBusinessObjectService(
52: BusinessObjectService businessObjectService) {
53: this.businessObjectService = businessObjectService;
54: }
55: }
|