1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.kuali.rice.kew.dto; |
18 | |
|
19 | |
import java.io.Serializable; |
20 | |
import java.util.ArrayList; |
21 | |
import java.util.Calendar; |
22 | |
import java.util.List; |
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
public class RouteHeaderDTO implements Serializable { |
31 | |
|
32 | |
static final long serialVersionUID = -677289794727007572L; |
33 | |
|
34 | |
private Long routeHeaderId; |
35 | |
private String docRouteStatus; |
36 | |
private Calendar dateCreated; |
37 | |
private Calendar dateLastModified; |
38 | |
private Calendar dateApproved; |
39 | |
private Calendar dateFinalized; |
40 | |
private String docTitle; |
41 | |
private String appDocId; |
42 | |
private String initiatorPrincipalId; |
43 | |
private String routedByPrincipalId; |
44 | |
private Integer docRouteLevel; |
45 | |
private String currentRouteNodeNames; |
46 | |
private Integer docVersion; |
47 | |
private String docTypeName; |
48 | |
private String documentUrl; |
49 | |
private String appDocStatus; |
50 | |
private Calendar appDocStatusDate; |
51 | |
private boolean fyiRequested; |
52 | |
private boolean ackRequested; |
53 | |
private boolean approveRequested; |
54 | |
private boolean completeRequested; |
55 | |
private boolean userBlanketApprover; |
56 | |
private Long docTypeId; |
57 | |
private ValidActionsDTO validActions; |
58 | |
|
59 | 0 | private NoteDTO[] notes = null; |
60 | 0 | private NoteDTO[] notesToDelete = null; |
61 | |
|
62 | |
|
63 | |
|
64 | |
|
65 | |
|
66 | |
|
67 | 0 | private List<KeyValueDTO> variables = new ArrayList<KeyValueDTO>(); |
68 | |
|
69 | 0 | public RouteHeaderDTO() { } |
70 | |
|
71 | |
public String getCurrentRouteNodeNames() { |
72 | 0 | return currentRouteNodeNames; |
73 | |
} |
74 | |
|
75 | |
public void setCurrentRouteNodeNames(String currentRouteNodeNames) { |
76 | 0 | this.currentRouteNodeNames = currentRouteNodeNames; |
77 | 0 | } |
78 | |
|
79 | |
public String getAppDocId() { |
80 | 0 | return appDocId; |
81 | |
} |
82 | |
|
83 | |
public void setAppDocId(String appDocId) { |
84 | 0 | this.appDocId = appDocId; |
85 | 0 | } |
86 | |
|
87 | |
public Calendar getDateApproved() { |
88 | 0 | return dateApproved; |
89 | |
} |
90 | |
|
91 | |
public void setDateApproved(Calendar dateApproved) { |
92 | 0 | this.dateApproved = dateApproved; |
93 | 0 | } |
94 | |
|
95 | |
public Calendar getDateCreated() { |
96 | 0 | return dateCreated; |
97 | |
} |
98 | |
|
99 | |
public void setDateCreated(Calendar dateCreated) { |
100 | 0 | this.dateCreated = dateCreated; |
101 | 0 | } |
102 | |
|
103 | |
public Calendar getDateFinalized() { |
104 | 0 | return dateFinalized; |
105 | |
} |
106 | |
|
107 | |
public void setDateFinalized(Calendar dateFinalized) { |
108 | 0 | this.dateFinalized = dateFinalized; |
109 | 0 | } |
110 | |
|
111 | |
public Calendar getDateLastModified() { |
112 | 0 | return dateLastModified; |
113 | |
} |
114 | |
|
115 | |
public void setDateLastModified(Calendar dateLastModified) { |
116 | 0 | this.dateLastModified = dateLastModified; |
117 | 0 | } |
118 | |
|
119 | |
public Integer getDocRouteLevel() { |
120 | 0 | return docRouteLevel; |
121 | |
} |
122 | |
|
123 | |
public void setDocRouteLevel(Integer docRouteLevel) { |
124 | 0 | this.docRouteLevel = docRouteLevel; |
125 | 0 | } |
126 | |
|
127 | |
public String getDocRouteStatus() { |
128 | 0 | return docRouteStatus; |
129 | |
} |
130 | |
|
131 | |
public void setDocRouteStatus(String docRouteStatus) { |
132 | 0 | this.docRouteStatus = docRouteStatus; |
133 | 0 | } |
134 | |
|
135 | |
public String getAppDocStatus() { |
136 | 0 | return appDocStatus; |
137 | |
} |
138 | |
|
139 | |
public void setAppDocStatus(String appDocStatus) { |
140 | 0 | this.appDocStatus = appDocStatus; |
141 | 0 | } |
142 | |
|
143 | |
public Calendar getAppDocStatusDate() { |
144 | 0 | return appDocStatusDate; |
145 | |
} |
146 | |
|
147 | |
public void setAppDocStatusDate(Calendar date) { |
148 | 0 | this.appDocStatusDate = date; |
149 | 0 | } |
150 | |
|
151 | |
|
152 | |
|
153 | |
|
154 | |
|
155 | |
|
156 | |
|
157 | |
|
158 | |
|
159 | |
public String getDocTitle() { |
160 | 0 | return docTitle; |
161 | |
} |
162 | |
|
163 | |
public void setDocTitle(String docTitle) { |
164 | 0 | this.docTitle = docTitle; |
165 | 0 | } |
166 | |
|
167 | |
|
168 | |
|
169 | |
|
170 | |
public String getDocTypeName() { |
171 | 0 | return docTypeName; |
172 | |
} |
173 | |
|
174 | |
|
175 | |
|
176 | |
|
177 | |
public void setDocTypeName(String docTypeName) { |
178 | 0 | this.docTypeName = docTypeName; |
179 | 0 | } |
180 | |
|
181 | |
public String getDocumentUrl() { |
182 | 0 | return documentUrl; |
183 | |
} |
184 | |
|
185 | |
public void setDocumentUrl(String documentUrl) { |
186 | 0 | this.documentUrl = documentUrl; |
187 | 0 | } |
188 | |
|
189 | |
public Integer getDocVersion() { |
190 | 0 | return docVersion; |
191 | |
} |
192 | |
|
193 | |
public void setDocVersion(Integer docVersion) { |
194 | 0 | this.docVersion = docVersion; |
195 | 0 | } |
196 | |
|
197 | |
public String getInitiatorPrincipalId() { |
198 | 0 | return this.initiatorPrincipalId; |
199 | |
} |
200 | |
|
201 | |
public void setInitiatorPrincipalId(String initiatorPrincipalId) { |
202 | 0 | this.initiatorPrincipalId = initiatorPrincipalId; |
203 | 0 | } |
204 | |
|
205 | |
public String getRoutedByPrincipalId() { |
206 | 0 | return this.routedByPrincipalId; |
207 | |
} |
208 | |
|
209 | |
public void setRoutedByPrincipalId(String routedByPrincipalId) { |
210 | 0 | this.routedByPrincipalId = routedByPrincipalId; |
211 | 0 | } |
212 | |
|
213 | |
public Long getRouteHeaderId() { |
214 | 0 | return routeHeaderId; |
215 | |
} |
216 | |
|
217 | |
public void setRouteHeaderId(Long routeHeaderId) { |
218 | 0 | this.routeHeaderId = routeHeaderId; |
219 | 0 | } |
220 | |
public boolean isAckRequested() { |
221 | 0 | return ackRequested; |
222 | |
} |
223 | |
public void setAckRequested(boolean ackRequested) { |
224 | 0 | this.ackRequested = ackRequested; |
225 | 0 | } |
226 | |
public boolean isApproveRequested() { |
227 | 0 | return approveRequested; |
228 | |
} |
229 | |
public void setApproveRequested(boolean approveRequested) { |
230 | 0 | this.approveRequested = approveRequested; |
231 | 0 | } |
232 | |
public boolean isCompleteRequested() { |
233 | 0 | return completeRequested; |
234 | |
} |
235 | |
public void setCompleteRequested(boolean completeRequested) { |
236 | 0 | this.completeRequested = completeRequested; |
237 | 0 | } |
238 | |
public boolean isFyiRequested() { |
239 | 0 | return fyiRequested; |
240 | |
} |
241 | |
public void setFyiRequested(boolean fyiRequested) { |
242 | 0 | this.fyiRequested = fyiRequested; |
243 | 0 | } |
244 | |
public boolean isUserBlanketApprover() { |
245 | 0 | return userBlanketApprover; |
246 | |
} |
247 | |
public void setUserBlanketApprover(boolean userBlanketApprover) { |
248 | 0 | this.userBlanketApprover = userBlanketApprover; |
249 | 0 | } |
250 | |
|
251 | |
|
252 | |
public Long getDocTypeId() { |
253 | 0 | return docTypeId; |
254 | |
} |
255 | |
|
256 | |
public void setDocTypeId(Long docTypeId) { |
257 | 0 | this.docTypeId = docTypeId; |
258 | 0 | } |
259 | |
|
260 | |
|
261 | |
|
262 | |
public NoteDTO[] getNotes() { |
263 | 0 | return notes; |
264 | |
} |
265 | |
|
266 | |
public void setNotes(NoteDTO[] notes) { |
267 | 0 | this.notes = notes; |
268 | 0 | } |
269 | |
|
270 | |
public NoteDTO[] getNotesToDelete() { |
271 | 0 | return notesToDelete; |
272 | |
} |
273 | |
|
274 | |
public void setNotesToDelete(NoteDTO[] notesToDelete) { |
275 | 0 | this.notesToDelete = notesToDelete; |
276 | 0 | } |
277 | |
|
278 | |
|
279 | |
private KeyValueDTO findVariable(String name) { |
280 | 0 | for (KeyValueDTO kvp : variables) { |
281 | 0 | if (isEqual(kvp.getKey(), name)) { |
282 | 0 | return kvp; |
283 | |
} |
284 | |
} |
285 | 0 | return null; |
286 | |
} |
287 | |
public String getVariable(String name) { |
288 | 0 | KeyValueDTO kvp = findVariable(name); |
289 | 0 | if (kvp == null) return null; |
290 | 0 | return kvp.getValue(); |
291 | |
} |
292 | |
|
293 | |
public void setVariable(String name, String value) { |
294 | 0 | KeyValueDTO kvp = findVariable(name); |
295 | 0 | if (kvp == null) { |
296 | 0 | if (value == null) { |
297 | 0 | return; |
298 | |
} |
299 | 0 | kvp = new KeyValueDTO(); |
300 | 0 | kvp.setKey(name); |
301 | 0 | kvp.setValue(value); |
302 | 0 | variables.add(kvp); |
303 | |
} else { |
304 | |
|
305 | |
|
306 | |
|
307 | |
|
308 | |
|
309 | |
|
310 | |
|
311 | |
|
312 | |
|
313 | |
|
314 | |
|
315 | |
|
316 | |
|
317 | 0 | kvp.setValue(value); |
318 | |
|
319 | |
} |
320 | 0 | } |
321 | |
|
322 | |
public List<KeyValueDTO> getVariables() { |
323 | 0 | return variables; |
324 | |
} |
325 | |
|
326 | |
public ValidActionsDTO getValidActions() { |
327 | 0 | return validActions; |
328 | |
} |
329 | |
|
330 | |
public void setValidActions(ValidActionsDTO validActions) { |
331 | 0 | this.validActions = validActions; |
332 | 0 | } |
333 | |
|
334 | |
private boolean isEqual(String a, String b) { |
335 | 0 | return ((a == null && b == null) || (a != null && a.equals(b))); |
336 | |
} |
337 | |
|
338 | |
} |