1
2
3 package org.andromda.timetracker.web.timecardsearch;
4
5 import java.io.Serializable;
6 import java.text.DateFormat;
7 import java.text.SimpleDateFormat;
8 import java.util.ArrayList;
9 import java.util.Arrays;
10 import java.util.Collection;
11 import java.util.Date;
12 import java.util.HashMap;
13 import java.util.Iterator;
14 import java.util.LinkedHashMap;
15 import java.util.List;
16 import java.util.Map;
17 import javax.faces.application.FacesMessage;
18 import javax.faces.event.ActionEvent;
19 import javax.faces.event.FacesEvent;
20 import javax.faces.event.ValueChangeEvent;
21 import javax.faces.model.SelectItem;
22 import org.andromda.timetracker.vo.TimecardSummaryVO;
23 import org.apache.commons.beanutils.PropertyUtils;
24
25
26
27
28
29
30 public class SearchTimecardsFormImpl
31 implements Serializable, PopulateSearchScreenForm
32 {
33
34
35
36 public SearchTimecardsFormImpl()
37 {
38 final DateFormat timecardSummariesStartDateDateFormatter = new SimpleDateFormat("MM/dd/yyyy");
39 timecardSummariesStartDateDateFormatter.setLenient(true);
40 this.dateTimeFormatters.put("timecardSummaries.startDate", timecardSummariesStartDateDateFormatter);
41 final DateFormat startDateMinimumDateFormatter = new SimpleDateFormat("MM/dd/yyyy");
42 startDateMinimumDateFormatter.setLenient(true);
43 this.dateTimeFormatters.put("startDateMinimum", startDateMinimumDateFormatter);
44 final DateFormat startDateMaximumDateFormatter = new SimpleDateFormat("MM/dd/yyyy");
45 startDateMaximumDateFormatter.setLenient(true);
46 this.dateTimeFormatters.put("startDateMaximum", startDateMaximumDateFormatter);
47
48 final DateFormat dateFormatter = new SimpleDateFormat("EEE MMM dd hh:mm:ss zzz yyyy");
49 dateFormatter.setLenient(true);
50 this.dateTimeFormatters.put(null, dateFormatter);
51 }
52
53 private transient FacesEvent event;
54
55
56
57
58 @Override
59 public void setEvent(FacesEvent eventIn)
60 {
61 this.event = eventIn;
62 }
63
64
65
66
67 @Override
68 public ValueChangeEvent getValueChangeEvent()
69 {
70 return this.event instanceof ValueChangeEvent
71 ? (ValueChangeEvent)this.event : null;
72 }
73
74
75
76
77 @Override
78 public ActionEvent getActionEvent()
79 {
80 return this.event instanceof ActionEvent
81 ? (ActionEvent)this.event : null;
82 }
83
84
85
86 private TimecardSummaryVO[] timecardSummaries;
87
88
89
90
91
92
93
94
95
96 public TimecardSummaryVO[] getTimecardSummaries()
97 {
98 return this.timecardSummaries;
99 }
100
101
102
103
104
105 private boolean timecardSummariesSet = false;
106
107
108
109
110 public void resetTimecardSummariesSet()
111 {
112 this.timecardSummariesSet = false;
113 }
114
115
116
117
118
119
120
121 public boolean isTimecardSummariesSet()
122 {
123 return this.timecardSummariesSet;
124 }
125
126
127
128
129
130
131
132
133
134 public void setTimecardSummaries(TimecardSummaryVO[] timecardSummariesIn)
135 {
136 this.timecardSummaries = timecardSummariesIn;
137 this.timecardSummariesSet = true;
138 }
139
140
141
142
143 private Object[] timecardSummariesValueList;
144
145
146
147
148 private Object[] timecardSummariesLabelList;
149
150
151
152
153 public Object[] getTimecardSummariesBackingList()
154 {
155 Object[] values = this.timecardSummariesValueList;
156 Object[] labels = this.timecardSummariesLabelList;
157
158 if (values == null || values.length == 0)
159 {
160 return values;
161 }
162
163 if (labels == null || labels.length == 0)
164 {
165 labels = values;
166 }
167
168 final int length = Math.min(labels.length, values.length);
169 SelectItem[] backingList = new SelectItem[length];
170
171 for (int ctr = 0; ctr < length; ctr++)
172 {
173 backingList[ctr] = new SelectItem(
174 values[ctr] != null ? values[ctr] : "", labels[ctr] != null ? String.valueOf(labels[ctr]) : "");
175 }
176 return backingList;
177 }
178
179
180
181
182 public Object[] getTimecardSummariesValueList()
183 {
184 return this.timecardSummariesValueList;
185 }
186
187
188
189
190 public void setTimecardSummariesValueList(Object[] timecardSummariesValueListIn)
191 {
192 this.timecardSummariesValueList = timecardSummariesValueListIn;
193 }
194
195
196
197
198 public Object[] getTimecardSummariesLabelList()
199 {
200 return this.timecardSummariesLabelList;
201 }
202
203
204
205
206 public void setTimecardSummariesLabelList(Object[] timecardSummariesLabelListIn)
207 {
208 this.timecardSummariesLabelList = timecardSummariesLabelListIn;
209 }
210
211
212
213
214
215
216 public void setTimecardSummariesBackingList(Collection<? extends Object> items, String valueProperty, String labelProperty)
217 {
218 this.timecardSummariesValueList = null;
219 this.timecardSummariesLabelList = null;
220 if (items != null)
221 {
222 this.timecardSummariesValueList = new Object[items.size()];
223 this.timecardSummariesLabelList = new Object[items.size()];
224
225 try
226 {
227 final List<String> labelProperties =
228 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\W&&[^\\.]]+")));
229 final List<String> labelDelimiters =
230 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\w\\.]+")));
231 int ctr = 0;
232 for (final Iterator<? extends Object> iterator = items.iterator(); iterator.hasNext(); ctr++)
233 {
234 final Object item = iterator.next();
235 if (item != null)
236 {
237 this.timecardSummariesValueList[ctr] = valueProperty == null ? item :
238 PropertyUtils.getProperty(item, valueProperty.trim());
239 if (labelProperties == null)
240 {
241 this.timecardSummariesLabelList[ctr] = item;
242 }
243 else
244 {
245 final StringBuilder labelText = new StringBuilder();
246 int ctr2 = 0;
247 do
248 {
249 if (!labelDelimiters.isEmpty())
250 {
251 labelText.append(labelDelimiters.get(ctr2));
252 }
253 String property = null;
254 if (ctr2 < labelProperties.size())
255 {
256 property = labelProperties.get(ctr2);
257 }
258 if (property != null && property.length() > 0)
259 {
260 if (PropertyUtils.isReadable(item, property))
261 {
262 Object value = PropertyUtils.getProperty(item, property);
263 if (value != null)
264 {
265 if (value instanceof String)
266 {
267 if (((String)value).trim().length() == 0)
268 {
269 value = null;
270 }
271 }
272 if (value != null)
273 {
274 labelText.append(value);
275 }
276 }
277 }
278 else
279 {
280 labelText.append(property);
281 }
282 }
283 ctr2++;
284 }
285 while (ctr2 < labelDelimiters.size());
286 this.timecardSummariesLabelList[ctr] = labelText.toString().replaceAll("\\s+", " ").trim();
287 }
288 }
289 }
290 }
291 catch (final Throwable throwable)
292 {
293 throw new RuntimeException(throwable);
294 }
295 }
296 }
297 private TimecardSummaryVO[] timecardSummariesBackingValue;
298
299
300
301
302 public void setTimecardSummariesBackingValue(TimecardSummaryVO[] timecardSummariesBackingValueIn)
303 {
304 this.timecardSummariesBackingValue = timecardSummariesBackingValueIn;
305 }
306
307
308
309
310 public TimecardSummaryVO[] getTimecardSummariesBackingValue()
311 {
312 return this.timecardSummariesBackingValue;
313 }
314
315
316
317
318
319
320 private Object[] timecardSummariesIdValueList;
321
322
323
324
325 private Object[] timecardSummariesIdLabelList;
326
327
328
329
330 public Object[] getTimecardSummariesIdBackingList()
331 {
332 Object[] values = this.timecardSummariesIdValueList;
333 Object[] labels = this.timecardSummariesIdLabelList;
334
335 if (values == null || values.length == 0)
336 {
337 return values;
338 }
339
340 if (labels == null || labels.length == 0)
341 {
342 labels = values;
343 }
344
345 final int length = Math.min(labels.length, values.length);
346 SelectItem[] backingList = new SelectItem[length];
347
348 for (int ctr = 0; ctr < length; ctr++)
349 {
350 backingList[ctr] = new SelectItem(
351 values[ctr] != null ? values[ctr] : "", labels[ctr] != null ? String.valueOf(labels[ctr]) : "");
352 }
353 return backingList;
354 }
355
356
357
358
359 public Object[] getTimecardSummariesIdValueList()
360 {
361 return this.timecardSummariesIdValueList;
362 }
363
364
365
366
367 public void setTimecardSummariesIdValueList(Object[] timecardSummariesIdValueListIn)
368 {
369 this.timecardSummariesIdValueList = timecardSummariesIdValueListIn;
370 }
371
372
373
374
375 public Object[] getTimecardSummariesIdLabelList()
376 {
377 return this.timecardSummariesIdLabelList;
378 }
379
380
381
382
383 public void setTimecardSummariesIdLabelList(Object[] timecardSummariesIdLabelListIn)
384 {
385 this.timecardSummariesIdLabelList = timecardSummariesIdLabelListIn;
386 }
387
388
389
390
391
392
393 public void setTimecardSummariesIdBackingList(Collection<? extends Object> items, String valueProperty, String labelProperty)
394 {
395 this.timecardSummariesIdValueList = null;
396 this.timecardSummariesIdLabelList = null;
397 if (items != null)
398 {
399 this.timecardSummariesIdValueList = new Object[items.size()];
400 this.timecardSummariesIdLabelList = new Object[items.size()];
401
402 try
403 {
404 final List<String> labelProperties =
405 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\W&&[^\\.]]+")));
406 final List<String> labelDelimiters =
407 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\w\\.]+")));
408 int ctr = 0;
409 for (final Iterator<? extends Object> iterator = items.iterator(); iterator.hasNext(); ctr++)
410 {
411 final Object item = iterator.next();
412 if (item != null)
413 {
414 this.timecardSummariesIdValueList[ctr] = valueProperty == null ? item :
415 PropertyUtils.getProperty(item, valueProperty.trim());
416 if (labelProperties == null)
417 {
418 this.timecardSummariesIdLabelList[ctr] = item;
419 }
420 else
421 {
422 final StringBuilder labelText = new StringBuilder();
423 int ctr2 = 0;
424 do
425 {
426 if (!labelDelimiters.isEmpty())
427 {
428 labelText.append(labelDelimiters.get(ctr2));
429 }
430 String property = null;
431 if (ctr2 < labelProperties.size())
432 {
433 property = labelProperties.get(ctr2);
434 }
435 if (property != null && property.length() > 0)
436 {
437 if (PropertyUtils.isReadable(item, property))
438 {
439 Object value = PropertyUtils.getProperty(item, property);
440 if (value != null)
441 {
442 if (value instanceof String)
443 {
444 if (((String)value).trim().length() == 0)
445 {
446 value = null;
447 }
448 }
449 if (value != null)
450 {
451 labelText.append(value);
452 }
453 }
454 }
455 else
456 {
457 labelText.append(property);
458 }
459 }
460 ctr2++;
461 }
462 while (ctr2 < labelDelimiters.size());
463 this.timecardSummariesIdLabelList[ctr] = labelText.toString().replaceAll("\\s+", " ").trim();
464 }
465 }
466 }
467 }
468 catch (final Throwable throwable)
469 {
470 throw new RuntimeException(throwable);
471 }
472 }
473 }
474
475
476
477
478 private Object[] timecardSummariesStatusValueList;
479
480
481
482
483 private Object[] timecardSummariesStatusLabelList;
484
485
486
487
488 public Object[] getTimecardSummariesStatusBackingList()
489 {
490 Object[] values = this.timecardSummariesStatusValueList;
491 Object[] labels = this.timecardSummariesStatusLabelList;
492
493 if (values == null || values.length == 0)
494 {
495 return values;
496 }
497
498 if (labels == null || labels.length == 0)
499 {
500 labels = values;
501 }
502
503 final int length = Math.min(labels.length, values.length);
504 SelectItem[] backingList = new SelectItem[length];
505
506 for (int ctr = 0; ctr < length; ctr++)
507 {
508 backingList[ctr] = new SelectItem(
509 values[ctr] != null ? values[ctr] : "", labels[ctr] != null ? String.valueOf(labels[ctr]) : "");
510 }
511 return backingList;
512 }
513
514
515
516
517 public Object[] getTimecardSummariesStatusValueList()
518 {
519 return this.timecardSummariesStatusValueList;
520 }
521
522
523
524
525 public void setTimecardSummariesStatusValueList(Object[] timecardSummariesStatusValueListIn)
526 {
527 this.timecardSummariesStatusValueList = timecardSummariesStatusValueListIn;
528 }
529
530
531
532
533 public Object[] getTimecardSummariesStatusLabelList()
534 {
535 return this.timecardSummariesStatusLabelList;
536 }
537
538
539
540
541 public void setTimecardSummariesStatusLabelList(Object[] timecardSummariesStatusLabelListIn)
542 {
543 this.timecardSummariesStatusLabelList = timecardSummariesStatusLabelListIn;
544 }
545
546
547
548
549
550
551 public void setTimecardSummariesStatusBackingList(Collection<? extends Object> items, String valueProperty, String labelProperty)
552 {
553 this.timecardSummariesStatusValueList = null;
554 this.timecardSummariesStatusLabelList = null;
555 if (items != null)
556 {
557 this.timecardSummariesStatusValueList = new Object[items.size()];
558 this.timecardSummariesStatusLabelList = new Object[items.size()];
559
560 try
561 {
562 final List<String> labelProperties =
563 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\W&&[^\\.]]+")));
564 final List<String> labelDelimiters =
565 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\w\\.]+")));
566 int ctr = 0;
567 for (final Iterator<? extends Object> iterator = items.iterator(); iterator.hasNext(); ctr++)
568 {
569 final Object item = iterator.next();
570 if (item != null)
571 {
572 this.timecardSummariesStatusValueList[ctr] = valueProperty == null ? item :
573 PropertyUtils.getProperty(item, valueProperty.trim());
574 if (labelProperties == null)
575 {
576 this.timecardSummariesStatusLabelList[ctr] = item;
577 }
578 else
579 {
580 final StringBuilder labelText = new StringBuilder();
581 int ctr2 = 0;
582 do
583 {
584 if (!labelDelimiters.isEmpty())
585 {
586 labelText.append(labelDelimiters.get(ctr2));
587 }
588 String property = null;
589 if (ctr2 < labelProperties.size())
590 {
591 property = labelProperties.get(ctr2);
592 }
593 if (property != null && property.length() > 0)
594 {
595 if (PropertyUtils.isReadable(item, property))
596 {
597 Object value = PropertyUtils.getProperty(item, property);
598 if (value != null)
599 {
600 if (value instanceof String)
601 {
602 if (((String)value).trim().length() == 0)
603 {
604 value = null;
605 }
606 }
607 if (value != null)
608 {
609 labelText.append(value);
610 }
611 }
612 }
613 else
614 {
615 labelText.append(property);
616 }
617 }
618 ctr2++;
619 }
620 while (ctr2 < labelDelimiters.size());
621 this.timecardSummariesStatusLabelList[ctr] = labelText.toString().replaceAll("\\s+", " ").trim();
622 }
623 }
624 }
625 }
626 catch (final Throwable throwable)
627 {
628 throw new RuntimeException(throwable);
629 }
630 }
631 }
632
633
634
635
636 private Object[] timecardSummariesStartDateValueList;
637
638
639
640
641 private Object[] timecardSummariesStartDateLabelList;
642
643
644
645
646 public Object[] getTimecardSummariesStartDateBackingList()
647 {
648 Object[] values = this.timecardSummariesStartDateValueList;
649 Object[] labels = this.timecardSummariesStartDateLabelList;
650
651 if (values == null || values.length == 0)
652 {
653 return values;
654 }
655
656 if (labels == null || labels.length == 0)
657 {
658 labels = values;
659 }
660
661 final int length = Math.min(labels.length, values.length);
662 SelectItem[] backingList = new SelectItem[length];
663
664 for (int ctr = 0; ctr < length; ctr++)
665 {
666 backingList[ctr] = new SelectItem(
667 values[ctr] != null ? values[ctr] : "", labels[ctr] != null ? String.valueOf(labels[ctr]) : "");
668 }
669 return backingList;
670 }
671
672
673
674
675 public Object[] getTimecardSummariesStartDateValueList()
676 {
677 return this.timecardSummariesStartDateValueList;
678 }
679
680
681
682
683 public void setTimecardSummariesStartDateValueList(Object[] timecardSummariesStartDateValueListIn)
684 {
685 this.timecardSummariesStartDateValueList = timecardSummariesStartDateValueListIn;
686 }
687
688
689
690
691 public Object[] getTimecardSummariesStartDateLabelList()
692 {
693 return this.timecardSummariesStartDateLabelList;
694 }
695
696
697
698
699 public void setTimecardSummariesStartDateLabelList(Object[] timecardSummariesStartDateLabelListIn)
700 {
701 this.timecardSummariesStartDateLabelList = timecardSummariesStartDateLabelListIn;
702 }
703
704
705
706
707
708
709 public void setTimecardSummariesStartDateBackingList(Collection<? extends Object> items, String valueProperty, String labelProperty)
710 {
711 this.timecardSummariesStartDateValueList = null;
712 this.timecardSummariesStartDateLabelList = null;
713 if (items != null)
714 {
715 this.timecardSummariesStartDateValueList = new Object[items.size()];
716 this.timecardSummariesStartDateLabelList = new Object[items.size()];
717
718 try
719 {
720 final List<String> labelProperties =
721 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\W&&[^\\.]]+")));
722 final List<String> labelDelimiters =
723 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\w\\.]+")));
724 int ctr = 0;
725 for (final Iterator<? extends Object> iterator = items.iterator(); iterator.hasNext(); ctr++)
726 {
727 final Object item = iterator.next();
728 if (item != null)
729 {
730 this.timecardSummariesStartDateValueList[ctr] = valueProperty == null ? item :
731 PropertyUtils.getProperty(item, valueProperty.trim());
732 if (labelProperties == null)
733 {
734 this.timecardSummariesStartDateLabelList[ctr] = item;
735 }
736 else
737 {
738 final StringBuilder labelText = new StringBuilder();
739 int ctr2 = 0;
740 do
741 {
742 if (!labelDelimiters.isEmpty())
743 {
744 labelText.append(labelDelimiters.get(ctr2));
745 }
746 String property = null;
747 if (ctr2 < labelProperties.size())
748 {
749 property = labelProperties.get(ctr2);
750 }
751 if (property != null && property.length() > 0)
752 {
753 if (PropertyUtils.isReadable(item, property))
754 {
755 Object value = PropertyUtils.getProperty(item, property);
756 if (value != null)
757 {
758 if (value instanceof String)
759 {
760 if (((String)value).trim().length() == 0)
761 {
762 value = null;
763 }
764 }
765 if (value != null)
766 {
767 labelText.append(value);
768 }
769 }
770 }
771 else
772 {
773 labelText.append(property);
774 }
775 }
776 ctr2++;
777 }
778 while (ctr2 < labelDelimiters.size());
779 this.timecardSummariesStartDateLabelList[ctr] = labelText.toString().replaceAll("\\s+", " ").trim();
780 }
781 }
782 }
783 }
784 catch (final Throwable throwable)
785 {
786 throw new RuntimeException(throwable);
787 }
788 }
789 }
790
791
792
793
794 private Object[] timecardSummariesCommentsValueList;
795
796
797
798
799 private Object[] timecardSummariesCommentsLabelList;
800
801
802
803
804 public Object[] getTimecardSummariesCommentsBackingList()
805 {
806 Object[] values = this.timecardSummariesCommentsValueList;
807 Object[] labels = this.timecardSummariesCommentsLabelList;
808
809 if (values == null || values.length == 0)
810 {
811 return values;
812 }
813
814 if (labels == null || labels.length == 0)
815 {
816 labels = values;
817 }
818
819 final int length = Math.min(labels.length, values.length);
820 SelectItem[] backingList = new SelectItem[length];
821
822 for (int ctr = 0; ctr < length; ctr++)
823 {
824 backingList[ctr] = new SelectItem(
825 values[ctr] != null ? values[ctr] : "", labels[ctr] != null ? String.valueOf(labels[ctr]) : "");
826 }
827 return backingList;
828 }
829
830
831
832
833 public Object[] getTimecardSummariesCommentsValueList()
834 {
835 return this.timecardSummariesCommentsValueList;
836 }
837
838
839
840
841 public void setTimecardSummariesCommentsValueList(Object[] timecardSummariesCommentsValueListIn)
842 {
843 this.timecardSummariesCommentsValueList = timecardSummariesCommentsValueListIn;
844 }
845
846
847
848
849 public Object[] getTimecardSummariesCommentsLabelList()
850 {
851 return this.timecardSummariesCommentsLabelList;
852 }
853
854
855
856
857 public void setTimecardSummariesCommentsLabelList(Object[] timecardSummariesCommentsLabelListIn)
858 {
859 this.timecardSummariesCommentsLabelList = timecardSummariesCommentsLabelListIn;
860 }
861
862
863
864
865
866
867 public void setTimecardSummariesCommentsBackingList(Collection<? extends Object> items, String valueProperty, String labelProperty)
868 {
869 this.timecardSummariesCommentsValueList = null;
870 this.timecardSummariesCommentsLabelList = null;
871 if (items != null)
872 {
873 this.timecardSummariesCommentsValueList = new Object[items.size()];
874 this.timecardSummariesCommentsLabelList = new Object[items.size()];
875
876 try
877 {
878 final List<String> labelProperties =
879 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\W&&[^\\.]]+")));
880 final List<String> labelDelimiters =
881 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\w\\.]+")));
882 int ctr = 0;
883 for (final Iterator<? extends Object> iterator = items.iterator(); iterator.hasNext(); ctr++)
884 {
885 final Object item = iterator.next();
886 if (item != null)
887 {
888 this.timecardSummariesCommentsValueList[ctr] = valueProperty == null ? item :
889 PropertyUtils.getProperty(item, valueProperty.trim());
890 if (labelProperties == null)
891 {
892 this.timecardSummariesCommentsLabelList[ctr] = item;
893 }
894 else
895 {
896 final StringBuilder labelText = new StringBuilder();
897 int ctr2 = 0;
898 do
899 {
900 if (!labelDelimiters.isEmpty())
901 {
902 labelText.append(labelDelimiters.get(ctr2));
903 }
904 String property = null;
905 if (ctr2 < labelProperties.size())
906 {
907 property = labelProperties.get(ctr2);
908 }
909 if (property != null && property.length() > 0)
910 {
911 if (PropertyUtils.isReadable(item, property))
912 {
913 Object value = PropertyUtils.getProperty(item, property);
914 if (value != null)
915 {
916 if (value instanceof String)
917 {
918 if (((String)value).trim().length() == 0)
919 {
920 value = null;
921 }
922 }
923 if (value != null)
924 {
925 labelText.append(value);
926 }
927 }
928 }
929 else
930 {
931 labelText.append(property);
932 }
933 }
934 ctr2++;
935 }
936 while (ctr2 < labelDelimiters.size());
937 this.timecardSummariesCommentsLabelList[ctr] = labelText.toString().replaceAll("\\s+", " ").trim();
938 }
939 }
940 }
941 }
942 catch (final Throwable throwable)
943 {
944 throw new RuntimeException(throwable);
945 }
946 }
947 }
948
949
950
951
952 private Object[] timecardSummariesSubmitterNameValueList;
953
954
955
956
957 private Object[] timecardSummariesSubmitterNameLabelList;
958
959
960
961
962 public Object[] getTimecardSummariesSubmitterNameBackingList()
963 {
964 Object[] values = this.timecardSummariesSubmitterNameValueList;
965 Object[] labels = this.timecardSummariesSubmitterNameLabelList;
966
967 if (values == null || values.length == 0)
968 {
969 return values;
970 }
971
972 if (labels == null || labels.length == 0)
973 {
974 labels = values;
975 }
976
977 final int length = Math.min(labels.length, values.length);
978 SelectItem[] backingList = new SelectItem[length];
979
980 for (int ctr = 0; ctr < length; ctr++)
981 {
982 backingList[ctr] = new SelectItem(
983 values[ctr] != null ? values[ctr] : "", labels[ctr] != null ? String.valueOf(labels[ctr]) : "");
984 }
985 return backingList;
986 }
987
988
989
990
991 public Object[] getTimecardSummariesSubmitterNameValueList()
992 {
993 return this.timecardSummariesSubmitterNameValueList;
994 }
995
996
997
998
999 public void setTimecardSummariesSubmitterNameValueList(Object[] timecardSummariesSubmitterNameValueListIn)
1000 {
1001 this.timecardSummariesSubmitterNameValueList = timecardSummariesSubmitterNameValueListIn;
1002 }
1003
1004
1005
1006
1007 public Object[] getTimecardSummariesSubmitterNameLabelList()
1008 {
1009 return this.timecardSummariesSubmitterNameLabelList;
1010 }
1011
1012
1013
1014
1015 public void setTimecardSummariesSubmitterNameLabelList(Object[] timecardSummariesSubmitterNameLabelListIn)
1016 {
1017 this.timecardSummariesSubmitterNameLabelList = timecardSummariesSubmitterNameLabelListIn;
1018 }
1019
1020
1021
1022
1023
1024
1025 public void setTimecardSummariesSubmitterNameBackingList(Collection<? extends Object> items, String valueProperty, String labelProperty)
1026 {
1027 this.timecardSummariesSubmitterNameValueList = null;
1028 this.timecardSummariesSubmitterNameLabelList = null;
1029 if (items != null)
1030 {
1031 this.timecardSummariesSubmitterNameValueList = new Object[items.size()];
1032 this.timecardSummariesSubmitterNameLabelList = new Object[items.size()];
1033
1034 try
1035 {
1036 final List<String> labelProperties =
1037 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\W&&[^\\.]]+")));
1038 final List<String> labelDelimiters =
1039 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\w\\.]+")));
1040 int ctr = 0;
1041 for (final Iterator<? extends Object> iterator = items.iterator(); iterator.hasNext(); ctr++)
1042 {
1043 final Object item = iterator.next();
1044 if (item != null)
1045 {
1046 this.timecardSummariesSubmitterNameValueList[ctr] = valueProperty == null ? item :
1047 PropertyUtils.getProperty(item, valueProperty.trim());
1048 if (labelProperties == null)
1049 {
1050 this.timecardSummariesSubmitterNameLabelList[ctr] = item;
1051 }
1052 else
1053 {
1054 final StringBuilder labelText = new StringBuilder();
1055 int ctr2 = 0;
1056 do
1057 {
1058 if (!labelDelimiters.isEmpty())
1059 {
1060 labelText.append(labelDelimiters.get(ctr2));
1061 }
1062 String property = null;
1063 if (ctr2 < labelProperties.size())
1064 {
1065 property = labelProperties.get(ctr2);
1066 }
1067 if (property != null && property.length() > 0)
1068 {
1069 if (PropertyUtils.isReadable(item, property))
1070 {
1071 Object value = PropertyUtils.getProperty(item, property);
1072 if (value != null)
1073 {
1074 if (value instanceof String)
1075 {
1076 if (((String)value).trim().length() == 0)
1077 {
1078 value = null;
1079 }
1080 }
1081 if (value != null)
1082 {
1083 labelText.append(value);
1084 }
1085 }
1086 }
1087 else
1088 {
1089 labelText.append(property);
1090 }
1091 }
1092 ctr2++;
1093 }
1094 while (ctr2 < labelDelimiters.size());
1095 this.timecardSummariesSubmitterNameLabelList[ctr] = labelText.toString().replaceAll("\\s+", " ").trim();
1096 }
1097 }
1098 }
1099 }
1100 catch (final Throwable throwable)
1101 {
1102 throw new RuntimeException(throwable);
1103 }
1104 }
1105 }
1106
1107
1108
1109
1110 private Object[] timecardSummariesApproverNameValueList;
1111
1112
1113
1114
1115 private Object[] timecardSummariesApproverNameLabelList;
1116
1117
1118
1119
1120 public Object[] getTimecardSummariesApproverNameBackingList()
1121 {
1122 Object[] values = this.timecardSummariesApproverNameValueList;
1123 Object[] labels = this.timecardSummariesApproverNameLabelList;
1124
1125 if (values == null || values.length == 0)
1126 {
1127 return values;
1128 }
1129
1130 if (labels == null || labels.length == 0)
1131 {
1132 labels = values;
1133 }
1134
1135 final int length = Math.min(labels.length, values.length);
1136 SelectItem[] backingList = new SelectItem[length];
1137
1138 for (int ctr = 0; ctr < length; ctr++)
1139 {
1140 backingList[ctr] = new SelectItem(
1141 values[ctr] != null ? values[ctr] : "", labels[ctr] != null ? String.valueOf(labels[ctr]) : "");
1142 }
1143 return backingList;
1144 }
1145
1146
1147
1148
1149 public Object[] getTimecardSummariesApproverNameValueList()
1150 {
1151 return this.timecardSummariesApproverNameValueList;
1152 }
1153
1154
1155
1156
1157 public void setTimecardSummariesApproverNameValueList(Object[] timecardSummariesApproverNameValueListIn)
1158 {
1159 this.timecardSummariesApproverNameValueList = timecardSummariesApproverNameValueListIn;
1160 }
1161
1162
1163
1164
1165 public Object[] getTimecardSummariesApproverNameLabelList()
1166 {
1167 return this.timecardSummariesApproverNameLabelList;
1168 }
1169
1170
1171
1172
1173 public void setTimecardSummariesApproverNameLabelList(Object[] timecardSummariesApproverNameLabelListIn)
1174 {
1175 this.timecardSummariesApproverNameLabelList = timecardSummariesApproverNameLabelListIn;
1176 }
1177
1178
1179
1180
1181
1182
1183 public void setTimecardSummariesApproverNameBackingList(Collection<? extends Object> items, String valueProperty, String labelProperty)
1184 {
1185 this.timecardSummariesApproverNameValueList = null;
1186 this.timecardSummariesApproverNameLabelList = null;
1187 if (items != null)
1188 {
1189 this.timecardSummariesApproverNameValueList = new Object[items.size()];
1190 this.timecardSummariesApproverNameLabelList = new Object[items.size()];
1191
1192 try
1193 {
1194 final List<String> labelProperties =
1195 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\W&&[^\\.]]+")));
1196 final List<String> labelDelimiters =
1197 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\w\\.]+")));
1198 int ctr = 0;
1199 for (final Iterator<? extends Object> iterator = items.iterator(); iterator.hasNext(); ctr++)
1200 {
1201 final Object item = iterator.next();
1202 if (item != null)
1203 {
1204 this.timecardSummariesApproverNameValueList[ctr] = valueProperty == null ? item :
1205 PropertyUtils.getProperty(item, valueProperty.trim());
1206 if (labelProperties == null)
1207 {
1208 this.timecardSummariesApproverNameLabelList[ctr] = item;
1209 }
1210 else
1211 {
1212 final StringBuilder labelText = new StringBuilder();
1213 int ctr2 = 0;
1214 do
1215 {
1216 if (!labelDelimiters.isEmpty())
1217 {
1218 labelText.append(labelDelimiters.get(ctr2));
1219 }
1220 String property = null;
1221 if (ctr2 < labelProperties.size())
1222 {
1223 property = labelProperties.get(ctr2);
1224 }
1225 if (property != null && property.length() > 0)
1226 {
1227 if (PropertyUtils.isReadable(item, property))
1228 {
1229 Object value = PropertyUtils.getProperty(item, property);
1230 if (value != null)
1231 {
1232 if (value instanceof String)
1233 {
1234 if (((String)value).trim().length() == 0)
1235 {
1236 value = null;
1237 }
1238 }
1239 if (value != null)
1240 {
1241 labelText.append(value);
1242 }
1243 }
1244 }
1245 else
1246 {
1247 labelText.append(property);
1248 }
1249 }
1250 ctr2++;
1251 }
1252 while (ctr2 < labelDelimiters.size());
1253 this.timecardSummariesApproverNameLabelList[ctr] = labelText.toString().replaceAll("\\s+", " ").trim();
1254 }
1255 }
1256 }
1257 }
1258 catch (final Throwable throwable)
1259 {
1260 throw new RuntimeException(throwable);
1261 }
1262 }
1263 }
1264
1265
1266 private Long submitter;
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276 public Long getSubmitter()
1277 {
1278 return this.submitter;
1279 }
1280
1281
1282
1283
1284
1285 private boolean submitterSet = false;
1286
1287
1288
1289
1290 public void resetSubmitterSet()
1291 {
1292 this.submitterSet = false;
1293 }
1294
1295
1296
1297
1298
1299
1300
1301 public boolean isSubmitterSet()
1302 {
1303 return this.submitterSet;
1304 }
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314 public void setSubmitter(Long submitterIn)
1315 {
1316 this.submitter = submitterIn;
1317 this.submitterSet = true;
1318 }
1319
1320
1321
1322
1323 private Object[] submitterValueList;
1324
1325
1326
1327
1328 private Object[] submitterLabelList;
1329
1330
1331
1332
1333 public Object[] getSubmitterBackingList()
1334 {
1335 Object[] values = this.submitterValueList;
1336 Object[] labels = this.submitterLabelList;
1337
1338 if (values == null || values.length == 0)
1339 {
1340 return values;
1341 }
1342
1343 if (labels == null || labels.length == 0)
1344 {
1345 labels = values;
1346 }
1347
1348 final int length = Math.min(labels.length, values.length);
1349 SelectItem[] backingList = new SelectItem[length];
1350
1351 for (int ctr = 0; ctr < length; ctr++)
1352 {
1353 backingList[ctr] = new SelectItem(
1354 values[ctr] != null ? values[ctr] : "", labels[ctr] != null ? String.valueOf(labels[ctr]) : "");
1355 }
1356 return backingList;
1357 }
1358
1359
1360
1361
1362 public Object[] getSubmitterValueList()
1363 {
1364 return this.submitterValueList;
1365 }
1366
1367
1368
1369
1370 public void setSubmitterValueList(Object[] submitterValueListIn)
1371 {
1372 this.submitterValueList = submitterValueListIn;
1373 }
1374
1375
1376
1377
1378 public Object[] getSubmitterLabelList()
1379 {
1380 return this.submitterLabelList;
1381 }
1382
1383
1384
1385
1386 public void setSubmitterLabelList(Object[] submitterLabelListIn)
1387 {
1388 this.submitterLabelList = submitterLabelListIn;
1389 }
1390
1391
1392
1393
1394
1395
1396 public void setSubmitterBackingList(Collection<? extends Object> items, String valueProperty, String labelProperty)
1397 {
1398 this.submitterValueList = null;
1399 this.submitterLabelList = null;
1400 if (items != null)
1401 {
1402 this.submitterValueList = new Object[items.size()];
1403 this.submitterLabelList = new Object[items.size()];
1404
1405 try
1406 {
1407 final List<String> labelProperties =
1408 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\W&&[^\\.]]+")));
1409 final List<String> labelDelimiters =
1410 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\w\\.]+")));
1411 int ctr = 0;
1412 for (final Iterator<? extends Object> iterator = items.iterator(); iterator.hasNext(); ctr++)
1413 {
1414 final Object item = iterator.next();
1415 if (item != null)
1416 {
1417 this.submitterValueList[ctr] = valueProperty == null ? item :
1418 PropertyUtils.getProperty(item, valueProperty.trim());
1419 if (labelProperties == null)
1420 {
1421 this.submitterLabelList[ctr] = item;
1422 }
1423 else
1424 {
1425 final StringBuilder labelText = new StringBuilder();
1426 int ctr2 = 0;
1427 do
1428 {
1429 if (!labelDelimiters.isEmpty())
1430 {
1431 labelText.append(labelDelimiters.get(ctr2));
1432 }
1433 String property = null;
1434 if (ctr2 < labelProperties.size())
1435 {
1436 property = labelProperties.get(ctr2);
1437 }
1438 if (property != null && property.length() > 0)
1439 {
1440 if (PropertyUtils.isReadable(item, property))
1441 {
1442 Object value = PropertyUtils.getProperty(item, property);
1443 if (value != null)
1444 {
1445 if (value instanceof String)
1446 {
1447 if (((String)value).trim().length() == 0)
1448 {
1449 value = null;
1450 }
1451 }
1452 if (value != null)
1453 {
1454 labelText.append(value);
1455 }
1456 }
1457 }
1458 else
1459 {
1460 labelText.append(property);
1461 }
1462 }
1463 ctr2++;
1464 }
1465 while (ctr2 < labelDelimiters.size());
1466 this.submitterLabelList[ctr] = labelText.toString().replaceAll("\\s+", " ").trim();
1467 }
1468 }
1469 }
1470 }
1471 catch (final Throwable throwable)
1472 {
1473 throw new RuntimeException(throwable);
1474 }
1475 }
1476 }
1477
1478
1479 private Long approver;
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489 public Long getApprover()
1490 {
1491 return this.approver;
1492 }
1493
1494
1495
1496
1497
1498 private boolean approverSet = false;
1499
1500
1501
1502
1503 public void resetApproverSet()
1504 {
1505 this.approverSet = false;
1506 }
1507
1508
1509
1510
1511
1512
1513
1514 public boolean isApproverSet()
1515 {
1516 return this.approverSet;
1517 }
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527 public void setApprover(Long approverIn)
1528 {
1529 this.approver = approverIn;
1530 this.approverSet = true;
1531 }
1532
1533
1534
1535
1536 private Object[] approverValueList;
1537
1538
1539
1540
1541 private Object[] approverLabelList;
1542
1543
1544
1545
1546 public Object[] getApproverBackingList()
1547 {
1548 Object[] values = this.approverValueList;
1549 Object[] labels = this.approverLabelList;
1550
1551 if (values == null || values.length == 0)
1552 {
1553 return values;
1554 }
1555
1556 if (labels == null || labels.length == 0)
1557 {
1558 labels = values;
1559 }
1560
1561 final int length = Math.min(labels.length, values.length);
1562 SelectItem[] backingList = new SelectItem[length];
1563
1564 for (int ctr = 0; ctr < length; ctr++)
1565 {
1566 backingList[ctr] = new SelectItem(
1567 values[ctr] != null ? values[ctr] : "", labels[ctr] != null ? String.valueOf(labels[ctr]) : "");
1568 }
1569 return backingList;
1570 }
1571
1572
1573
1574
1575 public Object[] getApproverValueList()
1576 {
1577 return this.approverValueList;
1578 }
1579
1580
1581
1582
1583 public void setApproverValueList(Object[] approverValueListIn)
1584 {
1585 this.approverValueList = approverValueListIn;
1586 }
1587
1588
1589
1590
1591 public Object[] getApproverLabelList()
1592 {
1593 return this.approverLabelList;
1594 }
1595
1596
1597
1598
1599 public void setApproverLabelList(Object[] approverLabelListIn)
1600 {
1601 this.approverLabelList = approverLabelListIn;
1602 }
1603
1604
1605
1606
1607
1608
1609 public void setApproverBackingList(Collection<? extends Object> items, String valueProperty, String labelProperty)
1610 {
1611 this.approverValueList = null;
1612 this.approverLabelList = null;
1613 if (items != null)
1614 {
1615 this.approverValueList = new Object[items.size()];
1616 this.approverLabelList = new Object[items.size()];
1617
1618 try
1619 {
1620 final List<String> labelProperties =
1621 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\W&&[^\\.]]+")));
1622 final List<String> labelDelimiters =
1623 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\w\\.]+")));
1624 int ctr = 0;
1625 for (final Iterator<? extends Object> iterator = items.iterator(); iterator.hasNext(); ctr++)
1626 {
1627 final Object item = iterator.next();
1628 if (item != null)
1629 {
1630 this.approverValueList[ctr] = valueProperty == null ? item :
1631 PropertyUtils.getProperty(item, valueProperty.trim());
1632 if (labelProperties == null)
1633 {
1634 this.approverLabelList[ctr] = item;
1635 }
1636 else
1637 {
1638 final StringBuilder labelText = new StringBuilder();
1639 int ctr2 = 0;
1640 do
1641 {
1642 if (!labelDelimiters.isEmpty())
1643 {
1644 labelText.append(labelDelimiters.get(ctr2));
1645 }
1646 String property = null;
1647 if (ctr2 < labelProperties.size())
1648 {
1649 property = labelProperties.get(ctr2);
1650 }
1651 if (property != null && property.length() > 0)
1652 {
1653 if (PropertyUtils.isReadable(item, property))
1654 {
1655 Object value = PropertyUtils.getProperty(item, property);
1656 if (value != null)
1657 {
1658 if (value instanceof String)
1659 {
1660 if (((String)value).trim().length() == 0)
1661 {
1662 value = null;
1663 }
1664 }
1665 if (value != null)
1666 {
1667 labelText.append(value);
1668 }
1669 }
1670 }
1671 else
1672 {
1673 labelText.append(property);
1674 }
1675 }
1676 ctr2++;
1677 }
1678 while (ctr2 < labelDelimiters.size());
1679 this.approverLabelList[ctr] = labelText.toString().replaceAll("\\s+", " ").trim();
1680 }
1681 }
1682 }
1683 }
1684 catch (final Throwable throwable)
1685 {
1686 throw new RuntimeException(throwable);
1687 }
1688 }
1689 }
1690
1691
1692 private String status;
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702 public String getStatus()
1703 {
1704 return this.status;
1705 }
1706
1707
1708
1709
1710
1711 private boolean statusSet = false;
1712
1713
1714
1715
1716 public void resetStatusSet()
1717 {
1718 this.statusSet = false;
1719 }
1720
1721
1722
1723
1724
1725
1726
1727 public boolean isStatusSet()
1728 {
1729 return this.statusSet;
1730 }
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740 public void setStatus(String statusIn)
1741 {
1742 this.status = statusIn;
1743 this.statusSet = true;
1744 }
1745
1746
1747
1748
1749 private Object[] statusValueList;
1750
1751
1752
1753
1754 private Object[] statusLabelList;
1755
1756
1757
1758
1759 public Object[] getStatusBackingList()
1760 {
1761 Object[] values = this.statusValueList;
1762 Object[] labels = this.statusLabelList;
1763
1764 if (values == null || values.length == 0)
1765 {
1766 return values;
1767 }
1768
1769 if (labels == null || labels.length == 0)
1770 {
1771 labels = values;
1772 }
1773
1774 final int length = Math.min(labels.length, values.length);
1775 SelectItem[] backingList = new SelectItem[length];
1776
1777 for (int ctr = 0; ctr < length; ctr++)
1778 {
1779 backingList[ctr] = new SelectItem(
1780 values[ctr] != null ? values[ctr] : "", labels[ctr] != null ? String.valueOf(labels[ctr]) : "");
1781 }
1782 return backingList;
1783 }
1784
1785
1786
1787
1788 public Object[] getStatusValueList()
1789 {
1790 return this.statusValueList;
1791 }
1792
1793
1794
1795
1796 public void setStatusValueList(Object[] statusValueListIn)
1797 {
1798 this.statusValueList = statusValueListIn;
1799 }
1800
1801
1802
1803
1804 public Object[] getStatusLabelList()
1805 {
1806 return this.statusLabelList;
1807 }
1808
1809
1810
1811
1812 public void setStatusLabelList(Object[] statusLabelListIn)
1813 {
1814 this.statusLabelList = statusLabelListIn;
1815 }
1816
1817
1818
1819
1820
1821
1822 public void setStatusBackingList(Collection<? extends Object> items, String valueProperty, String labelProperty)
1823 {
1824 this.statusValueList = null;
1825 this.statusLabelList = null;
1826 if (items != null)
1827 {
1828 this.statusValueList = new Object[items.size()];
1829 this.statusLabelList = new Object[items.size()];
1830
1831 try
1832 {
1833 final List<String> labelProperties =
1834 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\W&&[^\\.]]+")));
1835 final List<String> labelDelimiters =
1836 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\w\\.]+")));
1837 int ctr = 0;
1838 for (final Iterator<? extends Object> iterator = items.iterator(); iterator.hasNext(); ctr++)
1839 {
1840 final Object item = iterator.next();
1841 if (item != null)
1842 {
1843 this.statusValueList[ctr] = valueProperty == null ? item :
1844 PropertyUtils.getProperty(item, valueProperty.trim());
1845 if (labelProperties == null)
1846 {
1847 this.statusLabelList[ctr] = item;
1848 }
1849 else
1850 {
1851 final StringBuilder labelText = new StringBuilder();
1852 int ctr2 = 0;
1853 do
1854 {
1855 if (!labelDelimiters.isEmpty())
1856 {
1857 labelText.append(labelDelimiters.get(ctr2));
1858 }
1859 String property = null;
1860 if (ctr2 < labelProperties.size())
1861 {
1862 property = labelProperties.get(ctr2);
1863 }
1864 if (property != null && property.length() > 0)
1865 {
1866 if (PropertyUtils.isReadable(item, property))
1867 {
1868 Object value = PropertyUtils.getProperty(item, property);
1869 if (value != null)
1870 {
1871 if (value instanceof String)
1872 {
1873 if (((String)value).trim().length() == 0)
1874 {
1875 value = null;
1876 }
1877 }
1878 if (value != null)
1879 {
1880 labelText.append(value);
1881 }
1882 }
1883 }
1884 else
1885 {
1886 labelText.append(property);
1887 }
1888 }
1889 ctr2++;
1890 }
1891 while (ctr2 < labelDelimiters.size());
1892 this.statusLabelList[ctr] = labelText.toString().replaceAll("\\s+", " ").trim();
1893 }
1894 }
1895 }
1896 }
1897 catch (final Throwable throwable)
1898 {
1899 throw new RuntimeException(throwable);
1900 }
1901 }
1902 }
1903
1904
1905 private Date startDateMinimum;
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915 public Date getStartDateMinimum()
1916 {
1917 return this.startDateMinimum;
1918 }
1919
1920
1921
1922
1923
1924 private boolean startDateMinimumSet = false;
1925
1926
1927
1928
1929 public void resetStartDateMinimumSet()
1930 {
1931 this.startDateMinimumSet = false;
1932 }
1933
1934
1935
1936
1937
1938
1939
1940 public boolean isStartDateMinimumSet()
1941 {
1942 return this.startDateMinimumSet;
1943 }
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953 public void setStartDateMinimum(Date startDateMinimumIn)
1954 {
1955 this.startDateMinimum = startDateMinimumIn;
1956 this.startDateMinimumSet = true;
1957 }
1958
1959
1960
1961
1962 private Object[] startDateMinimumValueList;
1963
1964
1965
1966
1967 private Object[] startDateMinimumLabelList;
1968
1969
1970
1971
1972 public Object[] getStartDateMinimumBackingList()
1973 {
1974 Object[] values = this.startDateMinimumValueList;
1975 Object[] labels = this.startDateMinimumLabelList;
1976
1977 if (values == null || values.length == 0)
1978 {
1979 return values;
1980 }
1981
1982 if (labels == null || labels.length == 0)
1983 {
1984 labels = values;
1985 }
1986
1987 final int length = Math.min(labels.length, values.length);
1988 SelectItem[] backingList = new SelectItem[length];
1989
1990 for (int ctr = 0; ctr < length; ctr++)
1991 {
1992 backingList[ctr] = new SelectItem(
1993 values[ctr] != null ? values[ctr] : "", labels[ctr] != null ? String.valueOf(labels[ctr]) : "");
1994 }
1995 return backingList;
1996 }
1997
1998
1999
2000
2001 public Object[] getStartDateMinimumValueList()
2002 {
2003 return this.startDateMinimumValueList;
2004 }
2005
2006
2007
2008
2009 public void setStartDateMinimumValueList(Object[] startDateMinimumValueListIn)
2010 {
2011 this.startDateMinimumValueList = startDateMinimumValueListIn;
2012 }
2013
2014
2015
2016
2017 public Object[] getStartDateMinimumLabelList()
2018 {
2019 return this.startDateMinimumLabelList;
2020 }
2021
2022
2023
2024
2025 public void setStartDateMinimumLabelList(Object[] startDateMinimumLabelListIn)
2026 {
2027 this.startDateMinimumLabelList = startDateMinimumLabelListIn;
2028 }
2029
2030
2031
2032
2033
2034
2035 public void setStartDateMinimumBackingList(Collection<? extends Object> items, String valueProperty, String labelProperty)
2036 {
2037 this.startDateMinimumValueList = null;
2038 this.startDateMinimumLabelList = null;
2039 if (items != null)
2040 {
2041 this.startDateMinimumValueList = new Object[items.size()];
2042 this.startDateMinimumLabelList = new Object[items.size()];
2043
2044 try
2045 {
2046 final List<String> labelProperties =
2047 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\W&&[^\\.]]+")));
2048 final List<String> labelDelimiters =
2049 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\w\\.]+")));
2050 int ctr = 0;
2051 for (final Iterator<? extends Object> iterator = items.iterator(); iterator.hasNext(); ctr++)
2052 {
2053 final Object item = iterator.next();
2054 if (item != null)
2055 {
2056 this.startDateMinimumValueList[ctr] = valueProperty == null ? item :
2057 PropertyUtils.getProperty(item, valueProperty.trim());
2058 if (labelProperties == null)
2059 {
2060 this.startDateMinimumLabelList[ctr] = item;
2061 }
2062 else
2063 {
2064 final StringBuilder labelText = new StringBuilder();
2065 int ctr2 = 0;
2066 do
2067 {
2068 if (!labelDelimiters.isEmpty())
2069 {
2070 labelText.append(labelDelimiters.get(ctr2));
2071 }
2072 String property = null;
2073 if (ctr2 < labelProperties.size())
2074 {
2075 property = labelProperties.get(ctr2);
2076 }
2077 if (property != null && property.length() > 0)
2078 {
2079 if (PropertyUtils.isReadable(item, property))
2080 {
2081 Object value = PropertyUtils.getProperty(item, property);
2082 if (value != null)
2083 {
2084 if (value instanceof String)
2085 {
2086 if (((String)value).trim().length() == 0)
2087 {
2088 value = null;
2089 }
2090 }
2091 if (value != null)
2092 {
2093 labelText.append(value);
2094 }
2095 }
2096 }
2097 else
2098 {
2099 labelText.append(property);
2100 }
2101 }
2102 ctr2++;
2103 }
2104 while (ctr2 < labelDelimiters.size());
2105 this.startDateMinimumLabelList[ctr] = labelText.toString().replaceAll("\\s+", " ").trim();
2106 }
2107 }
2108 }
2109 }
2110 catch (final Throwable throwable)
2111 {
2112 throw new RuntimeException(throwable);
2113 }
2114 }
2115 }
2116
2117
2118 private Date startDateMaximum;
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128 public Date getStartDateMaximum()
2129 {
2130 return this.startDateMaximum;
2131 }
2132
2133
2134
2135
2136
2137 private boolean startDateMaximumSet = false;
2138
2139
2140
2141
2142 public void resetStartDateMaximumSet()
2143 {
2144 this.startDateMaximumSet = false;
2145 }
2146
2147
2148
2149
2150
2151
2152
2153 public boolean isStartDateMaximumSet()
2154 {
2155 return this.startDateMaximumSet;
2156 }
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166 public void setStartDateMaximum(Date startDateMaximumIn)
2167 {
2168 this.startDateMaximum = startDateMaximumIn;
2169 this.startDateMaximumSet = true;
2170 }
2171
2172
2173
2174
2175 private Object[] startDateMaximumValueList;
2176
2177
2178
2179
2180 private Object[] startDateMaximumLabelList;
2181
2182
2183
2184
2185 public Object[] getStartDateMaximumBackingList()
2186 {
2187 Object[] values = this.startDateMaximumValueList;
2188 Object[] labels = this.startDateMaximumLabelList;
2189
2190 if (values == null || values.length == 0)
2191 {
2192 return values;
2193 }
2194
2195 if (labels == null || labels.length == 0)
2196 {
2197 labels = values;
2198 }
2199
2200 final int length = Math.min(labels.length, values.length);
2201 SelectItem[] backingList = new SelectItem[length];
2202
2203 for (int ctr = 0; ctr < length; ctr++)
2204 {
2205 backingList[ctr] = new SelectItem(
2206 values[ctr] != null ? values[ctr] : "", labels[ctr] != null ? String.valueOf(labels[ctr]) : "");
2207 }
2208 return backingList;
2209 }
2210
2211
2212
2213
2214 public Object[] getStartDateMaximumValueList()
2215 {
2216 return this.startDateMaximumValueList;
2217 }
2218
2219
2220
2221
2222 public void setStartDateMaximumValueList(Object[] startDateMaximumValueListIn)
2223 {
2224 this.startDateMaximumValueList = startDateMaximumValueListIn;
2225 }
2226
2227
2228
2229
2230 public Object[] getStartDateMaximumLabelList()
2231 {
2232 return this.startDateMaximumLabelList;
2233 }
2234
2235
2236
2237
2238 public void setStartDateMaximumLabelList(Object[] startDateMaximumLabelListIn)
2239 {
2240 this.startDateMaximumLabelList = startDateMaximumLabelListIn;
2241 }
2242
2243
2244
2245
2246
2247
2248 public void setStartDateMaximumBackingList(Collection<? extends Object> items, String valueProperty, String labelProperty)
2249 {
2250 this.startDateMaximumValueList = null;
2251 this.startDateMaximumLabelList = null;
2252 if (items != null)
2253 {
2254 this.startDateMaximumValueList = new Object[items.size()];
2255 this.startDateMaximumLabelList = new Object[items.size()];
2256
2257 try
2258 {
2259 final List<String> labelProperties =
2260 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\W&&[^\\.]]+")));
2261 final List<String> labelDelimiters =
2262 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\w\\.]+")));
2263 int ctr = 0;
2264 for (final Iterator<? extends Object> iterator = items.iterator(); iterator.hasNext(); ctr++)
2265 {
2266 final Object item = iterator.next();
2267 if (item != null)
2268 {
2269 this.startDateMaximumValueList[ctr] = valueProperty == null ? item :
2270 PropertyUtils.getProperty(item, valueProperty.trim());
2271 if (labelProperties == null)
2272 {
2273 this.startDateMaximumLabelList[ctr] = item;
2274 }
2275 else
2276 {
2277 final StringBuilder labelText = new StringBuilder();
2278 int ctr2 = 0;
2279 do
2280 {
2281 if (!labelDelimiters.isEmpty())
2282 {
2283 labelText.append(labelDelimiters.get(ctr2));
2284 }
2285 String property = null;
2286 if (ctr2 < labelProperties.size())
2287 {
2288 property = labelProperties.get(ctr2);
2289 }
2290 if (property != null && property.length() > 0)
2291 {
2292 if (PropertyUtils.isReadable(item, property))
2293 {
2294 Object value = PropertyUtils.getProperty(item, property);
2295 if (value != null)
2296 {
2297 if (value instanceof String)
2298 {
2299 if (((String)value).trim().length() == 0)
2300 {
2301 value = null;
2302 }
2303 }
2304 if (value != null)
2305 {
2306 labelText.append(value);
2307 }
2308 }
2309 }
2310 else
2311 {
2312 labelText.append(property);
2313 }
2314 }
2315 ctr2++;
2316 }
2317 while (ctr2 < labelDelimiters.size());
2318 this.startDateMaximumLabelList[ctr] = labelText.toString().replaceAll("\\s+", " ").trim();
2319 }
2320 }
2321 }
2322 }
2323 catch (final Throwable throwable)
2324 {
2325 throw new RuntimeException(throwable);
2326 }
2327 }
2328 }
2329
2330
2331 private Long id;
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341 public Long getId()
2342 {
2343 return this.id;
2344 }
2345
2346
2347
2348
2349
2350 private boolean idSet = false;
2351
2352
2353
2354
2355 public void resetIdSet()
2356 {
2357 this.idSet = false;
2358 }
2359
2360
2361
2362
2363
2364
2365
2366 public boolean isIdSet()
2367 {
2368 return this.idSet;
2369 }
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379 public void setId(Long idIn)
2380 {
2381 this.id = idIn;
2382 this.idSet = true;
2383 }
2384
2385
2386
2387
2388 private Object[] idValueList;
2389
2390
2391
2392
2393 private Object[] idLabelList;
2394
2395
2396
2397
2398 public Object[] getIdBackingList()
2399 {
2400 Object[] values = this.idValueList;
2401 Object[] labels = this.idLabelList;
2402
2403 if (values == null || values.length == 0)
2404 {
2405 return values;
2406 }
2407
2408 if (labels == null || labels.length == 0)
2409 {
2410 labels = values;
2411 }
2412
2413 final int length = Math.min(labels.length, values.length);
2414 SelectItem[] backingList = new SelectItem[length];
2415
2416 for (int ctr = 0; ctr < length; ctr++)
2417 {
2418 backingList[ctr] = new SelectItem(
2419 values[ctr] != null ? values[ctr] : "", labels[ctr] != null ? String.valueOf(labels[ctr]) : "");
2420 }
2421 return backingList;
2422 }
2423
2424
2425
2426
2427 public Object[] getIdValueList()
2428 {
2429 return this.idValueList;
2430 }
2431
2432
2433
2434
2435 public void setIdValueList(Object[] idValueListIn)
2436 {
2437 this.idValueList = idValueListIn;
2438 }
2439
2440
2441
2442
2443 public Object[] getIdLabelList()
2444 {
2445 return this.idLabelList;
2446 }
2447
2448
2449
2450
2451 public void setIdLabelList(Object[] idLabelListIn)
2452 {
2453 this.idLabelList = idLabelListIn;
2454 }
2455
2456
2457
2458
2459
2460
2461 public void setIdBackingList(Collection<? extends Object> items, String valueProperty, String labelProperty)
2462 {
2463 this.idValueList = null;
2464 this.idLabelList = null;
2465 if (items != null)
2466 {
2467 this.idValueList = new Object[items.size()];
2468 this.idLabelList = new Object[items.size()];
2469
2470 try
2471 {
2472 final List<String> labelProperties =
2473 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\W&&[^\\.]]+")));
2474 final List<String> labelDelimiters =
2475 labelProperty == null ? null : new ArrayList<String>(Arrays.asList(labelProperty.split("[\\w\\.]+")));
2476 int ctr = 0;
2477 for (final Iterator<? extends Object> iterator = items.iterator(); iterator.hasNext(); ctr++)
2478 {
2479 final Object item = iterator.next();
2480 if (item != null)
2481 {
2482 this.idValueList[ctr] = valueProperty == null ? item :
2483 PropertyUtils.getProperty(item, valueProperty.trim());
2484 if (labelProperties == null)
2485 {
2486 this.idLabelList[ctr] = item;
2487 }
2488 else
2489 {
2490 final StringBuilder labelText = new StringBuilder();
2491 int ctr2 = 0;
2492 do
2493 {
2494 if (!labelDelimiters.isEmpty())
2495 {
2496 labelText.append(labelDelimiters.get(ctr2));
2497 }
2498 String property = null;
2499 if (ctr2 < labelProperties.size())
2500 {
2501 property = labelProperties.get(ctr2);
2502 }
2503 if (property != null && property.length() > 0)
2504 {
2505 if (PropertyUtils.isReadable(item, property))
2506 {
2507 Object value = PropertyUtils.getProperty(item, property);
2508 if (value != null)
2509 {
2510 if (value instanceof String)
2511 {
2512 if (((String)value).trim().length() == 0)
2513 {
2514 value = null;
2515 }
2516 }
2517 if (value != null)
2518 {
2519 labelText.append(value);
2520 }
2521 }
2522 }
2523 else
2524 {
2525 labelText.append(property);
2526 }
2527 }
2528 ctr2++;
2529 }
2530 while (ctr2 < labelDelimiters.size());
2531 this.idLabelList[ctr] = labelText.toString().replaceAll("\\s+", " ").trim();
2532 }
2533 }
2534 }
2535 }
2536 catch (final Throwable throwable)
2537 {
2538 throw new RuntimeException(throwable);
2539 }
2540 }
2541 }
2542
2543
2544
2545
2546
2547 public void resetIsSetFlags()
2548 {
2549 this.resetTimecardSummariesSet();
2550 this.resetSubmitterSet();
2551 this.resetApproverSet();
2552 this.resetStatusSet();
2553 this.resetStartDateMinimumSet();
2554 this.resetStartDateMaximumSet();
2555 this.resetIdSet();
2556 }
2557
2558
2559
2560
2561 private final Map<String, DateFormat> dateTimeFormatters =
2562 new HashMap<String, DateFormat>();
2563
2564
2565
2566
2567
2568
2569
2570 public Map<String, DateFormat> getDateTimeFormatters()
2571 {
2572 return this.dateTimeFormatters;
2573 }
2574
2575
2576
2577
2578 private transient Map<String, FacesMessage> jsfMessages =
2579 new LinkedHashMap<String, FacesMessage>();
2580
2581
2582
2583
2584
2585
2586
2587
2588 public void addJsfMessages(FacesMessage jsfMessage)
2589 {
2590 if (this.jsfMessages != null)
2591 {
2592 this.jsfMessages.put(jsfMessage.getDetail(), jsfMessage);
2593 }
2594 }
2595
2596
2597
2598
2599
2600
2601
2602 public Collection<FacesMessage> getJsfMessages()
2603 {
2604 if (this.jsfMessages == null)
2605 {
2606 this.jsfMessages = new LinkedHashMap<String, FacesMessage>();
2607 }
2608 return this.jsfMessages.values();
2609 }
2610
2611
2612
2613
2614
2615
2616
2617 public void setJsfMessages(final Collection<FacesMessage> messages)
2618 {
2619 if (messages != null)
2620 {
2621 for (final FacesMessage jsfMessage: messages)
2622 {
2623 this.jsfMessages.put(jsfMessage.getDetail(), jsfMessage);
2624 }
2625 }
2626 }
2627
2628
2629
2630
2631
2632 public void clearJsfMessages()
2633 {
2634 this.jsfMessages.clear();
2635 }
2636
2637
2638
2639
2640 private String jsfMessagesTitle;
2641
2642
2643
2644
2645
2646
2647
2648 public void setJsfMessagesTitle(final String jsfMessagesTitleIn)
2649 {
2650 this.jsfMessagesTitle = jsfMessagesTitleIn;
2651 }
2652
2653
2654
2655
2656
2657
2658 public String getJsfMessagesTitle()
2659 {
2660 return this.jsfMessagesTitle;
2661 }
2662
2663
2664
2665
2666
2667
2668 public FacesMessage.Severity getMaximumMessageSeverity()
2669 {
2670 FacesMessage.Severity maxSeverity = null;
2671 for (final FacesMessage message : this.getJsfMessages())
2672 {
2673 final FacesMessage.Severity severity = message.getSeverity();
2674 if (maxSeverity == null || (severity != null && severity.getOrdinal() > maxSeverity.getOrdinal()))
2675 {
2676 maxSeverity = severity;
2677 }
2678 }
2679 return maxSeverity;
2680 }
2681
2682
2683
2684
2685 private static final long serialVersionUID = 5516538652390151847L;
2686 }