Java method "com.liferay.portal.kernel.theme.NavItem.hasBrowsableChildren()" threw an exception when invoked on com.liferay.site.navigation.taglib.internal.util.SiteNavigationMenuNavItem object "com.liferay.site.navigation.taglib.internal.util.SiteNavigationMenuNavItem@239bc9"; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign showChildren = (displayDepth ... [in template "20102#20128#1144078" at line 16, column 33] ----
1<#if !entries?has_content>
2 <#if themeDisplay.isSignedIn()>
3 <div class="alert alert-info">
4 <@liferay.language key="there-are-no-menu-items-to-display" />
5 </div>
6 </#if>
7 <#else>
8 <#assign portletDisplay=themeDisplay.getPortletDisplay() navbarId="navbar_" + portletDisplay.getId() />
9
10 <div id="${navbarId}">
11 <ul aria-label="<@liferay.language key=" site-pages" />" class="navbar-blank navbar-nav navbar-site"
12 role="menubar">
13 <#assign navItems=entries />
14
15 <#list navItems as navItem>
16 <#assign showChildren=(displayDepth !=1) && navItem.hasBrowsableChildren() />
17
18 <#if navItem.isBrowsable() || showChildren>
19 <#assign nav_item_attr_has_popup="" nav_item_caret="" nav_item_css_class="lfr-nav-item nav-item"
20 nav_item_href_link="" nav_item_link_css_class="nav-link text-truncate" />
21
22 <#if showChildren>
23 <#assign nav_item_attr_has_popup="aria-haspopup='true'" />
24
25 <#assign nav_item_caret>
26 <span class="lfr-nav-child-toggle">
27 <@liferay_aui.icon image="angle-down" markupView="lexicon" />
28 </span>
29 </#assign>
30
31 <#assign nav_item_css_class="${nav_item_css_class} dropdown"
32 nav_item_link_css_class="${nav_item_link_css_class} dropdown-toggle" />
33 </#if>
34
35 <#if navItem.isBrowsable()>
36 <#assign nav_item_href_link="href='${navItem.getURL()}'" />
37 </#if>
38
39 <#if navItem.isSelected()>
40 <#assign nav_item_css_class="${nav_item_css_class} selected active" />
41 </#if>
42 <li class="${nav_item_css_class}" id="11ayout_${portletDisplay.getId()}_${navItem.getLayoutId()}"
43 role="presentation" onClick="toggleCookie('${navItem.getName()}')">
44 <a aria-labelledby="layout_${portletDisplay.getId()}_${navItem.getLayoutId()}"
45 ${nav_item_attr_has_popup} class="${nav_item_link_css_class}" ${nav_item_href_link}
46 ${navItem.getTarget()} role="menuitem">
47 <span class="text-truncate">
48 <@liferay_theme["layout-icon"] layout=navItem.getLayout() /> ${navItem.getName()}
49 ${nav_item_caret}
50 </span>
51 </a>
52
53 <#if showChildren>
54 <ul aria-expanded="false" class="child-menu dropdown-menu" role="menu">
55 <#list navItem.getBrowsableChildren() as childNavigationItem>
56 <#assign nav_child_css_class="" />
57
58 <#if childNavigationItem.isSelected()>
59 <#assign nav_child_css_class="active selected" />
60 </#if>
61
62 <li class="${nav_child_css_class}"
63 id="layout_${portletDisplay.getId()}_${childNavigationItem.getLayoutId()}"
64 role="presentation">
65 <a aria-labelledby="layout_${portletDisplay.getId()}_${childNavigationItem.getLayoutId()}"
66 class="dropdown-item" href="${childNavigationItem.getURL()}"
67 ${childNavigationItem.getTarget()}
68 role="menuitem">${childNavigationItem.getName()}</a>
69 </li>
70 </#list>
71 </ul>
72 </#if>
73 </li>
74 </#if>
75 </#list>
76 </ul>
77 </div>
78
79 <@liferay_aui.script use="liferay-navigation-interaction">
80 var navigation = A.one('#${navbarId}');
81
82 Liferay.Data.NAV_INTERACTION_LIST_SELECTOR = '.navbar-site';
83 Liferay.Data.NAV_LIST_SELECTOR = '.navbar-site';
84
85 if (navigation) {
86 navigation.plug(Liferay.NavigationInteraction);
87 }
88 </@>
89</#if>
90
91<script>
92 if($.cookie) {
93 var CURRENT_VIEW_REF = $.cookie("CURRENT_VIEW");
94 checkCookies();
95 } else {
96 console.log('Jquery Lib Cookie is not ready!')
97 }
98
99 function checkCookies() {
100
101 if (CURRENT_VIEW_REF && CURRENT_VIEW_REF !== 'undefined' && $.cookie('COOPERATIVA_SESSION')) {
102 const cooperativa = $.cookie('COOPERATIVA_SESSION').toLowerCase();
103 //TODO: setar no selectbox.
104
105 if (location.href.endsWith('/web/sicoob/') || location.href.endsWith("/" + cooperativa)) {
106 const href = document.location.href + (document.location.href.endsWith('/') ? '' : '/') + CURRENT_VIEW_REF.toLowerCase();
107 document.location.href = href;
108 CURRENT_VIEW_REF = '';
109 }
110 }
111 }
112
113
114 function toggleCookie(name) {
115 name = name.toLowerCase();
116
117 if ((name.toLowerCase().indexOf("voce") !== -1) || (name.toLowerCase().indexOf("você") !== -1)) {
118 $.cookie("CURRENT_VIEW", "para-voce", { path: "/", expires: 365 });
119 CURRENT_VIEW_REF = 'para-voce';
120 }
121 else if (name.indexOf("empresa") !== -1) {
122 $.cookie("CURRENT_VIEW", "para-empresa", { path: "/", expires: 365 });
123 CURRENT_VIEW_REF = 'para-empresa';
124 }
125 else if((name.indexOf("agronegocio") !== -1) || (name.indexOf("agronegócio") !== -1)) {
126 $.cookie("CURRENT_VIEW", "para-agronegocio", { path: "/", expires: 365 });
127 CURRENT_VIEW_REF = 'para-agronegocio';
128 }
129 else if(name.indexOf("campo") !== -1) {
130 $.cookie("CURRENT_VIEW", "para-campo", { path: "/", expires: 365 });
131 CURRENT_VIEW_REF = 'para-campo';
132 }
133 }
134
135</script>