View Javadoc

1   /**
2    * Copyright 2004-2013 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 String adminDescr;
40      private String userPrincipalId;
41      private String defaultOvertimeEarnCode;
42      private String overtimeEditRole;
43      private Boolean ovtEarnCode;
44      
45  	private boolean history;
46  
47      private List<TkRole> roles = new ArrayList<TkRole>();
48      private List<TkRole> inactiveRoles = new ArrayList<TkRole>();
49      private List<Task> tasks = new ArrayList<Task>();
50  
51      private Department department;
52      private EarnCode defaultOvertimeEarnCodeObj;
53  
54      public Date getEffectiveDate() {
55          return effectiveDate;
56      }
57  
58  
59      public void setEffectiveDate(Date effectiveDate) {
60          this.effectiveDate = effectiveDate;
61      }
62  
63  
64      public boolean isActive() {
65          return active;
66      }
67  
68      public void setActive(boolean active) {
69          this.active = active;
70      }
71  
72  
73      public String getAdminDescr() {
74          return adminDescr;
75      }
76  
77  
78      public void setAdminDescr(String adminDescr) {
79          this.adminDescr = adminDescr;
80      }
81  
82      public Timestamp getTimestamp() {
83          return timestamp;
84      }
85  
86  
87      public void setTimestamp(Timestamp timestamp) {
88          this.timestamp = timestamp;
89      }
90  
91      public String getUserPrincipalId() {
92          return userPrincipalId;
93      }
94  
95  
96      public void setUserPrincipalId(String userPrincipalId) {
97          this.userPrincipalId = userPrincipalId;
98      }
99  
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 }