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.util.ArrayList; 019 import java.util.List; 020 021 import org.kuali.hr.core.KPMEConstants; 022 import org.kuali.hr.time.HrBusinessObject; 023 import org.kuali.hr.time.authorization.DepartmentalRule; 024 import org.kuali.hr.time.department.Department; 025 import org.kuali.hr.time.earncode.EarnCode; 026 import org.kuali.hr.time.roles.TkRole; 027 import org.kuali.hr.time.task.Task; 028 029 public class WorkArea extends HrBusinessObject implements DepartmentalRule { 030 031 private static final long serialVersionUID = 307144025705246544L; 032 033 public static final String CACHE_NAME = KPMEConstants.APPLICATION_NAMESPACE_CODE + "/" + "WorkArea"; 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 String getAdminDescr() { 055 return adminDescr; 056 } 057 058 public void setAdminDescr(String adminDescr) { 059 this.adminDescr = adminDescr; 060 } 061 062 public String getUserPrincipalId() { 063 return userPrincipalId; 064 } 065 066 public void setUserPrincipalId(String userPrincipalId) { 067 this.userPrincipalId = userPrincipalId; 068 } 069 070 public String getDescription() { 071 return description; 072 } 073 074 public void setDescription(String description) { 075 this.description = description; 076 } 077 078 public List<Task> getTasks() { 079 return tasks; 080 } 081 082 public void setTasks(List<Task> tasks) { 083 this.tasks = tasks; 084 } 085 086 public String getTkWorkAreaId() { 087 return tkWorkAreaId; 088 } 089 090 public void setTkWorkAreaId(String tkWorkAreaId) { 091 this.tkWorkAreaId = tkWorkAreaId; 092 } 093 094 public Long getWorkArea() { 095 return workArea; 096 } 097 098 public void setWorkArea(Long workArea) { 099 this.workArea = workArea; 100 } 101 102 public String getDept() { 103 return dept; 104 } 105 106 public void setDept(String dept) { 107 this.dept = dept; 108 } 109 110 public List<TkRole> getInactiveRoles() { 111 return inactiveRoles; 112 } 113 114 public void setInactiveRoles(List<TkRole> inactiveRoles) { 115 this.inactiveRoles = inactiveRoles; 116 } 117 118 public List<TkRole> getRoles() { 119 return roles; 120 } 121 122 public void setRoles(List<TkRole> roles) { 123 this.roles = roles; 124 } 125 126 public Department getDepartment() { 127 return department; 128 } 129 130 public void setDepartment(Department department) { 131 this.department = department; 132 } 133 134 public String getDefaultOvertimeEarnCode() { 135 return defaultOvertimeEarnCode; 136 } 137 138 public void setDefaultOvertimeEarnCode(String defaultOvertimeEarnCode) { 139 this.defaultOvertimeEarnCode = defaultOvertimeEarnCode; 140 } 141 142 public EarnCode getDefaultOvertimeEarnCodeObj() { 143 return defaultOvertimeEarnCodeObj; 144 } 145 146 public void setDefaultOvertimeEarnCodeObj(EarnCode defaultOvertimeEarnCodeObj) { 147 this.defaultOvertimeEarnCodeObj = defaultOvertimeEarnCodeObj; 148 } 149 150 public String getOvertimeEditRole() { 151 return overtimeEditRole; 152 } 153 154 public void setOvertimeEditRole(String overtimeEditRole) { 155 this.overtimeEditRole = overtimeEditRole; 156 } 157 158 public Boolean getOvtEarnCode() { 159 return ovtEarnCode; 160 } 161 162 public void setOvtEarnCode(Boolean ovtEarnCode) { 163 this.ovtEarnCode = ovtEarnCode; 164 } 165 166 @Override 167 public String getUniqueKey() { 168 return workArea != null ? workArea.toString() : "" +"_"+dept; 169 } 170 171 @Override 172 public String getId() { 173 return getTkWorkAreaId(); 174 } 175 176 @Override 177 public void setId(String id) { 178 setTkWorkAreaId(id); 179 } 180 181 public boolean isHistory() { 182 return history; 183 } 184 185 public void setHistory(boolean history) { 186 this.history = history; 187 } 188 189 }