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 52, 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
30 <#if !curLanguage.isSelected()>
31
32 <p>url:${curLanguage.getURL()}</p>
33 <p>parameter ics:${request.getParameter("ics")}</p>
34 <p>matchedItem en_us:${matchedItemsCache["ics"].value_i18n["en_US"]}</p>
35
36
37 <#assign entryHref = buildTranslatedHref(curLanguage.getURL(), curLanguage.getLanguageId(), translatableParams, matchedItemsCache) />
38 <li class="option" role="option"><span class="option-text"> <a href="${entryHref}" class="language-entry-short-text"
39 lang="${curLanguage.getLanguageId()}">${curLanguage.getLongDisplayName()?capitalize}</a> </span></li>
40
41 </#if>
42 </#list>
43 </#if>
44</ul>
45
46
47<#-- ============================================================
48 Traduccion de parametros de la URL al cambiar de idioma
49 ============================================================ -->
50
51<#function findMatchedItem paramName locale>
52 <#local paramValue = request.getParameter(paramName)! />
53 <#if !paramValue?has_content>
54 <#return "" />
55 </#if>
56
57 <#local paramValueTrim = paramValue?trim />
58 <#local paramType = paramName?upper_case />
59 <#local endpointURL = "/c/selectoptions/?languageId=" + locale?string + "&sort=name:asc&filter=optionsType eq '" + paramType + "'" />
60 <#local optionsResponse = restClient.get(endpointURL) />
61
62 <#list optionsResponse.items![] as item>
63 <#local valueI18n = item.value_i18n![] />
64 <#local found = false />
65
66 <#list valueI18n?keys as key>
67 <#if valueI18n[key]! == paramValueTrim>
68 <#local found = true />
69 <#break />
70 </#if>
71 </#list>
72
73 <#if !found && (item.value!"") == paramValueTrim>
74 <#local found = true />
75 </#if>
76
77 <#if found>
78 <#return item />
79 </#if>
80 </#list>
81
82 <#return "" />
83</#function>
84
85<#function buildMatchedItemsCache paramNames locale>
86 <#local cache = {} />
87 <#list paramNames as paramName>
88 <#local cache = cache + {paramName: findMatchedItem(paramName, locale)} />
89 </#list>
90 <#return cache />
91</#function>
92
93<#function translateParamInURL originalURL paramName targetLanguageId matchedItemsCache>
94
95 <#local paramValue = request.getParameter(paramName)! />
96 <#local matchedItem = matchedItemsCache[paramName]!"" />
97
98 <#if !paramValue?has_content || !matchedItem?has_content>
99 <#return originalURL />
100 </#if>
101
102 <#local newValue = matchedItem.value_i18n[targetLanguageId]!matchedItem.value!paramValue />
103
104 <#if !newValue?has_content>
105 <#return originalURL />
106 </#if>
107
108 <#-- Codifica el nuevo valor para que encaje dentro del redirect -->
109 <#local encodedNewValue = httpUtil.encodeURL(newValue) />
110
111 <#-- Sustituye el valor de ics codificado dentro de redirect -->
112 <#local resultURL = originalURL?replace(
113 "(" + paramName + "%3D)[^&]*",
114 "$1" + encodedNewValue,
115 "r"
116 ) />
117
118 <#return resultURL />
119
120</#function>
121
122<#function buildTranslatedHref originalURL targetLanguageId paramNames matchedItemsCache>
123 <#local resultURL = originalURL />
124
125 <#list paramNames as paramName>
126 <#local resultURL = translateParamInURL(resultURL, paramName, targetLanguageId, matchedItemsCache) />
127 </#list>
128
129 <#return resultURL />
130</#function>
131
132<#-- ============================================================ -->
133
134<script>
135 $(document).ready(function () {
136 // Toggle el estado del menu de idiomas
137 $('.select-btn').on('click', function () {
138 var expanded = $(this).attr('aria-expanded') === 'true';
139 $(this).attr('aria-expanded', !expanded);
140 $('.options').toggleClass('hide', expanded);
141 });
142
143 // Acciones de teclado para la lupa
144 $('.select-btn').on('keydown', function (e) {
145 if (e.key === 'Enter' || e.key === ' ') {
146 e.preventDefault(); // Evitar desplazamiento al presionar espacio
147 $(this).click(); // Simula el click para abrir/cerrar el menu
148 }
149 });
150
151 // Cerrar el menu al hacer clic en cualquier parte fuera de el
152 $(document).on('click', function (event) {
153 if (!$(event.target).closest('.select-btn, .options').length) {
154 $('.options').addClass('hide');
155 $('.select-btn').attr('aria-expanded', 'false');
156 }
157 });
158
159 // Navegar con las teclas de flecha
160 let options = $('.option');
161 let selectedIndex = 0;
162
163 options.on('keydown', function (e) {
164 if (e.key === 'ArrowDown') {
165 selectedIndex = (selectedIndex + 1) % options.length;
166 options.eq(selectedIndex).focus();
167 }
168 if (e.key === 'ArrowUp') {
169 selectedIndex = (selectedIndex - 1 + options.length) % options.length;
170 options.eq(selectedIndex).focus();
171 }
172 if (e.key === 'Enter') {
173 window.location.href = $(this).find('a').attr('href'); // Redirige a la opcion seleccionada
174 }
175 });
176 });
177</script>
El producto se ha añadido a la cesta de la compra
Listado colecciones temáticas relacionadas
-
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}










