View Javadoc

1   /**
2    * Copyright 2004-2013 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.shiftdiff.rule.service;
17  
18  import java.util.Map;
19  
20  import org.kuali.hr.time.HrBusinessObject;
21  import org.kuali.hr.time.service.base.TkServiceLocator;
22  import org.kuali.hr.time.shiftdiff.rule.ShiftDifferentialRule;
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 ShiftDifferentialRuleMaintenableImpl extends HrBusinessObjectMaintainableImpl {
28  	/**
29  	 * 
30  	 */
31  	private static final long serialVersionUID = 1L;
32  
33  	@Override
34  	public void processAfterNew(MaintenanceDocument document,
35  			Map<String, String[]> parameters) {
36  		super.processAfterNew(document, parameters);
37  	}
38  
39  	@Override
40  	public void processAfterPost(MaintenanceDocument document,
41  			Map<String, String[]> parameters) {
42  		ShiftDifferentialRule shiftDifferentialRule = (ShiftDifferentialRule) document
43  				.getNewMaintainableObject().getBusinessObject();
44  		shiftDifferentialRule.setUserPrincipalId(GlobalVariables
45  				.getUserSession().getPrincipalId());
46  		super.processAfterPost(document, parameters);
47  	}
48  
49  	@Override
50  	public void processAfterEdit(MaintenanceDocument document,
51  			Map<String, String[]> parameters) {
52  		ShiftDifferentialRule shiftDifferentialRule = (ShiftDifferentialRule) document
53  				.getNewMaintainableObject().getBusinessObject();
54  		shiftDifferentialRule.setUserPrincipalId(GlobalVariables
55  				.getUserSession().getPrincipalId());
56  		super.processAfterEdit(document, parameters);
57  	}
58  
59  
60  	@Override
61  	public HrBusinessObject getObjectById(String id) {
62  		return TkServiceLocator.getShiftDifferentialRuleService().getShiftDifferentialRule(id);
63  	}
64  
65  }