Se ha producido un error al procesar la plantilla.
Denied access to method or field getParameter of class org.apache.catalina.core.ApplicationHttpRequest
----
FTL stack trace ("~" means nesting-related):
- Failed at: #local paramValue = request.getParame... [in template "34352066712900#33336#65816767" in function "findMatchedItem" at line 49, column 5]
----
1<#--
2 LANGUAGE HEADER DROPDOWN
3 -->
4<#assign currentURL = themeDisplay.getURLCurrent()>
5<#assign baseURL = themeDisplay.getPortalURL()>
6<#assign relativeURL = currentURL?replace(baseURL, "")>
7
8<#assign translatableParams = ["ics", "ctn"] />
9<#assign matchedItemsCache = buildMatchedItemsCache(translatableParams, locale) />
10
11<#assign desc = themeDisplay.getLanguageId()?split("_")?first >
12<div class="select-btn" id="language-select" role="button" aria-haspopup="listbox" aria-expanded="false" tabindex="0">
13 <#assign siteLanguage = themeDisplay.getLocale().getDisplayLanguage( themeDisplay.getLocale() )?cap_first>
14 <span
15 class="sBtn-text text-uppercase d-flex align-content-center align-items-center">${desc} <span
16 class="fa-solid fa-chevron-down" aria-hidden="true"></span></span>
17</div>
18 <ul class="options hide" role="listbox" aria-labelledby="language-select">
19 <li class="option actives" style="pointer-events:none" role="option" aria-selected="true">
20 <span class="option-text">
21 <svg aria-hidden="true" class="lexicon-icon mr-2 lexicon-icon-${themeDisplay.getLanguageId()?replace('_', '-')?lower_case}">
22 <use href="/o/classic-theme/images/clay/icons.svg#${themeDisplay.getLanguageId()?replace('_', '-')?lower_case}"></use>
23 </svg>
24 ${siteLanguage}
25 </span>
26 </li>
27 <#if entries?has_content>
28 <#list entries as curLanguage>
29 <#if !curLanguage.isSelected()>
30
31 <p>LanguageId:${curLanguage.getLanguageId()}</p>
32
33 <#assign entryHref = buildTranslatedHref(curLanguage.getURL(), curLanguage.getLanguageId(), translatableParams, matchedItemsCache) />
34 <li class="option" role="option"><span class="option-text"> <a href="${entryHref}" class="language-entry-short-text"
35 lang="${curLanguage.getLanguageId()}">${curLanguage.getLongDisplayName()?capitalize}</a> </span></li>
36
37
38 </#if>
39 </#list>
40 </#if>
41</ul>
42
43
44<#-- ============================================================
45 Traduccion de parametros de la URL al cambiar de idioma
46 ============================================================ -->
47
48<#function findMatchedItem paramName locale>
49 <#local paramValue = request.getParameter(paramName)! />
50 <#if !paramValue?has_content>
51 <#return "" />
52 </#if>
53
54 <#local paramValueTrim = paramValue?trim />
55 <#local paramType = paramName?upper_case />
56 <#local endpointURL = "/c/selectoptions/?languageId=" + locale?string + "&sort=name:asc&filter=optionsType eq '" + paramType + "'" />
57 <#local optionsResponse = restClient.get(endpointURL) />
58
59 <#list optionsResponse.items![] as item>
60 <#local valueI18n = item.value_i18n![] />
61 <#local found = false />
62
63 <#list valueI18n?keys as key>
64 <#if valueI18n[key]! == paramValueTrim>
65 <#local found = true />
66 <#break />
67 </#if>
68 </#list>
69
70 <#if !found && (item.value!"") == paramValueTrim>
71 <#local found = true />
72 </#if>
73
74 <#if found>
75 <#return item />
76 </#if>
77 </#list>
78
79 <#return "" />
80</#function>
81
82<#function buildMatchedItemsCache paramNames locale>
83 <#local cache = {} />
84 <#list paramNames as paramName>
85 <#local cache = cache + {paramName: findMatchedItem(paramName, locale)} />
86 </#list>
87 <#return cache />
88</#function>
89
90<#function translateParamInURL originalURL paramName targetLanguageId matchedItemsCache>
91 <#local paramValue = request.getParameter(paramName)! />
92 <#local matchedItem = matchedItemsCache[paramName]!"" />
93
94 <#if !paramValue?has_content || !matchedItem?has_content>
95 <#return originalURL />
96 </#if>
97
98 <#local rawValueInURL = originalURL?replace(".*[?&]" + paramName + "=([^&]*).*", "$1", "r") />
99
100 <#if rawValueInURL == originalURL>
101 <#return originalURL />
102 </#if>
103
104 <#local urlDecoder = staticUtil["java.net.URLDecoder"] />
105 <#local urlEncoder = staticUtil["java.net.URLEncoder"] />
106 <#local decodedValueInURL = urlDecoder.decode(rawValueInURL, "UTF-8") />
107
108 <#if decodedValueInURL != paramValue?trim>
109 <#return originalURL />
110 </#if>
111
112 <#local newValue = matchedItem.value_i18n[targetLanguageId]!matchedItem.value!paramValue />
113
114 <#if newValue == decodedValueInURL>
115 <#return originalURL />
116 </#if>
117
118 <#local newEncoded = urlEncoder.encode(newValue, "UTF-8") />
119
120 <#return originalURL?replace(paramName + "=" + rawValueInURL, paramName + "=" + newEncoded) />
121</#function>
122
123<#function buildTranslatedHref originalURL targetLanguageId paramNames matchedItemsCache>
124 <#local resultURL = originalURL />
125
126 <#list paramNames as paramName>
127 <#local resultURL = translateParamInURL(resultURL, paramName, targetLanguageId, matchedItemsCache) />
128 </#list>
129
130 <#return resultURL />
131</#function>
132
133
134<#-- ============================================================ -->
135
136<script>
137 $(document).ready(function () {
138 // Toggle el estado del menu de idiomas
139 $('.select-btn').on('click', function () {
140 var expanded = $(this).attr('aria-expanded') === 'true';
141 $(this).attr('aria-expanded', !expanded);
142 $('.options').toggleClass('hide', expanded);
143 });
144
145 // Acciones de teclado para la lupa
146 $('.select-btn').on('keydown', function (e) {
147 if (e.key === 'Enter' || e.key === ' ') {
148 e.preventDefault(); // Evitar desplazamiento al presionar espacio
149 $(this).click(); // Simula el click para abrir/cerrar el menu
150 }
151 });
152
153 // Cerrar el menu al hacer clic en cualquier parte fuera de el
154 $(document).on('click', function (event) {
155 if (!$(event.target).closest('.select-btn, .options').length) {
156 $('.options').addClass('hide');
157 $('.select-btn').attr('aria-expanded', 'false');
158 }
159 });
160
161 // Navegar con las teclas de flecha
162 let options = $('.option');
163 let selectedIndex = 0;
164
165 options.on('keydown', function (e) {
166 if (e.key === 'ArrowDown') {
167 selectedIndex = (selectedIndex + 1) % options.length;
168 options.eq(selectedIndex).focus();
169 }
170 if (e.key === 'ArrowUp') {
171 selectedIndex = (selectedIndex - 1 + options.length) % options.length;
172 options.eq(selectedIndex).focus();
173 }
174 if (e.key === 'Enter') {
175 window.location.href = $(this).find('a').attr('href'); // Redirige a la opcion seleccionada
176 }
177 });
178 });
179</script>
El producto se ha añadido a la cesta de la compra
Listado libros relacionados
-
URL del producto:
https://aenorportalesweb-uat.lxc.liferay.com/web/tienda/e/{friendlyURL_display-page-template}/{ClassNameId-CPDefinition}/{CPDefinition ID (Field: product.id)}
por ejemplo: https://aenorportalesweb-uat.lxc.liferay.com/web/tienda/e/producto-tienda/30025/${cpDefinitionId}










