001 /** 002 * Copyright 2004-2012 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package org.kuali.hr.time.timeblock; 017 018 import java.sql.Timestamp; 019 import java.util.ArrayList; 020 import java.util.List; 021 022 import org.kuali.hr.time.service.base.TkServiceLocator; 023 import org.kuali.rice.kim.api.identity.Person; 024 025 public class TimeBlockHistory extends TimeBlock { 026 027 /** 028 * 029 */ 030 private static final long serialVersionUID = 3943771766084238699L; 031 032 private String tkTimeBlockHistoryId = null; 033 private String actionHistory; 034 private String modifiedByPrincipalId; 035 private Timestamp timestampModified; 036 private Person principal; 037 private Person userPrincipal; 038 private List<TimeBlockHistoryDetail> timeBlockHistoryDetails = new ArrayList<TimeBlockHistoryDetail>(); 039 040 public TimeBlockHistory() { 041 } 042 043 public TimeBlockHistory(TimeBlock tb) { 044 this.setTkTimeBlockId(tb.getTkTimeBlockId()); 045 this.setDocumentId(tb.getDocumentId()); 046 this.setJobNumber(tb.getJobNumber()); 047 this.setWorkArea(tb.getWorkArea()); 048 this.setTask(tb.getTask()); 049 this.setHrJobId(tb.getHrJobId()); 050 this.setTkWorkAreaId(tb.getTkWorkAreaId()); 051 this.setTkTaskId(tb.getTkTaskId()); 052 this.setEarnCode(tb.getEarnCode()); 053 this.setBeginTimestamp(tb.getBeginTimestamp()); 054 this.setEndTimestamp(tb.getEndTimestamp()); 055 this.setClockLogCreated(tb.getClockLogCreated()); 056 this.setHours(tb.getHours()); 057 this.setUserPrincipalId(tb.getUserPrincipalId()); 058 this.setPrincipalId(tb.getPrincipalId()); 059 this.setTimestamp(tb.getTimestamp()); 060 this.setBeginTimestampTimezone(tb.getBeginTimestampTimezone()); 061 this.setEndTimestampTimezone(tb.getEndTimestampTimezone()); 062 // add time block history details for this time block history 063 TkServiceLocator.getTimeBlockHistoryService().addTimeBlockHistoryDetails(this, tb); 064 } 065 066 067 public String getTkTimeBlockHistoryId() { 068 return tkTimeBlockHistoryId; 069 } 070 public void setTkTimeBlockHistoryId(String tkTimeBlockHistoryId) { 071 this.tkTimeBlockHistoryId = tkTimeBlockHistoryId; 072 } 073 public String getActionHistory() { 074 return actionHistory; 075 } 076 public void setActionHistory(String actionHistory) { 077 this.actionHistory = actionHistory; 078 } 079 public String getModifiedByPrincipalId() { 080 return modifiedByPrincipalId; 081 } 082 public void setModifiedByPrincipalId(String modifiedByPrincipalId) { 083 this.modifiedByPrincipalId = modifiedByPrincipalId; 084 } 085 086 public Timestamp getTimestampModified() { 087 return timestampModified; 088 } 089 090 public void setTimestampModified(Timestamp timestampModified) { 091 this.timestampModified = timestampModified; 092 } 093 094 public Person getPrincipal() { 095 return principal; 096 } 097 098 public void setPrincipal(Person principal) { 099 this.principal = principal; 100 } 101 102 public Person getUserPrincipal() { 103 return userPrincipal; 104 } 105 106 public void setUserPrincipal(Person userPrincipal) { 107 this.userPrincipal = userPrincipal; 108 } 109 110 public List<TimeBlockHistoryDetail> getTimeBlockHistoryDetails() { 111 return timeBlockHistoryDetails; 112 } 113 114 public void setTimeBlockHistoryDetails(List<TimeBlockHistoryDetail> timeBlockHistoryDetails) { 115 this.timeBlockHistoryDetails = timeBlockHistoryDetails; 116 } 117 }