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