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