1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.view;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.rice.krad.datadictionary.DataDictionary;
20 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
21 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
22 import org.kuali.rice.krad.datadictionary.parse.BeanTags;
23 import org.kuali.rice.krad.datadictionary.state.StateMapping;
24 import org.kuali.rice.krad.datadictionary.validator.ValidationTrace;
25 import org.kuali.rice.krad.datadictionary.validator.Validator;
26 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
27 import org.kuali.rice.krad.uif.UifConstants;
28 import org.kuali.rice.krad.uif.UifConstants.ViewStatus;
29 import org.kuali.rice.krad.uif.UifConstants.ViewType;
30 import org.kuali.rice.krad.uif.component.Component;
31 import org.kuali.rice.krad.uif.component.ReferenceCopy;
32 import org.kuali.rice.krad.uif.component.RequestParameter;
33 import org.kuali.rice.krad.uif.container.Container;
34 import org.kuali.rice.krad.uif.container.ContainerBase;
35 import org.kuali.rice.krad.uif.container.Group;
36 import org.kuali.rice.krad.uif.container.NavigationGroup;
37 import org.kuali.rice.krad.uif.container.PageGroup;
38 import org.kuali.rice.krad.uif.element.Header;
39 import org.kuali.rice.krad.uif.element.Link;
40 import org.kuali.rice.krad.uif.layout.LayoutManager;
41 import org.kuali.rice.krad.uif.service.ViewHelperService;
42 import org.kuali.rice.krad.uif.util.BooleanMap;
43 import org.kuali.rice.krad.uif.util.ClientValidationUtils;
44 import org.kuali.rice.krad.uif.widget.BlockUI;
45 import org.kuali.rice.krad.uif.widget.BreadCrumbs;
46 import org.kuali.rice.krad.uif.widget.Growls;
47 import org.kuali.rice.krad.util.ObjectUtils;
48 import org.kuali.rice.krad.web.form.UifFormBase;
49
50 import java.util.ArrayList;
51 import java.util.HashMap;
52 import java.util.HashSet;
53 import java.util.List;
54 import java.util.Map;
55 import java.util.Set;
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83 @BeanTags({@BeanTag(name = "view-bean", parent = "Uif-View"), @BeanTag(name = "view-knsTheme-bean", parent = "Uif-View-KnsTheme")
84 })
85 public class View extends ContainerBase {
86 private static final long serialVersionUID = -1220009725554576953L;
87
88 private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(View.class);
89
90 private String namespaceCode;
91 private String viewName;
92 private ViewTheme theme;
93
94 private int idSequence;
95
96 private String stateObjectBindingPath;
97 private StateMapping stateMapping;
98
99
100 private Header applicationHeader;
101 private Group applicationFooter;
102
103
104 private BreadCrumbs breadcrumbs;
105 private String breadcrumbTitlePropertyName;
106 private String breadcrumbTitleDisplayOption;
107
108 private boolean renderBreadcrumbsInView;
109
110
111 private Growls growls;
112 private boolean growlMessagingEnabled;
113
114 private BlockUI refreshBlockUI;
115 private BlockUI navigationBlockUI;
116
117 private String entryPageId;
118
119 @RequestParameter
120 private String currentPageId;
121
122 private Group navigation;
123
124 private Class<?> formClass;
125 private String defaultBindingObjectPath;
126 private Map<String, Class<?>> objectPathToConcreteClassMapping;
127
128 private List<String> additionalScriptFiles;
129 private List<String> additionalCssFiles;
130
131 private ViewType viewTypeName;
132
133 private String viewStatus;
134 private ViewIndex viewIndex;
135 private Map<String, String> viewRequestParameters;
136
137 private boolean persistFormToSession;
138
139 private ViewPresentationController presentationController;
140 private ViewAuthorizer authorizer;
141
142 private BooleanMap actionFlags;
143 private BooleanMap editModes;
144
145 private Map<String, String> expressionVariables;
146
147 private boolean singlePageView;
148 private boolean mergeWithPageItems;
149 private PageGroup page;
150
151 private List<? extends Group> items;
152 private List<? extends Group> dialogs;
153
154 private Link viewMenuLink;
155 private String viewMenuGroupName;
156
157 private boolean applyDirtyCheck;
158 private boolean translateCodesOnReadOnlyDisplay;
159 private boolean supportsRequestOverrideOfReadOnlyFields;
160
161 private String preLoadScript;
162
163 private int preloadPoolSize;
164
165 private List<String> viewTemplates;
166
167 private Class<? extends ViewHelperService> viewHelperServiceClass;
168
169 @ReferenceCopy
170 private ViewHelperService viewHelperService;
171
172 public View() {
173 singlePageView = false;
174 mergeWithPageItems = true;
175 translateCodesOnReadOnlyDisplay = false;
176 viewTypeName = ViewType.DEFAULT;
177 viewStatus = UifConstants.ViewStatus.CREATED;
178 formClass = UifFormBase.class;
179 renderBreadcrumbsInView = true;
180 supportsRequestOverrideOfReadOnlyFields = true;
181 persistFormToSession = true;
182
183 idSequence = 0;
184 this.viewIndex = new ViewIndex();
185 preloadPoolSize = 0;
186
187 additionalScriptFiles = new ArrayList<String>();
188 additionalCssFiles = new ArrayList<String>();
189 items = new ArrayList<Group>();
190 objectPathToConcreteClassMapping = new HashMap<String, Class<?>>();
191 viewRequestParameters = new HashMap<String, String>();
192 expressionVariables = new HashMap<String, String>();
193
194 dialogs = new ArrayList<Group>();
195 viewTemplates = new ArrayList<String>();
196 }
197
198
199
200
201
202
203
204
205
206
207
208 @SuppressWarnings("unchecked")
209 @Override
210 public void performInitialization(View view, Object model) {
211 super.performInitialization(view, model);
212
213
214 if (singlePageView) {
215 if (page != null) {
216
217 if (!mergeWithPageItems) {
218 page.setItems(new ArrayList<Group>());
219 }
220
221 view.assignComponentIds(page);
222
223
224
225 List<Component> newItems = (List<Component>) page.getItems();
226 newItems.addAll(items);
227 page.setItems(newItems);
228
229
230 items = new ArrayList<Group>();
231 ((List<Group>) items).add(page);
232 } else {
233 throw new RuntimeException("For single paged views the page Group must be set.");
234 }
235 }
236
237
238 for (Group group : this.getItems()) {
239 if (StringUtils.isBlank(group.getId())) {
240 group.setId(view.getNextId());
241 }
242 }
243 }
244
245
246
247
248
249
250
251
252 public void performApplyModel(View view, Object model, Component parent) {
253 super.performApplyModel(view, model, parent);
254
255 if (theme != null) {
256 KRADServiceLocatorWeb.getExpressionEvaluatorService().evaluateExpressionsOnConfigurable(view, theme, model,
257 getContext());
258 }
259 }
260
261
262
263
264
265
266
267
268
269
270
271
272 @Override
273 public void performFinalize(View view, Object model, Component parent) {
274 super.performFinalize(view, model, parent);
275
276 String preLoadScript = "";
277 if (this.getPreLoadScript() != null) {
278 preLoadScript = this.getPreLoadScript();
279 }
280
281
282 Growls gw = view.getGrowls();
283 if (!gw.getTemplateOptions().isEmpty()) {
284 preLoadScript += "setGrowlDefaults(" + gw.getTemplateOptionsJSString() + ");";
285 }
286
287 BlockUI navBlockUI = view.getNavigationBlockUI();
288 if (!navBlockUI.getTemplateOptions().isEmpty()) {
289 preLoadScript += "setBlockUIDefaults("
290 + navBlockUI.getTemplateOptionsJSString()
291 + ", '"
292 + UifConstants.BLOCKUI_NAVOPTS
293 + "');";
294 }
295
296 BlockUI refBlockUI = view.getRefreshBlockUI();
297 if (!refBlockUI.getTemplateOptions().isEmpty()) {
298 preLoadScript += "setBlockUIDefaults("
299 + refBlockUI.getTemplateOptionsJSString()
300 + ", '"
301 + UifConstants.BLOCKUI_REFRESHOPTS
302 + "');";
303 }
304
305 this.setPreLoadScript(preLoadScript);
306
307 String onReadyScript = "";
308 if (this.getOnDocumentReadyScript() != null) {
309 onReadyScript = this.getOnDocumentReadyScript();
310 }
311
312 this.setOnDocumentReadyScript(onReadyScript + "jQuery.extend(jQuery.validator.messages, " +
313 ClientValidationUtils.generateValidatorMessagesOption() + ");");
314 }
315
316
317
318
319
320
321 public void assignComponentIds(Component component) {
322 if (component == null) {
323 return;
324 }
325
326 Integer currentSequenceVal = idSequence;
327
328
329 if (StringUtils.isBlank(component.getId())) {
330 component.setId(UifConstants.COMPONENT_ID_PREFIX + getNextId());
331 }
332
333
334 getViewIndex().addSequenceValueToSnapshot(component.getId(), currentSequenceVal);
335
336 if (component instanceof Container) {
337 LayoutManager layoutManager = ((Container) component).getLayoutManager();
338 if (layoutManager != null) {
339 if (StringUtils.isBlank(layoutManager.getId())) {
340 layoutManager.setId(UifConstants.COMPONENT_ID_PREFIX + getNextId());
341 }
342 }
343 }
344
345
346 List<Component> allNested = new ArrayList<Component>(component.getComponentsForLifecycle());
347 allNested.addAll(component.getComponentPrototypes());
348 for (Component nestedComponent : allNested) {
349 assignComponentIds(nestedComponent);
350 }
351 }
352
353
354
355
356 @Override
357 public List<Component> getComponentsForLifecycle() {
358 List<Component> components = new ArrayList<Component>();
359
360 components.add(applicationHeader);
361 components.add(applicationFooter);
362 components.add(navigation);
363 components.add(breadcrumbs);
364 components.add(growls);
365 components.addAll(dialogs);
366 components.add(viewMenuLink);
367 components.add(navigationBlockUI);
368 components.add(refreshBlockUI);
369
370
371
372 components.addAll(super.getComponentsForLifecycle());
373
374
375 if (!singlePageView) {
376 for (Group group : this.getItems()) {
377 if ((group instanceof PageGroup) && !StringUtils.equals(group.getId(), getCurrentPageId()) && components
378 .contains(group)) {
379 components.remove(group);
380 }
381 }
382 }
383
384 return components;
385 }
386
387
388
389
390 @Override
391 public Set<Class<? extends Component>> getSupportedComponents() {
392 Set<Class<? extends Component>> supportedComponents = new HashSet<Class<? extends Component>>();
393 supportedComponents.add(Group.class);
394
395 return supportedComponents;
396 }
397
398
399
400
401 @Override
402 public String getComponentTypeName() {
403 return "view";
404 }
405
406
407
408
409
410
411
412 public PageGroup getCurrentPage() {
413 for (Group pageGroup : this.getItems()) {
414 if (StringUtils.equals(pageGroup.getId(), getCurrentPageId()) && pageGroup instanceof PageGroup) {
415 return (PageGroup) pageGroup;
416 }
417 }
418
419 return null;
420 }
421
422
423
424
425
426 @Override
427 protected void sortItems(View view, Object model) {
428 if (!singlePageView) {
429 super.sortItems(view, model);
430 }
431 }
432
433
434
435
436
437
438
439
440
441
442
443 @BeanTagAttribute(name = "namespaceCode")
444 public String getNamespaceCode() {
445 return namespaceCode;
446 }
447
448
449
450
451
452
453 public void setNamespaceCode(String namespaceCode) {
454 this.namespaceCode = namespaceCode;
455 }
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471 @BeanTagAttribute(name = "viewName")
472 public String getViewName() {
473 return this.viewName;
474 }
475
476
477
478
479
480
481 public void setViewName(String viewName) {
482 this.viewName = viewName;
483 }
484
485
486
487
488
489
490
491
492
493
494
495
496 @BeanTagAttribute(name = "applicationHeader", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
497 public Header getApplicationHeader() {
498 return applicationHeader;
499 }
500
501
502
503
504
505
506 public void setApplicationHeader(Header applicationHeader) {
507 this.applicationHeader = applicationHeader;
508 }
509
510
511
512
513
514
515
516
517
518
519
520
521 @BeanTagAttribute(name = "applicationFooter", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
522 public Group getApplicationFooter() {
523 return applicationFooter;
524 }
525
526
527
528
529
530
531 public void setApplicationFooter(Group applicationFooter) {
532 this.applicationFooter = applicationFooter;
533 }
534
535
536
537
538
539
540 public int getIdSequence() {
541 return idSequence;
542 }
543
544
545
546
547
548
549 public void setIdSequence(int idSequence) {
550 this.idSequence = idSequence;
551 }
552
553
554
555
556
557
558 public String getNextId() {
559 idSequence += 1;
560 return Integer.toString(idSequence);
561 }
562
563
564
565
566
567
568
569
570 @BeanTagAttribute(name = "entryPageId")
571 public String getEntryPageId() {
572 return this.entryPageId;
573 }
574
575
576
577
578
579
580 public void setEntryPageId(String entryPageId) {
581 this.entryPageId = entryPageId;
582 }
583
584
585
586
587
588
589
590
591
592
593
594 public String getCurrentPageId() {
595
596 if (StringUtils.isBlank(currentPageId)) {
597 if (StringUtils.isNotBlank(entryPageId)) {
598 currentPageId = entryPageId;
599 } else if ((getItems() != null) && !getItems().isEmpty()) {
600 Group firstPageGroup = getItems().get(0);
601 currentPageId = firstPageGroup.getId();
602 }
603 }
604
605 return this.currentPageId;
606 }
607
608
609
610
611
612
613 public void setCurrentPageId(String currentPageId) {
614 this.currentPageId = currentPageId;
615 }
616
617
618
619
620
621
622
623
624
625
626
627 @BeanTagAttribute(name = "navigation", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
628 public Group getNavigation() {
629 return this.navigation;
630 }
631
632
633
634
635
636
637 public void setNavigation(Group navigation) {
638 this.navigation = navigation;
639 }
640
641
642
643
644
645
646
647
648
649
650 @BeanTagAttribute(name = "formClass")
651 public Class<?> getFormClass() {
652 return this.formClass;
653 }
654
655
656
657
658
659
660 public void setFormClass(Class<?> formClass) {
661 this.formClass = formClass;
662 }
663
664
665
666
667
668
669
670
671
672
673 @BeanTagAttribute(name = "defaultObjectPath")
674 public String getDefaultBindingObjectPath() {
675 return this.defaultBindingObjectPath;
676 }
677
678
679
680
681
682
683 public void setDefaultBindingObjectPath(String defaultBindingObjectPath) {
684 this.defaultBindingObjectPath = defaultBindingObjectPath;
685 }
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711 @BeanTagAttribute(name = "objectPathConcreteClassMapping", type = BeanTagAttribute.AttributeType.MAPVALUE)
712 public Map<String, Class<?>> getObjectPathToConcreteClassMapping() {
713 return this.objectPathToConcreteClassMapping;
714 }
715
716
717
718
719
720
721 public void setObjectPathToConcreteClassMapping(Map<String, Class<?>> objectPathToConcreteClassMapping) {
722 this.objectPathToConcreteClassMapping = objectPathToConcreteClassMapping;
723 }
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738 @BeanTagAttribute(name = "additionalScriptFiles", type = BeanTagAttribute.AttributeType.LISTVALUE)
739 public List<String> getAdditionalScriptFiles() {
740 return this.additionalScriptFiles;
741 }
742
743
744
745
746
747
748
749 public void setAdditionalScriptFiles(List<String> additionalScriptFiles) {
750 this.additionalScriptFiles = additionalScriptFiles;
751 }
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766 @BeanTagAttribute(name = "additionalCssFiles", type = BeanTagAttribute.AttributeType.LISTVALUE)
767 public List<String> getAdditionalCssFiles() {
768 return this.additionalCssFiles;
769 }
770
771
772
773
774
775
776
777 public void setAdditionalCssFiles(List<String> additionalCssFiles) {
778 this.additionalCssFiles = additionalCssFiles;
779 }
780
781
782
783
784
785
786
787
788
789
790
791
792
793 @BeanTagAttribute(name = "preloadPoolSize")
794 public int getPreloadPoolSize() {
795 return preloadPoolSize;
796 }
797
798
799
800
801
802
803 public void setPreloadPoolSize(int preloadPoolSize) {
804 this.preloadPoolSize = preloadPoolSize;
805 }
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825 public List<String> getViewTemplates() {
826 return viewTemplates;
827 }
828
829
830
831
832
833
834 public void setViewTemplates(List<String> viewTemplates) {
835 this.viewTemplates = viewTemplates;
836 }
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851 @BeanTagAttribute(name = "viewTypeName", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
852 public ViewType getViewTypeName() {
853 return this.viewTypeName;
854 }
855
856
857
858
859
860
861 public void setViewTypeName(ViewType viewTypeName) {
862 this.viewTypeName = viewTypeName;
863 }
864
865
866
867
868
869
870
871
872 @BeanTagAttribute(name = "viewHelperServiceClass")
873 public Class<? extends ViewHelperService> getViewHelperServiceClass() {
874 return this.viewHelperServiceClass;
875 }
876
877
878
879
880
881
882 public void setViewHelperServiceClass(Class<? extends ViewHelperService> viewHelperServiceClass) {
883 this.viewHelperServiceClass = viewHelperServiceClass;
884 }
885
886
887
888
889
890
891 @BeanTagAttribute(name = "viewHelperService", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
892 public ViewHelperService getViewHelperService() {
893 if ((this.viewHelperService == null) && (this.viewHelperServiceClass != null)) {
894 viewHelperService = ObjectUtils.newInstance(viewHelperServiceClass);
895 }
896
897 return viewHelperService;
898 }
899
900
901
902
903 public void index() {
904 if (this.viewIndex == null) {
905 this.viewIndex = new ViewIndex();
906 }
907 this.viewIndex.index(this);
908 }
909
910
911
912
913
914
915 @BeanTagAttribute(name = "viewIndex", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
916 public ViewIndex getViewIndex() {
917 return this.viewIndex;
918 }
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938 public Map<String, String> getViewRequestParameters() {
939 return this.viewRequestParameters;
940 }
941
942
943
944
945
946
947 public void setViewRequestParameters(Map<String, String> viewRequestParameters) {
948 this.viewRequestParameters = viewRequestParameters;
949 }
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979 @BeanTagAttribute(name = "persistFormToSession")
980 public boolean isPersistFormToSession() {
981 return persistFormToSession;
982 }
983
984
985
986
987
988
989 public void setPersistFormToSession(boolean persistFormToSession) {
990 this.persistFormToSession = persistFormToSession;
991 }
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006 @BeanTagAttribute(name = "presentationController", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1007 public ViewPresentationController getPresentationController() {
1008 return this.presentationController;
1009 }
1010
1011
1012
1013
1014
1015
1016 public void setPresentationController(ViewPresentationController presentationController) {
1017 this.presentationController = presentationController;
1018 }
1019
1020
1021
1022
1023
1024
1025 public void setPresentationControllerClass(
1026 Class<? extends ViewPresentationController> presentationControllerClass) {
1027 this.presentationController = ObjectUtils.newInstance(presentationControllerClass);
1028 }
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046 @BeanTagAttribute(name = "authorizer", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1047 public ViewAuthorizer getAuthorizer() {
1048 return this.authorizer;
1049 }
1050
1051
1052
1053
1054
1055
1056 public void setAuthorizer(ViewAuthorizer authorizer) {
1057 this.authorizer = authorizer;
1058 }
1059
1060
1061
1062
1063
1064
1065 public void setAuthorizerClass(Class<? extends ViewAuthorizer> authorizerClass) {
1066 this.authorizer = ObjectUtils.newInstance(authorizerClass);
1067 }
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078 @BeanTagAttribute(name = "actionFlags", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1079 public BooleanMap getActionFlags() {
1080 return this.actionFlags;
1081 }
1082
1083
1084
1085
1086
1087
1088 public void setActionFlags(BooleanMap actionFlags) {
1089 this.actionFlags = actionFlags;
1090 }
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101 @BeanTagAttribute(name = "editModes", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1102 public BooleanMap getEditModes() {
1103 return this.editModes;
1104 }
1105
1106
1107
1108
1109
1110
1111 public void setEditModes(BooleanMap editModes) {
1112 this.editModes = editModes;
1113 }
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129 @BeanTagAttribute(name = "expressionVariables", type = BeanTagAttribute.AttributeType.MAPVALUE)
1130 public Map<String, String> getExpressionVariables() {
1131 return this.expressionVariables;
1132 }
1133
1134
1135
1136
1137
1138
1139 public void setExpressionVariables(Map<String, String> expressionVariables) {
1140 this.expressionVariables = expressionVariables;
1141 }
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154 @BeanTagAttribute(name = "singlePageView")
1155 public boolean isSinglePageView() {
1156 return this.singlePageView;
1157 }
1158
1159
1160
1161
1162
1163
1164 public void setSinglePageView(boolean singlePageView) {
1165 this.singlePageView = singlePageView;
1166 }
1167
1168
1169
1170
1171
1172
1173
1174
1175 public boolean isMergeWithPageItems() {
1176 return mergeWithPageItems;
1177 }
1178
1179
1180
1181
1182
1183
1184 public void setMergeWithPageItems(boolean mergeWithPageItems) {
1185 this.mergeWithPageItems = mergeWithPageItems;
1186 }
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196 @BeanTagAttribute(name = "page", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1197 public PageGroup getPage() {
1198 return this.page;
1199 }
1200
1201
1202
1203
1204
1205
1206 public void setPage(PageGroup page) {
1207 this.page = page;
1208 }
1209
1210
1211
1212
1213 @Override
1214 @BeanTagAttribute(name = "items", type = BeanTagAttribute.AttributeType.LISTBEAN)
1215 public List<? extends Group> getItems() {
1216 return this.items;
1217 }
1218
1219
1220
1221
1222
1223
1224 @Override
1225 public void setItems(List<? extends Component> items) {
1226
1227 this.items = (List<? extends Group>) items;
1228 }
1229
1230
1231
1232
1233
1234
1235 @BeanTagAttribute(name = "dialogs", type = BeanTagAttribute.AttributeType.LISTBEAN)
1236 public List<? extends Group> getDialogs() {
1237 return dialogs;
1238 }
1239
1240
1241
1242
1243
1244
1245 public void setDialogs(List<? extends Group> dialogs) {
1246 this.dialogs = dialogs;
1247 }
1248
1249
1250
1251
1252
1253
1254
1255 @BeanTagAttribute(name = "viewMenuLink", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1256 public Link getViewMenuLink() {
1257 return this.viewMenuLink;
1258 }
1259
1260
1261
1262
1263
1264
1265 public void setViewMenuLink(Link viewMenuLink) {
1266 this.viewMenuLink = viewMenuLink;
1267 }
1268
1269
1270
1271
1272
1273
1274
1275 @BeanTagAttribute(name = "viewMenuGroupName")
1276 public String getViewMenuGroupName() {
1277 return this.viewMenuGroupName;
1278 }
1279
1280
1281
1282
1283
1284
1285 public void setViewMenuGroupName(String viewMenuGroupName) {
1286 this.viewMenuGroupName = viewMenuGroupName;
1287 }
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302 public String getViewStatus() {
1303 return this.viewStatus;
1304 }
1305
1306
1307
1308
1309
1310
1311 public void setViewStatus(String viewStatus) {
1312 this.viewStatus = viewStatus;
1313 }
1314
1315
1316
1317
1318
1319
1320 public boolean isInitialized() {
1321 return StringUtils.equals(viewStatus, ViewStatus.INITIALIZED) || StringUtils.equals(viewStatus,
1322 ViewStatus.FINAL);
1323 }
1324
1325
1326
1327
1328
1329
1330
1331 public boolean isFinal() {
1332 return StringUtils.equals(viewStatus, ViewStatus.FINAL);
1333 }
1334
1335
1336
1337
1338
1339
1340 @BeanTagAttribute(name = "breadcrumbs", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1341 public BreadCrumbs getBreadcrumbs() {
1342 return this.breadcrumbs;
1343 }
1344
1345
1346
1347
1348 public void setBreadcrumbs(BreadCrumbs breadcrumbs) {
1349 this.breadcrumbs = breadcrumbs;
1350 }
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364 @BeanTagAttribute(name = "renderBreadcrumbsInView")
1365 public boolean isRenderBreadcrumbsInView() {
1366 return renderBreadcrumbsInView;
1367 }
1368
1369
1370
1371
1372
1373
1374 public void setRenderBreadcrumbsInView(boolean renderBreadcrumbsInView) {
1375 this.renderBreadcrumbsInView = renderBreadcrumbsInView;
1376 }
1377
1378
1379
1380
1381
1382
1383
1384 @BeanTagAttribute(name = "growls", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1385 public Growls getGrowls() {
1386 return this.growls;
1387 }
1388
1389
1390
1391
1392 public void setGrowls(Growls growls) {
1393 this.growls = growls;
1394 }
1395
1396
1397
1398
1399
1400
1401
1402 public void setRefreshBlockUI(BlockUI refreshBlockUI) {
1403 this.refreshBlockUI = refreshBlockUI;
1404 }
1405
1406
1407
1408
1409 @BeanTagAttribute(name = "refreshBlockUI", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1410 public BlockUI getRefreshBlockUI() {
1411 return refreshBlockUI;
1412 }
1413
1414
1415
1416
1417
1418
1419
1420 public void setNavigationBlockUI(BlockUI navigationBlockUI) {
1421 this.navigationBlockUI = navigationBlockUI;
1422 }
1423
1424
1425
1426
1427 @BeanTagAttribute(name = "navigationBlockUI", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1428 public BlockUI getNavigationBlockUI() {
1429 return navigationBlockUI;
1430 }
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447 @BeanTagAttribute(name = "growlMessagingEnabled")
1448 public boolean isGrowlMessagingEnabled() {
1449 return this.growlMessagingEnabled;
1450 }
1451
1452
1453
1454
1455
1456
1457 public void setGrowlMessagingEnabled(boolean growlMessagingEnabled) {
1458 this.growlMessagingEnabled = growlMessagingEnabled;
1459 }
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473 @BeanTagAttribute(name = "applyDirtyCheck")
1474 public boolean isApplyDirtyCheck() {
1475 return this.applyDirtyCheck;
1476 }
1477
1478
1479
1480
1481 public void setApplyDirtyCheck(boolean applyDirtyCheck) {
1482 this.applyDirtyCheck = applyDirtyCheck;
1483 }
1484
1485
1486
1487
1488
1489
1490 public void setTranslateCodesOnReadOnlyDisplay(boolean translateCodesOnReadOnlyDisplay) {
1491 this.translateCodesOnReadOnlyDisplay = translateCodesOnReadOnlyDisplay;
1492 }
1493
1494
1495
1496
1497
1498
1499 @BeanTagAttribute(name = "translateCodesOnReadOnlyDisplay")
1500 public boolean isTranslateCodesOnReadOnlyDisplay() {
1501 return translateCodesOnReadOnlyDisplay;
1502 }
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522 @BeanTagAttribute(name = "breadcrumbTitlePropertyName")
1523 public String getBreadcrumbTitlePropertyName() {
1524 return this.breadcrumbTitlePropertyName;
1525 }
1526
1527
1528
1529
1530
1531
1532 public void setBreadcrumbTitlePropertyName(String breadcrumbTitlePropertyName) {
1533 this.breadcrumbTitlePropertyName = breadcrumbTitlePropertyName;
1534 }
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544 @BeanTagAttribute(name = "breadcrumbTitleDisplayOption")
1545 public String getBreadcrumbTitleDisplayOption() {
1546 return this.breadcrumbTitleDisplayOption;
1547 }
1548
1549
1550
1551
1552
1553
1554 public void setBreadcrumbTitleDisplayOption(String breadcrumbTitleDisplayOption) {
1555 this.breadcrumbTitleDisplayOption = breadcrumbTitleDisplayOption;
1556 }
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568 @BeanTagAttribute(name = "supportsRequestOverrideOfReadOnlyFields")
1569 public boolean isSupportsRequestOverrideOfReadOnlyFields() {
1570 return supportsRequestOverrideOfReadOnlyFields;
1571 }
1572
1573
1574
1575
1576
1577
1578 public void setSupportsRequestOverrideOfReadOnlyFields(boolean supportsRequestOverrideOfReadOnlyFields) {
1579 this.supportsRequestOverrideOfReadOnlyFields = supportsRequestOverrideOfReadOnlyFields;
1580 }
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591 @BeanTagAttribute(name = "preLoadScript")
1592 public String getPreLoadScript() {
1593 return preLoadScript;
1594 }
1595
1596
1597
1598
1599
1600
1601 public void setPreLoadScript(String preLoadScript) {
1602 this.preLoadScript = preLoadScript;
1603 }
1604
1605
1606
1607
1608
1609
1610 @BeanTagAttribute(name = "theme", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1611 public ViewTheme getTheme() {
1612 return theme;
1613 }
1614
1615
1616
1617
1618
1619
1620 public void setTheme(ViewTheme theme) {
1621 this.theme = theme;
1622 }
1623
1624
1625
1626
1627
1628
1629
1630 @BeanTagAttribute(name = "stateObjectBindingPath")
1631 public String getStateObjectBindingPath() {
1632 return stateObjectBindingPath;
1633 }
1634
1635
1636
1637
1638
1639
1640
1641 public void setStateObjectBindingPath(String stateObjectBindingPath) {
1642 this.stateObjectBindingPath = stateObjectBindingPath;
1643 }
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659 @BeanTagAttribute(name = "stateMapping", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1660 public StateMapping getStateMapping() {
1661 return stateMapping;
1662 }
1663
1664
1665
1666
1667
1668
1669 public void setStateMapping(StateMapping stateMapping) {
1670 this.stateMapping = stateMapping;
1671 }
1672
1673
1674
1675
1676 @Override
1677 public void completeValidation(ValidationTrace tracer) {
1678 tracer.addBean(this);
1679
1680
1681 boolean validPageId = false;
1682 if (getEntryPageId() != null) {
1683 for (int i = 0; i < getItems().size(); i++) {
1684 if (getEntryPageId().compareTo(getItems().get(i).getId()) == 0) {
1685 validPageId = true;
1686 }
1687 }
1688 } else {
1689 validPageId = true;
1690 }
1691 if (!validPageId) {
1692 String currentValues[] = {"entryPageId = " + getEntryPageId()};
1693 tracer.createError("Items must contain an item with a matching id to entryPageId", currentValues);
1694 }
1695
1696
1697 if (tracer.getValidationStage() == ValidationTrace.START_UP) {
1698 if (getViewStatus().compareTo(UifConstants.ViewStatus.CREATED) != 0) {
1699 String currentValues[] = {"viewStatus = " + getViewStatus()};
1700 tracer.createError("ViewStatus should not be set", currentValues);
1701 }
1702 }
1703
1704
1705 boolean validDefaultBindingObjectPath = false;
1706 if (getDefaultBindingObjectPath() == null) {
1707 validDefaultBindingObjectPath = true;
1708 } else if (DataDictionary.isPropertyOf(getFormClass(), getDefaultBindingObjectPath())) {
1709 validDefaultBindingObjectPath = true;
1710 }
1711 if (!validDefaultBindingObjectPath) {
1712 String currentValues[] =
1713 {"formClass = " + getFormClass(), "defaultBindingPath = " + getDefaultBindingObjectPath()};
1714 tracer.createError("DefaultBingdingObjectPath must be a valid property of the formClass", currentValues);
1715 }
1716
1717
1718 if (isSinglePageView()) {
1719 if (getPage() == null) {
1720 String currentValues[] = {"singlePageView = " + isSinglePageView(), "page = " + getPage()};
1721 tracer.createError("Page must be set if singlePageView is true", currentValues);
1722 }
1723 for (int i = 0; i < getItems().size(); i++) {
1724 if (getItems().get(i).getClass() == PageGroup.class) {
1725 String currentValues[] =
1726 {"singlePageView = " + isSinglePageView(), "items(" + i + ") = " + getItems().get(i)
1727 .getClass()};
1728 tracer.createError("Items cannot be pageGroups if singlePageView is true", currentValues);
1729 }
1730 }
1731 }
1732
1733
1734 if (isGrowlMessagingEnabled() == true && getGrowls() == null) {
1735 if (Validator.checkExpressions(this, "growls")) {
1736 String currentValues[] =
1737 {"growlMessagingEnabled = " + isGrowlMessagingEnabled(), "growls = " + getGrowls()};
1738 tracer.createError("Growls cannot be null if Growl Messaging is enabled", currentValues);
1739 }
1740 }
1741
1742
1743 if (!isSinglePageView()) {
1744 if (getItems().size() == 0) {
1745 String currentValues[] =
1746 {"singlePageView = " + isSinglePageView(), "items.size = " + getItems().size()};
1747 tracer.createWarning("Items cannot be empty if singlePageView is false", currentValues);
1748 } else {
1749 for (int i = 0; i < getItems().size(); i++) {
1750 if (getItems().get(i).getClass() != PageGroup.class) {
1751 String currentValues[] =
1752 {"singlePageView = " + isSinglePageView(), "items(" + i + ") = " + getItems().get(i)
1753 .getClass()};
1754 tracer.createError("Items must be pageGroups if singlePageView is false", currentValues);
1755 }
1756 }
1757 }
1758 }
1759 super.completeValidation(tracer.getCopy());
1760 }
1761
1762 }