View Javadoc
1   /**
2    * Copyright 2004-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
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.kpme.pm.positionreportsubcat.service;
17  
18  import java.util.List;
19  
20  import org.joda.time.LocalDate;
21  import org.kuali.kpme.pm.api.positionreportsubcat.PositionReportSubCategory;
22  import org.kuali.kpme.pm.api.positionreportsubcat.service.PositionReportSubCatService;
23  import org.kuali.kpme.pm.positionreportsubcat.PositionReportSubCategoryBo;
24  import org.kuali.kpme.pm.positionreportsubcat.dao.PositionReportSubCatDao;
25  import org.kuali.rice.core.api.mo.ModelObjectUtils;
26  
27  public class PositionReportSubCatServiceImpl implements PositionReportSubCatService{
28  	private PositionReportSubCatDao positionReportSubCatDao;
29  	
30  	@Override
31  	public PositionReportSubCategory getPositionReportSubCatById(
32  			String pmPositionReportSubCatId) {
33  		return PositionReportSubCategoryBo.to(positionReportSubCatDao.getPositionReportSubCatById(pmPositionReportSubCatId));
34  	}
35  
36  	public PositionReportSubCatDao getPositionReportSubCatDao() {
37  		return positionReportSubCatDao;
38  	}
39  
40  	public void setPositionReportSubCatDao(
41  			PositionReportSubCatDao positionReportSubCatDao) {
42  		this.positionReportSubCatDao = positionReportSubCatDao;
43  	}
44  	
45  	public List<PositionReportSubCategory> getPositionReportSubCat(String pstnRptSubCat, LocalDate asOfDate) {
46  		return ModelObjectUtils.transform(positionReportSubCatDao.getPositionReportSubCat(pstnRptSubCat, asOfDate),PositionReportSubCategoryBo.toImmutable);
47  	}
48  
49  	@Override
50  	public PositionReportSubCategory getActivePositionReportSubCat(
51  			String pstnRptSubCat, LocalDate asOfDate) {
52  		return PositionReportSubCategoryBo.to(positionReportSubCatDao.getActivePositionReportSubCat(pstnRptSubCat, asOfDate));
53  	}
54  
55  }