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.overtime.weekly.rule.service;
17  
18  import java.util.Map;
19  
20  import org.kuali.hr.time.HrBusinessObject;
21  import org.kuali.hr.time.overtime.weekly.rule.WeeklyOvertimeRule;
22  import org.kuali.hr.time.service.base.TkServiceLocator;
23  import org.kuali.hr.time.util.HrBusinessObjectMaintainableImpl;
24  import org.kuali.rice.kns.document.MaintenanceDocument;
25  import org.kuali.rice.krad.util.GlobalVariables;
26  
27  public class WeeklyOvertimeRuleMaintainableImpl extends HrBusinessObjectMaintainableImpl {
28  
29  	/**
30  	 * 
31  	 */
32  	private static final long serialVersionUID = 1L;
33  
34  	@Override
35  	public void processAfterNew(MaintenanceDocument document,
36  			Map<String, String[]> parameters) {
37  		super.processAfterNew(document, parameters);
38  	}
39  
40  	@Override
41  	public void processAfterPost(MaintenanceDocument document,
42  			Map<String, String[]> parameters) {
43  		WeeklyOvertimeRule weeklyOvertimeRule = (WeeklyOvertimeRule) document
44  				.getDocumentBusinessObject();
45  		weeklyOvertimeRule.setUserPrincipalId(GlobalVariables.getUserSession()
46  				.getPrincipalId());
47  		super.processAfterPost(document, parameters);
48  	}
49  
50  	@Override
51  	public void processAfterEdit(MaintenanceDocument document,
52  			Map<String, String[]> parameters) {
53  		WeeklyOvertimeRule weeklyOvertimeRule = (WeeklyOvertimeRule) document
54  				.getDocumentBusinessObject();
55  		weeklyOvertimeRule.setUserPrincipalId(GlobalVariables.getUserSession()
56  				.getPrincipalId());
57  		super.processAfterEdit(document, parameters);
58  	}
59  
60  	@Override
61  	public HrBusinessObject getObjectById(String id) {
62  		return TkServiceLocator.getWeeklyOvertimeRuleService().getWeeklyOvertimeRule(id);
63  	}
64  
65  }