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.timeblock;
17  
18  import java.sql.Timestamp;
19  import java.util.ArrayList;
20  import java.util.List;
21  
22  import org.kuali.hr.time.service.base.TkServiceLocator;
23  import org.kuali.rice.kim.api.identity.Person;
24  
25  public class TimeBlockHistory extends TimeBlock {
26  
27  	/**
28  	 *
29  	 */
30  	private static final long serialVersionUID = 3943771766084238699L;
31  
32  	private String tkTimeBlockHistoryId = null;
33  	private String actionHistory;
34  	private String modifiedByPrincipalId;
35  	private Timestamp timestampModified;
36  	private transient Person principal;
37  	private transient Person userPrincipal;
38  	private List<TimeBlockHistoryDetail> timeBlockHistoryDetails = new ArrayList<TimeBlockHistoryDetail>();
39      private TimeBlock timeBlock;
40  
41  	public TimeBlockHistory() {
42  	}
43  
44  	public TimeBlockHistory(TimeBlock tb) {
45  		this.setTkTimeBlockId(tb.getTkTimeBlockId());
46  		this.setDocumentId(tb.getDocumentId());
47  		this.setJobNumber(tb.getJobNumber());
48  		this.setWorkArea(tb.getWorkArea());
49  		this.setTask(tb.getTask());
50  		this.setEarnCode(tb.getEarnCode());
51  		this.setBeginTimestamp(tb.getBeginTimestamp());
52  		this.setEndTimestamp(tb.getEndTimestamp());
53  		this.setClockLogCreated(tb.getClockLogCreated());
54  		this.setHours(tb.getHours());
55  		this.setUserPrincipalId(tb.getUserPrincipalId());
56  		this.setPrincipalId(tb.getPrincipalId());
57  		this.setTimestamp(tb.getTimestamp());
58  		this.setBeginTimestampTimezone(tb.getBeginTimestampTimezone());
59  		this.setEndTimestampTimezone(tb.getEndTimestampTimezone());
60  		// add time block history details for this time block history
61  		TkServiceLocator.getTimeBlockHistoryService().addTimeBlockHistoryDetails(this, tb);
62  	}
63  	
64  
65  	public String getTkTimeBlockHistoryId() {
66  		return tkTimeBlockHistoryId;
67  	}
68  	public void setTkTimeBlockHistoryId(String tkTimeBlockHistoryId) {
69  		this.tkTimeBlockHistoryId = tkTimeBlockHistoryId;
70  	}
71  	public String getActionHistory() {
72  		return actionHistory;
73  	}
74  	public void setActionHistory(String actionHistory) {
75  		this.actionHistory = actionHistory;
76  	}
77  	public String getModifiedByPrincipalId() {
78  		return modifiedByPrincipalId;
79  	}
80  	public void setModifiedByPrincipalId(String modifiedByPrincipalId) {
81  		this.modifiedByPrincipalId = modifiedByPrincipalId;
82  	}
83  
84  	public Timestamp getTimestampModified() {
85  		return timestampModified;
86  	}
87  
88  	public void setTimestampModified(Timestamp timestampModified) {
89  		this.timestampModified = timestampModified;
90  	}
91  
92  	public Person getPrincipal() {
93  		return principal;
94  	}
95  
96  	public void setPrincipal(Person principal) {
97  		this.principal = principal;
98  	}
99  
100 	public Person getUserPrincipal() {
101 		return userPrincipal;
102 	}
103 
104 	public void setUserPrincipal(Person userPrincipal) {
105 		this.userPrincipal = userPrincipal;
106 	}
107 
108 	public List<TimeBlockHistoryDetail> getTimeBlockHistoryDetails() {
109 		return timeBlockHistoryDetails;
110 	}
111 
112 	public void setTimeBlockHistoryDetails(List<TimeBlockHistoryDetail> timeBlockHistoryDetails) {
113 		this.timeBlockHistoryDetails = timeBlockHistoryDetails;
114 	}
115 
116     public TimeBlock getTimeBlock(){
117         return this.timeBlock;
118     }
119 
120     public void setTimeBlock(TimeBlock timeBlock) {
121         this.timeBlock = timeBlock;
122     }
123 
124     public TimeBlockHistory copy() {
125         return new TimeBlockHistory(this);
126     }
127 }