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