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