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