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.workarea; 017 018 import java.sql.Date; 019 import java.sql.Timestamp; 020 import java.util.ArrayList; 021 import java.util.List; 022 023 import org.kuali.hr.core.KPMEConstants; 024 import org.kuali.hr.time.HrBusinessObject; 025 import org.kuali.hr.time.authorization.DepartmentalRule; 026 import org.kuali.hr.time.department.Department; 027 import org.kuali.hr.time.earncode.EarnCode; 028 import org.kuali.hr.time.roles.TkRole; 029 import org.kuali.hr.time.task.Task; 030 031 public class WorkArea extends HrBusinessObject implements DepartmentalRule { 032 public static final String CACHE_NAME = KPMEConstants.APPLICATION_NAMESPACE_CODE + "/" + "WorkArea"; 033 private static final long serialVersionUID = 1L; 034 035 private String tkWorkAreaId; 036 private Long workArea; 037 private String description; 038 private String dept; 039 private Long task; 040 private String adminDescr; 041 private String userPrincipalId; 042 private String defaultOvertimeEarnCode; 043 private String overtimeEditRole; 044 private Boolean ovtEarnCode; 045 046 private boolean history; 047 048 private String hrDeptId; 049 050 private List<TkRole> roles = new ArrayList<TkRole>(); 051 private List<TkRole> inactiveRoles = new ArrayList<TkRole>(); 052 private List<Task> tasks = new ArrayList<Task>(); 053 054 private Department department; 055 private Task taskObj; 056 private EarnCode defaultOvertimeEarnCodeObj; 057 058 public Date getEffectiveDate() { 059 return effectiveDate; 060 } 061 062 063 public void setEffectiveDate(Date effectiveDate) { 064 this.effectiveDate = effectiveDate; 065 } 066 067 068 public boolean isActive() { 069 return active; 070 } 071 072 public void setActive(boolean active) { 073 this.active = active; 074 } 075 076 077 public String getAdminDescr() { 078 return adminDescr; 079 } 080 081 082 public void setAdminDescr(String adminDescr) { 083 this.adminDescr = adminDescr; 084 } 085 086 public Timestamp getTimestamp() { 087 return timestamp; 088 } 089 090 091 public void setTimestamp(Timestamp timestamp) { 092 this.timestamp = timestamp; 093 } 094 095 public String getUserPrincipalId() { 096 return userPrincipalId; 097 } 098 099 100 public void setUserPrincipalId(String userPrincipalId) { 101 this.userPrincipalId = userPrincipalId; 102 } 103 104 public String getDescription() { 105 return description; 106 } 107 108 109 public void setDescription(String description) { 110 this.description = description; 111 } 112 113 114 public List<Task> getTasks() { 115 return tasks; 116 } 117 118 119 public void setTasks(List<Task> tasks) { 120 this.tasks = tasks; 121 } 122 123 124 public String getTkWorkAreaId() { 125 return tkWorkAreaId; 126 } 127 128 129 public void setTkWorkAreaId(String tkWorkAreaId) { 130 this.tkWorkAreaId = tkWorkAreaId; 131 } 132 133 134 public Long getWorkArea() { 135 return workArea; 136 } 137 138 139 public void setWorkArea(Long workArea) { 140 this.workArea = workArea; 141 } 142 143 144 public String getDept() { 145 return dept; 146 } 147 148 149 public void setDept(String dept) { 150 this.dept = dept; 151 } 152 153 154 public List<TkRole> getInactiveRoles() { 155 return inactiveRoles; 156 } 157 158 159 public void setInactiveRoles(List<TkRole> inactiveRoles) { 160 this.inactiveRoles = inactiveRoles; 161 } 162 163 164 public List<TkRole> getRoles() { 165 return roles; 166 } 167 168 public void setRoles(List<TkRole> roles) { 169 this.roles = roles; 170 } 171 172 public Department getDepartment() { 173 return department; 174 } 175 176 177 public void setDepartment(Department department) { 178 this.department = department; 179 } 180 181 182 public Task getTaskObj() { 183 return taskObj; 184 } 185 186 187 public void setTaskObj(Task taskObj) { 188 this.taskObj = taskObj; 189 } 190 191 192 public Long getTask() { 193 return task; 194 } 195 196 197 public void setTask(Long task) { 198 this.task = task; 199 } 200 201 public String getDefaultOvertimeEarnCode() { 202 return defaultOvertimeEarnCode; 203 } 204 205 public void setDefaultOvertimeEarnCode(String defaultOvertimeEarnCode) { 206 this.defaultOvertimeEarnCode = defaultOvertimeEarnCode; 207 } 208 209 public EarnCode getDefaultOvertimeEarnCodeObj() { 210 return defaultOvertimeEarnCodeObj; 211 } 212 213 public void setDefaultOvertimeEarnCodeObj(EarnCode defaultOvertimeEarnCodeObj) { 214 this.defaultOvertimeEarnCodeObj = defaultOvertimeEarnCodeObj; 215 } 216 217 public String getOvertimeEditRole() { 218 return overtimeEditRole; 219 } 220 221 public void setOvertimeEditRole(String overtimeEditRole) { 222 this.overtimeEditRole = overtimeEditRole; 223 } 224 225 public Boolean getOvtEarnCode() { 226 return ovtEarnCode; 227 } 228 229 230 public void setOvtEarnCode(Boolean ovtEarnCode) { 231 this.ovtEarnCode = ovtEarnCode; 232 } 233 234 235 public String getHrDeptId() { 236 return hrDeptId; 237 } 238 239 public void setHrDeptId(String hrDeptId) { 240 this.hrDeptId = hrDeptId; 241 } 242 243 244 @Override 245 public String getUniqueKey() { 246 return workArea != null ? workArea.toString() : "" +"_"+dept; 247 } 248 249 250 @Override 251 public String getId() { 252 return getTkWorkAreaId(); 253 } 254 255 256 @Override 257 public void setId(String id) { 258 setTkWorkAreaId(id); 259 } 260 261 262 public boolean isHistory() { 263 return history; 264 } 265 266 267 public void setHistory(boolean history) { 268 this.history = history; 269 } 270 271 }