001 /** 002 * Copyright 2004-2013 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 String adminDescr; 040 private String userPrincipalId; 041 private String defaultOvertimeEarnCode; 042 private String overtimeEditRole; 043 private Boolean ovtEarnCode; 044 045 private boolean history; 046 047 private List<TkRole> roles = new ArrayList<TkRole>(); 048 private List<TkRole> inactiveRoles = new ArrayList<TkRole>(); 049 private List<Task> tasks = new ArrayList<Task>(); 050 051 private Department department; 052 private EarnCode defaultOvertimeEarnCodeObj; 053 054 public Date getEffectiveDate() { 055 return effectiveDate; 056 } 057 058 059 public void setEffectiveDate(Date effectiveDate) { 060 this.effectiveDate = effectiveDate; 061 } 062 063 064 public boolean isActive() { 065 return active; 066 } 067 068 public void setActive(boolean active) { 069 this.active = active; 070 } 071 072 073 public String getAdminDescr() { 074 return adminDescr; 075 } 076 077 078 public void setAdminDescr(String adminDescr) { 079 this.adminDescr = adminDescr; 080 } 081 082 public Timestamp getTimestamp() { 083 return timestamp; 084 } 085 086 087 public void setTimestamp(Timestamp timestamp) { 088 this.timestamp = timestamp; 089 } 090 091 public String getUserPrincipalId() { 092 return userPrincipalId; 093 } 094 095 096 public void setUserPrincipalId(String userPrincipalId) { 097 this.userPrincipalId = userPrincipalId; 098 } 099 100 public String getDescription() { 101 return description; 102 } 103 104 105 public void setDescription(String description) { 106 this.description = description; 107 } 108 109 110 public List<Task> getTasks() { 111 return tasks; 112 } 113 114 115 public void setTasks(List<Task> tasks) { 116 this.tasks = tasks; 117 } 118 119 120 public String getTkWorkAreaId() { 121 return tkWorkAreaId; 122 } 123 124 125 public void setTkWorkAreaId(String tkWorkAreaId) { 126 this.tkWorkAreaId = tkWorkAreaId; 127 } 128 129 130 public Long getWorkArea() { 131 return workArea; 132 } 133 134 135 public void setWorkArea(Long workArea) { 136 this.workArea = workArea; 137 } 138 139 140 public String getDept() { 141 return dept; 142 } 143 144 145 public void setDept(String dept) { 146 this.dept = dept; 147 } 148 149 150 public List<TkRole> getInactiveRoles() { 151 return inactiveRoles; 152 } 153 154 155 public void setInactiveRoles(List<TkRole> inactiveRoles) { 156 this.inactiveRoles = inactiveRoles; 157 } 158 159 160 public List<TkRole> getRoles() { 161 return roles; 162 } 163 164 public void setRoles(List<TkRole> roles) { 165 this.roles = roles; 166 } 167 168 public Department getDepartment() { 169 return department; 170 } 171 172 public void setDepartment(Department department) { 173 this.department = department; 174 } 175 176 public String getDefaultOvertimeEarnCode() { 177 return defaultOvertimeEarnCode; 178 } 179 180 public void setDefaultOvertimeEarnCode(String defaultOvertimeEarnCode) { 181 this.defaultOvertimeEarnCode = defaultOvertimeEarnCode; 182 } 183 184 public EarnCode getDefaultOvertimeEarnCodeObj() { 185 return defaultOvertimeEarnCodeObj; 186 } 187 188 public void setDefaultOvertimeEarnCodeObj(EarnCode defaultOvertimeEarnCodeObj) { 189 this.defaultOvertimeEarnCodeObj = defaultOvertimeEarnCodeObj; 190 } 191 192 public String getOvertimeEditRole() { 193 return overtimeEditRole; 194 } 195 196 public void setOvertimeEditRole(String overtimeEditRole) { 197 this.overtimeEditRole = overtimeEditRole; 198 } 199 200 public Boolean getOvtEarnCode() { 201 return ovtEarnCode; 202 } 203 204 205 public void setOvtEarnCode(Boolean ovtEarnCode) { 206 this.ovtEarnCode = ovtEarnCode; 207 } 208 209 210 @Override 211 public String getUniqueKey() { 212 return workArea != null ? workArea.toString() : "" +"_"+dept; 213 } 214 215 216 @Override 217 public String getId() { 218 return getTkWorkAreaId(); 219 } 220 221 222 @Override 223 public void setId(String id) { 224 setTkWorkAreaId(id); 225 } 226 227 228 public boolean isHistory() { 229 return history; 230 } 231 232 233 public void setHistory(boolean history) { 234 this.history = history; 235 } 236 237 }