View Javadoc

1   /**
2    * Copyright 2004-2012 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.workarea;
17  
18  import java.sql.Date;
19  import java.sql.Timestamp;
20  import java.util.ArrayList;
21  import java.util.List;
22  
23  import org.kuali.hr.core.KPMEConstants;
24  import org.kuali.hr.time.HrBusinessObject;
25  import org.kuali.hr.time.authorization.DepartmentalRule;
26  import org.kuali.hr.time.department.Department;
27  import org.kuali.hr.time.earncode.EarnCode;
28  import org.kuali.hr.time.roles.TkRole;
29  import org.kuali.hr.time.task.Task;
30  
31  public class WorkArea extends HrBusinessObject implements DepartmentalRule {
32      public static final String CACHE_NAME = KPMEConstants.APPLICATION_NAMESPACE_CODE + "/" + "WorkArea";
33      private static final long serialVersionUID = 1L;
34  
35      private String tkWorkAreaId;
36      private Long workArea;
37      private String description;
38      private String dept;
39      private Long task;
40      private String adminDescr;
41      private String userPrincipalId;
42      private String defaultOvertimeEarnCode;
43      private String overtimeEditRole;
44      private Boolean ovtEarnCode;
45      
46  	private boolean history;
47      
48      private String hrDeptId;
49  
50      private List<TkRole> roles = new ArrayList<TkRole>();
51      private List<TkRole> inactiveRoles = new ArrayList<TkRole>();
52      private List<Task> tasks = new ArrayList<Task>();
53  
54      private Department department;
55      private Task taskObj;
56      private EarnCode defaultOvertimeEarnCodeObj;
57  
58      public Date getEffectiveDate() {
59          return effectiveDate;
60      }
61  
62  
63      public void setEffectiveDate(Date effectiveDate) {
64          this.effectiveDate = effectiveDate;
65      }
66  
67  
68      public boolean isActive() {
69          return active;
70      }
71  
72      public void setActive(boolean active) {
73          this.active = active;
74      }
75  
76  
77      public String getAdminDescr() {
78          return adminDescr;
79      }
80  
81  
82      public void setAdminDescr(String adminDescr) {
83          this.adminDescr = adminDescr;
84      }
85  
86      public Timestamp getTimestamp() {
87          return timestamp;
88      }
89  
90  
91      public void setTimestamp(Timestamp timestamp) {
92          this.timestamp = timestamp;
93      }
94  
95      public String getUserPrincipalId() {
96          return userPrincipalId;
97      }
98  
99  
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 }