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