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 java.util.ArrayList;
19 import java.util.Collections;
20 import java.util.HashMap;
21 import java.util.HashSet;
22 import java.util.List;
23 import java.util.Map;
24 import java.util.Set;
25
26 import org.apache.commons.lang.StringUtils;
27 import org.kuali.rice.core.api.CoreApiServiceLocator;
28 import org.kuali.rice.krad.data.DataObjectUtils;
29 import org.kuali.rice.krad.datadictionary.DataDictionary;
30 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
31 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
32 import org.kuali.rice.krad.datadictionary.parse.BeanTags;
33 import org.kuali.rice.krad.datadictionary.state.StateMapping;
34 import org.kuali.rice.krad.datadictionary.validator.ValidationTrace;
35 import org.kuali.rice.krad.datadictionary.validator.Validator;
36 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
37 import org.kuali.rice.krad.uif.UifConstants;
38 import org.kuali.rice.krad.uif.UifConstants.ViewStatus;
39 import org.kuali.rice.krad.uif.UifConstants.ViewType;
40 import org.kuali.rice.krad.uif.component.Component;
41 import org.kuali.rice.krad.uif.component.ReferenceCopy;
42 import org.kuali.rice.krad.uif.component.RequestParameter;
43 import org.kuali.rice.krad.uif.container.ContainerBase;
44 import org.kuali.rice.krad.uif.container.Group;
45 import org.kuali.rice.krad.uif.container.PageGroup;
46 import org.kuali.rice.krad.uif.element.Header;
47 import org.kuali.rice.krad.uif.element.Link;
48 import org.kuali.rice.krad.uif.element.ViewHeader;
49 import org.kuali.rice.krad.uif.lifecycle.ViewLifecycle;
50 import org.kuali.rice.krad.uif.service.ViewHelperService;
51 import org.kuali.rice.krad.uif.util.BooleanMap;
52 import org.kuali.rice.krad.uif.util.BreadcrumbItem;
53 import org.kuali.rice.krad.uif.util.BreadcrumbOptions;
54 import org.kuali.rice.krad.uif.util.ClientValidationUtils;
55 import org.kuali.rice.krad.uif.util.CloneUtils;
56 import org.kuali.rice.krad.uif.util.ComponentFactory;
57 import org.kuali.rice.krad.uif.util.ComponentUtils;
58 import org.kuali.rice.krad.uif.util.LifecycleAwareList;
59 import org.kuali.rice.krad.uif.util.LifecycleAwareMap;
60 import org.kuali.rice.krad.uif.util.ParentLocation;
61 import org.kuali.rice.krad.uif.util.ScriptUtils;
62 import org.kuali.rice.krad.uif.widget.BlockUI;
63 import org.kuali.rice.krad.uif.widget.Breadcrumbs;
64 import org.kuali.rice.krad.uif.widget.Growls;
65 import org.kuali.rice.krad.util.KRADConstants;
66 import org.kuali.rice.krad.web.form.UifFormBase;
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94 @BeanTags({@BeanTag(name = "view-bean", parent = "Uif-View"),
95 @BeanTag(name = "view-knsTheme-bean", parent = "Uif-View-KnsTheme")})
96 public class View extends ContainerBase {
97 private static final long serialVersionUID = -1220009725554576953L;
98
99 private String namespaceCode;
100 private String viewName;
101 private ViewTheme theme;
102
103 private String stateObjectBindingPath;
104 private StateMapping stateMapping;
105
106
107 private boolean unifiedHeader;
108
109
110 private Group topGroup;
111
112
113 private Header applicationHeader;
114 private Group applicationFooter;
115
116
117 private boolean stickyTopGroup;
118 private boolean stickyBreadcrumbs;
119 private boolean stickyHeader;
120 private boolean stickyApplicationHeader;
121 private boolean stickyFooter;
122 private boolean stickyApplicationFooter;
123
124
125 private Breadcrumbs breadcrumbs;
126 private BreadcrumbOptions breadcrumbOptions;
127 private BreadcrumbItem breadcrumbItem;
128 private ParentLocation parentLocation;
129 private List<BreadcrumbItem> pathBasedBreadcrumbs;
130
131
132 private Growls growls;
133 private boolean growlMessagingEnabled;
134
135 private BlockUI refreshBlockUI;
136 private BlockUI navigationBlockUI;
137
138 private String entryPageId;
139
140 @RequestParameter
141 private String currentPageId;
142
143 private Group navigation;
144
145 private Class<?> formClass;
146 private String defaultBindingObjectPath;
147 private Map<String, Class<?>> objectPathToConcreteClassMapping;
148
149 private List<String> additionalScriptFiles;
150 private List<String> additionalCssFiles;
151 private boolean useLibraryCssClasses;
152
153 private ViewType viewTypeName;
154
155 protected ViewIndex viewIndex;
156 private Map<String, String> viewRequestParameters;
157
158 private boolean persistFormToSession;
159 private ViewSessionPolicy sessionPolicy;
160
161 private ViewPresentationController presentationController;
162 private ViewAuthorizer authorizer;
163
164 private Map<String, Boolean> actionFlags;
165 private Map<String, Boolean> editModes;
166
167 private Map<String, String> expressionVariables;
168
169 private boolean singlePageView;
170 private boolean mergeWithPageItems;
171 private PageGroup page;
172
173 private List<Group> dialogs;
174
175 private Link viewMenuLink;
176 private String viewMenuGroupName;
177
178 protected boolean applyDirtyCheck;
179 private boolean translateCodesOnReadOnlyDisplay;
180 private boolean supportsRequestOverrideOfReadOnlyFields;
181 private boolean disableNativeAutocomplete;
182 private boolean disableBrowserCache;
183
184 private String preLoadScript;
185
186 private List<Group> items;
187 private List<String> viewTemplates;
188
189 private Class<? extends ViewHelperService> viewHelperServiceClass;
190
191 @ReferenceCopy
192 private ViewHelperService viewHelperService;
193
194 private Map<String, Object> preModelContext;
195
196 public View() {
197 singlePageView = false;
198 mergeWithPageItems = true;
199 translateCodesOnReadOnlyDisplay = false;
200 viewTypeName = ViewType.DEFAULT;
201 formClass = UifFormBase.class;
202 supportsRequestOverrideOfReadOnlyFields = true;
203 disableBrowserCache = true;
204 persistFormToSession = true;
205 sessionPolicy = new ViewSessionPolicy();
206
207 this.viewIndex = new ViewIndex();
208
209 additionalScriptFiles = Collections.emptyList();
210 additionalCssFiles = Collections.emptyList();
211 objectPathToConcreteClassMapping = Collections.emptyMap();
212 viewRequestParameters = Collections.emptyMap();
213 expressionVariables = Collections.emptyMap();
214
215 dialogs = Collections.emptyList();
216
217 items = Collections.emptyList();
218 viewTemplates = Collections.emptyList();
219 }
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234 @SuppressWarnings("unchecked")
235 @Override
236 public void performInitialization(Object model) {
237 super.performInitialization(model);
238
239 assert this == ViewLifecycle.getView();
240
241
242 if (singlePageView) {
243 if (page != null) {
244
245 if (!mergeWithPageItems) {
246 page.setItems(new ArrayList<Group>());
247 }
248
249
250
251
252
253
254 List<Component> newItems = (List<Component>) page.getItems();
255 newItems.addAll(items);
256 page.setItems(newItems);
257
258
259 items = new ArrayList<Group>();
260 ((List<Group>) items).add(page);
261 } else {
262 throw new RuntimeException("For single paged views the page Group must be set.");
263 }
264 }
265
266 else if ((this.items != null) && (this.items.size() == 1)) {
267 Component itemComponent = this.items.get(0);
268
269 if (itemComponent instanceof PageGroup) {
270 this.singlePageView = true;
271 }
272 }
273
274 if (sessionPolicy.isEnableTimeoutWarning()) {
275 Group warningDialog = ComponentFactory.getSessionTimeoutWarningDialog();
276 warningDialog.setId(ComponentFactory.SESSION_TIMEOUT_WARNING_DIALOG);
277 getDialogs().add(warningDialog);
278
279 Group timeoutDialog = ComponentFactory.getSessionTimeoutDialog();
280 timeoutDialog.setId(ComponentFactory.SESSION_TIMEOUT_DIALOG);
281 getDialogs().add(timeoutDialog);
282 }
283
284 breadcrumbOptions.setupBreadcrumbs(model);
285 }
286
287
288
289
290
291
292
293
294
295 @Override
296 public void performApplyModel(Object model, Component parent) {
297 super.performApplyModel(model, parent);
298
299 View view = ViewLifecycle.getView();
300 if (theme != null) {
301 ViewLifecycle.getHelper().getExpressionEvaluator()
302 .evaluateExpressionsOnConfigurable(view, theme, getContext());
303
304 theme.configureThemeDefaults();
305 }
306
307
308 parentLocation.constructParentLocationBreadcrumbItems(view, model, view.getContext());
309 }
310
311
312
313
314
315
316
317
318
319
320
321
322 @SuppressWarnings("unchecked")
323 @Override
324 public void performFinalize(Object model, Component parent) {
325 super.performFinalize(model, parent);
326
327 assert this == ViewLifecycle.getView();
328
329 String preLoadScript = "";
330 if (this.getPreLoadScript() != null) {
331 preLoadScript = this.getPreLoadScript();
332 }
333
334
335 Growls gw = getGrowls();
336 if (!gw.getTemplateOptions().isEmpty()) {
337 preLoadScript += "setGrowlDefaults(" + gw.getTemplateOptionsJSString() + ");";
338 }
339
340 BlockUI navBlockUI = getNavigationBlockUI();
341 if (!navBlockUI.getTemplateOptions().isEmpty()) {
342 preLoadScript += "setBlockUIDefaults("
343 + navBlockUI.getTemplateOptionsJSString()
344 + ", '"
345 + UifConstants.BLOCKUI_NAVOPTS
346 + "');";
347 }
348
349 BlockUI refBlockUI = getRefreshBlockUI();
350 if (!refBlockUI.getTemplateOptions().isEmpty()) {
351 preLoadScript += "setBlockUIDefaults("
352 + refBlockUI.getTemplateOptionsJSString()
353 + ", '"
354 + UifConstants.BLOCKUI_REFRESHOPTS
355 + "');";
356 }
357
358 this.setPreLoadScript(preLoadScript);
359
360 String onReadyScript = "";
361 if (this.getOnDocumentReadyScript() != null) {
362 onReadyScript = this.getOnDocumentReadyScript();
363 }
364
365
366 if (sessionPolicy.isEnableTimeoutWarning()) {
367
368
369 int sessionTimeoutInterval = ((UifFormBase) model).getSessionTimeoutInterval();
370 int sessionWarningMilliseconds = (sessionPolicy.getTimeoutWarningSeconds() * 1000);
371
372 if (sessionWarningMilliseconds >= sessionTimeoutInterval) {
373 throw new RuntimeException(
374 "Time until giving the session warning should be less than the session timeout. Session Warning is "
375 + sessionWarningMilliseconds
376 + "ms, session timeout is "
377 + sessionTimeoutInterval
378 + "ms.");
379 }
380
381 int sessionWarningInterval = sessionTimeoutInterval - sessionWarningMilliseconds;
382
383 onReadyScript = ScriptUtils.appendScript(onReadyScript, ScriptUtils.buildFunctionCall(
384 UifConstants.JsFunctions.INITIALIZE_SESSION_TIMERS, sessionWarningInterval,
385 sessionTimeoutInterval));
386 }
387
388 onReadyScript = ScriptUtils.appendScript(onReadyScript, "jQuery.extend(jQuery.validator.messages, "
389 + ClientValidationUtils.generateValidatorMessagesOption()
390 + ");");
391
392 this.setOnDocumentReadyScript(onReadyScript);
393
394
395 breadcrumbOptions.finalizeBreadcrumbs(model, this, breadcrumbItem);
396
397
398 Object groupValidationDataDefaults = KRADServiceLocatorWeb.getDataDictionaryService().getDictionaryObject(
399 UifConstants.GROUP_VALIDATION_DEFAULTS_MAP_ID);
400 Object fieldValidationDataDefaults = KRADServiceLocatorWeb.getDataDictionaryService().getDictionaryObject(
401 UifConstants.FIELD_VALIDATION_DEFAULTS_MAP_ID);
402
403 this.addDataAttribute(UifConstants.DataAttributes.GROUP_VALIDATION_DEFAULTS, ScriptUtils.convertToJsValue(
404 (Map<String, String>) groupValidationDataDefaults));
405 this.addDataAttribute(UifConstants.DataAttributes.FIELD_VALIDATION_DEFAULTS, ScriptUtils.convertToJsValue(
406 (Map<String, String>) fieldValidationDataDefaults));
407
408
409 this.addDataAttribute(UifConstants.DataAttributes.ROLE, "view");
410 }
411
412
413
414
415 @Override
416 public List<Component> getComponentsForLifecycle() {
417 List<Component> components = new ArrayList<Component>();
418
419 components.add(applicationHeader);
420 components.add(applicationFooter);
421 components.add(topGroup);
422 components.add(navigation);
423 components.add(breadcrumbs);
424 components.add(growls);
425 components.addAll(dialogs);
426 components.add(viewMenuLink);
427 components.add(navigationBlockUI);
428 components.add(refreshBlockUI);
429 components.add(breadcrumbItem);
430
431 if (parentLocation != null) {
432 components.add(parentLocation.getPageBreadcrumbItem());
433 components.add(parentLocation.getViewBreadcrumbItem());
434 for (BreadcrumbItem item : parentLocation.getResolvedBreadcrumbItems()) {
435 if (!components.contains(item)) {
436 components.add(item);
437 }
438 }
439 }
440
441
442
443 components.addAll(super.getComponentsForLifecycle());
444
445
446 if (!singlePageView && (this.getItems() != null)) {
447 for (Group group : this.getItems()) {
448 if ((group instanceof PageGroup) && !StringUtils.equals(group.getId(), getCurrentPageId()) && components
449 .contains(group)) {
450 components.remove(group);
451 }
452 }
453 }
454
455 return components;
456 }
457
458
459
460
461 @Override
462 public Set<Class<? extends Component>> getSupportedComponents() {
463 Set<Class<? extends Component>> supportedComponents = new HashSet<Class<? extends Component>>();
464 supportedComponents.add(Group.class);
465
466 return supportedComponents;
467 }
468
469
470
471
472 @Override
473 public String getComponentTypeName() {
474 return "view";
475 }
476
477
478
479
480
481
482
483 public PageGroup getCurrentPage() {
484 for (Group pageGroup : this.getItems()) {
485 if (StringUtils.equals(pageGroup.getId(), getCurrentPageId()) && pageGroup instanceof PageGroup) {
486 return (PageGroup) pageGroup;
487 }
488 }
489
490 return null;
491 }
492
493
494
495
496
497 @Override
498 protected void sortItems(Object model) {
499 if (!singlePageView) {
500 super.sortItems(model);
501 }
502 }
503
504
505
506
507
508
509
510
511
512
513
514 @BeanTagAttribute(name = "namespaceCode")
515 public String getNamespaceCode() {
516 return namespaceCode;
517 }
518
519
520
521
522
523
524 public void setNamespaceCode(String namespaceCode) {
525 checkMutable(true);
526 this.namespaceCode = namespaceCode;
527 }
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543 @BeanTagAttribute(name = "viewName")
544 public String getViewName() {
545 return this.viewName;
546 }
547
548
549
550
551
552
553 public void setViewName(String viewName) {
554 checkMutable(true);
555 this.viewName = viewName;
556 }
557
558
559
560
561
562
563
564 @BeanTagAttribute(name = "unifiedHeader")
565 public boolean isUnifiedHeader() {
566 return unifiedHeader;
567 }
568
569
570
571
572
573
574 public void setUnifiedHeader(boolean unifiedHeader) {
575 checkMutable(true);
576 this.unifiedHeader = unifiedHeader;
577 }
578
579
580
581
582
583
584 @BeanTagAttribute(name = "topGroup", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
585 public Group getTopGroup() {
586 return topGroup;
587 }
588
589
590
591
592
593
594 public void setTopGroup(Group topGroup) {
595 checkMutable(true);
596 this.topGroup = topGroup;
597 }
598
599
600
601
602
603
604
605
606
607
608
609
610 @BeanTagAttribute(name = "applicationHeader", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
611 public Header getApplicationHeader() {
612 return applicationHeader;
613 }
614
615
616
617
618
619
620 public void setApplicationHeader(Header applicationHeader) {
621 checkMutable(true);
622 this.applicationHeader = applicationHeader;
623 }
624
625
626
627
628
629
630
631
632
633
634
635
636 @BeanTagAttribute(name = "applicationFooter", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
637 public Group getApplicationFooter() {
638 return applicationFooter;
639 }
640
641
642
643
644
645
646 public void setApplicationFooter(Group applicationFooter) {
647 checkMutable(true);
648 this.applicationFooter = applicationFooter;
649 }
650
651
652
653
654
655
656 @BeanTagAttribute(name = "stickyTopGroup")
657 public boolean isStickyTopGroup() {
658 return stickyTopGroup;
659 }
660
661
662
663
664
665
666 public void setStickyTopGroup(boolean stickyTopGroup) {
667 checkMutable(true);
668 this.stickyTopGroup = stickyTopGroup;
669 }
670
671
672
673
674
675
676 @BeanTagAttribute(name = "stickyBreadcrumbs")
677 public boolean isStickyBreadcrumbs() {
678 return stickyBreadcrumbs;
679 }
680
681
682
683
684
685
686 public void setStickyBreadcrumbs(boolean stickyBreadcrumbs) {
687 checkMutable(true);
688 this.stickyBreadcrumbs = stickyBreadcrumbs;
689 }
690
691
692
693
694
695
696 @BeanTagAttribute(name = "stickyHeader")
697 public boolean isStickyHeader() {
698 if (this.getHeader() != null && this.getHeader() instanceof ViewHeader) {
699 return ((ViewHeader) this.getHeader()).isSticky();
700 } else {
701 return false;
702 }
703 }
704
705
706
707
708
709
710 public void setStickyHeader(boolean stickyHeader) {
711 checkMutable(true);
712 this.stickyHeader = stickyHeader;
713 if (this.getHeader() != null && this.getHeader() instanceof ViewHeader) {
714 ((ViewHeader) this.getHeader()).setSticky(stickyHeader);
715 }
716 }
717
718
719
720
721
722
723 @BeanTagAttribute(name = "stickyApplicationHeader")
724 public boolean isStickyApplicationHeader() {
725 return stickyApplicationHeader;
726 }
727
728
729
730
731
732
733 public void setStickyApplicationHeader(boolean stickyApplicationHeader) {
734 checkMutable(true);
735 this.stickyApplicationHeader = stickyApplicationHeader;
736 }
737
738
739
740
741
742
743 @BeanTagAttribute(name = "stickyFooter")
744 public boolean isStickyFooter() {
745 return stickyFooter;
746 }
747
748
749
750
751
752
753 public void setStickyFooter(boolean stickyFooter) {
754 checkMutable(true);
755 this.stickyFooter = stickyFooter;
756 if (this.getFooter() != null) {
757 this.getFooter().addDataAttribute(UifConstants.DataAttributes.STICKY_FOOTER, Boolean.toString(
758 stickyFooter));
759 }
760 }
761
762
763
764
765
766
767 @BeanTagAttribute(name = "stickyApplicationFooter")
768 public boolean isStickyApplicationFooter() {
769 return stickyApplicationFooter;
770 }
771
772
773
774
775
776
777 public void setStickyApplicationFooter(boolean stickyApplicationFooter) {
778 checkMutable(true);
779 this.stickyApplicationFooter = stickyApplicationFooter;
780 }
781
782
783
784
785
786
787
788
789 @BeanTagAttribute(name = "entryPageId")
790 public String getEntryPageId() {
791 return this.entryPageId;
792 }
793
794
795
796
797
798
799 public void setEntryPageId(String entryPageId) {
800 checkMutable(true);
801 this.entryPageId = entryPageId;
802 }
803
804
805
806
807
808
809
810
811
812
813
814 public String getCurrentPageId() {
815 if (!isFinal()) {
816 checkMutable(true);
817 }
818
819
820 if (StringUtils.isBlank(currentPageId)) {
821 if (StringUtils.isNotBlank(entryPageId)) {
822 currentPageId = entryPageId;
823 } else if ((getItems() != null) && !getItems().isEmpty()) {
824 Group firstPageGroup = getItems().get(0);
825 currentPageId = firstPageGroup.getId();
826 }
827 }
828
829 return this.currentPageId;
830 }
831
832
833
834
835
836
837 public void setCurrentPageId(String currentPageId) {
838 checkMutable(true);
839 this.currentPageId = currentPageId;
840 }
841
842
843
844
845
846
847
848
849
850
851
852 @BeanTagAttribute(name = "navigation", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
853 public Group getNavigation() {
854 return this.navigation;
855 }
856
857
858
859
860
861
862 public void setNavigation(Group navigation) {
863 checkMutable(true);
864 this.navigation = navigation;
865 }
866
867
868
869
870
871
872
873
874
875
876 @BeanTagAttribute(name = "formClass")
877 public Class<?> getFormClass() {
878 return this.formClass;
879 }
880
881
882
883
884
885
886 public void setFormClass(Class<?> formClass) {
887 checkMutable(true);
888 this.formClass = formClass;
889 }
890
891
892
893
894
895
896
897
898
899
900 @BeanTagAttribute(name = "defaultObjectPath")
901 public String getDefaultBindingObjectPath() {
902 return this.defaultBindingObjectPath;
903 }
904
905
906
907
908
909
910 public void setDefaultBindingObjectPath(String defaultBindingObjectPath) {
911 checkMutable(true);
912 this.defaultBindingObjectPath = defaultBindingObjectPath;
913 }
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939 @BeanTagAttribute(name = "objectPathConcreteClassMapping", type = BeanTagAttribute.AttributeType.MAPVALUE)
940 public Map<String, Class<?>> getObjectPathToConcreteClassMapping() {
941 return this.objectPathToConcreteClassMapping;
942 }
943
944
945
946
947
948
949 public void setObjectPathToConcreteClassMapping(Map<String, Class<?>> objectPathToConcreteClassMapping) {
950 checkMutable(true);
951 this.objectPathToConcreteClassMapping = objectPathToConcreteClassMapping;
952 }
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967 @BeanTagAttribute(name = "additionalScriptFiles", type = BeanTagAttribute.AttributeType.LISTVALUE)
968 public List<String> getAdditionalScriptFiles() {
969 if (additionalScriptFiles == Collections.EMPTY_LIST && isMutable(true)) {
970 additionalScriptFiles = new LifecycleAwareList<String>(this);
971 }
972
973 return additionalScriptFiles;
974 }
975
976
977
978
979
980
981
982 public void setAdditionalScriptFiles(List<String> additionalScriptFiles) {
983 checkMutable(true);
984 if (additionalScriptFiles == null) {
985 this.additionalScriptFiles = Collections.emptyList();
986 } else {
987 this.additionalScriptFiles = new LifecycleAwareList<String>(this, additionalScriptFiles);
988 }
989 }
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004 @BeanTagAttribute(name = "additionalCssFiles", type = BeanTagAttribute.AttributeType.LISTVALUE)
1005 public List<String> getAdditionalCssFiles() {
1006 if (additionalCssFiles == Collections.EMPTY_LIST && isMutable(true)) {
1007 additionalCssFiles = new LifecycleAwareList<String>(this);
1008 }
1009
1010 return additionalCssFiles;
1011 }
1012
1013
1014
1015
1016
1017
1018
1019 public void setAdditionalCssFiles(List<String> additionalCssFiles) {
1020 checkMutable(true);
1021 if (additionalCssFiles == null) {
1022 this.additionalCssFiles = Collections.emptyList();
1023 } else {
1024 this.additionalCssFiles = new LifecycleAwareList<String>(this, additionalCssFiles);
1025 }
1026 }
1027
1028
1029
1030
1031
1032
1033 public boolean isUseLibraryCssClasses() {
1034 return useLibraryCssClasses;
1035 }
1036
1037
1038
1039
1040
1041
1042 public void setUseLibraryCssClasses(boolean useLibraryCssClasses) {
1043 checkMutable(true);
1044 this.useLibraryCssClasses = useLibraryCssClasses;
1045 }
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065 public List<String> getViewTemplates() {
1066 if (viewTemplates == Collections.EMPTY_LIST && isMutable(true)) {
1067 viewTemplates = new LifecycleAwareList<String>(this);
1068 }
1069
1070 return viewTemplates;
1071 }
1072
1073
1074
1075
1076
1077
1078 public void addViewTemplate(String template) {
1079 if (StringUtils.isEmpty(template)) {
1080 return;
1081 }
1082
1083 if (viewTemplates.isEmpty()) {
1084 setViewTemplates(new ArrayList<String>());
1085 }
1086
1087 if (!viewTemplates.contains(template)) {
1088 viewTemplates.add(template);
1089 }
1090 }
1091
1092
1093
1094
1095
1096
1097 public void setViewTemplates(List<String> viewTemplates) {
1098 checkMutable(true);
1099
1100 if (viewTemplates == null) {
1101 this.viewTemplates = Collections.emptyList();
1102 } else {
1103 this.viewTemplates = new LifecycleAwareList<String>(this, viewTemplates);
1104 }
1105 }
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120 @BeanTagAttribute(name = "viewTypeName", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1121 public ViewType getViewTypeName() {
1122 return this.viewTypeName;
1123 }
1124
1125
1126
1127
1128
1129
1130 public void setViewTypeName(ViewType viewTypeName) {
1131 checkMutable(true);
1132 this.viewTypeName = viewTypeName;
1133 }
1134
1135
1136
1137
1138
1139
1140
1141
1142 @BeanTagAttribute(name = "viewHelperServiceClass")
1143 public Class<? extends ViewHelperService> getViewHelperServiceClass() {
1144 return this.viewHelperServiceClass;
1145 }
1146
1147
1148
1149
1150
1151
1152
1153 public void setViewHelperServiceClass(Class<? extends ViewHelperService> viewHelperServiceClass) {
1154 checkMutable(true);
1155 this.viewHelperServiceClass = viewHelperServiceClass;
1156 if ((this.viewHelperService == null) && (this.viewHelperServiceClass != null)) {
1157 viewHelperService = DataObjectUtils.newInstance(viewHelperServiceClass);
1158 }
1159 }
1160
1161
1162
1163
1164
1165
1166 @BeanTagAttribute(name = "viewHelperService", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1167 public ViewHelperService getViewHelperService() {
1168 return viewHelperService;
1169 }
1170
1171
1172
1173
1174
1175
1176 public void setViewHelperService(ViewHelperService viewHelperService) {
1177 checkMutable(true);
1178 this.viewHelperService = viewHelperService;
1179 }
1180
1181
1182
1183
1184 public void index() {
1185 checkMutable(false);
1186 if (this.viewIndex == null) {
1187 this.viewIndex = new ViewIndex();
1188 }
1189 this.viewIndex.index(this);
1190 }
1191
1192
1193
1194
1195
1196
1197 @BeanTagAttribute(name = "viewIndex", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1198 public ViewIndex getViewIndex() {
1199 return this.viewIndex;
1200 }
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222 public Map<String, String> getViewRequestParameters() {
1223 return this.viewRequestParameters;
1224 }
1225
1226
1227
1228
1229
1230
1231 public void setViewRequestParameters(Map<String, String> viewRequestParameters) {
1232 checkMutable(true);
1233 this.viewRequestParameters = Collections.unmodifiableMap(viewRequestParameters);
1234 }
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264 @BeanTagAttribute(name = "persistFormToSession")
1265 public boolean isPersistFormToSession() {
1266 return persistFormToSession;
1267 }
1268
1269
1270
1271
1272
1273
1274 public void setPersistFormToSession(boolean persistFormToSession) {
1275 checkMutable(true);
1276 this.persistFormToSession = persistFormToSession;
1277 }
1278
1279 public ViewSessionPolicy getSessionPolicy() {
1280 return sessionPolicy;
1281 }
1282
1283 public void setSessionPolicy(ViewSessionPolicy sessionPolicy) {
1284 checkMutable(true);
1285 this.sessionPolicy = sessionPolicy;
1286 }
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301 @BeanTagAttribute(name = "presentationController", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1302 public ViewPresentationController getPresentationController() {
1303 return this.presentationController;
1304 }
1305
1306
1307
1308
1309
1310
1311 public void setPresentationController(ViewPresentationController presentationController) {
1312 checkMutable(true);
1313 this.presentationController = presentationController;
1314 }
1315
1316
1317
1318
1319
1320
1321 public void setPresentationControllerClass(
1322 Class<? extends ViewPresentationController> presentationControllerClass) {
1323 checkMutable(true);
1324 this.presentationController = DataObjectUtils.newInstance(presentationControllerClass);
1325 }
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343 @BeanTagAttribute(name = "authorizer", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1344 public ViewAuthorizer getAuthorizer() {
1345 return this.authorizer;
1346 }
1347
1348
1349
1350
1351
1352
1353 public void setAuthorizer(ViewAuthorizer authorizer) {
1354 checkMutable(true);
1355 this.authorizer = authorizer;
1356 }
1357
1358
1359
1360
1361
1362
1363 public void setAuthorizerClass(Class<? extends ViewAuthorizer> authorizerClass) {
1364 checkMutable(true);
1365 this.authorizer = DataObjectUtils.newInstance(authorizerClass);
1366 }
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377 @BeanTagAttribute(name = "actionFlags", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1378 public Map<String, Boolean> getActionFlags() {
1379 if (actionFlags == Collections.EMPTY_MAP && isMutable(true)) {
1380 actionFlags = new LifecycleAwareMap<String, Boolean>(this);
1381 }
1382
1383 return actionFlags;
1384 }
1385
1386
1387
1388
1389
1390
1391 public void setActionFlags(Map<String, Boolean> actionFlags) {
1392 checkMutable(true);
1393 if (actionFlags == null) {
1394 this.actionFlags = Collections.emptyMap();
1395 } else {
1396 this.actionFlags = new LifecycleAwareMap<String, Boolean>(this, actionFlags);
1397 }
1398 }
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410 @BeanTagAttribute(name = "editModes", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1411 public Map<String, Boolean> getEditModes() {
1412 if (editModes == Collections.EMPTY_MAP && isMutable(true)) {
1413 editModes = new LifecycleAwareMap<String, Boolean>(this);
1414 }
1415
1416 return editModes;
1417 }
1418
1419
1420
1421
1422
1423
1424 public void setEditModes(Map<String, Boolean> editModes) {
1425 checkMutable(true);
1426 if (editModes == null) {
1427 this.editModes = Collections.emptyMap();
1428 } else {
1429 this.editModes = new LifecycleAwareMap<String, Boolean>(this, actionFlags);
1430 }
1431 }
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448 @BeanTagAttribute(name = "expressionVariables", type = BeanTagAttribute.AttributeType.MAPVALUE)
1449 public Map<String, String> getExpressionVariables() {
1450 return this.expressionVariables;
1451 }
1452
1453
1454
1455
1456
1457
1458 public void setExpressionVariables(Map<String, String> expressionVariables) {
1459 checkMutable(true);
1460 this.expressionVariables = Collections.unmodifiableMap(expressionVariables);
1461 }
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474 @BeanTagAttribute(name = "singlePageView")
1475 public boolean isSinglePageView() {
1476 return this.singlePageView;
1477 }
1478
1479
1480
1481
1482
1483
1484 public void setSinglePageView(boolean singlePageView) {
1485 checkMutable(true);
1486 this.singlePageView = singlePageView;
1487 }
1488
1489
1490
1491
1492
1493
1494
1495
1496 public boolean isMergeWithPageItems() {
1497 return mergeWithPageItems;
1498 }
1499
1500
1501
1502
1503
1504
1505 public void setMergeWithPageItems(boolean mergeWithPageItems) {
1506 checkMutable(true);
1507 this.mergeWithPageItems = mergeWithPageItems;
1508 }
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518 @BeanTagAttribute(name = "page", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1519 public PageGroup getPage() {
1520 return this.page;
1521 }
1522
1523
1524
1525
1526
1527
1528 public void setPage(PageGroup page) {
1529 checkMutable(true);
1530 this.page = page;
1531 }
1532
1533
1534
1535
1536 @Override
1537 @BeanTagAttribute(name = "items", type = BeanTagAttribute.AttributeType.LISTBEAN)
1538 public List<? extends Group> getItems() {
1539 if (items == Collections.EMPTY_LIST && isMutable(true)) {
1540 items = new LifecycleAwareList<Group>(this);
1541 }
1542
1543 return items;
1544 }
1545
1546
1547
1548
1549
1550
1551 @SuppressWarnings("unchecked")
1552 @Override
1553 public void setItems(List<? extends Component> items) {
1554 checkMutable(true);
1555
1556 if (items == null) {
1557 items = Collections.emptyList();
1558 } else {
1559
1560 this.items = new LifecycleAwareList<Group>(this, (List<Group>) items);
1561 }
1562 }
1563
1564
1565
1566
1567
1568
1569 @BeanTagAttribute(name = "dialogs", type = BeanTagAttribute.AttributeType.LISTBEAN)
1570 public List<Group> getDialogs() {
1571 return dialogs;
1572 }
1573
1574
1575
1576
1577
1578
1579 public void setDialogs(List<Group> dialogs) {
1580 checkMutable(true);
1581 this.dialogs = Collections.unmodifiableList(dialogs);
1582 }
1583
1584
1585
1586
1587
1588
1589
1590 @BeanTagAttribute(name = "viewMenuLink", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1591 public Link getViewMenuLink() {
1592 return this.viewMenuLink;
1593 }
1594
1595
1596
1597
1598
1599
1600 public void setViewMenuLink(Link viewMenuLink) {
1601 checkMutable(true);
1602 this.viewMenuLink = viewMenuLink;
1603 }
1604
1605
1606
1607
1608
1609
1610
1611 @BeanTagAttribute(name = "viewMenuGroupName")
1612 public String getViewMenuGroupName() {
1613 return this.viewMenuGroupName;
1614 }
1615
1616
1617
1618
1619
1620
1621 public void setViewMenuGroupName(String viewMenuGroupName) {
1622 checkMutable(true);
1623 this.viewMenuGroupName = viewMenuGroupName;
1624 }
1625
1626
1627
1628
1629
1630
1631 @BeanTagAttribute(name = "breadcrumbs", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1632 public Breadcrumbs getBreadcrumbs() {
1633 return this.breadcrumbs;
1634 }
1635
1636
1637
1638
1639 public void setBreadcrumbs(Breadcrumbs breadcrumbs) {
1640 checkMutable(true);
1641 this.breadcrumbs = breadcrumbs;
1642 }
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655 @BeanTagAttribute(name = "breadcrumbOptions", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1656 public BreadcrumbOptions getBreadcrumbOptions() {
1657 return breadcrumbOptions;
1658 }
1659
1660
1661
1662
1663
1664
1665 public void setBreadcrumbOptions(BreadcrumbOptions breadcrumbOptions) {
1666 checkMutable(true);
1667 this.breadcrumbOptions = breadcrumbOptions;
1668 }
1669
1670
1671
1672
1673
1674
1675
1676 @BeanTagAttribute(name = "breadcrumbItem", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1677 public BreadcrumbItem getBreadcrumbItem() {
1678 return breadcrumbItem;
1679 }
1680
1681
1682
1683
1684
1685
1686 public void setBreadcrumbItem(BreadcrumbItem breadcrumbItem) {
1687 checkMutable(true);
1688 this.breadcrumbItem = breadcrumbItem;
1689 }
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705 @BeanTagAttribute(name = "parentLocation", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1706 public ParentLocation getParentLocation() {
1707 return parentLocation;
1708 }
1709
1710
1711
1712
1713
1714
1715 public void setParentLocation(ParentLocation parentLocation) {
1716 checkMutable(true);
1717 this.parentLocation = parentLocation;
1718 }
1719
1720
1721
1722
1723
1724
1725 public List<BreadcrumbItem> getPathBasedBreadcrumbs() {
1726 return pathBasedBreadcrumbs;
1727 }
1728
1729
1730
1731
1732
1733
1734 public void setPathBasedBreadcrumbs(List<BreadcrumbItem> pathBasedBreadcrumbs) {
1735 checkMutable(true);
1736 this.pathBasedBreadcrumbs = pathBasedBreadcrumbs == null ? null :
1737 new LifecycleAwareList<BreadcrumbItem>(this, pathBasedBreadcrumbs);
1738 }
1739
1740
1741
1742
1743
1744
1745
1746 @BeanTagAttribute(name = "growls", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1747 public Growls getGrowls() {
1748 return this.growls;
1749 }
1750
1751
1752
1753
1754 public void setGrowls(Growls growls) {
1755 checkMutable(true);
1756 this.growls = growls;
1757 }
1758
1759
1760
1761
1762
1763
1764
1765 public void setRefreshBlockUI(BlockUI refreshBlockUI) {
1766 checkMutable(true);
1767 this.refreshBlockUI = refreshBlockUI;
1768 }
1769
1770
1771
1772
1773 @BeanTagAttribute(name = "refreshBlockUI", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1774 public BlockUI getRefreshBlockUI() {
1775 return refreshBlockUI;
1776 }
1777
1778
1779
1780
1781
1782
1783
1784 public void setNavigationBlockUI(BlockUI navigationBlockUI) {
1785 checkMutable(true);
1786 this.navigationBlockUI = navigationBlockUI;
1787 }
1788
1789
1790
1791
1792 @BeanTagAttribute(name = "navigationBlockUI", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1793 public BlockUI getNavigationBlockUI() {
1794 return navigationBlockUI;
1795 }
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812 @BeanTagAttribute(name = "growlMessagingEnabled")
1813 public boolean isGrowlMessagingEnabled() {
1814 return this.growlMessagingEnabled;
1815 }
1816
1817
1818
1819
1820
1821
1822 public void setGrowlMessagingEnabled(boolean growlMessagingEnabled) {
1823 checkMutable(true);
1824 this.growlMessagingEnabled = growlMessagingEnabled;
1825 }
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839 @BeanTagAttribute(name = "applyDirtyCheck")
1840 public boolean isApplyDirtyCheck() {
1841 return this.applyDirtyCheck;
1842 }
1843
1844
1845
1846
1847 public void setApplyDirtyCheck(boolean applyDirtyCheck) {
1848 checkMutable(true);
1849 this.applyDirtyCheck = applyDirtyCheck;
1850 }
1851
1852
1853
1854
1855
1856
1857 public void setTranslateCodesOnReadOnlyDisplay(boolean translateCodesOnReadOnlyDisplay) {
1858 checkMutable(true);
1859 this.translateCodesOnReadOnlyDisplay = translateCodesOnReadOnlyDisplay;
1860 }
1861
1862
1863
1864
1865
1866
1867 @BeanTagAttribute(name = "translateCodesOnReadOnlyDisplay")
1868 public boolean isTranslateCodesOnReadOnlyDisplay() {
1869 return translateCodesOnReadOnlyDisplay;
1870 }
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882 @BeanTagAttribute(name = "supportsRequestOverrideOfReadOnlyFields")
1883 public boolean isSupportsRequestOverrideOfReadOnlyFields() {
1884 return supportsRequestOverrideOfReadOnlyFields;
1885 }
1886
1887
1888
1889
1890
1891
1892 public void setSupportsRequestOverrideOfReadOnlyFields(boolean supportsRequestOverrideOfReadOnlyFields) {
1893 checkMutable(true);
1894 this.supportsRequestOverrideOfReadOnlyFields = supportsRequestOverrideOfReadOnlyFields;
1895 }
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908 public boolean isDisableNativeAutocomplete() {
1909 return disableNativeAutocomplete;
1910 }
1911
1912
1913
1914
1915
1916
1917 public void setDisableNativeAutocomplete(boolean disableNativeAutocomplete) {
1918 checkMutable(true);
1919 this.disableNativeAutocomplete = disableNativeAutocomplete;
1920 }
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935 public boolean isDisableBrowserCache() {
1936 return disableBrowserCache;
1937 }
1938
1939
1940
1941
1942
1943
1944 public void setDisableBrowserCache(boolean disableBrowserCache) {
1945 checkMutable(true);
1946 this.disableBrowserCache = disableBrowserCache;
1947 }
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958 @BeanTagAttribute(name = "preLoadScript")
1959 public String getPreLoadScript() {
1960 return preLoadScript;
1961 }
1962
1963
1964
1965
1966
1967
1968 public void setPreLoadScript(String preLoadScript) {
1969 checkMutable(true);
1970 this.preLoadScript = preLoadScript;
1971 }
1972
1973
1974
1975
1976
1977
1978 @BeanTagAttribute(name = "theme", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
1979 public ViewTheme getTheme() {
1980 return theme;
1981 }
1982
1983
1984
1985
1986
1987
1988 public void setTheme(ViewTheme theme) {
1989 checkMutable(true);
1990 this.theme = theme;
1991 }
1992
1993
1994
1995
1996
1997
1998
1999 @BeanTagAttribute(name = "stateObjectBindingPath")
2000 public String getStateObjectBindingPath() {
2001 return stateObjectBindingPath;
2002 }
2003
2004
2005
2006
2007
2008
2009
2010 public void setStateObjectBindingPath(String stateObjectBindingPath) {
2011 checkMutable(true);
2012 this.stateObjectBindingPath = stateObjectBindingPath;
2013 }
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028 @BeanTagAttribute(name = "stateMapping", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
2029 public StateMapping getStateMapping() {
2030 return stateMapping;
2031 }
2032
2033
2034
2035
2036
2037
2038 public void setStateMapping(StateMapping stateMapping) {
2039 checkMutable(true);
2040 this.stateMapping = stateMapping;
2041 }
2042
2043
2044
2045
2046
2047
2048
2049
2050 public Map<String, Object> getPreModelContext() {
2051 if (preModelContext == null) {
2052 Map<String, Object> context = new HashMap<String, Object>();
2053
2054 context.put(UifConstants.ContextVariableNames.VIEW, this);
2055 context.put(UifConstants.ContextVariableNames.VIEW_HELPER, viewHelperService);
2056
2057 Map<String, String> properties = CoreApiServiceLocator.getKualiConfigurationService().getAllProperties();
2058 context.put(UifConstants.ContextVariableNames.CONFIG_PROPERTIES, properties);
2059 context.put(UifConstants.ContextVariableNames.CONSTANTS, KRADConstants.class);
2060 context.put(UifConstants.ContextVariableNames.UIF_CONSTANTS, UifConstants.class);
2061
2062 preModelContext = Collections.unmodifiableMap(context);
2063 }
2064
2065 return preModelContext;
2066 }
2067
2068
2069
2070
2071 @Override
2072 protected <T> void copyProperties(T component) {
2073 super.copyProperties(component);
2074
2075 View viewCopy = (View) component;
2076
2077 viewCopy.setNamespaceCode(this.namespaceCode);
2078 viewCopy.setViewName(this.viewName);
2079
2080 if (this.theme != null) {
2081 viewCopy.setTheme((ViewTheme) this.theme.copy());
2082 }
2083
2084 viewCopy.setStateObjectBindingPath(this.stateObjectBindingPath);
2085
2086 if (this.stateMapping != null) {
2087 viewCopy.setStateMapping(CloneUtils.deepClone(this.stateMapping));
2088 }
2089
2090 viewCopy.setUnifiedHeader(this.unifiedHeader);
2091
2092 if (this.topGroup != null) {
2093 viewCopy.setTopGroup((Group) this.topGroup.copy());
2094 }
2095
2096 if (this.applicationHeader != null) {
2097 viewCopy.setApplicationHeader((Header) this.applicationHeader.copy());
2098 }
2099
2100 if (this.applicationFooter != null) {
2101 viewCopy.setApplicationFooter((Group) this.applicationFooter.copy());
2102 }
2103
2104 viewCopy.setStickyApplicationFooter(this.stickyApplicationFooter);
2105 viewCopy.setStickyApplicationHeader(this.stickyApplicationHeader);
2106 viewCopy.setStickyBreadcrumbs(this.stickyBreadcrumbs);
2107 viewCopy.setStickyFooter(this.stickyFooter);
2108 viewCopy.setStickyHeader(this.stickyHeader);
2109 viewCopy.setStickyTopGroup(this.stickyTopGroup);
2110
2111 if (this.breadcrumbItem != null) {
2112 viewCopy.setBreadcrumbItem((BreadcrumbItem) this.breadcrumbItem.copy());
2113 }
2114
2115 if (this.breadcrumbs != null) {
2116 viewCopy.setBreadcrumbs((Breadcrumbs) this.breadcrumbs.copy());
2117 }
2118
2119 if (this.breadcrumbOptions != null) {
2120 viewCopy.setBreadcrumbOptions((BreadcrumbOptions) this.breadcrumbOptions.copy());
2121 }
2122
2123 if (this.parentLocation != null) {
2124 viewCopy.setParentLocation((ParentLocation) this.parentLocation.copy());
2125 }
2126
2127 if (this.pathBasedBreadcrumbs != null) {
2128 List<BreadcrumbItem> pathBasedBreadcrumbsCopy = ComponentUtils.copy(pathBasedBreadcrumbs);
2129 viewCopy.setPathBasedBreadcrumbs(pathBasedBreadcrumbsCopy);
2130 }
2131
2132 viewCopy.setGrowlMessagingEnabled(this.growlMessagingEnabled);
2133
2134 if (this.growls != null) {
2135 viewCopy.setGrowls((Growls) this.growls.copy());
2136 }
2137
2138 if (this.refreshBlockUI != null) {
2139 viewCopy.setRefreshBlockUI((BlockUI) this.refreshBlockUI.copy());
2140 }
2141
2142 if (this.navigationBlockUI != null) {
2143 viewCopy.setNavigationBlockUI((BlockUI) this.navigationBlockUI.copy());
2144 }
2145
2146 viewCopy.setEntryPageId(this.entryPageId);
2147 viewCopy.setCurrentPageId(this.currentPageId);
2148
2149 if (this.navigation != null) {
2150 viewCopy.setNavigation((Group) this.navigation.copy());
2151 }
2152
2153 viewCopy.setFormClass(this.formClass);
2154 viewCopy.setDefaultBindingObjectPath(this.defaultBindingObjectPath);
2155
2156 if (this.objectPathToConcreteClassMapping != null) {
2157 viewCopy.setObjectPathToConcreteClassMapping(new HashMap<String, Class<?>>(this.objectPathToConcreteClassMapping));
2158 }
2159
2160 if (this.additionalCssFiles != null) {
2161 viewCopy.setAdditionalCssFiles(new ArrayList<String>(this.additionalCssFiles));
2162 }
2163
2164 if (this.additionalScriptFiles != null) {
2165 viewCopy.setAdditionalScriptFiles(new ArrayList<String>(this.additionalScriptFiles));
2166 }
2167
2168 viewCopy.setUseLibraryCssClasses(this.useLibraryCssClasses);
2169 viewCopy.setViewTypeName(this.viewTypeName);
2170
2171 if (this.viewIndex != null) {
2172 viewCopy.viewIndex = this.viewIndex.copy();
2173 }
2174
2175 if (this.viewRequestParameters != null) {
2176 viewCopy.setViewRequestParameters(new HashMap<String, String>(this.viewRequestParameters));
2177 }
2178
2179 viewCopy.setPersistFormToSession(this.persistFormToSession);
2180
2181 if (this.sessionPolicy != null) {
2182 viewCopy.setSessionPolicy(CloneUtils.deepClone(this.sessionPolicy));
2183 }
2184
2185 viewCopy.setPresentationController(this.presentationController);
2186 viewCopy.setAuthorizer(this.authorizer);
2187
2188 if (this.actionFlags != null) {
2189 viewCopy.setActionFlags(new BooleanMap(this.actionFlags));
2190 }
2191
2192 if (this.editModes != null) {
2193 viewCopy.setEditModes(new BooleanMap(this.editModes));
2194 }
2195
2196 if (this.expressionVariables != null) {
2197 viewCopy.setExpressionVariables(new HashMap<String, String>(this.expressionVariables));
2198 }
2199
2200 viewCopy.setSinglePageView(this.singlePageView);
2201 viewCopy.setMergeWithPageItems(this.mergeWithPageItems);
2202
2203 if (this.page != null) {
2204 viewCopy.setPage((PageGroup) this.page.copy());
2205 }
2206
2207 if (this.dialogs != null) {
2208 List<Group> dialogsCopy = ComponentUtils.copy(dialogs);
2209 viewCopy.setDialogs(dialogsCopy);
2210 }
2211
2212 if (this.viewMenuLink != null) {
2213 viewCopy.setViewMenuLink((Link) this.viewMenuLink.copy());
2214 }
2215
2216 viewCopy.setViewMenuGroupName(this.viewMenuGroupName);
2217 viewCopy.setApplyDirtyCheck(this.applyDirtyCheck);
2218 viewCopy.setTranslateCodesOnReadOnlyDisplay(this.translateCodesOnReadOnlyDisplay);
2219 viewCopy.setSupportsRequestOverrideOfReadOnlyFields(this.supportsRequestOverrideOfReadOnlyFields);
2220 viewCopy.setDisableBrowserCache(this.disableBrowserCache);
2221 viewCopy.setDisableNativeAutocomplete(this.disableNativeAutocomplete);
2222 viewCopy.setPreLoadScript(this.preLoadScript);
2223
2224 if (this.viewTemplates != null) {
2225 viewCopy.setViewTemplates(new ArrayList<String>(this.viewTemplates));
2226 }
2227
2228 if (this.viewHelperServiceClass != null) {
2229 viewCopy.setViewHelperServiceClass(this.viewHelperServiceClass);
2230 }
2231 else if (this.viewHelperService != null) {
2232 viewCopy.setViewHelperService(CloneUtils.deepClone(this.viewHelperService));
2233 }
2234 }
2235
2236
2237
2238
2239 @Override
2240 public void completeValidation(ValidationTrace tracer) {
2241 tracer.addBean(this);
2242
2243
2244 boolean validPageId = false;
2245 if (getEntryPageId() != null) {
2246 for (int i = 0; i < getItems().size(); i++) {
2247 if (getEntryPageId().compareTo(getItems().get(i).getId()) == 0) {
2248 validPageId = true;
2249 }
2250 }
2251 } else {
2252 validPageId = true;
2253 }
2254 if (!validPageId) {
2255 String currentValues[] = {"entryPageId = " + getEntryPageId()};
2256 tracer.createError("Items must contain an item with a matching id to entryPageId", currentValues);
2257 }
2258
2259
2260 if (tracer.getValidationStage() == ValidationTrace.START_UP) {
2261 if (getViewStatus().compareTo(ViewStatus.CREATED) != 0) {
2262 String currentValues[] = {"viewStatus = " + getViewStatus()};
2263 tracer.createError("ViewStatus should not be set", currentValues);
2264 }
2265 }
2266
2267
2268 boolean validDefaultBindingObjectPath = false;
2269 if (getDefaultBindingObjectPath() == null) {
2270 validDefaultBindingObjectPath = true;
2271 } else if (DataDictionary.isPropertyOf(getFormClass(), getDefaultBindingObjectPath())) {
2272 validDefaultBindingObjectPath = true;
2273 }
2274 if (!validDefaultBindingObjectPath) {
2275 String currentValues[] =
2276 {"formClass = " + getFormClass(), "defaultBindingPath = " + getDefaultBindingObjectPath()};
2277 tracer.createError("DefaultBingdingObjectPath must be a valid property of the formClass", currentValues);
2278 }
2279
2280
2281 if (isSinglePageView()) {
2282 if (getPage() == null) {
2283 String currentValues[] = {"singlePageView = " + isSinglePageView(), "page = " + getPage()};
2284 tracer.createError("Page must be set if singlePageView is true", currentValues);
2285 }
2286 for (int i = 0; i < getItems().size(); i++) {
2287 if (getItems().get(i).getClass() == PageGroup.class) {
2288 String currentValues[] =
2289 {"singlePageView = " + isSinglePageView(), "items(" + i + ") = " + getItems().get(i)
2290 .getClass()};
2291 tracer.createError("Items cannot be pageGroups if singlePageView is true", currentValues);
2292 }
2293 }
2294 }
2295
2296
2297 if (isGrowlMessagingEnabled() == true && getGrowls() == null) {
2298 if (Validator.checkExpressions(this, "growls")) {
2299 String currentValues[] =
2300 {"growlMessagingEnabled = " + isGrowlMessagingEnabled(), "growls = " + getGrowls()};
2301 tracer.createError("Growls cannot be null if Growl Messaging is enabled", currentValues);
2302 }
2303 }
2304
2305
2306 if (!isSinglePageView()) {
2307 if (getItems().size() == 0) {
2308 String currentValues[] =
2309 {"singlePageView = " + isSinglePageView(), "items.size = " + getItems().size()};
2310 tracer.createWarning("Items cannot be empty if singlePageView is false", currentValues);
2311 } else {
2312 for (int i = 0; i < getItems().size(); i++) {
2313 if (getItems().get(i).getClass() != PageGroup.class) {
2314 String currentValues[] =
2315 {"singlePageView = " + isSinglePageView(), "items(" + i + ") = " + getItems().get(i)
2316 .getClass()};
2317 tracer.createError("Items must be pageGroups if singlePageView is false", currentValues);
2318 }
2319 }
2320 }
2321 }
2322 super.completeValidation(tracer.getCopy());
2323 }
2324
2325 }