1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  package org.kuali.hr.time.clocklog.service;
17  
18  import org.kuali.hr.time.clocklog.ClockLog;
19  import org.kuali.rice.kns.document.MaintenanceDocument;
20  import org.kuali.rice.krad.service.KRADServiceLocator;
21  import org.kuali.rice.krad.util.GlobalVariables;
22  
23  import java.util.Map;
24  
25  public class ClockLogMaintainableImpl extends org.kuali.rice.kns.maintenance.KualiMaintainableImpl {
26  
27  	
28  
29  
30  	private static final long serialVersionUID = 1L;
31  
32  	 @Override
33  	public void processAfterNew(MaintenanceDocument document,
34  			Map<String, String[]> parameters) {		 
35  		super.processAfterNew(document, parameters);
36  	}
37  	 
38  	@Override
39  	public void processAfterPost(MaintenanceDocument document,
40  			Map<String, String[]> parameters) {		
41  		ClockLog clockLog = (ClockLog) document.getDocumentBusinessObject();
42  		clockLog.setUserPrincipalId(GlobalVariables.getUserSession().getPrincipalId());
43  		super.processAfterPost(document, parameters);
44  	}
45  	
46  	@Override
47  	public void processAfterEdit(MaintenanceDocument document,
48  			Map<String, String[]> parameters) {
49  		ClockLog clockLog = (ClockLog) document.getDocumentBusinessObject();
50  		clockLog.setUserPrincipalId(GlobalVariables.getUserSession().getPrincipalId());
51  		super.processAfterEdit(document, parameters);
52  	}
53  	
54  	@Override
55  	public void saveBusinessObject() {
56  		ClockLog clockLog = (ClockLog) this.getBusinessObject();
57  		clockLog.setTkClockLogId(null);
58  		clockLog.setTimestamp(null);
59  		KRADServiceLocator.getBusinessObjectService().save(clockLog);
60  	}
61  
62  }