View Javadoc

1   /**
2    * Copyright 2004-2012 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.hr.time.principal.service;
17  
18  import org.kuali.hr.time.principal.PrincipalHRAttributes;
19  import org.kuali.hr.time.principal.dao.PrincipalHRAttributesDao;
20  import org.kuali.hr.time.service.base.TkServiceLocator;
21  
22  import java.util.Date;
23  import java.util.List;
24  
25  public class PrincipalHRAttributesServiceImpl implements PrincipalHRAttributesService {
26  	private PrincipalHRAttributesDao principalHRAttributesDao;
27  
28  	public void setPrincipalHRAttributesDao(PrincipalHRAttributesDao principalHRAttributesDao) {
29  		this.principalHRAttributesDao = principalHRAttributesDao;
30  	}
31  	
32  	public PrincipalHRAttributes getPrincipalCalendar(String principalId, Date asOfDate){
33  		PrincipalHRAttributes pc =  this.principalHRAttributesDao.getPrincipalCalendar(principalId, asOfDate);
34  		if(pc != null) {
35  			pc.setCalendar(TkServiceLocator.getCalendarService().getCalendarByGroup(pc.getPayCalendar()));
36  		}
37  		return pc;
38  	}
39      
40  //    @Override
41  //	public PrincipalHRAttributes getPrincipalHRAttributes(String principalId) {
42  //		return this.principalHRAttributesDao.getPrincipalHRAttributes(principalId);
43  //	}
44      
45      @Override
46      public PrincipalHRAttributes getInactivePrincipalHRAttributes(String principalId, Date asOfDate) {
47      	return this.principalHRAttributesDao.getInactivePrincipalHRAttributes(principalId, asOfDate);
48      }
49      
50      @Override
51      public PrincipalHRAttributes getPrincipalHRAttributes(String hrPrincipalAttributeId) {
52      	return this.principalHRAttributesDao.getPrincipalHRAttributes(hrPrincipalAttributeId);
53      }
54      
55      @Override
56      public List<PrincipalHRAttributes> getAllActivePrincipalHrAttributesForPrincipalId(String principalId, Date asOfDate) {
57      	return this.principalHRAttributesDao.getAllActivePrincipalHrAttributesForPrincipalId(principalId, asOfDate);
58      }
59      @Override
60      public PrincipalHRAttributes getMaxTimeStampPrincipalHRAttributes(String principalId) {
61      	return principalHRAttributesDao.getMaxTimeStampPrincipalHRAttributes(principalId);
62      }
63      
64      @Override
65      public List<PrincipalHRAttributes> getAllInActivePrincipalHrAttributesForPrincipalId(String principalId, Date asOfDate) {
66      	return this.principalHRAttributesDao.getAllInActivePrincipalHrAttributesForPrincipalId(principalId, asOfDate);
67      }
68      @Override
69      public List<PrincipalHRAttributes> getActivePrincipalHrAttributesForRange(String principalId, Date startDate, Date endDate) {
70      	return this.principalHRAttributesDao.getActivePrincipalHrAttributesForRange(principalId, startDate, endDate);
71      }
72      @Override
73      public List<PrincipalHRAttributes> getInactivePrincipalHRAttributesForRange(String principalId, Date startDate, Date endDate) {
74      	return this.principalHRAttributesDao.getInactivePrincipalHRAttributesForRange(principalId, startDate, endDate);
75      }
76  }