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.budget.dao.ojb;
17:
18: import java.util.List;
19:
20: import org.apache.ojb.broker.query.Criteria;
21: import org.kuali.core.dao.ojb.KualiModuleUserDaoOjb;
22: import org.kuali.kfs.service.ParameterService;
23: import org.kuali.kfs.service.impl.ParameterConstants;
24: import org.kuali.module.kra.KraConstants;
25:
26: public class KraUserDaoOjb extends KualiModuleUserDaoOjb {
27:
28: ParameterService parameterService;
29:
30: @Override
31: public Object getActiveUserQueryCriteria(String moduleId) {
32: List<String> values = parameterService.getParameterValues(
33: ParameterConstants.RESEARCH_ADMINISTRATION_ALL.class,
34: KraConstants.ALLOWED_EMPLOYEE_STATUS_RULE);
35:
36: Criteria criteria = new Criteria();
37: criteria.addEqualTo("staff", "Y");
38: Criteria isFacultyCriteria = new Criteria();
39: isFacultyCriteria.addEqualTo("faculty", "Y");
40: criteria.addOrCriteria(isFacultyCriteria);
41: criteria.addIn("employeeStatusCode", values);
42: return criteria;
43:
44: }
45:
46: public void setParameterService(ParameterService parameterService) {
47: this.parameterService = parameterService;
48: }
49:
50: }
|