2464 Resultados disponibles

Filtrar:

Se ha producido un error al procesar la plantilla.
Syntax error in template "34352066712900#33336#362186" in line 86, column 54:
Unknown built-in: "class". Help (latest version): https://freemarker.apache.org/docs/ref_builtins.html; you're using FreeMarker 2.3.33.
The alphabetical list of built-ins:
abs, absolute_template_name, ancestors, api, 
boolean, byte, 
c, c_lower_case, c_upper_case, cap_first, capitalize, ceiling, children, chop_linebreak, chunk, cn, contains, counter, 
date, date_if_unknown, datetime, datetime_if_unknown, default, double, drop_while, 
ends_with, ensure_ends_with, ensure_starts_with, esc, eval, eval_json, exists, 
filter, first, float, floor, 
groups, 
has_api, has_content, has_next, html, 
if_exists, index, index_of, int, interpret, is_boolean, is_collection, is_collection_ex, is_date, is_date_like, is_date_only, is_datetime, is_directive, is_enumerable, is_even_item, is_first, is_hash, is_hash_ex, is_indexable, is_infinite, is_last, is_macro, is_markup_output, is_method, is_nan, is_node, is_number, is_odd_item, is_sequence, is_string, is_time, is_transform, is_unknown_date_like, iso, iso_h, iso_h_nz, iso_local, iso_local_h, iso_local_h_nz, iso_local_m, iso_local_m_nz, iso_local_ms, iso_local_ms_nz, iso_local_nz, iso_m, iso_m_nz, iso_ms, iso_ms_nz, iso_nz, iso_utc, iso_utc_fz, iso_utc_h, iso_utc_h_nz, iso_utc_m, iso_utc_m_nz, iso_utc_ms, iso_utc_ms_nz, iso_utc_nz, item_cycle, item_parity, item_parity_cap, 
j_string, join, js_string, json_string, 
keep_after, keep_after_last, keep_before, keep_before_last, keys, 
last, last_index_of, left_pad, length, long, lower_abc, lower_case, 
map, markup_string, matches, max, min, 
namespace, new, next_sibling, no_esc, node_name, node_namespace, node_type, number, number_to_date, number_to_datetime, number_to_time, 
parent, previous_sibling, 
remove_beginning, remove_ending, replace, reverse, right_pad, root, round, rtf, 
seq_contains, seq_index_of, seq_last_index_of, sequence, short, size, sort, sort_by, split, starts_with, string, substring, switch, 
take_while, then, time, time_if_unknown, trim, truncate, truncate_c, truncate_c_m, truncate_m, truncate_w, truncate_w_m, 
uncap_first, upper_abc, upper_case, url, url_path, 
values, 
web_safe, with_args, with_args_last, word_list, 
xhtml, xml
1<#-- Variables --> 
2<#assign specificationName          = 'ctn' /> 
3<#assign paramNameSpecificationName = cpSpecificationOptionsSearchFacetDisplayContext.getParameterName() /> 
4<#assign isDebug                    = false /> 
5<#assign showAllSpecificationsName  = false /> 
6<#assign staticHost                 = getCXConfig("ecom-static-files") /> 
7 
8<#-- ========================= --> 
9<#-- Functions freemaker       --> 
10<#-- ========================= --> 
11<#function getCXConfig clientExtensionName field="webApiUrl"> 
12    <#if !clientExtensionName?has_content><#return "" /></#if> 
13    <#local encoded = urlCodec.encodeURL(clientExtensionName) /> 
14    <#local items   = restClient.get("/c/customconfigs/?fields=clientExtensionConfig&filter=clientExtensionName eq '" + encoded + "'").items![] /> 
15    <#return items?has_content?then(items[0].clientExtensionConfig?eval[field]!"", "") /> 
16</#function> 
17 
18<#function getTaxonomyVocabularyId vocabularyName> 
19    <#local response = restClient.get("/headless-admin-taxonomy/v1.0/sites/" + groupId + "/taxonomy-vocabularies?filter=contains(name,'" + vocabularyName + "')&pageSize=1")!{} /> 
20    <#local items    = response.items![] /> 
21    <#return items?has_content?then(items[0].id, "") /> 
22</#function> 
23 
24<#function getTaxonomyCategoryMap vocabularyId pageSize=200> 
25    <#local response   = restClient.get("/headless-admin-taxonomy/v1.0/taxonomy-vocabularies/" + vocabularyId + "/taxonomy-categories?pageSize=" + pageSize)!{} /> 
26    <#local categoryMap = {} /> 
27    <#list response.items![] as cat> 
28        <#local categoryMap = categoryMap + {vocabularyId + "-" + cat.id: cat.name} /> 
29    </#list> 
30    <#return categoryMap /> 
31</#function> 
32 
33<#function getSpecOrganismosMap organismoMap aggResult> 
34    <#local specMap = {} /> 
35    <#if !aggResult?has_content || !organismoMap?has_content><#return specMap /></#if> 
36    <#list aggResult.getBuckets() as specBucket> 
37        <#local specKey      = specBucket.getKey() /> 
38        <#local organismoAgg = specBucket.getChildAggregationResult("organismos") /> 
39        <#local orgNames     = [] /> 
40        <#if organismoAgg?has_content> 
41            <#list organismoAgg.getBuckets() as orgBucket> 
42                <#local orgName  = organismoMap[orgBucket.getKey()]!"" /> 
43                <#if orgName?has_content> 
44                    <#local orgNames = orgNames + [orgName] /> 
45                </#if> 
46            </#list> 
47        </#if> 
48        <#if orgNames?has_content> 
49            <#local specMap = specMap + {specKey: orgNames} /> 
50        </#if> 
51    </#list> 
52    <#return specMap /> 
53</#function> 
54 
55<#function getAggregationResult specificationKey> 
56    <#if !specificationKey?has_content><#return "" /></#if> 
57 
58    <#local sharedSearchResponse = renderRequest.getAttribute("LIFERAY_SHARED_PortletSharedSearchResponse") /> 
59    <#if !sharedSearchResponse?has_content><#return "" /></#if> 
60 
61    <#local searchResponse = sharedSearchResponse.get() /> 
62    <#if !searchResponse?has_content><#return "" /></#if> 
63 
64    <#local esResponse = searchResponse.getSearchResponse() /> 
65    <#if !esResponse?has_content><#return "" /></#if> 
66 
67    <#local aggregationResult = esResponse.getAggregationResult(specificationKey + "_with_organismos") /> 
68    <#if !aggregationResult?has_content><#return "" /></#if> 
69 
70    <#return aggregationResult /> 
71</#function> 
72 
73 
74 
75<#if paramNameSpecificationName == specificationName || showAllSpecificationsName> 
76 
77    <#-- ========================= --> 
78    <#-- Datos                     --> 
79    <#-- ========================= --> 
80	<#assign organismoVocabId  = getTaxonomyVocabularyId("organismos") /> 
81	<#assign organismoMap      = getTaxonomyCategoryMap(organismoVocabId) /> 
82	<#assign aggResult         = getAggregationResult(paramNameSpecificationName)! /> 
83	<#assign specOrganismosMap = getSpecOrganismosMap(organismoMap, aggResult) /> 
84			 
85			BUCKET KEY TYPE: 
86${specBucket.getKey()?string} (${specBucket.getKey()?class}) 
87			 
88 
89    <#-- ========================= --> 
90    <#-- Debug                     --> 
91    <#-- ========================= --> 
92    <#if isDebug> 
93        <div style="background:#f0f0f0;padding:8px;margin-bottom:8px;font-size:11px;border:1px solid #ccc;"> 
94            <p><strong>paramName:</strong> ${paramNameSpecificationName}</p> 
95            <p><strong>organismoMap size:</strong> ${organismoMap?size}</p> 
96            <p><strong>specOrganismosMap size:</strong> ${specOrganismosMap?size}</p> 
97            <#list specOrganismosMap?keys as spec> 
98                <p>${spec}: ${specOrganismosMap[spec]?join(", ")}</p> 
99            </#list> 
100        </div> 
101    </#if> 
102 
103    <#-- Variables --> 
104    <#assign facetId    = "facet-" + paramNameSpecificationName + "-" + renderResponse.getNamespace() /> 
105    <#assign facetClass = "facet-" + paramNameSpecificationName + "-combo-search-wrapper" /> 
106 
107    <#-- ========================= --> 
108    <#-- TOM SELECT framework      --> 
109    <#-- ========================= --> 
110    <@liferay_util["html-top"] outputKey="tom-select"> 
111        <link href="${staticHost}/scripts/vendor/tom-select/tom-select.css" rel="stylesheet"> 
112        <script src="${staticHost}/scripts/vendor/tom-select/tom-select.complete.min.js"></script> 
113    </@> 
114 
115    <#-- ========================= --> 
116    <#-- CSS                       --> 
117    <#-- ========================= --> 
118    <style> 
119        #${facetId} { 
120            --facet-font-family: Inter; 
121            --facet-font-size: 14px; 
122            --facet-font-weight: 400; 
123            --facet-line-height: 18px; 
124            --facet-letter-spacing: 0.5px; 
125            --facet-color: #66757f; 
126
127        #${facetId}-select { 
128            appearance: none; 
129            -webkit-appearance: none; 
130            visibility: hidden; 
131            position: absolute; 
132
133        #${facetId} .ts-wrapper { 
134            width: 100%; 
135            margin-bottom: 16px; 
136            opacity: 0; 
137            transition: opacity 0.1s ease; 
138
139        #${facetId} .ts-wrapper .ts-control { 
140            padding: 15.5px 16px; 
141            font-family: var(--facet-font-family); 
142            font-size: var(--facet-font-size); 
143            font-weight: var(--facet-font-weight); 
144            line-height: var(--facet-line-height); 
145            letter-spacing: var(--facet-letter-spacing); 
146            color: var(--facet-color); 
147            text-align: left; 
148            height: 55px; 
149            width: 100%; 
150            border-radius: 4px; 
151            border: none; 
152            background-color: #F5F5F5; 
153            background-image: url(/documents/d/global/ico-chevron-down-2); 
154            background-repeat: no-repeat; 
155            background-position: right 1rem center; 
156            background-size: 18px 10px; 
157            box-shadow: none; 
158            cursor: pointer; 
159            box-sizing: border-box; 
160
161        #${facetId} .ts-wrapper .ts-control:focus, 
162        #${facetId} .ts-wrapper .ts-control:focus-visible { 
163            background-image: url(/documents/d/global/ico-chevron-down-2); 
164            background-position: right 1rem center; 
165            background-size: 18px 10px; 
166            outline: none; 
167            box-shadow: none; 
168
169        #${facetId} .ts-wrapper .ts-control .item { 
170            padding-right: 0.75rem; 
171            overflow: hidden; 
172            text-overflow: ellipsis; 
173            max-width: calc(100% - 0.75rem); 
174
175        #${facetId} .ts-wrapper.single .ts-control::after { 
176            display: none; 
177
178        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input { 
179            font-family: var(--facet-font-family); 
180            font-size: var(--facet-font-size); 
181            font-weight: var(--facet-font-weight); 
182            line-height: var(--facet-line-height); 
183            letter-spacing: var(--facet-letter-spacing); 
184            color: var(--facet-color); 
185            padding: 8px 16px; 
186            border: none; 
187            border-bottom: 1px solid #d9d9d9; 
188            background-color: #fff; 
189            width: 100%; 
190            box-sizing: border-box; 
191
192        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input:focus { 
193            outline: none; 
194            box-shadow: none; 
195
196        #${facetId} .ts-dropdown .ts-dropdown-content .option { 
197            font-family: var(--facet-font-family); 
198            font-size: var(--facet-font-size); 
199            font-weight: var(--facet-font-weight); 
200            line-height: var(--facet-line-height); 
201            letter-spacing: var(--facet-letter-spacing); 
202            color: var(--facet-color); 
203            padding: 8px 16px; 
204
205        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover, 
206        #${facetId} .ts-dropdown .ts-dropdown-content .option.active { 
207            background-color: #6a9bd3; 
208            color: #fff; 
209
210        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover .badge, 
211        #${facetId} .ts-dropdown .ts-dropdown-content .option.active .badge { 
212            background-color: #fff; 
213            color: #3a6a9b; 
214
215    </style> 
216 
217    <div class="checks-container ${facetClass}" id="${facetId}"> 
218        <div class="d-flex flex-column w-100"> 
219            <label class="panel-title mb-2" for="${facetId}-select"> 
220                ${languageUtil.get(locale, "norma." + paramNameSpecificationName)} 
221                <#if isDebug> 
222                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
223                        (total options: ${entries?size}) 
224                    </p> 
225                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
226                        (facetId: ${facetId}) 
227                    </p> 
228                </#if> 
229            </label> 
230 
231            <#-- ========================= --> 
232            <#-- SELECT UI                 --> 
233            <#-- ========================= --> 
234             
235 
236             
237            <select id="${facetId}-select" data-parameter-name="${paramNameSpecificationName}"> 
238                <option value="">${languageUtil.get(locale, "search.cualquiera")}</option> 
239                <#list entries?sort_by("displayName") as entry> 
240                    <#assign specName = entry.getDisplayName() /> 
241                    <#assign orgNames = specOrganismosMap[specName]![] /> 
242									 
243							 
244									 
245                    <option value="${htmlUtil.escape(specName)}" 
246                        <#if entry.isSelected()>selected</#if> 
247                        data-organismos="${htmlUtil.escape(orgNames?join(","))}"> 
248                        ${htmlUtil.escape(specName)} (${entry.getFrequency()}) 
249                    </option> 
250                </#list> 
251            </select> 
252        </div> 
253    </div> 
254 
255    <#-- ========================= --> 
256    <#-- SCRIPT                    --> 
257    <#-- ========================= --> 
258    <script> 
259        (function () { 
260            var FACET_ID   = '${facetId}'; 
261            var PARAM_NAME = '${paramNameSpecificationName}'; 
262 
263            function applyUrlFilter(value) { 
264                var url = new URL(window.location.href); 
265                if (value) { 
266                    url.searchParams.set(PARAM_NAME, value); 
267                } else { 
268                    url.searchParams.delete(PARAM_NAME); 
269
270                window.location.href = url.toString(); 
271
272 
273            function initFacet() { 
274                var select = document.getElementById(FACET_ID + '-select'); 
275                if (!select) return; 
276                if (select.tomselect) select.tomselect.destroy(); 
277                if (select.dataset.bound === 'true') return; 
278                select.dataset.bound = 'true'; 
279 
280                new TomSelect(select, { 
281                    allowEmptyOption: true, 
282                    maxItems: 1, 
283                    create: false, 
284                    render: { 
285                        option: function(data, escape) { 
286                            var organismos = data.$option ? data.$option.getAttribute('data-organismos') : ''; 
287                            var badges = ''; 
288                            if (organismos) { 
289                                organismos.split(',').forEach(function(org) { 
290                                    badges += '<span class="badge badge-secondary mr-1">' + escape(org.trim()) + '</span>'; 
291                                }); 
292
293                            return '<div class="option py-1">' + escape(data.text) + '<div class="mt-1">' + badges + '</div></div>'; 
294                        }, 
295                        no_results: function(data, escape) { 
296                            return '<div class="no-results">${languageUtil.get(locale, "occurrence-not-found")}</div>'; 
297
298                    }, 
299                    plugins: { 
300                        dropdown_input: {} 
301                    }, 
302                    onDelete: function(value) { 
303                        this.isDelete = true; 
304                    }, 
305                    onChange: function(value) { 
306                        if (value) { 
307                            this.lastValidValue = value; 
308                            applyUrlFilter(value); 
309                            return; 
310
311                        this.lastValidValue = ''; 
312                        applyUrlFilter(''); 
313                    }, 
314                    onInitialize: function() { 
315                        this.lastValidValue = this.getValue() || ''; 
316                        this.isDelete = false; 
317                        var wrapper = document.querySelector('#' + FACET_ID + ' .ts-wrapper'); 
318                        if (wrapper) wrapper.style.opacity = '1'; 
319
320                }); 
321
322 
323            if (document.readyState === 'loading') { 
324                document.addEventListener('DOMContentLoaded', initFacet); 
325            } else { 
326                initFacet(); 
327
328        })(); 
329    </script> 
330 
331</#if> 
Se ha producido un error al procesar la plantilla.
Syntax error in template "34352066712900#33336#362186" in line 86, column 54:
Unknown built-in: "class". Help (latest version): https://freemarker.apache.org/docs/ref_builtins.html; you're using FreeMarker 2.3.33.
The alphabetical list of built-ins:
abs, absolute_template_name, ancestors, api, 
boolean, byte, 
c, c_lower_case, c_upper_case, cap_first, capitalize, ceiling, children, chop_linebreak, chunk, cn, contains, counter, 
date, date_if_unknown, datetime, datetime_if_unknown, default, double, drop_while, 
ends_with, ensure_ends_with, ensure_starts_with, esc, eval, eval_json, exists, 
filter, first, float, floor, 
groups, 
has_api, has_content, has_next, html, 
if_exists, index, index_of, int, interpret, is_boolean, is_collection, is_collection_ex, is_date, is_date_like, is_date_only, is_datetime, is_directive, is_enumerable, is_even_item, is_first, is_hash, is_hash_ex, is_indexable, is_infinite, is_last, is_macro, is_markup_output, is_method, is_nan, is_node, is_number, is_odd_item, is_sequence, is_string, is_time, is_transform, is_unknown_date_like, iso, iso_h, iso_h_nz, iso_local, iso_local_h, iso_local_h_nz, iso_local_m, iso_local_m_nz, iso_local_ms, iso_local_ms_nz, iso_local_nz, iso_m, iso_m_nz, iso_ms, iso_ms_nz, iso_nz, iso_utc, iso_utc_fz, iso_utc_h, iso_utc_h_nz, iso_utc_m, iso_utc_m_nz, iso_utc_ms, iso_utc_ms_nz, iso_utc_nz, item_cycle, item_parity, item_parity_cap, 
j_string, join, js_string, json_string, 
keep_after, keep_after_last, keep_before, keep_before_last, keys, 
last, last_index_of, left_pad, length, long, lower_abc, lower_case, 
map, markup_string, matches, max, min, 
namespace, new, next_sibling, no_esc, node_name, node_namespace, node_type, number, number_to_date, number_to_datetime, number_to_time, 
parent, previous_sibling, 
remove_beginning, remove_ending, replace, reverse, right_pad, root, round, rtf, 
seq_contains, seq_index_of, seq_last_index_of, sequence, short, size, sort, sort_by, split, starts_with, string, substring, switch, 
take_while, then, time, time_if_unknown, trim, truncate, truncate_c, truncate_c_m, truncate_m, truncate_w, truncate_w_m, 
uncap_first, upper_abc, upper_case, url, url_path, 
values, 
web_safe, with_args, with_args_last, word_list, 
xhtml, xml
1<#-- Variables --> 
2<#assign specificationName          = 'ctn' /> 
3<#assign paramNameSpecificationName = cpSpecificationOptionsSearchFacetDisplayContext.getParameterName() /> 
4<#assign isDebug                    = false /> 
5<#assign showAllSpecificationsName  = false /> 
6<#assign staticHost                 = getCXConfig("ecom-static-files") /> 
7 
8<#-- ========================= --> 
9<#-- Functions freemaker       --> 
10<#-- ========================= --> 
11<#function getCXConfig clientExtensionName field="webApiUrl"> 
12    <#if !clientExtensionName?has_content><#return "" /></#if> 
13    <#local encoded = urlCodec.encodeURL(clientExtensionName) /> 
14    <#local items   = restClient.get("/c/customconfigs/?fields=clientExtensionConfig&filter=clientExtensionName eq '" + encoded + "'").items![] /> 
15    <#return items?has_content?then(items[0].clientExtensionConfig?eval[field]!"", "") /> 
16</#function> 
17 
18<#function getTaxonomyVocabularyId vocabularyName> 
19    <#local response = restClient.get("/headless-admin-taxonomy/v1.0/sites/" + groupId + "/taxonomy-vocabularies?filter=contains(name,'" + vocabularyName + "')&pageSize=1")!{} /> 
20    <#local items    = response.items![] /> 
21    <#return items?has_content?then(items[0].id, "") /> 
22</#function> 
23 
24<#function getTaxonomyCategoryMap vocabularyId pageSize=200> 
25    <#local response   = restClient.get("/headless-admin-taxonomy/v1.0/taxonomy-vocabularies/" + vocabularyId + "/taxonomy-categories?pageSize=" + pageSize)!{} /> 
26    <#local categoryMap = {} /> 
27    <#list response.items![] as cat> 
28        <#local categoryMap = categoryMap + {vocabularyId + "-" + cat.id: cat.name} /> 
29    </#list> 
30    <#return categoryMap /> 
31</#function> 
32 
33<#function getSpecOrganismosMap organismoMap aggResult> 
34    <#local specMap = {} /> 
35    <#if !aggResult?has_content || !organismoMap?has_content><#return specMap /></#if> 
36    <#list aggResult.getBuckets() as specBucket> 
37        <#local specKey      = specBucket.getKey() /> 
38        <#local organismoAgg = specBucket.getChildAggregationResult("organismos") /> 
39        <#local orgNames     = [] /> 
40        <#if organismoAgg?has_content> 
41            <#list organismoAgg.getBuckets() as orgBucket> 
42                <#local orgName  = organismoMap[orgBucket.getKey()]!"" /> 
43                <#if orgName?has_content> 
44                    <#local orgNames = orgNames + [orgName] /> 
45                </#if> 
46            </#list> 
47        </#if> 
48        <#if orgNames?has_content> 
49            <#local specMap = specMap + {specKey: orgNames} /> 
50        </#if> 
51    </#list> 
52    <#return specMap /> 
53</#function> 
54 
55<#function getAggregationResult specificationKey> 
56    <#if !specificationKey?has_content><#return "" /></#if> 
57 
58    <#local sharedSearchResponse = renderRequest.getAttribute("LIFERAY_SHARED_PortletSharedSearchResponse") /> 
59    <#if !sharedSearchResponse?has_content><#return "" /></#if> 
60 
61    <#local searchResponse = sharedSearchResponse.get() /> 
62    <#if !searchResponse?has_content><#return "" /></#if> 
63 
64    <#local esResponse = searchResponse.getSearchResponse() /> 
65    <#if !esResponse?has_content><#return "" /></#if> 
66 
67    <#local aggregationResult = esResponse.getAggregationResult(specificationKey + "_with_organismos") /> 
68    <#if !aggregationResult?has_content><#return "" /></#if> 
69 
70    <#return aggregationResult /> 
71</#function> 
72 
73 
74 
75<#if paramNameSpecificationName == specificationName || showAllSpecificationsName> 
76 
77    <#-- ========================= --> 
78    <#-- Datos                     --> 
79    <#-- ========================= --> 
80	<#assign organismoVocabId  = getTaxonomyVocabularyId("organismos") /> 
81	<#assign organismoMap      = getTaxonomyCategoryMap(organismoVocabId) /> 
82	<#assign aggResult         = getAggregationResult(paramNameSpecificationName)! /> 
83	<#assign specOrganismosMap = getSpecOrganismosMap(organismoMap, aggResult) /> 
84			 
85			BUCKET KEY TYPE: 
86${specBucket.getKey()?string} (${specBucket.getKey()?class}) 
87			 
88 
89    <#-- ========================= --> 
90    <#-- Debug                     --> 
91    <#-- ========================= --> 
92    <#if isDebug> 
93        <div style="background:#f0f0f0;padding:8px;margin-bottom:8px;font-size:11px;border:1px solid #ccc;"> 
94            <p><strong>paramName:</strong> ${paramNameSpecificationName}</p> 
95            <p><strong>organismoMap size:</strong> ${organismoMap?size}</p> 
96            <p><strong>specOrganismosMap size:</strong> ${specOrganismosMap?size}</p> 
97            <#list specOrganismosMap?keys as spec> 
98                <p>${spec}: ${specOrganismosMap[spec]?join(", ")}</p> 
99            </#list> 
100        </div> 
101    </#if> 
102 
103    <#-- Variables --> 
104    <#assign facetId    = "facet-" + paramNameSpecificationName + "-" + renderResponse.getNamespace() /> 
105    <#assign facetClass = "facet-" + paramNameSpecificationName + "-combo-search-wrapper" /> 
106 
107    <#-- ========================= --> 
108    <#-- TOM SELECT framework      --> 
109    <#-- ========================= --> 
110    <@liferay_util["html-top"] outputKey="tom-select"> 
111        <link href="${staticHost}/scripts/vendor/tom-select/tom-select.css" rel="stylesheet"> 
112        <script src="${staticHost}/scripts/vendor/tom-select/tom-select.complete.min.js"></script> 
113    </@> 
114 
115    <#-- ========================= --> 
116    <#-- CSS                       --> 
117    <#-- ========================= --> 
118    <style> 
119        #${facetId} { 
120            --facet-font-family: Inter; 
121            --facet-font-size: 14px; 
122            --facet-font-weight: 400; 
123            --facet-line-height: 18px; 
124            --facet-letter-spacing: 0.5px; 
125            --facet-color: #66757f; 
126
127        #${facetId}-select { 
128            appearance: none; 
129            -webkit-appearance: none; 
130            visibility: hidden; 
131            position: absolute; 
132
133        #${facetId} .ts-wrapper { 
134            width: 100%; 
135            margin-bottom: 16px; 
136            opacity: 0; 
137            transition: opacity 0.1s ease; 
138
139        #${facetId} .ts-wrapper .ts-control { 
140            padding: 15.5px 16px; 
141            font-family: var(--facet-font-family); 
142            font-size: var(--facet-font-size); 
143            font-weight: var(--facet-font-weight); 
144            line-height: var(--facet-line-height); 
145            letter-spacing: var(--facet-letter-spacing); 
146            color: var(--facet-color); 
147            text-align: left; 
148            height: 55px; 
149            width: 100%; 
150            border-radius: 4px; 
151            border: none; 
152            background-color: #F5F5F5; 
153            background-image: url(/documents/d/global/ico-chevron-down-2); 
154            background-repeat: no-repeat; 
155            background-position: right 1rem center; 
156            background-size: 18px 10px; 
157            box-shadow: none; 
158            cursor: pointer; 
159            box-sizing: border-box; 
160
161        #${facetId} .ts-wrapper .ts-control:focus, 
162        #${facetId} .ts-wrapper .ts-control:focus-visible { 
163            background-image: url(/documents/d/global/ico-chevron-down-2); 
164            background-position: right 1rem center; 
165            background-size: 18px 10px; 
166            outline: none; 
167            box-shadow: none; 
168
169        #${facetId} .ts-wrapper .ts-control .item { 
170            padding-right: 0.75rem; 
171            overflow: hidden; 
172            text-overflow: ellipsis; 
173            max-width: calc(100% - 0.75rem); 
174
175        #${facetId} .ts-wrapper.single .ts-control::after { 
176            display: none; 
177
178        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input { 
179            font-family: var(--facet-font-family); 
180            font-size: var(--facet-font-size); 
181            font-weight: var(--facet-font-weight); 
182            line-height: var(--facet-line-height); 
183            letter-spacing: var(--facet-letter-spacing); 
184            color: var(--facet-color); 
185            padding: 8px 16px; 
186            border: none; 
187            border-bottom: 1px solid #d9d9d9; 
188            background-color: #fff; 
189            width: 100%; 
190            box-sizing: border-box; 
191
192        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input:focus { 
193            outline: none; 
194            box-shadow: none; 
195
196        #${facetId} .ts-dropdown .ts-dropdown-content .option { 
197            font-family: var(--facet-font-family); 
198            font-size: var(--facet-font-size); 
199            font-weight: var(--facet-font-weight); 
200            line-height: var(--facet-line-height); 
201            letter-spacing: var(--facet-letter-spacing); 
202            color: var(--facet-color); 
203            padding: 8px 16px; 
204
205        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover, 
206        #${facetId} .ts-dropdown .ts-dropdown-content .option.active { 
207            background-color: #6a9bd3; 
208            color: #fff; 
209
210        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover .badge, 
211        #${facetId} .ts-dropdown .ts-dropdown-content .option.active .badge { 
212            background-color: #fff; 
213            color: #3a6a9b; 
214
215    </style> 
216 
217    <div class="checks-container ${facetClass}" id="${facetId}"> 
218        <div class="d-flex flex-column w-100"> 
219            <label class="panel-title mb-2" for="${facetId}-select"> 
220                ${languageUtil.get(locale, "norma." + paramNameSpecificationName)} 
221                <#if isDebug> 
222                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
223                        (total options: ${entries?size}) 
224                    </p> 
225                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
226                        (facetId: ${facetId}) 
227                    </p> 
228                </#if> 
229            </label> 
230 
231            <#-- ========================= --> 
232            <#-- SELECT UI                 --> 
233            <#-- ========================= --> 
234             
235 
236             
237            <select id="${facetId}-select" data-parameter-name="${paramNameSpecificationName}"> 
238                <option value="">${languageUtil.get(locale, "search.cualquiera")}</option> 
239                <#list entries?sort_by("displayName") as entry> 
240                    <#assign specName = entry.getDisplayName() /> 
241                    <#assign orgNames = specOrganismosMap[specName]![] /> 
242									 
243							 
244									 
245                    <option value="${htmlUtil.escape(specName)}" 
246                        <#if entry.isSelected()>selected</#if> 
247                        data-organismos="${htmlUtil.escape(orgNames?join(","))}"> 
248                        ${htmlUtil.escape(specName)} (${entry.getFrequency()}) 
249                    </option> 
250                </#list> 
251            </select> 
252        </div> 
253    </div> 
254 
255    <#-- ========================= --> 
256    <#-- SCRIPT                    --> 
257    <#-- ========================= --> 
258    <script> 
259        (function () { 
260            var FACET_ID   = '${facetId}'; 
261            var PARAM_NAME = '${paramNameSpecificationName}'; 
262 
263            function applyUrlFilter(value) { 
264                var url = new URL(window.location.href); 
265                if (value) { 
266                    url.searchParams.set(PARAM_NAME, value); 
267                } else { 
268                    url.searchParams.delete(PARAM_NAME); 
269
270                window.location.href = url.toString(); 
271
272 
273            function initFacet() { 
274                var select = document.getElementById(FACET_ID + '-select'); 
275                if (!select) return; 
276                if (select.tomselect) select.tomselect.destroy(); 
277                if (select.dataset.bound === 'true') return; 
278                select.dataset.bound = 'true'; 
279 
280                new TomSelect(select, { 
281                    allowEmptyOption: true, 
282                    maxItems: 1, 
283                    create: false, 
284                    render: { 
285                        option: function(data, escape) { 
286                            var organismos = data.$option ? data.$option.getAttribute('data-organismos') : ''; 
287                            var badges = ''; 
288                            if (organismos) { 
289                                organismos.split(',').forEach(function(org) { 
290                                    badges += '<span class="badge badge-secondary mr-1">' + escape(org.trim()) + '</span>'; 
291                                }); 
292
293                            return '<div class="option py-1">' + escape(data.text) + '<div class="mt-1">' + badges + '</div></div>'; 
294                        }, 
295                        no_results: function(data, escape) { 
296                            return '<div class="no-results">${languageUtil.get(locale, "occurrence-not-found")}</div>'; 
297
298                    }, 
299                    plugins: { 
300                        dropdown_input: {} 
301                    }, 
302                    onDelete: function(value) { 
303                        this.isDelete = true; 
304                    }, 
305                    onChange: function(value) { 
306                        if (value) { 
307                            this.lastValidValue = value; 
308                            applyUrlFilter(value); 
309                            return; 
310
311                        this.lastValidValue = ''; 
312                        applyUrlFilter(''); 
313                    }, 
314                    onInitialize: function() { 
315                        this.lastValidValue = this.getValue() || ''; 
316                        this.isDelete = false; 
317                        var wrapper = document.querySelector('#' + FACET_ID + ' .ts-wrapper'); 
318                        if (wrapper) wrapper.style.opacity = '1'; 
319
320                }); 
321
322 
323            if (document.readyState === 'loading') { 
324                document.addEventListener('DOMContentLoaded', initFacet); 
325            } else { 
326                initFacet(); 
327
328        })(); 
329    </script> 
330 
331</#if> 
Se ha producido un error al procesar la plantilla.
Syntax error in template "34352066712900#33336#362186" in line 86, column 54:
Unknown built-in: "class". Help (latest version): https://freemarker.apache.org/docs/ref_builtins.html; you're using FreeMarker 2.3.33.
The alphabetical list of built-ins:
abs, absolute_template_name, ancestors, api, 
boolean, byte, 
c, c_lower_case, c_upper_case, cap_first, capitalize, ceiling, children, chop_linebreak, chunk, cn, contains, counter, 
date, date_if_unknown, datetime, datetime_if_unknown, default, double, drop_while, 
ends_with, ensure_ends_with, ensure_starts_with, esc, eval, eval_json, exists, 
filter, first, float, floor, 
groups, 
has_api, has_content, has_next, html, 
if_exists, index, index_of, int, interpret, is_boolean, is_collection, is_collection_ex, is_date, is_date_like, is_date_only, is_datetime, is_directive, is_enumerable, is_even_item, is_first, is_hash, is_hash_ex, is_indexable, is_infinite, is_last, is_macro, is_markup_output, is_method, is_nan, is_node, is_number, is_odd_item, is_sequence, is_string, is_time, is_transform, is_unknown_date_like, iso, iso_h, iso_h_nz, iso_local, iso_local_h, iso_local_h_nz, iso_local_m, iso_local_m_nz, iso_local_ms, iso_local_ms_nz, iso_local_nz, iso_m, iso_m_nz, iso_ms, iso_ms_nz, iso_nz, iso_utc, iso_utc_fz, iso_utc_h, iso_utc_h_nz, iso_utc_m, iso_utc_m_nz, iso_utc_ms, iso_utc_ms_nz, iso_utc_nz, item_cycle, item_parity, item_parity_cap, 
j_string, join, js_string, json_string, 
keep_after, keep_after_last, keep_before, keep_before_last, keys, 
last, last_index_of, left_pad, length, long, lower_abc, lower_case, 
map, markup_string, matches, max, min, 
namespace, new, next_sibling, no_esc, node_name, node_namespace, node_type, number, number_to_date, number_to_datetime, number_to_time, 
parent, previous_sibling, 
remove_beginning, remove_ending, replace, reverse, right_pad, root, round, rtf, 
seq_contains, seq_index_of, seq_last_index_of, sequence, short, size, sort, sort_by, split, starts_with, string, substring, switch, 
take_while, then, time, time_if_unknown, trim, truncate, truncate_c, truncate_c_m, truncate_m, truncate_w, truncate_w_m, 
uncap_first, upper_abc, upper_case, url, url_path, 
values, 
web_safe, with_args, with_args_last, word_list, 
xhtml, xml
1<#-- Variables --> 
2<#assign specificationName          = 'ctn' /> 
3<#assign paramNameSpecificationName = cpSpecificationOptionsSearchFacetDisplayContext.getParameterName() /> 
4<#assign isDebug                    = false /> 
5<#assign showAllSpecificationsName  = false /> 
6<#assign staticHost                 = getCXConfig("ecom-static-files") /> 
7 
8<#-- ========================= --> 
9<#-- Functions freemaker       --> 
10<#-- ========================= --> 
11<#function getCXConfig clientExtensionName field="webApiUrl"> 
12    <#if !clientExtensionName?has_content><#return "" /></#if> 
13    <#local encoded = urlCodec.encodeURL(clientExtensionName) /> 
14    <#local items   = restClient.get("/c/customconfigs/?fields=clientExtensionConfig&filter=clientExtensionName eq '" + encoded + "'").items![] /> 
15    <#return items?has_content?then(items[0].clientExtensionConfig?eval[field]!"", "") /> 
16</#function> 
17 
18<#function getTaxonomyVocabularyId vocabularyName> 
19    <#local response = restClient.get("/headless-admin-taxonomy/v1.0/sites/" + groupId + "/taxonomy-vocabularies?filter=contains(name,'" + vocabularyName + "')&pageSize=1")!{} /> 
20    <#local items    = response.items![] /> 
21    <#return items?has_content?then(items[0].id, "") /> 
22</#function> 
23 
24<#function getTaxonomyCategoryMap vocabularyId pageSize=200> 
25    <#local response   = restClient.get("/headless-admin-taxonomy/v1.0/taxonomy-vocabularies/" + vocabularyId + "/taxonomy-categories?pageSize=" + pageSize)!{} /> 
26    <#local categoryMap = {} /> 
27    <#list response.items![] as cat> 
28        <#local categoryMap = categoryMap + {vocabularyId + "-" + cat.id: cat.name} /> 
29    </#list> 
30    <#return categoryMap /> 
31</#function> 
32 
33<#function getSpecOrganismosMap organismoMap aggResult> 
34    <#local specMap = {} /> 
35    <#if !aggResult?has_content || !organismoMap?has_content><#return specMap /></#if> 
36    <#list aggResult.getBuckets() as specBucket> 
37        <#local specKey      = specBucket.getKey() /> 
38        <#local organismoAgg = specBucket.getChildAggregationResult("organismos") /> 
39        <#local orgNames     = [] /> 
40        <#if organismoAgg?has_content> 
41            <#list organismoAgg.getBuckets() as orgBucket> 
42                <#local orgName  = organismoMap[orgBucket.getKey()]!"" /> 
43                <#if orgName?has_content> 
44                    <#local orgNames = orgNames + [orgName] /> 
45                </#if> 
46            </#list> 
47        </#if> 
48        <#if orgNames?has_content> 
49            <#local specMap = specMap + {specKey: orgNames} /> 
50        </#if> 
51    </#list> 
52    <#return specMap /> 
53</#function> 
54 
55<#function getAggregationResult specificationKey> 
56    <#if !specificationKey?has_content><#return "" /></#if> 
57 
58    <#local sharedSearchResponse = renderRequest.getAttribute("LIFERAY_SHARED_PortletSharedSearchResponse") /> 
59    <#if !sharedSearchResponse?has_content><#return "" /></#if> 
60 
61    <#local searchResponse = sharedSearchResponse.get() /> 
62    <#if !searchResponse?has_content><#return "" /></#if> 
63 
64    <#local esResponse = searchResponse.getSearchResponse() /> 
65    <#if !esResponse?has_content><#return "" /></#if> 
66 
67    <#local aggregationResult = esResponse.getAggregationResult(specificationKey + "_with_organismos") /> 
68    <#if !aggregationResult?has_content><#return "" /></#if> 
69 
70    <#return aggregationResult /> 
71</#function> 
72 
73 
74 
75<#if paramNameSpecificationName == specificationName || showAllSpecificationsName> 
76 
77    <#-- ========================= --> 
78    <#-- Datos                     --> 
79    <#-- ========================= --> 
80	<#assign organismoVocabId  = getTaxonomyVocabularyId("organismos") /> 
81	<#assign organismoMap      = getTaxonomyCategoryMap(organismoVocabId) /> 
82	<#assign aggResult         = getAggregationResult(paramNameSpecificationName)! /> 
83	<#assign specOrganismosMap = getSpecOrganismosMap(organismoMap, aggResult) /> 
84			 
85			BUCKET KEY TYPE: 
86${specBucket.getKey()?string} (${specBucket.getKey()?class}) 
87			 
88 
89    <#-- ========================= --> 
90    <#-- Debug                     --> 
91    <#-- ========================= --> 
92    <#if isDebug> 
93        <div style="background:#f0f0f0;padding:8px;margin-bottom:8px;font-size:11px;border:1px solid #ccc;"> 
94            <p><strong>paramName:</strong> ${paramNameSpecificationName}</p> 
95            <p><strong>organismoMap size:</strong> ${organismoMap?size}</p> 
96            <p><strong>specOrganismosMap size:</strong> ${specOrganismosMap?size}</p> 
97            <#list specOrganismosMap?keys as spec> 
98                <p>${spec}: ${specOrganismosMap[spec]?join(", ")}</p> 
99            </#list> 
100        </div> 
101    </#if> 
102 
103    <#-- Variables --> 
104    <#assign facetId    = "facet-" + paramNameSpecificationName + "-" + renderResponse.getNamespace() /> 
105    <#assign facetClass = "facet-" + paramNameSpecificationName + "-combo-search-wrapper" /> 
106 
107    <#-- ========================= --> 
108    <#-- TOM SELECT framework      --> 
109    <#-- ========================= --> 
110    <@liferay_util["html-top"] outputKey="tom-select"> 
111        <link href="${staticHost}/scripts/vendor/tom-select/tom-select.css" rel="stylesheet"> 
112        <script src="${staticHost}/scripts/vendor/tom-select/tom-select.complete.min.js"></script> 
113    </@> 
114 
115    <#-- ========================= --> 
116    <#-- CSS                       --> 
117    <#-- ========================= --> 
118    <style> 
119        #${facetId} { 
120            --facet-font-family: Inter; 
121            --facet-font-size: 14px; 
122            --facet-font-weight: 400; 
123            --facet-line-height: 18px; 
124            --facet-letter-spacing: 0.5px; 
125            --facet-color: #66757f; 
126
127        #${facetId}-select { 
128            appearance: none; 
129            -webkit-appearance: none; 
130            visibility: hidden; 
131            position: absolute; 
132
133        #${facetId} .ts-wrapper { 
134            width: 100%; 
135            margin-bottom: 16px; 
136            opacity: 0; 
137            transition: opacity 0.1s ease; 
138
139        #${facetId} .ts-wrapper .ts-control { 
140            padding: 15.5px 16px; 
141            font-family: var(--facet-font-family); 
142            font-size: var(--facet-font-size); 
143            font-weight: var(--facet-font-weight); 
144            line-height: var(--facet-line-height); 
145            letter-spacing: var(--facet-letter-spacing); 
146            color: var(--facet-color); 
147            text-align: left; 
148            height: 55px; 
149            width: 100%; 
150            border-radius: 4px; 
151            border: none; 
152            background-color: #F5F5F5; 
153            background-image: url(/documents/d/global/ico-chevron-down-2); 
154            background-repeat: no-repeat; 
155            background-position: right 1rem center; 
156            background-size: 18px 10px; 
157            box-shadow: none; 
158            cursor: pointer; 
159            box-sizing: border-box; 
160
161        #${facetId} .ts-wrapper .ts-control:focus, 
162        #${facetId} .ts-wrapper .ts-control:focus-visible { 
163            background-image: url(/documents/d/global/ico-chevron-down-2); 
164            background-position: right 1rem center; 
165            background-size: 18px 10px; 
166            outline: none; 
167            box-shadow: none; 
168
169        #${facetId} .ts-wrapper .ts-control .item { 
170            padding-right: 0.75rem; 
171            overflow: hidden; 
172            text-overflow: ellipsis; 
173            max-width: calc(100% - 0.75rem); 
174
175        #${facetId} .ts-wrapper.single .ts-control::after { 
176            display: none; 
177
178        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input { 
179            font-family: var(--facet-font-family); 
180            font-size: var(--facet-font-size); 
181            font-weight: var(--facet-font-weight); 
182            line-height: var(--facet-line-height); 
183            letter-spacing: var(--facet-letter-spacing); 
184            color: var(--facet-color); 
185            padding: 8px 16px; 
186            border: none; 
187            border-bottom: 1px solid #d9d9d9; 
188            background-color: #fff; 
189            width: 100%; 
190            box-sizing: border-box; 
191
192        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input:focus { 
193            outline: none; 
194            box-shadow: none; 
195
196        #${facetId} .ts-dropdown .ts-dropdown-content .option { 
197            font-family: var(--facet-font-family); 
198            font-size: var(--facet-font-size); 
199            font-weight: var(--facet-font-weight); 
200            line-height: var(--facet-line-height); 
201            letter-spacing: var(--facet-letter-spacing); 
202            color: var(--facet-color); 
203            padding: 8px 16px; 
204
205        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover, 
206        #${facetId} .ts-dropdown .ts-dropdown-content .option.active { 
207            background-color: #6a9bd3; 
208            color: #fff; 
209
210        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover .badge, 
211        #${facetId} .ts-dropdown .ts-dropdown-content .option.active .badge { 
212            background-color: #fff; 
213            color: #3a6a9b; 
214
215    </style> 
216 
217    <div class="checks-container ${facetClass}" id="${facetId}"> 
218        <div class="d-flex flex-column w-100"> 
219            <label class="panel-title mb-2" for="${facetId}-select"> 
220                ${languageUtil.get(locale, "norma." + paramNameSpecificationName)} 
221                <#if isDebug> 
222                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
223                        (total options: ${entries?size}) 
224                    </p> 
225                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
226                        (facetId: ${facetId}) 
227                    </p> 
228                </#if> 
229            </label> 
230 
231            <#-- ========================= --> 
232            <#-- SELECT UI                 --> 
233            <#-- ========================= --> 
234             
235 
236             
237            <select id="${facetId}-select" data-parameter-name="${paramNameSpecificationName}"> 
238                <option value="">${languageUtil.get(locale, "search.cualquiera")}</option> 
239                <#list entries?sort_by("displayName") as entry> 
240                    <#assign specName = entry.getDisplayName() /> 
241                    <#assign orgNames = specOrganismosMap[specName]![] /> 
242									 
243							 
244									 
245                    <option value="${htmlUtil.escape(specName)}" 
246                        <#if entry.isSelected()>selected</#if> 
247                        data-organismos="${htmlUtil.escape(orgNames?join(","))}"> 
248                        ${htmlUtil.escape(specName)} (${entry.getFrequency()}) 
249                    </option> 
250                </#list> 
251            </select> 
252        </div> 
253    </div> 
254 
255    <#-- ========================= --> 
256    <#-- SCRIPT                    --> 
257    <#-- ========================= --> 
258    <script> 
259        (function () { 
260            var FACET_ID   = '${facetId}'; 
261            var PARAM_NAME = '${paramNameSpecificationName}'; 
262 
263            function applyUrlFilter(value) { 
264                var url = new URL(window.location.href); 
265                if (value) { 
266                    url.searchParams.set(PARAM_NAME, value); 
267                } else { 
268                    url.searchParams.delete(PARAM_NAME); 
269
270                window.location.href = url.toString(); 
271
272 
273            function initFacet() { 
274                var select = document.getElementById(FACET_ID + '-select'); 
275                if (!select) return; 
276                if (select.tomselect) select.tomselect.destroy(); 
277                if (select.dataset.bound === 'true') return; 
278                select.dataset.bound = 'true'; 
279 
280                new TomSelect(select, { 
281                    allowEmptyOption: true, 
282                    maxItems: 1, 
283                    create: false, 
284                    render: { 
285                        option: function(data, escape) { 
286                            var organismos = data.$option ? data.$option.getAttribute('data-organismos') : ''; 
287                            var badges = ''; 
288                            if (organismos) { 
289                                organismos.split(',').forEach(function(org) { 
290                                    badges += '<span class="badge badge-secondary mr-1">' + escape(org.trim()) + '</span>'; 
291                                }); 
292
293                            return '<div class="option py-1">' + escape(data.text) + '<div class="mt-1">' + badges + '</div></div>'; 
294                        }, 
295                        no_results: function(data, escape) { 
296                            return '<div class="no-results">${languageUtil.get(locale, "occurrence-not-found")}</div>'; 
297
298                    }, 
299                    plugins: { 
300                        dropdown_input: {} 
301                    }, 
302                    onDelete: function(value) { 
303                        this.isDelete = true; 
304                    }, 
305                    onChange: function(value) { 
306                        if (value) { 
307                            this.lastValidValue = value; 
308                            applyUrlFilter(value); 
309                            return; 
310
311                        this.lastValidValue = ''; 
312                        applyUrlFilter(''); 
313                    }, 
314                    onInitialize: function() { 
315                        this.lastValidValue = this.getValue() || ''; 
316                        this.isDelete = false; 
317                        var wrapper = document.querySelector('#' + FACET_ID + ' .ts-wrapper'); 
318                        if (wrapper) wrapper.style.opacity = '1'; 
319
320                }); 
321
322 
323            if (document.readyState === 'loading') { 
324                document.addEventListener('DOMContentLoaded', initFacet); 
325            } else { 
326                initFacet(); 
327
328        })(); 
329    </script> 
330 
331</#if> 
Se ha producido un error al procesar la plantilla.
Syntax error in template "34352066712900#33336#362186" in line 86, column 54:
Unknown built-in: "class". Help (latest version): https://freemarker.apache.org/docs/ref_builtins.html; you're using FreeMarker 2.3.33.
The alphabetical list of built-ins:
abs, absolute_template_name, ancestors, api, 
boolean, byte, 
c, c_lower_case, c_upper_case, cap_first, capitalize, ceiling, children, chop_linebreak, chunk, cn, contains, counter, 
date, date_if_unknown, datetime, datetime_if_unknown, default, double, drop_while, 
ends_with, ensure_ends_with, ensure_starts_with, esc, eval, eval_json, exists, 
filter, first, float, floor, 
groups, 
has_api, has_content, has_next, html, 
if_exists, index, index_of, int, interpret, is_boolean, is_collection, is_collection_ex, is_date, is_date_like, is_date_only, is_datetime, is_directive, is_enumerable, is_even_item, is_first, is_hash, is_hash_ex, is_indexable, is_infinite, is_last, is_macro, is_markup_output, is_method, is_nan, is_node, is_number, is_odd_item, is_sequence, is_string, is_time, is_transform, is_unknown_date_like, iso, iso_h, iso_h_nz, iso_local, iso_local_h, iso_local_h_nz, iso_local_m, iso_local_m_nz, iso_local_ms, iso_local_ms_nz, iso_local_nz, iso_m, iso_m_nz, iso_ms, iso_ms_nz, iso_nz, iso_utc, iso_utc_fz, iso_utc_h, iso_utc_h_nz, iso_utc_m, iso_utc_m_nz, iso_utc_ms, iso_utc_ms_nz, iso_utc_nz, item_cycle, item_parity, item_parity_cap, 
j_string, join, js_string, json_string, 
keep_after, keep_after_last, keep_before, keep_before_last, keys, 
last, last_index_of, left_pad, length, long, lower_abc, lower_case, 
map, markup_string, matches, max, min, 
namespace, new, next_sibling, no_esc, node_name, node_namespace, node_type, number, number_to_date, number_to_datetime, number_to_time, 
parent, previous_sibling, 
remove_beginning, remove_ending, replace, reverse, right_pad, root, round, rtf, 
seq_contains, seq_index_of, seq_last_index_of, sequence, short, size, sort, sort_by, split, starts_with, string, substring, switch, 
take_while, then, time, time_if_unknown, trim, truncate, truncate_c, truncate_c_m, truncate_m, truncate_w, truncate_w_m, 
uncap_first, upper_abc, upper_case, url, url_path, 
values, 
web_safe, with_args, with_args_last, word_list, 
xhtml, xml
1<#-- Variables --> 
2<#assign specificationName          = 'ctn' /> 
3<#assign paramNameSpecificationName = cpSpecificationOptionsSearchFacetDisplayContext.getParameterName() /> 
4<#assign isDebug                    = false /> 
5<#assign showAllSpecificationsName  = false /> 
6<#assign staticHost                 = getCXConfig("ecom-static-files") /> 
7 
8<#-- ========================= --> 
9<#-- Functions freemaker       --> 
10<#-- ========================= --> 
11<#function getCXConfig clientExtensionName field="webApiUrl"> 
12    <#if !clientExtensionName?has_content><#return "" /></#if> 
13    <#local encoded = urlCodec.encodeURL(clientExtensionName) /> 
14    <#local items   = restClient.get("/c/customconfigs/?fields=clientExtensionConfig&filter=clientExtensionName eq '" + encoded + "'").items![] /> 
15    <#return items?has_content?then(items[0].clientExtensionConfig?eval[field]!"", "") /> 
16</#function> 
17 
18<#function getTaxonomyVocabularyId vocabularyName> 
19    <#local response = restClient.get("/headless-admin-taxonomy/v1.0/sites/" + groupId + "/taxonomy-vocabularies?filter=contains(name,'" + vocabularyName + "')&pageSize=1")!{} /> 
20    <#local items    = response.items![] /> 
21    <#return items?has_content?then(items[0].id, "") /> 
22</#function> 
23 
24<#function getTaxonomyCategoryMap vocabularyId pageSize=200> 
25    <#local response   = restClient.get("/headless-admin-taxonomy/v1.0/taxonomy-vocabularies/" + vocabularyId + "/taxonomy-categories?pageSize=" + pageSize)!{} /> 
26    <#local categoryMap = {} /> 
27    <#list response.items![] as cat> 
28        <#local categoryMap = categoryMap + {vocabularyId + "-" + cat.id: cat.name} /> 
29    </#list> 
30    <#return categoryMap /> 
31</#function> 
32 
33<#function getSpecOrganismosMap organismoMap aggResult> 
34    <#local specMap = {} /> 
35    <#if !aggResult?has_content || !organismoMap?has_content><#return specMap /></#if> 
36    <#list aggResult.getBuckets() as specBucket> 
37        <#local specKey      = specBucket.getKey() /> 
38        <#local organismoAgg = specBucket.getChildAggregationResult("organismos") /> 
39        <#local orgNames     = [] /> 
40        <#if organismoAgg?has_content> 
41            <#list organismoAgg.getBuckets() as orgBucket> 
42                <#local orgName  = organismoMap[orgBucket.getKey()]!"" /> 
43                <#if orgName?has_content> 
44                    <#local orgNames = orgNames + [orgName] /> 
45                </#if> 
46            </#list> 
47        </#if> 
48        <#if orgNames?has_content> 
49            <#local specMap = specMap + {specKey: orgNames} /> 
50        </#if> 
51    </#list> 
52    <#return specMap /> 
53</#function> 
54 
55<#function getAggregationResult specificationKey> 
56    <#if !specificationKey?has_content><#return "" /></#if> 
57 
58    <#local sharedSearchResponse = renderRequest.getAttribute("LIFERAY_SHARED_PortletSharedSearchResponse") /> 
59    <#if !sharedSearchResponse?has_content><#return "" /></#if> 
60 
61    <#local searchResponse = sharedSearchResponse.get() /> 
62    <#if !searchResponse?has_content><#return "" /></#if> 
63 
64    <#local esResponse = searchResponse.getSearchResponse() /> 
65    <#if !esResponse?has_content><#return "" /></#if> 
66 
67    <#local aggregationResult = esResponse.getAggregationResult(specificationKey + "_with_organismos") /> 
68    <#if !aggregationResult?has_content><#return "" /></#if> 
69 
70    <#return aggregationResult /> 
71</#function> 
72 
73 
74 
75<#if paramNameSpecificationName == specificationName || showAllSpecificationsName> 
76 
77    <#-- ========================= --> 
78    <#-- Datos                     --> 
79    <#-- ========================= --> 
80	<#assign organismoVocabId  = getTaxonomyVocabularyId("organismos") /> 
81	<#assign organismoMap      = getTaxonomyCategoryMap(organismoVocabId) /> 
82	<#assign aggResult         = getAggregationResult(paramNameSpecificationName)! /> 
83	<#assign specOrganismosMap = getSpecOrganismosMap(organismoMap, aggResult) /> 
84			 
85			BUCKET KEY TYPE: 
86${specBucket.getKey()?string} (${specBucket.getKey()?class}) 
87			 
88 
89    <#-- ========================= --> 
90    <#-- Debug                     --> 
91    <#-- ========================= --> 
92    <#if isDebug> 
93        <div style="background:#f0f0f0;padding:8px;margin-bottom:8px;font-size:11px;border:1px solid #ccc;"> 
94            <p><strong>paramName:</strong> ${paramNameSpecificationName}</p> 
95            <p><strong>organismoMap size:</strong> ${organismoMap?size}</p> 
96            <p><strong>specOrganismosMap size:</strong> ${specOrganismosMap?size}</p> 
97            <#list specOrganismosMap?keys as spec> 
98                <p>${spec}: ${specOrganismosMap[spec]?join(", ")}</p> 
99            </#list> 
100        </div> 
101    </#if> 
102 
103    <#-- Variables --> 
104    <#assign facetId    = "facet-" + paramNameSpecificationName + "-" + renderResponse.getNamespace() /> 
105    <#assign facetClass = "facet-" + paramNameSpecificationName + "-combo-search-wrapper" /> 
106 
107    <#-- ========================= --> 
108    <#-- TOM SELECT framework      --> 
109    <#-- ========================= --> 
110    <@liferay_util["html-top"] outputKey="tom-select"> 
111        <link href="${staticHost}/scripts/vendor/tom-select/tom-select.css" rel="stylesheet"> 
112        <script src="${staticHost}/scripts/vendor/tom-select/tom-select.complete.min.js"></script> 
113    </@> 
114 
115    <#-- ========================= --> 
116    <#-- CSS                       --> 
117    <#-- ========================= --> 
118    <style> 
119        #${facetId} { 
120            --facet-font-family: Inter; 
121            --facet-font-size: 14px; 
122            --facet-font-weight: 400; 
123            --facet-line-height: 18px; 
124            --facet-letter-spacing: 0.5px; 
125            --facet-color: #66757f; 
126
127        #${facetId}-select { 
128            appearance: none; 
129            -webkit-appearance: none; 
130            visibility: hidden; 
131            position: absolute; 
132
133        #${facetId} .ts-wrapper { 
134            width: 100%; 
135            margin-bottom: 16px; 
136            opacity: 0; 
137            transition: opacity 0.1s ease; 
138
139        #${facetId} .ts-wrapper .ts-control { 
140            padding: 15.5px 16px; 
141            font-family: var(--facet-font-family); 
142            font-size: var(--facet-font-size); 
143            font-weight: var(--facet-font-weight); 
144            line-height: var(--facet-line-height); 
145            letter-spacing: var(--facet-letter-spacing); 
146            color: var(--facet-color); 
147            text-align: left; 
148            height: 55px; 
149            width: 100%; 
150            border-radius: 4px; 
151            border: none; 
152            background-color: #F5F5F5; 
153            background-image: url(/documents/d/global/ico-chevron-down-2); 
154            background-repeat: no-repeat; 
155            background-position: right 1rem center; 
156            background-size: 18px 10px; 
157            box-shadow: none; 
158            cursor: pointer; 
159            box-sizing: border-box; 
160
161        #${facetId} .ts-wrapper .ts-control:focus, 
162        #${facetId} .ts-wrapper .ts-control:focus-visible { 
163            background-image: url(/documents/d/global/ico-chevron-down-2); 
164            background-position: right 1rem center; 
165            background-size: 18px 10px; 
166            outline: none; 
167            box-shadow: none; 
168
169        #${facetId} .ts-wrapper .ts-control .item { 
170            padding-right: 0.75rem; 
171            overflow: hidden; 
172            text-overflow: ellipsis; 
173            max-width: calc(100% - 0.75rem); 
174
175        #${facetId} .ts-wrapper.single .ts-control::after { 
176            display: none; 
177
178        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input { 
179            font-family: var(--facet-font-family); 
180            font-size: var(--facet-font-size); 
181            font-weight: var(--facet-font-weight); 
182            line-height: var(--facet-line-height); 
183            letter-spacing: var(--facet-letter-spacing); 
184            color: var(--facet-color); 
185            padding: 8px 16px; 
186            border: none; 
187            border-bottom: 1px solid #d9d9d9; 
188            background-color: #fff; 
189            width: 100%; 
190            box-sizing: border-box; 
191
192        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input:focus { 
193            outline: none; 
194            box-shadow: none; 
195
196        #${facetId} .ts-dropdown .ts-dropdown-content .option { 
197            font-family: var(--facet-font-family); 
198            font-size: var(--facet-font-size); 
199            font-weight: var(--facet-font-weight); 
200            line-height: var(--facet-line-height); 
201            letter-spacing: var(--facet-letter-spacing); 
202            color: var(--facet-color); 
203            padding: 8px 16px; 
204
205        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover, 
206        #${facetId} .ts-dropdown .ts-dropdown-content .option.active { 
207            background-color: #6a9bd3; 
208            color: #fff; 
209
210        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover .badge, 
211        #${facetId} .ts-dropdown .ts-dropdown-content .option.active .badge { 
212            background-color: #fff; 
213            color: #3a6a9b; 
214
215    </style> 
216 
217    <div class="checks-container ${facetClass}" id="${facetId}"> 
218        <div class="d-flex flex-column w-100"> 
219            <label class="panel-title mb-2" for="${facetId}-select"> 
220                ${languageUtil.get(locale, "norma." + paramNameSpecificationName)} 
221                <#if isDebug> 
222                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
223                        (total options: ${entries?size}) 
224                    </p> 
225                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
226                        (facetId: ${facetId}) 
227                    </p> 
228                </#if> 
229            </label> 
230 
231            <#-- ========================= --> 
232            <#-- SELECT UI                 --> 
233            <#-- ========================= --> 
234             
235 
236             
237            <select id="${facetId}-select" data-parameter-name="${paramNameSpecificationName}"> 
238                <option value="">${languageUtil.get(locale, "search.cualquiera")}</option> 
239                <#list entries?sort_by("displayName") as entry> 
240                    <#assign specName = entry.getDisplayName() /> 
241                    <#assign orgNames = specOrganismosMap[specName]![] /> 
242									 
243							 
244									 
245                    <option value="${htmlUtil.escape(specName)}" 
246                        <#if entry.isSelected()>selected</#if> 
247                        data-organismos="${htmlUtil.escape(orgNames?join(","))}"> 
248                        ${htmlUtil.escape(specName)} (${entry.getFrequency()}) 
249                    </option> 
250                </#list> 
251            </select> 
252        </div> 
253    </div> 
254 
255    <#-- ========================= --> 
256    <#-- SCRIPT                    --> 
257    <#-- ========================= --> 
258    <script> 
259        (function () { 
260            var FACET_ID   = '${facetId}'; 
261            var PARAM_NAME = '${paramNameSpecificationName}'; 
262 
263            function applyUrlFilter(value) { 
264                var url = new URL(window.location.href); 
265                if (value) { 
266                    url.searchParams.set(PARAM_NAME, value); 
267                } else { 
268                    url.searchParams.delete(PARAM_NAME); 
269
270                window.location.href = url.toString(); 
271
272 
273            function initFacet() { 
274                var select = document.getElementById(FACET_ID + '-select'); 
275                if (!select) return; 
276                if (select.tomselect) select.tomselect.destroy(); 
277                if (select.dataset.bound === 'true') return; 
278                select.dataset.bound = 'true'; 
279 
280                new TomSelect(select, { 
281                    allowEmptyOption: true, 
282                    maxItems: 1, 
283                    create: false, 
284                    render: { 
285                        option: function(data, escape) { 
286                            var organismos = data.$option ? data.$option.getAttribute('data-organismos') : ''; 
287                            var badges = ''; 
288                            if (organismos) { 
289                                organismos.split(',').forEach(function(org) { 
290                                    badges += '<span class="badge badge-secondary mr-1">' + escape(org.trim()) + '</span>'; 
291                                }); 
292
293                            return '<div class="option py-1">' + escape(data.text) + '<div class="mt-1">' + badges + '</div></div>'; 
294                        }, 
295                        no_results: function(data, escape) { 
296                            return '<div class="no-results">${languageUtil.get(locale, "occurrence-not-found")}</div>'; 
297
298                    }, 
299                    plugins: { 
300                        dropdown_input: {} 
301                    }, 
302                    onDelete: function(value) { 
303                        this.isDelete = true; 
304                    }, 
305                    onChange: function(value) { 
306                        if (value) { 
307                            this.lastValidValue = value; 
308                            applyUrlFilter(value); 
309                            return; 
310
311                        this.lastValidValue = ''; 
312                        applyUrlFilter(''); 
313                    }, 
314                    onInitialize: function() { 
315                        this.lastValidValue = this.getValue() || ''; 
316                        this.isDelete = false; 
317                        var wrapper = document.querySelector('#' + FACET_ID + ' .ts-wrapper'); 
318                        if (wrapper) wrapper.style.opacity = '1'; 
319
320                }); 
321
322 
323            if (document.readyState === 'loading') { 
324                document.addEventListener('DOMContentLoaded', initFacet); 
325            } else { 
326                initFacet(); 
327
328        })(); 
329    </script> 
330 
331</#if> 
Se ha producido un error al procesar la plantilla.
Syntax error in template "34352066712900#33336#362186" in line 86, column 54:
Unknown built-in: "class". Help (latest version): https://freemarker.apache.org/docs/ref_builtins.html; you're using FreeMarker 2.3.33.
The alphabetical list of built-ins:
abs, absolute_template_name, ancestors, api, 
boolean, byte, 
c, c_lower_case, c_upper_case, cap_first, capitalize, ceiling, children, chop_linebreak, chunk, cn, contains, counter, 
date, date_if_unknown, datetime, datetime_if_unknown, default, double, drop_while, 
ends_with, ensure_ends_with, ensure_starts_with, esc, eval, eval_json, exists, 
filter, first, float, floor, 
groups, 
has_api, has_content, has_next, html, 
if_exists, index, index_of, int, interpret, is_boolean, is_collection, is_collection_ex, is_date, is_date_like, is_date_only, is_datetime, is_directive, is_enumerable, is_even_item, is_first, is_hash, is_hash_ex, is_indexable, is_infinite, is_last, is_macro, is_markup_output, is_method, is_nan, is_node, is_number, is_odd_item, is_sequence, is_string, is_time, is_transform, is_unknown_date_like, iso, iso_h, iso_h_nz, iso_local, iso_local_h, iso_local_h_nz, iso_local_m, iso_local_m_nz, iso_local_ms, iso_local_ms_nz, iso_local_nz, iso_m, iso_m_nz, iso_ms, iso_ms_nz, iso_nz, iso_utc, iso_utc_fz, iso_utc_h, iso_utc_h_nz, iso_utc_m, iso_utc_m_nz, iso_utc_ms, iso_utc_ms_nz, iso_utc_nz, item_cycle, item_parity, item_parity_cap, 
j_string, join, js_string, json_string, 
keep_after, keep_after_last, keep_before, keep_before_last, keys, 
last, last_index_of, left_pad, length, long, lower_abc, lower_case, 
map, markup_string, matches, max, min, 
namespace, new, next_sibling, no_esc, node_name, node_namespace, node_type, number, number_to_date, number_to_datetime, number_to_time, 
parent, previous_sibling, 
remove_beginning, remove_ending, replace, reverse, right_pad, root, round, rtf, 
seq_contains, seq_index_of, seq_last_index_of, sequence, short, size, sort, sort_by, split, starts_with, string, substring, switch, 
take_while, then, time, time_if_unknown, trim, truncate, truncate_c, truncate_c_m, truncate_m, truncate_w, truncate_w_m, 
uncap_first, upper_abc, upper_case, url, url_path, 
values, 
web_safe, with_args, with_args_last, word_list, 
xhtml, xml
1<#-- Variables --> 
2<#assign specificationName          = 'ctn' /> 
3<#assign paramNameSpecificationName = cpSpecificationOptionsSearchFacetDisplayContext.getParameterName() /> 
4<#assign isDebug                    = false /> 
5<#assign showAllSpecificationsName  = false /> 
6<#assign staticHost                 = getCXConfig("ecom-static-files") /> 
7 
8<#-- ========================= --> 
9<#-- Functions freemaker       --> 
10<#-- ========================= --> 
11<#function getCXConfig clientExtensionName field="webApiUrl"> 
12    <#if !clientExtensionName?has_content><#return "" /></#if> 
13    <#local encoded = urlCodec.encodeURL(clientExtensionName) /> 
14    <#local items   = restClient.get("/c/customconfigs/?fields=clientExtensionConfig&filter=clientExtensionName eq '" + encoded + "'").items![] /> 
15    <#return items?has_content?then(items[0].clientExtensionConfig?eval[field]!"", "") /> 
16</#function> 
17 
18<#function getTaxonomyVocabularyId vocabularyName> 
19    <#local response = restClient.get("/headless-admin-taxonomy/v1.0/sites/" + groupId + "/taxonomy-vocabularies?filter=contains(name,'" + vocabularyName + "')&pageSize=1")!{} /> 
20    <#local items    = response.items![] /> 
21    <#return items?has_content?then(items[0].id, "") /> 
22</#function> 
23 
24<#function getTaxonomyCategoryMap vocabularyId pageSize=200> 
25    <#local response   = restClient.get("/headless-admin-taxonomy/v1.0/taxonomy-vocabularies/" + vocabularyId + "/taxonomy-categories?pageSize=" + pageSize)!{} /> 
26    <#local categoryMap = {} /> 
27    <#list response.items![] as cat> 
28        <#local categoryMap = categoryMap + {vocabularyId + "-" + cat.id: cat.name} /> 
29    </#list> 
30    <#return categoryMap /> 
31</#function> 
32 
33<#function getSpecOrganismosMap organismoMap aggResult> 
34    <#local specMap = {} /> 
35    <#if !aggResult?has_content || !organismoMap?has_content><#return specMap /></#if> 
36    <#list aggResult.getBuckets() as specBucket> 
37        <#local specKey      = specBucket.getKey() /> 
38        <#local organismoAgg = specBucket.getChildAggregationResult("organismos") /> 
39        <#local orgNames     = [] /> 
40        <#if organismoAgg?has_content> 
41            <#list organismoAgg.getBuckets() as orgBucket> 
42                <#local orgName  = organismoMap[orgBucket.getKey()]!"" /> 
43                <#if orgName?has_content> 
44                    <#local orgNames = orgNames + [orgName] /> 
45                </#if> 
46            </#list> 
47        </#if> 
48        <#if orgNames?has_content> 
49            <#local specMap = specMap + {specKey: orgNames} /> 
50        </#if> 
51    </#list> 
52    <#return specMap /> 
53</#function> 
54 
55<#function getAggregationResult specificationKey> 
56    <#if !specificationKey?has_content><#return "" /></#if> 
57 
58    <#local sharedSearchResponse = renderRequest.getAttribute("LIFERAY_SHARED_PortletSharedSearchResponse") /> 
59    <#if !sharedSearchResponse?has_content><#return "" /></#if> 
60 
61    <#local searchResponse = sharedSearchResponse.get() /> 
62    <#if !searchResponse?has_content><#return "" /></#if> 
63 
64    <#local esResponse = searchResponse.getSearchResponse() /> 
65    <#if !esResponse?has_content><#return "" /></#if> 
66 
67    <#local aggregationResult = esResponse.getAggregationResult(specificationKey + "_with_organismos") /> 
68    <#if !aggregationResult?has_content><#return "" /></#if> 
69 
70    <#return aggregationResult /> 
71</#function> 
72 
73 
74 
75<#if paramNameSpecificationName == specificationName || showAllSpecificationsName> 
76 
77    <#-- ========================= --> 
78    <#-- Datos                     --> 
79    <#-- ========================= --> 
80	<#assign organismoVocabId  = getTaxonomyVocabularyId("organismos") /> 
81	<#assign organismoMap      = getTaxonomyCategoryMap(organismoVocabId) /> 
82	<#assign aggResult         = getAggregationResult(paramNameSpecificationName)! /> 
83	<#assign specOrganismosMap = getSpecOrganismosMap(organismoMap, aggResult) /> 
84			 
85			BUCKET KEY TYPE: 
86${specBucket.getKey()?string} (${specBucket.getKey()?class}) 
87			 
88 
89    <#-- ========================= --> 
90    <#-- Debug                     --> 
91    <#-- ========================= --> 
92    <#if isDebug> 
93        <div style="background:#f0f0f0;padding:8px;margin-bottom:8px;font-size:11px;border:1px solid #ccc;"> 
94            <p><strong>paramName:</strong> ${paramNameSpecificationName}</p> 
95            <p><strong>organismoMap size:</strong> ${organismoMap?size}</p> 
96            <p><strong>specOrganismosMap size:</strong> ${specOrganismosMap?size}</p> 
97            <#list specOrganismosMap?keys as spec> 
98                <p>${spec}: ${specOrganismosMap[spec]?join(", ")}</p> 
99            </#list> 
100        </div> 
101    </#if> 
102 
103    <#-- Variables --> 
104    <#assign facetId    = "facet-" + paramNameSpecificationName + "-" + renderResponse.getNamespace() /> 
105    <#assign facetClass = "facet-" + paramNameSpecificationName + "-combo-search-wrapper" /> 
106 
107    <#-- ========================= --> 
108    <#-- TOM SELECT framework      --> 
109    <#-- ========================= --> 
110    <@liferay_util["html-top"] outputKey="tom-select"> 
111        <link href="${staticHost}/scripts/vendor/tom-select/tom-select.css" rel="stylesheet"> 
112        <script src="${staticHost}/scripts/vendor/tom-select/tom-select.complete.min.js"></script> 
113    </@> 
114 
115    <#-- ========================= --> 
116    <#-- CSS                       --> 
117    <#-- ========================= --> 
118    <style> 
119        #${facetId} { 
120            --facet-font-family: Inter; 
121            --facet-font-size: 14px; 
122            --facet-font-weight: 400; 
123            --facet-line-height: 18px; 
124            --facet-letter-spacing: 0.5px; 
125            --facet-color: #66757f; 
126
127        #${facetId}-select { 
128            appearance: none; 
129            -webkit-appearance: none; 
130            visibility: hidden; 
131            position: absolute; 
132
133        #${facetId} .ts-wrapper { 
134            width: 100%; 
135            margin-bottom: 16px; 
136            opacity: 0; 
137            transition: opacity 0.1s ease; 
138
139        #${facetId} .ts-wrapper .ts-control { 
140            padding: 15.5px 16px; 
141            font-family: var(--facet-font-family); 
142            font-size: var(--facet-font-size); 
143            font-weight: var(--facet-font-weight); 
144            line-height: var(--facet-line-height); 
145            letter-spacing: var(--facet-letter-spacing); 
146            color: var(--facet-color); 
147            text-align: left; 
148            height: 55px; 
149            width: 100%; 
150            border-radius: 4px; 
151            border: none; 
152            background-color: #F5F5F5; 
153            background-image: url(/documents/d/global/ico-chevron-down-2); 
154            background-repeat: no-repeat; 
155            background-position: right 1rem center; 
156            background-size: 18px 10px; 
157            box-shadow: none; 
158            cursor: pointer; 
159            box-sizing: border-box; 
160
161        #${facetId} .ts-wrapper .ts-control:focus, 
162        #${facetId} .ts-wrapper .ts-control:focus-visible { 
163            background-image: url(/documents/d/global/ico-chevron-down-2); 
164            background-position: right 1rem center; 
165            background-size: 18px 10px; 
166            outline: none; 
167            box-shadow: none; 
168
169        #${facetId} .ts-wrapper .ts-control .item { 
170            padding-right: 0.75rem; 
171            overflow: hidden; 
172            text-overflow: ellipsis; 
173            max-width: calc(100% - 0.75rem); 
174
175        #${facetId} .ts-wrapper.single .ts-control::after { 
176            display: none; 
177
178        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input { 
179            font-family: var(--facet-font-family); 
180            font-size: var(--facet-font-size); 
181            font-weight: var(--facet-font-weight); 
182            line-height: var(--facet-line-height); 
183            letter-spacing: var(--facet-letter-spacing); 
184            color: var(--facet-color); 
185            padding: 8px 16px; 
186            border: none; 
187            border-bottom: 1px solid #d9d9d9; 
188            background-color: #fff; 
189            width: 100%; 
190            box-sizing: border-box; 
191
192        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input:focus { 
193            outline: none; 
194            box-shadow: none; 
195
196        #${facetId} .ts-dropdown .ts-dropdown-content .option { 
197            font-family: var(--facet-font-family); 
198            font-size: var(--facet-font-size); 
199            font-weight: var(--facet-font-weight); 
200            line-height: var(--facet-line-height); 
201            letter-spacing: var(--facet-letter-spacing); 
202            color: var(--facet-color); 
203            padding: 8px 16px; 
204
205        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover, 
206        #${facetId} .ts-dropdown .ts-dropdown-content .option.active { 
207            background-color: #6a9bd3; 
208            color: #fff; 
209
210        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover .badge, 
211        #${facetId} .ts-dropdown .ts-dropdown-content .option.active .badge { 
212            background-color: #fff; 
213            color: #3a6a9b; 
214
215    </style> 
216 
217    <div class="checks-container ${facetClass}" id="${facetId}"> 
218        <div class="d-flex flex-column w-100"> 
219            <label class="panel-title mb-2" for="${facetId}-select"> 
220                ${languageUtil.get(locale, "norma." + paramNameSpecificationName)} 
221                <#if isDebug> 
222                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
223                        (total options: ${entries?size}) 
224                    </p> 
225                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
226                        (facetId: ${facetId}) 
227                    </p> 
228                </#if> 
229            </label> 
230 
231            <#-- ========================= --> 
232            <#-- SELECT UI                 --> 
233            <#-- ========================= --> 
234             
235 
236             
237            <select id="${facetId}-select" data-parameter-name="${paramNameSpecificationName}"> 
238                <option value="">${languageUtil.get(locale, "search.cualquiera")}</option> 
239                <#list entries?sort_by("displayName") as entry> 
240                    <#assign specName = entry.getDisplayName() /> 
241                    <#assign orgNames = specOrganismosMap[specName]![] /> 
242									 
243							 
244									 
245                    <option value="${htmlUtil.escape(specName)}" 
246                        <#if entry.isSelected()>selected</#if> 
247                        data-organismos="${htmlUtil.escape(orgNames?join(","))}"> 
248                        ${htmlUtil.escape(specName)} (${entry.getFrequency()}) 
249                    </option> 
250                </#list> 
251            </select> 
252        </div> 
253    </div> 
254 
255    <#-- ========================= --> 
256    <#-- SCRIPT                    --> 
257    <#-- ========================= --> 
258    <script> 
259        (function () { 
260            var FACET_ID   = '${facetId}'; 
261            var PARAM_NAME = '${paramNameSpecificationName}'; 
262 
263            function applyUrlFilter(value) { 
264                var url = new URL(window.location.href); 
265                if (value) { 
266                    url.searchParams.set(PARAM_NAME, value); 
267                } else { 
268                    url.searchParams.delete(PARAM_NAME); 
269
270                window.location.href = url.toString(); 
271
272 
273            function initFacet() { 
274                var select = document.getElementById(FACET_ID + '-select'); 
275                if (!select) return; 
276                if (select.tomselect) select.tomselect.destroy(); 
277                if (select.dataset.bound === 'true') return; 
278                select.dataset.bound = 'true'; 
279 
280                new TomSelect(select, { 
281                    allowEmptyOption: true, 
282                    maxItems: 1, 
283                    create: false, 
284                    render: { 
285                        option: function(data, escape) { 
286                            var organismos = data.$option ? data.$option.getAttribute('data-organismos') : ''; 
287                            var badges = ''; 
288                            if (organismos) { 
289                                organismos.split(',').forEach(function(org) { 
290                                    badges += '<span class="badge badge-secondary mr-1">' + escape(org.trim()) + '</span>'; 
291                                }); 
292
293                            return '<div class="option py-1">' + escape(data.text) + '<div class="mt-1">' + badges + '</div></div>'; 
294                        }, 
295                        no_results: function(data, escape) { 
296                            return '<div class="no-results">${languageUtil.get(locale, "occurrence-not-found")}</div>'; 
297
298                    }, 
299                    plugins: { 
300                        dropdown_input: {} 
301                    }, 
302                    onDelete: function(value) { 
303                        this.isDelete = true; 
304                    }, 
305                    onChange: function(value) { 
306                        if (value) { 
307                            this.lastValidValue = value; 
308                            applyUrlFilter(value); 
309                            return; 
310
311                        this.lastValidValue = ''; 
312                        applyUrlFilter(''); 
313                    }, 
314                    onInitialize: function() { 
315                        this.lastValidValue = this.getValue() || ''; 
316                        this.isDelete = false; 
317                        var wrapper = document.querySelector('#' + FACET_ID + ' .ts-wrapper'); 
318                        if (wrapper) wrapper.style.opacity = '1'; 
319
320                }); 
321
322 
323            if (document.readyState === 'loading') { 
324                document.addEventListener('DOMContentLoaded', initFacet); 
325            } else { 
326                initFacet(); 
327
328        })(); 
329    </script> 
330 
331</#if> 
Se ha producido un error al procesar la plantilla.
Syntax error in template "34352066712900#33336#362186" in line 86, column 54:
Unknown built-in: "class". Help (latest version): https://freemarker.apache.org/docs/ref_builtins.html; you're using FreeMarker 2.3.33.
The alphabetical list of built-ins:
abs, absolute_template_name, ancestors, api, 
boolean, byte, 
c, c_lower_case, c_upper_case, cap_first, capitalize, ceiling, children, chop_linebreak, chunk, cn, contains, counter, 
date, date_if_unknown, datetime, datetime_if_unknown, default, double, drop_while, 
ends_with, ensure_ends_with, ensure_starts_with, esc, eval, eval_json, exists, 
filter, first, float, floor, 
groups, 
has_api, has_content, has_next, html, 
if_exists, index, index_of, int, interpret, is_boolean, is_collection, is_collection_ex, is_date, is_date_like, is_date_only, is_datetime, is_directive, is_enumerable, is_even_item, is_first, is_hash, is_hash_ex, is_indexable, is_infinite, is_last, is_macro, is_markup_output, is_method, is_nan, is_node, is_number, is_odd_item, is_sequence, is_string, is_time, is_transform, is_unknown_date_like, iso, iso_h, iso_h_nz, iso_local, iso_local_h, iso_local_h_nz, iso_local_m, iso_local_m_nz, iso_local_ms, iso_local_ms_nz, iso_local_nz, iso_m, iso_m_nz, iso_ms, iso_ms_nz, iso_nz, iso_utc, iso_utc_fz, iso_utc_h, iso_utc_h_nz, iso_utc_m, iso_utc_m_nz, iso_utc_ms, iso_utc_ms_nz, iso_utc_nz, item_cycle, item_parity, item_parity_cap, 
j_string, join, js_string, json_string, 
keep_after, keep_after_last, keep_before, keep_before_last, keys, 
last, last_index_of, left_pad, length, long, lower_abc, lower_case, 
map, markup_string, matches, max, min, 
namespace, new, next_sibling, no_esc, node_name, node_namespace, node_type, number, number_to_date, number_to_datetime, number_to_time, 
parent, previous_sibling, 
remove_beginning, remove_ending, replace, reverse, right_pad, root, round, rtf, 
seq_contains, seq_index_of, seq_last_index_of, sequence, short, size, sort, sort_by, split, starts_with, string, substring, switch, 
take_while, then, time, time_if_unknown, trim, truncate, truncate_c, truncate_c_m, truncate_m, truncate_w, truncate_w_m, 
uncap_first, upper_abc, upper_case, url, url_path, 
values, 
web_safe, with_args, with_args_last, word_list, 
xhtml, xml
1<#-- Variables --> 
2<#assign specificationName          = 'ctn' /> 
3<#assign paramNameSpecificationName = cpSpecificationOptionsSearchFacetDisplayContext.getParameterName() /> 
4<#assign isDebug                    = false /> 
5<#assign showAllSpecificationsName  = false /> 
6<#assign staticHost                 = getCXConfig("ecom-static-files") /> 
7 
8<#-- ========================= --> 
9<#-- Functions freemaker       --> 
10<#-- ========================= --> 
11<#function getCXConfig clientExtensionName field="webApiUrl"> 
12    <#if !clientExtensionName?has_content><#return "" /></#if> 
13    <#local encoded = urlCodec.encodeURL(clientExtensionName) /> 
14    <#local items   = restClient.get("/c/customconfigs/?fields=clientExtensionConfig&filter=clientExtensionName eq '" + encoded + "'").items![] /> 
15    <#return items?has_content?then(items[0].clientExtensionConfig?eval[field]!"", "") /> 
16</#function> 
17 
18<#function getTaxonomyVocabularyId vocabularyName> 
19    <#local response = restClient.get("/headless-admin-taxonomy/v1.0/sites/" + groupId + "/taxonomy-vocabularies?filter=contains(name,'" + vocabularyName + "')&pageSize=1")!{} /> 
20    <#local items    = response.items![] /> 
21    <#return items?has_content?then(items[0].id, "") /> 
22</#function> 
23 
24<#function getTaxonomyCategoryMap vocabularyId pageSize=200> 
25    <#local response   = restClient.get("/headless-admin-taxonomy/v1.0/taxonomy-vocabularies/" + vocabularyId + "/taxonomy-categories?pageSize=" + pageSize)!{} /> 
26    <#local categoryMap = {} /> 
27    <#list response.items![] as cat> 
28        <#local categoryMap = categoryMap + {vocabularyId + "-" + cat.id: cat.name} /> 
29    </#list> 
30    <#return categoryMap /> 
31</#function> 
32 
33<#function getSpecOrganismosMap organismoMap aggResult> 
34    <#local specMap = {} /> 
35    <#if !aggResult?has_content || !organismoMap?has_content><#return specMap /></#if> 
36    <#list aggResult.getBuckets() as specBucket> 
37        <#local specKey      = specBucket.getKey() /> 
38        <#local organismoAgg = specBucket.getChildAggregationResult("organismos") /> 
39        <#local orgNames     = [] /> 
40        <#if organismoAgg?has_content> 
41            <#list organismoAgg.getBuckets() as orgBucket> 
42                <#local orgName  = organismoMap[orgBucket.getKey()]!"" /> 
43                <#if orgName?has_content> 
44                    <#local orgNames = orgNames + [orgName] /> 
45                </#if> 
46            </#list> 
47        </#if> 
48        <#if orgNames?has_content> 
49            <#local specMap = specMap + {specKey: orgNames} /> 
50        </#if> 
51    </#list> 
52    <#return specMap /> 
53</#function> 
54 
55<#function getAggregationResult specificationKey> 
56    <#if !specificationKey?has_content><#return "" /></#if> 
57 
58    <#local sharedSearchResponse = renderRequest.getAttribute("LIFERAY_SHARED_PortletSharedSearchResponse") /> 
59    <#if !sharedSearchResponse?has_content><#return "" /></#if> 
60 
61    <#local searchResponse = sharedSearchResponse.get() /> 
62    <#if !searchResponse?has_content><#return "" /></#if> 
63 
64    <#local esResponse = searchResponse.getSearchResponse() /> 
65    <#if !esResponse?has_content><#return "" /></#if> 
66 
67    <#local aggregationResult = esResponse.getAggregationResult(specificationKey + "_with_organismos") /> 
68    <#if !aggregationResult?has_content><#return "" /></#if> 
69 
70    <#return aggregationResult /> 
71</#function> 
72 
73 
74 
75<#if paramNameSpecificationName == specificationName || showAllSpecificationsName> 
76 
77    <#-- ========================= --> 
78    <#-- Datos                     --> 
79    <#-- ========================= --> 
80	<#assign organismoVocabId  = getTaxonomyVocabularyId("organismos") /> 
81	<#assign organismoMap      = getTaxonomyCategoryMap(organismoVocabId) /> 
82	<#assign aggResult         = getAggregationResult(paramNameSpecificationName)! /> 
83	<#assign specOrganismosMap = getSpecOrganismosMap(organismoMap, aggResult) /> 
84			 
85			BUCKET KEY TYPE: 
86${specBucket.getKey()?string} (${specBucket.getKey()?class}) 
87			 
88 
89    <#-- ========================= --> 
90    <#-- Debug                     --> 
91    <#-- ========================= --> 
92    <#if isDebug> 
93        <div style="background:#f0f0f0;padding:8px;margin-bottom:8px;font-size:11px;border:1px solid #ccc;"> 
94            <p><strong>paramName:</strong> ${paramNameSpecificationName}</p> 
95            <p><strong>organismoMap size:</strong> ${organismoMap?size}</p> 
96            <p><strong>specOrganismosMap size:</strong> ${specOrganismosMap?size}</p> 
97            <#list specOrganismosMap?keys as spec> 
98                <p>${spec}: ${specOrganismosMap[spec]?join(", ")}</p> 
99            </#list> 
100        </div> 
101    </#if> 
102 
103    <#-- Variables --> 
104    <#assign facetId    = "facet-" + paramNameSpecificationName + "-" + renderResponse.getNamespace() /> 
105    <#assign facetClass = "facet-" + paramNameSpecificationName + "-combo-search-wrapper" /> 
106 
107    <#-- ========================= --> 
108    <#-- TOM SELECT framework      --> 
109    <#-- ========================= --> 
110    <@liferay_util["html-top"] outputKey="tom-select"> 
111        <link href="${staticHost}/scripts/vendor/tom-select/tom-select.css" rel="stylesheet"> 
112        <script src="${staticHost}/scripts/vendor/tom-select/tom-select.complete.min.js"></script> 
113    </@> 
114 
115    <#-- ========================= --> 
116    <#-- CSS                       --> 
117    <#-- ========================= --> 
118    <style> 
119        #${facetId} { 
120            --facet-font-family: Inter; 
121            --facet-font-size: 14px; 
122            --facet-font-weight: 400; 
123            --facet-line-height: 18px; 
124            --facet-letter-spacing: 0.5px; 
125            --facet-color: #66757f; 
126
127        #${facetId}-select { 
128            appearance: none; 
129            -webkit-appearance: none; 
130            visibility: hidden; 
131            position: absolute; 
132
133        #${facetId} .ts-wrapper { 
134            width: 100%; 
135            margin-bottom: 16px; 
136            opacity: 0; 
137            transition: opacity 0.1s ease; 
138
139        #${facetId} .ts-wrapper .ts-control { 
140            padding: 15.5px 16px; 
141            font-family: var(--facet-font-family); 
142            font-size: var(--facet-font-size); 
143            font-weight: var(--facet-font-weight); 
144            line-height: var(--facet-line-height); 
145            letter-spacing: var(--facet-letter-spacing); 
146            color: var(--facet-color); 
147            text-align: left; 
148            height: 55px; 
149            width: 100%; 
150            border-radius: 4px; 
151            border: none; 
152            background-color: #F5F5F5; 
153            background-image: url(/documents/d/global/ico-chevron-down-2); 
154            background-repeat: no-repeat; 
155            background-position: right 1rem center; 
156            background-size: 18px 10px; 
157            box-shadow: none; 
158            cursor: pointer; 
159            box-sizing: border-box; 
160
161        #${facetId} .ts-wrapper .ts-control:focus, 
162        #${facetId} .ts-wrapper .ts-control:focus-visible { 
163            background-image: url(/documents/d/global/ico-chevron-down-2); 
164            background-position: right 1rem center; 
165            background-size: 18px 10px; 
166            outline: none; 
167            box-shadow: none; 
168
169        #${facetId} .ts-wrapper .ts-control .item { 
170            padding-right: 0.75rem; 
171            overflow: hidden; 
172            text-overflow: ellipsis; 
173            max-width: calc(100% - 0.75rem); 
174
175        #${facetId} .ts-wrapper.single .ts-control::after { 
176            display: none; 
177
178        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input { 
179            font-family: var(--facet-font-family); 
180            font-size: var(--facet-font-size); 
181            font-weight: var(--facet-font-weight); 
182            line-height: var(--facet-line-height); 
183            letter-spacing: var(--facet-letter-spacing); 
184            color: var(--facet-color); 
185            padding: 8px 16px; 
186            border: none; 
187            border-bottom: 1px solid #d9d9d9; 
188            background-color: #fff; 
189            width: 100%; 
190            box-sizing: border-box; 
191
192        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input:focus { 
193            outline: none; 
194            box-shadow: none; 
195
196        #${facetId} .ts-dropdown .ts-dropdown-content .option { 
197            font-family: var(--facet-font-family); 
198            font-size: var(--facet-font-size); 
199            font-weight: var(--facet-font-weight); 
200            line-height: var(--facet-line-height); 
201            letter-spacing: var(--facet-letter-spacing); 
202            color: var(--facet-color); 
203            padding: 8px 16px; 
204
205        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover, 
206        #${facetId} .ts-dropdown .ts-dropdown-content .option.active { 
207            background-color: #6a9bd3; 
208            color: #fff; 
209
210        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover .badge, 
211        #${facetId} .ts-dropdown .ts-dropdown-content .option.active .badge { 
212            background-color: #fff; 
213            color: #3a6a9b; 
214
215    </style> 
216 
217    <div class="checks-container ${facetClass}" id="${facetId}"> 
218        <div class="d-flex flex-column w-100"> 
219            <label class="panel-title mb-2" for="${facetId}-select"> 
220                ${languageUtil.get(locale, "norma." + paramNameSpecificationName)} 
221                <#if isDebug> 
222                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
223                        (total options: ${entries?size}) 
224                    </p> 
225                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
226                        (facetId: ${facetId}) 
227                    </p> 
228                </#if> 
229            </label> 
230 
231            <#-- ========================= --> 
232            <#-- SELECT UI                 --> 
233            <#-- ========================= --> 
234             
235 
236             
237            <select id="${facetId}-select" data-parameter-name="${paramNameSpecificationName}"> 
238                <option value="">${languageUtil.get(locale, "search.cualquiera")}</option> 
239                <#list entries?sort_by("displayName") as entry> 
240                    <#assign specName = entry.getDisplayName() /> 
241                    <#assign orgNames = specOrganismosMap[specName]![] /> 
242									 
243							 
244									 
245                    <option value="${htmlUtil.escape(specName)}" 
246                        <#if entry.isSelected()>selected</#if> 
247                        data-organismos="${htmlUtil.escape(orgNames?join(","))}"> 
248                        ${htmlUtil.escape(specName)} (${entry.getFrequency()}) 
249                    </option> 
250                </#list> 
251            </select> 
252        </div> 
253    </div> 
254 
255    <#-- ========================= --> 
256    <#-- SCRIPT                    --> 
257    <#-- ========================= --> 
258    <script> 
259        (function () { 
260            var FACET_ID   = '${facetId}'; 
261            var PARAM_NAME = '${paramNameSpecificationName}'; 
262 
263            function applyUrlFilter(value) { 
264                var url = new URL(window.location.href); 
265                if (value) { 
266                    url.searchParams.set(PARAM_NAME, value); 
267                } else { 
268                    url.searchParams.delete(PARAM_NAME); 
269
270                window.location.href = url.toString(); 
271
272 
273            function initFacet() { 
274                var select = document.getElementById(FACET_ID + '-select'); 
275                if (!select) return; 
276                if (select.tomselect) select.tomselect.destroy(); 
277                if (select.dataset.bound === 'true') return; 
278                select.dataset.bound = 'true'; 
279 
280                new TomSelect(select, { 
281                    allowEmptyOption: true, 
282                    maxItems: 1, 
283                    create: false, 
284                    render: { 
285                        option: function(data, escape) { 
286                            var organismos = data.$option ? data.$option.getAttribute('data-organismos') : ''; 
287                            var badges = ''; 
288                            if (organismos) { 
289                                organismos.split(',').forEach(function(org) { 
290                                    badges += '<span class="badge badge-secondary mr-1">' + escape(org.trim()) + '</span>'; 
291                                }); 
292
293                            return '<div class="option py-1">' + escape(data.text) + '<div class="mt-1">' + badges + '</div></div>'; 
294                        }, 
295                        no_results: function(data, escape) { 
296                            return '<div class="no-results">${languageUtil.get(locale, "occurrence-not-found")}</div>'; 
297
298                    }, 
299                    plugins: { 
300                        dropdown_input: {} 
301                    }, 
302                    onDelete: function(value) { 
303                        this.isDelete = true; 
304                    }, 
305                    onChange: function(value) { 
306                        if (value) { 
307                            this.lastValidValue = value; 
308                            applyUrlFilter(value); 
309                            return; 
310
311                        this.lastValidValue = ''; 
312                        applyUrlFilter(''); 
313                    }, 
314                    onInitialize: function() { 
315                        this.lastValidValue = this.getValue() || ''; 
316                        this.isDelete = false; 
317                        var wrapper = document.querySelector('#' + FACET_ID + ' .ts-wrapper'); 
318                        if (wrapper) wrapper.style.opacity = '1'; 
319
320                }); 
321
322 
323            if (document.readyState === 'loading') { 
324                document.addEventListener('DOMContentLoaded', initFacet); 
325            } else { 
326                initFacet(); 
327
328        })(); 
329    </script> 
330 
331</#if> 
Se ha producido un error al procesar la plantilla.
Syntax error in template "34352066712900#33336#362186" in line 86, column 54:
Unknown built-in: "class". Help (latest version): https://freemarker.apache.org/docs/ref_builtins.html; you're using FreeMarker 2.3.33.
The alphabetical list of built-ins:
abs, absolute_template_name, ancestors, api, 
boolean, byte, 
c, c_lower_case, c_upper_case, cap_first, capitalize, ceiling, children, chop_linebreak, chunk, cn, contains, counter, 
date, date_if_unknown, datetime, datetime_if_unknown, default, double, drop_while, 
ends_with, ensure_ends_with, ensure_starts_with, esc, eval, eval_json, exists, 
filter, first, float, floor, 
groups, 
has_api, has_content, has_next, html, 
if_exists, index, index_of, int, interpret, is_boolean, is_collection, is_collection_ex, is_date, is_date_like, is_date_only, is_datetime, is_directive, is_enumerable, is_even_item, is_first, is_hash, is_hash_ex, is_indexable, is_infinite, is_last, is_macro, is_markup_output, is_method, is_nan, is_node, is_number, is_odd_item, is_sequence, is_string, is_time, is_transform, is_unknown_date_like, iso, iso_h, iso_h_nz, iso_local, iso_local_h, iso_local_h_nz, iso_local_m, iso_local_m_nz, iso_local_ms, iso_local_ms_nz, iso_local_nz, iso_m, iso_m_nz, iso_ms, iso_ms_nz, iso_nz, iso_utc, iso_utc_fz, iso_utc_h, iso_utc_h_nz, iso_utc_m, iso_utc_m_nz, iso_utc_ms, iso_utc_ms_nz, iso_utc_nz, item_cycle, item_parity, item_parity_cap, 
j_string, join, js_string, json_string, 
keep_after, keep_after_last, keep_before, keep_before_last, keys, 
last, last_index_of, left_pad, length, long, lower_abc, lower_case, 
map, markup_string, matches, max, min, 
namespace, new, next_sibling, no_esc, node_name, node_namespace, node_type, number, number_to_date, number_to_datetime, number_to_time, 
parent, previous_sibling, 
remove_beginning, remove_ending, replace, reverse, right_pad, root, round, rtf, 
seq_contains, seq_index_of, seq_last_index_of, sequence, short, size, sort, sort_by, split, starts_with, string, substring, switch, 
take_while, then, time, time_if_unknown, trim, truncate, truncate_c, truncate_c_m, truncate_m, truncate_w, truncate_w_m, 
uncap_first, upper_abc, upper_case, url, url_path, 
values, 
web_safe, with_args, with_args_last, word_list, 
xhtml, xml
1<#-- Variables --> 
2<#assign specificationName          = 'ctn' /> 
3<#assign paramNameSpecificationName = cpSpecificationOptionsSearchFacetDisplayContext.getParameterName() /> 
4<#assign isDebug                    = false /> 
5<#assign showAllSpecificationsName  = false /> 
6<#assign staticHost                 = getCXConfig("ecom-static-files") /> 
7 
8<#-- ========================= --> 
9<#-- Functions freemaker       --> 
10<#-- ========================= --> 
11<#function getCXConfig clientExtensionName field="webApiUrl"> 
12    <#if !clientExtensionName?has_content><#return "" /></#if> 
13    <#local encoded = urlCodec.encodeURL(clientExtensionName) /> 
14    <#local items   = restClient.get("/c/customconfigs/?fields=clientExtensionConfig&filter=clientExtensionName eq '" + encoded + "'").items![] /> 
15    <#return items?has_content?then(items[0].clientExtensionConfig?eval[field]!"", "") /> 
16</#function> 
17 
18<#function getTaxonomyVocabularyId vocabularyName> 
19    <#local response = restClient.get("/headless-admin-taxonomy/v1.0/sites/" + groupId + "/taxonomy-vocabularies?filter=contains(name,'" + vocabularyName + "')&pageSize=1")!{} /> 
20    <#local items    = response.items![] /> 
21    <#return items?has_content?then(items[0].id, "") /> 
22</#function> 
23 
24<#function getTaxonomyCategoryMap vocabularyId pageSize=200> 
25    <#local response   = restClient.get("/headless-admin-taxonomy/v1.0/taxonomy-vocabularies/" + vocabularyId + "/taxonomy-categories?pageSize=" + pageSize)!{} /> 
26    <#local categoryMap = {} /> 
27    <#list response.items![] as cat> 
28        <#local categoryMap = categoryMap + {vocabularyId + "-" + cat.id: cat.name} /> 
29    </#list> 
30    <#return categoryMap /> 
31</#function> 
32 
33<#function getSpecOrganismosMap organismoMap aggResult> 
34    <#local specMap = {} /> 
35    <#if !aggResult?has_content || !organismoMap?has_content><#return specMap /></#if> 
36    <#list aggResult.getBuckets() as specBucket> 
37        <#local specKey      = specBucket.getKey() /> 
38        <#local organismoAgg = specBucket.getChildAggregationResult("organismos") /> 
39        <#local orgNames     = [] /> 
40        <#if organismoAgg?has_content> 
41            <#list organismoAgg.getBuckets() as orgBucket> 
42                <#local orgName  = organismoMap[orgBucket.getKey()]!"" /> 
43                <#if orgName?has_content> 
44                    <#local orgNames = orgNames + [orgName] /> 
45                </#if> 
46            </#list> 
47        </#if> 
48        <#if orgNames?has_content> 
49            <#local specMap = specMap + {specKey: orgNames} /> 
50        </#if> 
51    </#list> 
52    <#return specMap /> 
53</#function> 
54 
55<#function getAggregationResult specificationKey> 
56    <#if !specificationKey?has_content><#return "" /></#if> 
57 
58    <#local sharedSearchResponse = renderRequest.getAttribute("LIFERAY_SHARED_PortletSharedSearchResponse") /> 
59    <#if !sharedSearchResponse?has_content><#return "" /></#if> 
60 
61    <#local searchResponse = sharedSearchResponse.get() /> 
62    <#if !searchResponse?has_content><#return "" /></#if> 
63 
64    <#local esResponse = searchResponse.getSearchResponse() /> 
65    <#if !esResponse?has_content><#return "" /></#if> 
66 
67    <#local aggregationResult = esResponse.getAggregationResult(specificationKey + "_with_organismos") /> 
68    <#if !aggregationResult?has_content><#return "" /></#if> 
69 
70    <#return aggregationResult /> 
71</#function> 
72 
73 
74 
75<#if paramNameSpecificationName == specificationName || showAllSpecificationsName> 
76 
77    <#-- ========================= --> 
78    <#-- Datos                     --> 
79    <#-- ========================= --> 
80	<#assign organismoVocabId  = getTaxonomyVocabularyId("organismos") /> 
81	<#assign organismoMap      = getTaxonomyCategoryMap(organismoVocabId) /> 
82	<#assign aggResult         = getAggregationResult(paramNameSpecificationName)! /> 
83	<#assign specOrganismosMap = getSpecOrganismosMap(organismoMap, aggResult) /> 
84			 
85			BUCKET KEY TYPE: 
86${specBucket.getKey()?string} (${specBucket.getKey()?class}) 
87			 
88 
89    <#-- ========================= --> 
90    <#-- Debug                     --> 
91    <#-- ========================= --> 
92    <#if isDebug> 
93        <div style="background:#f0f0f0;padding:8px;margin-bottom:8px;font-size:11px;border:1px solid #ccc;"> 
94            <p><strong>paramName:</strong> ${paramNameSpecificationName}</p> 
95            <p><strong>organismoMap size:</strong> ${organismoMap?size}</p> 
96            <p><strong>specOrganismosMap size:</strong> ${specOrganismosMap?size}</p> 
97            <#list specOrganismosMap?keys as spec> 
98                <p>${spec}: ${specOrganismosMap[spec]?join(", ")}</p> 
99            </#list> 
100        </div> 
101    </#if> 
102 
103    <#-- Variables --> 
104    <#assign facetId    = "facet-" + paramNameSpecificationName + "-" + renderResponse.getNamespace() /> 
105    <#assign facetClass = "facet-" + paramNameSpecificationName + "-combo-search-wrapper" /> 
106 
107    <#-- ========================= --> 
108    <#-- TOM SELECT framework      --> 
109    <#-- ========================= --> 
110    <@liferay_util["html-top"] outputKey="tom-select"> 
111        <link href="${staticHost}/scripts/vendor/tom-select/tom-select.css" rel="stylesheet"> 
112        <script src="${staticHost}/scripts/vendor/tom-select/tom-select.complete.min.js"></script> 
113    </@> 
114 
115    <#-- ========================= --> 
116    <#-- CSS                       --> 
117    <#-- ========================= --> 
118    <style> 
119        #${facetId} { 
120            --facet-font-family: Inter; 
121            --facet-font-size: 14px; 
122            --facet-font-weight: 400; 
123            --facet-line-height: 18px; 
124            --facet-letter-spacing: 0.5px; 
125            --facet-color: #66757f; 
126
127        #${facetId}-select { 
128            appearance: none; 
129            -webkit-appearance: none; 
130            visibility: hidden; 
131            position: absolute; 
132
133        #${facetId} .ts-wrapper { 
134            width: 100%; 
135            margin-bottom: 16px; 
136            opacity: 0; 
137            transition: opacity 0.1s ease; 
138
139        #${facetId} .ts-wrapper .ts-control { 
140            padding: 15.5px 16px; 
141            font-family: var(--facet-font-family); 
142            font-size: var(--facet-font-size); 
143            font-weight: var(--facet-font-weight); 
144            line-height: var(--facet-line-height); 
145            letter-spacing: var(--facet-letter-spacing); 
146            color: var(--facet-color); 
147            text-align: left; 
148            height: 55px; 
149            width: 100%; 
150            border-radius: 4px; 
151            border: none; 
152            background-color: #F5F5F5; 
153            background-image: url(/documents/d/global/ico-chevron-down-2); 
154            background-repeat: no-repeat; 
155            background-position: right 1rem center; 
156            background-size: 18px 10px; 
157            box-shadow: none; 
158            cursor: pointer; 
159            box-sizing: border-box; 
160
161        #${facetId} .ts-wrapper .ts-control:focus, 
162        #${facetId} .ts-wrapper .ts-control:focus-visible { 
163            background-image: url(/documents/d/global/ico-chevron-down-2); 
164            background-position: right 1rem center; 
165            background-size: 18px 10px; 
166            outline: none; 
167            box-shadow: none; 
168
169        #${facetId} .ts-wrapper .ts-control .item { 
170            padding-right: 0.75rem; 
171            overflow: hidden; 
172            text-overflow: ellipsis; 
173            max-width: calc(100% - 0.75rem); 
174
175        #${facetId} .ts-wrapper.single .ts-control::after { 
176            display: none; 
177
178        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input { 
179            font-family: var(--facet-font-family); 
180            font-size: var(--facet-font-size); 
181            font-weight: var(--facet-font-weight); 
182            line-height: var(--facet-line-height); 
183            letter-spacing: var(--facet-letter-spacing); 
184            color: var(--facet-color); 
185            padding: 8px 16px; 
186            border: none; 
187            border-bottom: 1px solid #d9d9d9; 
188            background-color: #fff; 
189            width: 100%; 
190            box-sizing: border-box; 
191
192        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input:focus { 
193            outline: none; 
194            box-shadow: none; 
195
196        #${facetId} .ts-dropdown .ts-dropdown-content .option { 
197            font-family: var(--facet-font-family); 
198            font-size: var(--facet-font-size); 
199            font-weight: var(--facet-font-weight); 
200            line-height: var(--facet-line-height); 
201            letter-spacing: var(--facet-letter-spacing); 
202            color: var(--facet-color); 
203            padding: 8px 16px; 
204
205        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover, 
206        #${facetId} .ts-dropdown .ts-dropdown-content .option.active { 
207            background-color: #6a9bd3; 
208            color: #fff; 
209
210        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover .badge, 
211        #${facetId} .ts-dropdown .ts-dropdown-content .option.active .badge { 
212            background-color: #fff; 
213            color: #3a6a9b; 
214
215    </style> 
216 
217    <div class="checks-container ${facetClass}" id="${facetId}"> 
218        <div class="d-flex flex-column w-100"> 
219            <label class="panel-title mb-2" for="${facetId}-select"> 
220                ${languageUtil.get(locale, "norma." + paramNameSpecificationName)} 
221                <#if isDebug> 
222                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
223                        (total options: ${entries?size}) 
224                    </p> 
225                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
226                        (facetId: ${facetId}) 
227                    </p> 
228                </#if> 
229            </label> 
230 
231            <#-- ========================= --> 
232            <#-- SELECT UI                 --> 
233            <#-- ========================= --> 
234             
235 
236             
237            <select id="${facetId}-select" data-parameter-name="${paramNameSpecificationName}"> 
238                <option value="">${languageUtil.get(locale, "search.cualquiera")}</option> 
239                <#list entries?sort_by("displayName") as entry> 
240                    <#assign specName = entry.getDisplayName() /> 
241                    <#assign orgNames = specOrganismosMap[specName]![] /> 
242									 
243							 
244									 
245                    <option value="${htmlUtil.escape(specName)}" 
246                        <#if entry.isSelected()>selected</#if> 
247                        data-organismos="${htmlUtil.escape(orgNames?join(","))}"> 
248                        ${htmlUtil.escape(specName)} (${entry.getFrequency()}) 
249                    </option> 
250                </#list> 
251            </select> 
252        </div> 
253    </div> 
254 
255    <#-- ========================= --> 
256    <#-- SCRIPT                    --> 
257    <#-- ========================= --> 
258    <script> 
259        (function () { 
260            var FACET_ID   = '${facetId}'; 
261            var PARAM_NAME = '${paramNameSpecificationName}'; 
262 
263            function applyUrlFilter(value) { 
264                var url = new URL(window.location.href); 
265                if (value) { 
266                    url.searchParams.set(PARAM_NAME, value); 
267                } else { 
268                    url.searchParams.delete(PARAM_NAME); 
269
270                window.location.href = url.toString(); 
271
272 
273            function initFacet() { 
274                var select = document.getElementById(FACET_ID + '-select'); 
275                if (!select) return; 
276                if (select.tomselect) select.tomselect.destroy(); 
277                if (select.dataset.bound === 'true') return; 
278                select.dataset.bound = 'true'; 
279 
280                new TomSelect(select, { 
281                    allowEmptyOption: true, 
282                    maxItems: 1, 
283                    create: false, 
284                    render: { 
285                        option: function(data, escape) { 
286                            var organismos = data.$option ? data.$option.getAttribute('data-organismos') : ''; 
287                            var badges = ''; 
288                            if (organismos) { 
289                                organismos.split(',').forEach(function(org) { 
290                                    badges += '<span class="badge badge-secondary mr-1">' + escape(org.trim()) + '</span>'; 
291                                }); 
292
293                            return '<div class="option py-1">' + escape(data.text) + '<div class="mt-1">' + badges + '</div></div>'; 
294                        }, 
295                        no_results: function(data, escape) { 
296                            return '<div class="no-results">${languageUtil.get(locale, "occurrence-not-found")}</div>'; 
297
298                    }, 
299                    plugins: { 
300                        dropdown_input: {} 
301                    }, 
302                    onDelete: function(value) { 
303                        this.isDelete = true; 
304                    }, 
305                    onChange: function(value) { 
306                        if (value) { 
307                            this.lastValidValue = value; 
308                            applyUrlFilter(value); 
309                            return; 
310
311                        this.lastValidValue = ''; 
312                        applyUrlFilter(''); 
313                    }, 
314                    onInitialize: function() { 
315                        this.lastValidValue = this.getValue() || ''; 
316                        this.isDelete = false; 
317                        var wrapper = document.querySelector('#' + FACET_ID + ' .ts-wrapper'); 
318                        if (wrapper) wrapper.style.opacity = '1'; 
319
320                }); 
321
322 
323            if (document.readyState === 'loading') { 
324                document.addEventListener('DOMContentLoaded', initFacet); 
325            } else { 
326                initFacet(); 
327
328        })(); 
329    </script> 
330 
331</#if> 
Se ha producido un error al procesar la plantilla.
Syntax error in template "34352066712900#33336#362186" in line 86, column 54:
Unknown built-in: "class". Help (latest version): https://freemarker.apache.org/docs/ref_builtins.html; you're using FreeMarker 2.3.33.
The alphabetical list of built-ins:
abs, absolute_template_name, ancestors, api, 
boolean, byte, 
c, c_lower_case, c_upper_case, cap_first, capitalize, ceiling, children, chop_linebreak, chunk, cn, contains, counter, 
date, date_if_unknown, datetime, datetime_if_unknown, default, double, drop_while, 
ends_with, ensure_ends_with, ensure_starts_with, esc, eval, eval_json, exists, 
filter, first, float, floor, 
groups, 
has_api, has_content, has_next, html, 
if_exists, index, index_of, int, interpret, is_boolean, is_collection, is_collection_ex, is_date, is_date_like, is_date_only, is_datetime, is_directive, is_enumerable, is_even_item, is_first, is_hash, is_hash_ex, is_indexable, is_infinite, is_last, is_macro, is_markup_output, is_method, is_nan, is_node, is_number, is_odd_item, is_sequence, is_string, is_time, is_transform, is_unknown_date_like, iso, iso_h, iso_h_nz, iso_local, iso_local_h, iso_local_h_nz, iso_local_m, iso_local_m_nz, iso_local_ms, iso_local_ms_nz, iso_local_nz, iso_m, iso_m_nz, iso_ms, iso_ms_nz, iso_nz, iso_utc, iso_utc_fz, iso_utc_h, iso_utc_h_nz, iso_utc_m, iso_utc_m_nz, iso_utc_ms, iso_utc_ms_nz, iso_utc_nz, item_cycle, item_parity, item_parity_cap, 
j_string, join, js_string, json_string, 
keep_after, keep_after_last, keep_before, keep_before_last, keys, 
last, last_index_of, left_pad, length, long, lower_abc, lower_case, 
map, markup_string, matches, max, min, 
namespace, new, next_sibling, no_esc, node_name, node_namespace, node_type, number, number_to_date, number_to_datetime, number_to_time, 
parent, previous_sibling, 
remove_beginning, remove_ending, replace, reverse, right_pad, root, round, rtf, 
seq_contains, seq_index_of, seq_last_index_of, sequence, short, size, sort, sort_by, split, starts_with, string, substring, switch, 
take_while, then, time, time_if_unknown, trim, truncate, truncate_c, truncate_c_m, truncate_m, truncate_w, truncate_w_m, 
uncap_first, upper_abc, upper_case, url, url_path, 
values, 
web_safe, with_args, with_args_last, word_list, 
xhtml, xml
1<#-- Variables --> 
2<#assign specificationName          = 'ctn' /> 
3<#assign paramNameSpecificationName = cpSpecificationOptionsSearchFacetDisplayContext.getParameterName() /> 
4<#assign isDebug                    = false /> 
5<#assign showAllSpecificationsName  = false /> 
6<#assign staticHost                 = getCXConfig("ecom-static-files") /> 
7 
8<#-- ========================= --> 
9<#-- Functions freemaker       --> 
10<#-- ========================= --> 
11<#function getCXConfig clientExtensionName field="webApiUrl"> 
12    <#if !clientExtensionName?has_content><#return "" /></#if> 
13    <#local encoded = urlCodec.encodeURL(clientExtensionName) /> 
14    <#local items   = restClient.get("/c/customconfigs/?fields=clientExtensionConfig&filter=clientExtensionName eq '" + encoded + "'").items![] /> 
15    <#return items?has_content?then(items[0].clientExtensionConfig?eval[field]!"", "") /> 
16</#function> 
17 
18<#function getTaxonomyVocabularyId vocabularyName> 
19    <#local response = restClient.get("/headless-admin-taxonomy/v1.0/sites/" + groupId + "/taxonomy-vocabularies?filter=contains(name,'" + vocabularyName + "')&pageSize=1")!{} /> 
20    <#local items    = response.items![] /> 
21    <#return items?has_content?then(items[0].id, "") /> 
22</#function> 
23 
24<#function getTaxonomyCategoryMap vocabularyId pageSize=200> 
25    <#local response   = restClient.get("/headless-admin-taxonomy/v1.0/taxonomy-vocabularies/" + vocabularyId + "/taxonomy-categories?pageSize=" + pageSize)!{} /> 
26    <#local categoryMap = {} /> 
27    <#list response.items![] as cat> 
28        <#local categoryMap = categoryMap + {vocabularyId + "-" + cat.id: cat.name} /> 
29    </#list> 
30    <#return categoryMap /> 
31</#function> 
32 
33<#function getSpecOrganismosMap organismoMap aggResult> 
34    <#local specMap = {} /> 
35    <#if !aggResult?has_content || !organismoMap?has_content><#return specMap /></#if> 
36    <#list aggResult.getBuckets() as specBucket> 
37        <#local specKey      = specBucket.getKey() /> 
38        <#local organismoAgg = specBucket.getChildAggregationResult("organismos") /> 
39        <#local orgNames     = [] /> 
40        <#if organismoAgg?has_content> 
41            <#list organismoAgg.getBuckets() as orgBucket> 
42                <#local orgName  = organismoMap[orgBucket.getKey()]!"" /> 
43                <#if orgName?has_content> 
44                    <#local orgNames = orgNames + [orgName] /> 
45                </#if> 
46            </#list> 
47        </#if> 
48        <#if orgNames?has_content> 
49            <#local specMap = specMap + {specKey: orgNames} /> 
50        </#if> 
51    </#list> 
52    <#return specMap /> 
53</#function> 
54 
55<#function getAggregationResult specificationKey> 
56    <#if !specificationKey?has_content><#return "" /></#if> 
57 
58    <#local sharedSearchResponse = renderRequest.getAttribute("LIFERAY_SHARED_PortletSharedSearchResponse") /> 
59    <#if !sharedSearchResponse?has_content><#return "" /></#if> 
60 
61    <#local searchResponse = sharedSearchResponse.get() /> 
62    <#if !searchResponse?has_content><#return "" /></#if> 
63 
64    <#local esResponse = searchResponse.getSearchResponse() /> 
65    <#if !esResponse?has_content><#return "" /></#if> 
66 
67    <#local aggregationResult = esResponse.getAggregationResult(specificationKey + "_with_organismos") /> 
68    <#if !aggregationResult?has_content><#return "" /></#if> 
69 
70    <#return aggregationResult /> 
71</#function> 
72 
73 
74 
75<#if paramNameSpecificationName == specificationName || showAllSpecificationsName> 
76 
77    <#-- ========================= --> 
78    <#-- Datos                     --> 
79    <#-- ========================= --> 
80	<#assign organismoVocabId  = getTaxonomyVocabularyId("organismos") /> 
81	<#assign organismoMap      = getTaxonomyCategoryMap(organismoVocabId) /> 
82	<#assign aggResult         = getAggregationResult(paramNameSpecificationName)! /> 
83	<#assign specOrganismosMap = getSpecOrganismosMap(organismoMap, aggResult) /> 
84			 
85			BUCKET KEY TYPE: 
86${specBucket.getKey()?string} (${specBucket.getKey()?class}) 
87			 
88 
89    <#-- ========================= --> 
90    <#-- Debug                     --> 
91    <#-- ========================= --> 
92    <#if isDebug> 
93        <div style="background:#f0f0f0;padding:8px;margin-bottom:8px;font-size:11px;border:1px solid #ccc;"> 
94            <p><strong>paramName:</strong> ${paramNameSpecificationName}</p> 
95            <p><strong>organismoMap size:</strong> ${organismoMap?size}</p> 
96            <p><strong>specOrganismosMap size:</strong> ${specOrganismosMap?size}</p> 
97            <#list specOrganismosMap?keys as spec> 
98                <p>${spec}: ${specOrganismosMap[spec]?join(", ")}</p> 
99            </#list> 
100        </div> 
101    </#if> 
102 
103    <#-- Variables --> 
104    <#assign facetId    = "facet-" + paramNameSpecificationName + "-" + renderResponse.getNamespace() /> 
105    <#assign facetClass = "facet-" + paramNameSpecificationName + "-combo-search-wrapper" /> 
106 
107    <#-- ========================= --> 
108    <#-- TOM SELECT framework      --> 
109    <#-- ========================= --> 
110    <@liferay_util["html-top"] outputKey="tom-select"> 
111        <link href="${staticHost}/scripts/vendor/tom-select/tom-select.css" rel="stylesheet"> 
112        <script src="${staticHost}/scripts/vendor/tom-select/tom-select.complete.min.js"></script> 
113    </@> 
114 
115    <#-- ========================= --> 
116    <#-- CSS                       --> 
117    <#-- ========================= --> 
118    <style> 
119        #${facetId} { 
120            --facet-font-family: Inter; 
121            --facet-font-size: 14px; 
122            --facet-font-weight: 400; 
123            --facet-line-height: 18px; 
124            --facet-letter-spacing: 0.5px; 
125            --facet-color: #66757f; 
126
127        #${facetId}-select { 
128            appearance: none; 
129            -webkit-appearance: none; 
130            visibility: hidden; 
131            position: absolute; 
132
133        #${facetId} .ts-wrapper { 
134            width: 100%; 
135            margin-bottom: 16px; 
136            opacity: 0; 
137            transition: opacity 0.1s ease; 
138
139        #${facetId} .ts-wrapper .ts-control { 
140            padding: 15.5px 16px; 
141            font-family: var(--facet-font-family); 
142            font-size: var(--facet-font-size); 
143            font-weight: var(--facet-font-weight); 
144            line-height: var(--facet-line-height); 
145            letter-spacing: var(--facet-letter-spacing); 
146            color: var(--facet-color); 
147            text-align: left; 
148            height: 55px; 
149            width: 100%; 
150            border-radius: 4px; 
151            border: none; 
152            background-color: #F5F5F5; 
153            background-image: url(/documents/d/global/ico-chevron-down-2); 
154            background-repeat: no-repeat; 
155            background-position: right 1rem center; 
156            background-size: 18px 10px; 
157            box-shadow: none; 
158            cursor: pointer; 
159            box-sizing: border-box; 
160
161        #${facetId} .ts-wrapper .ts-control:focus, 
162        #${facetId} .ts-wrapper .ts-control:focus-visible { 
163            background-image: url(/documents/d/global/ico-chevron-down-2); 
164            background-position: right 1rem center; 
165            background-size: 18px 10px; 
166            outline: none; 
167            box-shadow: none; 
168
169        #${facetId} .ts-wrapper .ts-control .item { 
170            padding-right: 0.75rem; 
171            overflow: hidden; 
172            text-overflow: ellipsis; 
173            max-width: calc(100% - 0.75rem); 
174
175        #${facetId} .ts-wrapper.single .ts-control::after { 
176            display: none; 
177
178        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input { 
179            font-family: var(--facet-font-family); 
180            font-size: var(--facet-font-size); 
181            font-weight: var(--facet-font-weight); 
182            line-height: var(--facet-line-height); 
183            letter-spacing: var(--facet-letter-spacing); 
184            color: var(--facet-color); 
185            padding: 8px 16px; 
186            border: none; 
187            border-bottom: 1px solid #d9d9d9; 
188            background-color: #fff; 
189            width: 100%; 
190            box-sizing: border-box; 
191
192        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input:focus { 
193            outline: none; 
194            box-shadow: none; 
195
196        #${facetId} .ts-dropdown .ts-dropdown-content .option { 
197            font-family: var(--facet-font-family); 
198            font-size: var(--facet-font-size); 
199            font-weight: var(--facet-font-weight); 
200            line-height: var(--facet-line-height); 
201            letter-spacing: var(--facet-letter-spacing); 
202            color: var(--facet-color); 
203            padding: 8px 16px; 
204
205        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover, 
206        #${facetId} .ts-dropdown .ts-dropdown-content .option.active { 
207            background-color: #6a9bd3; 
208            color: #fff; 
209
210        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover .badge, 
211        #${facetId} .ts-dropdown .ts-dropdown-content .option.active .badge { 
212            background-color: #fff; 
213            color: #3a6a9b; 
214
215    </style> 
216 
217    <div class="checks-container ${facetClass}" id="${facetId}"> 
218        <div class="d-flex flex-column w-100"> 
219            <label class="panel-title mb-2" for="${facetId}-select"> 
220                ${languageUtil.get(locale, "norma." + paramNameSpecificationName)} 
221                <#if isDebug> 
222                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
223                        (total options: ${entries?size}) 
224                    </p> 
225                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
226                        (facetId: ${facetId}) 
227                    </p> 
228                </#if> 
229            </label> 
230 
231            <#-- ========================= --> 
232            <#-- SELECT UI                 --> 
233            <#-- ========================= --> 
234             
235 
236             
237            <select id="${facetId}-select" data-parameter-name="${paramNameSpecificationName}"> 
238                <option value="">${languageUtil.get(locale, "search.cualquiera")}</option> 
239                <#list entries?sort_by("displayName") as entry> 
240                    <#assign specName = entry.getDisplayName() /> 
241                    <#assign orgNames = specOrganismosMap[specName]![] /> 
242									 
243							 
244									 
245                    <option value="${htmlUtil.escape(specName)}" 
246                        <#if entry.isSelected()>selected</#if> 
247                        data-organismos="${htmlUtil.escape(orgNames?join(","))}"> 
248                        ${htmlUtil.escape(specName)} (${entry.getFrequency()}) 
249                    </option> 
250                </#list> 
251            </select> 
252        </div> 
253    </div> 
254 
255    <#-- ========================= --> 
256    <#-- SCRIPT                    --> 
257    <#-- ========================= --> 
258    <script> 
259        (function () { 
260            var FACET_ID   = '${facetId}'; 
261            var PARAM_NAME = '${paramNameSpecificationName}'; 
262 
263            function applyUrlFilter(value) { 
264                var url = new URL(window.location.href); 
265                if (value) { 
266                    url.searchParams.set(PARAM_NAME, value); 
267                } else { 
268                    url.searchParams.delete(PARAM_NAME); 
269
270                window.location.href = url.toString(); 
271
272 
273            function initFacet() { 
274                var select = document.getElementById(FACET_ID + '-select'); 
275                if (!select) return; 
276                if (select.tomselect) select.tomselect.destroy(); 
277                if (select.dataset.bound === 'true') return; 
278                select.dataset.bound = 'true'; 
279 
280                new TomSelect(select, { 
281                    allowEmptyOption: true, 
282                    maxItems: 1, 
283                    create: false, 
284                    render: { 
285                        option: function(data, escape) { 
286                            var organismos = data.$option ? data.$option.getAttribute('data-organismos') : ''; 
287                            var badges = ''; 
288                            if (organismos) { 
289                                organismos.split(',').forEach(function(org) { 
290                                    badges += '<span class="badge badge-secondary mr-1">' + escape(org.trim()) + '</span>'; 
291                                }); 
292
293                            return '<div class="option py-1">' + escape(data.text) + '<div class="mt-1">' + badges + '</div></div>'; 
294                        }, 
295                        no_results: function(data, escape) { 
296                            return '<div class="no-results">${languageUtil.get(locale, "occurrence-not-found")}</div>'; 
297
298                    }, 
299                    plugins: { 
300                        dropdown_input: {} 
301                    }, 
302                    onDelete: function(value) { 
303                        this.isDelete = true; 
304                    }, 
305                    onChange: function(value) { 
306                        if (value) { 
307                            this.lastValidValue = value; 
308                            applyUrlFilter(value); 
309                            return; 
310
311                        this.lastValidValue = ''; 
312                        applyUrlFilter(''); 
313                    }, 
314                    onInitialize: function() { 
315                        this.lastValidValue = this.getValue() || ''; 
316                        this.isDelete = false; 
317                        var wrapper = document.querySelector('#' + FACET_ID + ' .ts-wrapper'); 
318                        if (wrapper) wrapper.style.opacity = '1'; 
319
320                }); 
321
322 
323            if (document.readyState === 'loading') { 
324                document.addEventListener('DOMContentLoaded', initFacet); 
325            } else { 
326                initFacet(); 
327
328        })(); 
329    </script> 
330 
331</#if> 
Se ha producido un error al procesar la plantilla.
Syntax error in template "34352066712900#33336#362186" in line 86, column 54:
Unknown built-in: "class". Help (latest version): https://freemarker.apache.org/docs/ref_builtins.html; you're using FreeMarker 2.3.33.
The alphabetical list of built-ins:
abs, absolute_template_name, ancestors, api, 
boolean, byte, 
c, c_lower_case, c_upper_case, cap_first, capitalize, ceiling, children, chop_linebreak, chunk, cn, contains, counter, 
date, date_if_unknown, datetime, datetime_if_unknown, default, double, drop_while, 
ends_with, ensure_ends_with, ensure_starts_with, esc, eval, eval_json, exists, 
filter, first, float, floor, 
groups, 
has_api, has_content, has_next, html, 
if_exists, index, index_of, int, interpret, is_boolean, is_collection, is_collection_ex, is_date, is_date_like, is_date_only, is_datetime, is_directive, is_enumerable, is_even_item, is_first, is_hash, is_hash_ex, is_indexable, is_infinite, is_last, is_macro, is_markup_output, is_method, is_nan, is_node, is_number, is_odd_item, is_sequence, is_string, is_time, is_transform, is_unknown_date_like, iso, iso_h, iso_h_nz, iso_local, iso_local_h, iso_local_h_nz, iso_local_m, iso_local_m_nz, iso_local_ms, iso_local_ms_nz, iso_local_nz, iso_m, iso_m_nz, iso_ms, iso_ms_nz, iso_nz, iso_utc, iso_utc_fz, iso_utc_h, iso_utc_h_nz, iso_utc_m, iso_utc_m_nz, iso_utc_ms, iso_utc_ms_nz, iso_utc_nz, item_cycle, item_parity, item_parity_cap, 
j_string, join, js_string, json_string, 
keep_after, keep_after_last, keep_before, keep_before_last, keys, 
last, last_index_of, left_pad, length, long, lower_abc, lower_case, 
map, markup_string, matches, max, min, 
namespace, new, next_sibling, no_esc, node_name, node_namespace, node_type, number, number_to_date, number_to_datetime, number_to_time, 
parent, previous_sibling, 
remove_beginning, remove_ending, replace, reverse, right_pad, root, round, rtf, 
seq_contains, seq_index_of, seq_last_index_of, sequence, short, size, sort, sort_by, split, starts_with, string, substring, switch, 
take_while, then, time, time_if_unknown, trim, truncate, truncate_c, truncate_c_m, truncate_m, truncate_w, truncate_w_m, 
uncap_first, upper_abc, upper_case, url, url_path, 
values, 
web_safe, with_args, with_args_last, word_list, 
xhtml, xml
1<#-- Variables --> 
2<#assign specificationName          = 'ctn' /> 
3<#assign paramNameSpecificationName = cpSpecificationOptionsSearchFacetDisplayContext.getParameterName() /> 
4<#assign isDebug                    = false /> 
5<#assign showAllSpecificationsName  = false /> 
6<#assign staticHost                 = getCXConfig("ecom-static-files") /> 
7 
8<#-- ========================= --> 
9<#-- Functions freemaker       --> 
10<#-- ========================= --> 
11<#function getCXConfig clientExtensionName field="webApiUrl"> 
12    <#if !clientExtensionName?has_content><#return "" /></#if> 
13    <#local encoded = urlCodec.encodeURL(clientExtensionName) /> 
14    <#local items   = restClient.get("/c/customconfigs/?fields=clientExtensionConfig&filter=clientExtensionName eq '" + encoded + "'").items![] /> 
15    <#return items?has_content?then(items[0].clientExtensionConfig?eval[field]!"", "") /> 
16</#function> 
17 
18<#function getTaxonomyVocabularyId vocabularyName> 
19    <#local response = restClient.get("/headless-admin-taxonomy/v1.0/sites/" + groupId + "/taxonomy-vocabularies?filter=contains(name,'" + vocabularyName + "')&pageSize=1")!{} /> 
20    <#local items    = response.items![] /> 
21    <#return items?has_content?then(items[0].id, "") /> 
22</#function> 
23 
24<#function getTaxonomyCategoryMap vocabularyId pageSize=200> 
25    <#local response   = restClient.get("/headless-admin-taxonomy/v1.0/taxonomy-vocabularies/" + vocabularyId + "/taxonomy-categories?pageSize=" + pageSize)!{} /> 
26    <#local categoryMap = {} /> 
27    <#list response.items![] as cat> 
28        <#local categoryMap = categoryMap + {vocabularyId + "-" + cat.id: cat.name} /> 
29    </#list> 
30    <#return categoryMap /> 
31</#function> 
32 
33<#function getSpecOrganismosMap organismoMap aggResult> 
34    <#local specMap = {} /> 
35    <#if !aggResult?has_content || !organismoMap?has_content><#return specMap /></#if> 
36    <#list aggResult.getBuckets() as specBucket> 
37        <#local specKey      = specBucket.getKey() /> 
38        <#local organismoAgg = specBucket.getChildAggregationResult("organismos") /> 
39        <#local orgNames     = [] /> 
40        <#if organismoAgg?has_content> 
41            <#list organismoAgg.getBuckets() as orgBucket> 
42                <#local orgName  = organismoMap[orgBucket.getKey()]!"" /> 
43                <#if orgName?has_content> 
44                    <#local orgNames = orgNames + [orgName] /> 
45                </#if> 
46            </#list> 
47        </#if> 
48        <#if orgNames?has_content> 
49            <#local specMap = specMap + {specKey: orgNames} /> 
50        </#if> 
51    </#list> 
52    <#return specMap /> 
53</#function> 
54 
55<#function getAggregationResult specificationKey> 
56    <#if !specificationKey?has_content><#return "" /></#if> 
57 
58    <#local sharedSearchResponse = renderRequest.getAttribute("LIFERAY_SHARED_PortletSharedSearchResponse") /> 
59    <#if !sharedSearchResponse?has_content><#return "" /></#if> 
60 
61    <#local searchResponse = sharedSearchResponse.get() /> 
62    <#if !searchResponse?has_content><#return "" /></#if> 
63 
64    <#local esResponse = searchResponse.getSearchResponse() /> 
65    <#if !esResponse?has_content><#return "" /></#if> 
66 
67    <#local aggregationResult = esResponse.getAggregationResult(specificationKey + "_with_organismos") /> 
68    <#if !aggregationResult?has_content><#return "" /></#if> 
69 
70    <#return aggregationResult /> 
71</#function> 
72 
73 
74 
75<#if paramNameSpecificationName == specificationName || showAllSpecificationsName> 
76 
77    <#-- ========================= --> 
78    <#-- Datos                     --> 
79    <#-- ========================= --> 
80	<#assign organismoVocabId  = getTaxonomyVocabularyId("organismos") /> 
81	<#assign organismoMap      = getTaxonomyCategoryMap(organismoVocabId) /> 
82	<#assign aggResult         = getAggregationResult(paramNameSpecificationName)! /> 
83	<#assign specOrganismosMap = getSpecOrganismosMap(organismoMap, aggResult) /> 
84			 
85			BUCKET KEY TYPE: 
86${specBucket.getKey()?string} (${specBucket.getKey()?class}) 
87			 
88 
89    <#-- ========================= --> 
90    <#-- Debug                     --> 
91    <#-- ========================= --> 
92    <#if isDebug> 
93        <div style="background:#f0f0f0;padding:8px;margin-bottom:8px;font-size:11px;border:1px solid #ccc;"> 
94            <p><strong>paramName:</strong> ${paramNameSpecificationName}</p> 
95            <p><strong>organismoMap size:</strong> ${organismoMap?size}</p> 
96            <p><strong>specOrganismosMap size:</strong> ${specOrganismosMap?size}</p> 
97            <#list specOrganismosMap?keys as spec> 
98                <p>${spec}: ${specOrganismosMap[spec]?join(", ")}</p> 
99            </#list> 
100        </div> 
101    </#if> 
102 
103    <#-- Variables --> 
104    <#assign facetId    = "facet-" + paramNameSpecificationName + "-" + renderResponse.getNamespace() /> 
105    <#assign facetClass = "facet-" + paramNameSpecificationName + "-combo-search-wrapper" /> 
106 
107    <#-- ========================= --> 
108    <#-- TOM SELECT framework      --> 
109    <#-- ========================= --> 
110    <@liferay_util["html-top"] outputKey="tom-select"> 
111        <link href="${staticHost}/scripts/vendor/tom-select/tom-select.css" rel="stylesheet"> 
112        <script src="${staticHost}/scripts/vendor/tom-select/tom-select.complete.min.js"></script> 
113    </@> 
114 
115    <#-- ========================= --> 
116    <#-- CSS                       --> 
117    <#-- ========================= --> 
118    <style> 
119        #${facetId} { 
120            --facet-font-family: Inter; 
121            --facet-font-size: 14px; 
122            --facet-font-weight: 400; 
123            --facet-line-height: 18px; 
124            --facet-letter-spacing: 0.5px; 
125            --facet-color: #66757f; 
126
127        #${facetId}-select { 
128            appearance: none; 
129            -webkit-appearance: none; 
130            visibility: hidden; 
131            position: absolute; 
132
133        #${facetId} .ts-wrapper { 
134            width: 100%; 
135            margin-bottom: 16px; 
136            opacity: 0; 
137            transition: opacity 0.1s ease; 
138
139        #${facetId} .ts-wrapper .ts-control { 
140            padding: 15.5px 16px; 
141            font-family: var(--facet-font-family); 
142            font-size: var(--facet-font-size); 
143            font-weight: var(--facet-font-weight); 
144            line-height: var(--facet-line-height); 
145            letter-spacing: var(--facet-letter-spacing); 
146            color: var(--facet-color); 
147            text-align: left; 
148            height: 55px; 
149            width: 100%; 
150            border-radius: 4px; 
151            border: none; 
152            background-color: #F5F5F5; 
153            background-image: url(/documents/d/global/ico-chevron-down-2); 
154            background-repeat: no-repeat; 
155            background-position: right 1rem center; 
156            background-size: 18px 10px; 
157            box-shadow: none; 
158            cursor: pointer; 
159            box-sizing: border-box; 
160
161        #${facetId} .ts-wrapper .ts-control:focus, 
162        #${facetId} .ts-wrapper .ts-control:focus-visible { 
163            background-image: url(/documents/d/global/ico-chevron-down-2); 
164            background-position: right 1rem center; 
165            background-size: 18px 10px; 
166            outline: none; 
167            box-shadow: none; 
168
169        #${facetId} .ts-wrapper .ts-control .item { 
170            padding-right: 0.75rem; 
171            overflow: hidden; 
172            text-overflow: ellipsis; 
173            max-width: calc(100% - 0.75rem); 
174
175        #${facetId} .ts-wrapper.single .ts-control::after { 
176            display: none; 
177
178        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input { 
179            font-family: var(--facet-font-family); 
180            font-size: var(--facet-font-size); 
181            font-weight: var(--facet-font-weight); 
182            line-height: var(--facet-line-height); 
183            letter-spacing: var(--facet-letter-spacing); 
184            color: var(--facet-color); 
185            padding: 8px 16px; 
186            border: none; 
187            border-bottom: 1px solid #d9d9d9; 
188            background-color: #fff; 
189            width: 100%; 
190            box-sizing: border-box; 
191
192        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input:focus { 
193            outline: none; 
194            box-shadow: none; 
195
196        #${facetId} .ts-dropdown .ts-dropdown-content .option { 
197            font-family: var(--facet-font-family); 
198            font-size: var(--facet-font-size); 
199            font-weight: var(--facet-font-weight); 
200            line-height: var(--facet-line-height); 
201            letter-spacing: var(--facet-letter-spacing); 
202            color: var(--facet-color); 
203            padding: 8px 16px; 
204
205        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover, 
206        #${facetId} .ts-dropdown .ts-dropdown-content .option.active { 
207            background-color: #6a9bd3; 
208            color: #fff; 
209
210        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover .badge, 
211        #${facetId} .ts-dropdown .ts-dropdown-content .option.active .badge { 
212            background-color: #fff; 
213            color: #3a6a9b; 
214
215    </style> 
216 
217    <div class="checks-container ${facetClass}" id="${facetId}"> 
218        <div class="d-flex flex-column w-100"> 
219            <label class="panel-title mb-2" for="${facetId}-select"> 
220                ${languageUtil.get(locale, "norma." + paramNameSpecificationName)} 
221                <#if isDebug> 
222                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
223                        (total options: ${entries?size}) 
224                    </p> 
225                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
226                        (facetId: ${facetId}) 
227                    </p> 
228                </#if> 
229            </label> 
230 
231            <#-- ========================= --> 
232            <#-- SELECT UI                 --> 
233            <#-- ========================= --> 
234             
235 
236             
237            <select id="${facetId}-select" data-parameter-name="${paramNameSpecificationName}"> 
238                <option value="">${languageUtil.get(locale, "search.cualquiera")}</option> 
239                <#list entries?sort_by("displayName") as entry> 
240                    <#assign specName = entry.getDisplayName() /> 
241                    <#assign orgNames = specOrganismosMap[specName]![] /> 
242									 
243							 
244									 
245                    <option value="${htmlUtil.escape(specName)}" 
246                        <#if entry.isSelected()>selected</#if> 
247                        data-organismos="${htmlUtil.escape(orgNames?join(","))}"> 
248                        ${htmlUtil.escape(specName)} (${entry.getFrequency()}) 
249                    </option> 
250                </#list> 
251            </select> 
252        </div> 
253    </div> 
254 
255    <#-- ========================= --> 
256    <#-- SCRIPT                    --> 
257    <#-- ========================= --> 
258    <script> 
259        (function () { 
260            var FACET_ID   = '${facetId}'; 
261            var PARAM_NAME = '${paramNameSpecificationName}'; 
262 
263            function applyUrlFilter(value) { 
264                var url = new URL(window.location.href); 
265                if (value) { 
266                    url.searchParams.set(PARAM_NAME, value); 
267                } else { 
268                    url.searchParams.delete(PARAM_NAME); 
269
270                window.location.href = url.toString(); 
271
272 
273            function initFacet() { 
274                var select = document.getElementById(FACET_ID + '-select'); 
275                if (!select) return; 
276                if (select.tomselect) select.tomselect.destroy(); 
277                if (select.dataset.bound === 'true') return; 
278                select.dataset.bound = 'true'; 
279 
280                new TomSelect(select, { 
281                    allowEmptyOption: true, 
282                    maxItems: 1, 
283                    create: false, 
284                    render: { 
285                        option: function(data, escape) { 
286                            var organismos = data.$option ? data.$option.getAttribute('data-organismos') : ''; 
287                            var badges = ''; 
288                            if (organismos) { 
289                                organismos.split(',').forEach(function(org) { 
290                                    badges += '<span class="badge badge-secondary mr-1">' + escape(org.trim()) + '</span>'; 
291                                }); 
292
293                            return '<div class="option py-1">' + escape(data.text) + '<div class="mt-1">' + badges + '</div></div>'; 
294                        }, 
295                        no_results: function(data, escape) { 
296                            return '<div class="no-results">${languageUtil.get(locale, "occurrence-not-found")}</div>'; 
297
298                    }, 
299                    plugins: { 
300                        dropdown_input: {} 
301                    }, 
302                    onDelete: function(value) { 
303                        this.isDelete = true; 
304                    }, 
305                    onChange: function(value) { 
306                        if (value) { 
307                            this.lastValidValue = value; 
308                            applyUrlFilter(value); 
309                            return; 
310
311                        this.lastValidValue = ''; 
312                        applyUrlFilter(''); 
313                    }, 
314                    onInitialize: function() { 
315                        this.lastValidValue = this.getValue() || ''; 
316                        this.isDelete = false; 
317                        var wrapper = document.querySelector('#' + FACET_ID + ' .ts-wrapper'); 
318                        if (wrapper) wrapper.style.opacity = '1'; 
319
320                }); 
321
322 
323            if (document.readyState === 'loading') { 
324                document.addEventListener('DOMContentLoaded', initFacet); 
325            } else { 
326                initFacet(); 
327
328        })(); 
329    </script> 
330 
331</#if> 
Se ha producido un error al procesar la plantilla.
Syntax error in template "34352066712900#33336#362186" in line 86, column 54:
Unknown built-in: "class". Help (latest version): https://freemarker.apache.org/docs/ref_builtins.html; you're using FreeMarker 2.3.33.
The alphabetical list of built-ins:
abs, absolute_template_name, ancestors, api, 
boolean, byte, 
c, c_lower_case, c_upper_case, cap_first, capitalize, ceiling, children, chop_linebreak, chunk, cn, contains, counter, 
date, date_if_unknown, datetime, datetime_if_unknown, default, double, drop_while, 
ends_with, ensure_ends_with, ensure_starts_with, esc, eval, eval_json, exists, 
filter, first, float, floor, 
groups, 
has_api, has_content, has_next, html, 
if_exists, index, index_of, int, interpret, is_boolean, is_collection, is_collection_ex, is_date, is_date_like, is_date_only, is_datetime, is_directive, is_enumerable, is_even_item, is_first, is_hash, is_hash_ex, is_indexable, is_infinite, is_last, is_macro, is_markup_output, is_method, is_nan, is_node, is_number, is_odd_item, is_sequence, is_string, is_time, is_transform, is_unknown_date_like, iso, iso_h, iso_h_nz, iso_local, iso_local_h, iso_local_h_nz, iso_local_m, iso_local_m_nz, iso_local_ms, iso_local_ms_nz, iso_local_nz, iso_m, iso_m_nz, iso_ms, iso_ms_nz, iso_nz, iso_utc, iso_utc_fz, iso_utc_h, iso_utc_h_nz, iso_utc_m, iso_utc_m_nz, iso_utc_ms, iso_utc_ms_nz, iso_utc_nz, item_cycle, item_parity, item_parity_cap, 
j_string, join, js_string, json_string, 
keep_after, keep_after_last, keep_before, keep_before_last, keys, 
last, last_index_of, left_pad, length, long, lower_abc, lower_case, 
map, markup_string, matches, max, min, 
namespace, new, next_sibling, no_esc, node_name, node_namespace, node_type, number, number_to_date, number_to_datetime, number_to_time, 
parent, previous_sibling, 
remove_beginning, remove_ending, replace, reverse, right_pad, root, round, rtf, 
seq_contains, seq_index_of, seq_last_index_of, sequence, short, size, sort, sort_by, split, starts_with, string, substring, switch, 
take_while, then, time, time_if_unknown, trim, truncate, truncate_c, truncate_c_m, truncate_m, truncate_w, truncate_w_m, 
uncap_first, upper_abc, upper_case, url, url_path, 
values, 
web_safe, with_args, with_args_last, word_list, 
xhtml, xml
1<#-- Variables --> 
2<#assign specificationName          = 'ctn' /> 
3<#assign paramNameSpecificationName = cpSpecificationOptionsSearchFacetDisplayContext.getParameterName() /> 
4<#assign isDebug                    = false /> 
5<#assign showAllSpecificationsName  = false /> 
6<#assign staticHost                 = getCXConfig("ecom-static-files") /> 
7 
8<#-- ========================= --> 
9<#-- Functions freemaker       --> 
10<#-- ========================= --> 
11<#function getCXConfig clientExtensionName field="webApiUrl"> 
12    <#if !clientExtensionName?has_content><#return "" /></#if> 
13    <#local encoded = urlCodec.encodeURL(clientExtensionName) /> 
14    <#local items   = restClient.get("/c/customconfigs/?fields=clientExtensionConfig&filter=clientExtensionName eq '" + encoded + "'").items![] /> 
15    <#return items?has_content?then(items[0].clientExtensionConfig?eval[field]!"", "") /> 
16</#function> 
17 
18<#function getTaxonomyVocabularyId vocabularyName> 
19    <#local response = restClient.get("/headless-admin-taxonomy/v1.0/sites/" + groupId + "/taxonomy-vocabularies?filter=contains(name,'" + vocabularyName + "')&pageSize=1")!{} /> 
20    <#local items    = response.items![] /> 
21    <#return items?has_content?then(items[0].id, "") /> 
22</#function> 
23 
24<#function getTaxonomyCategoryMap vocabularyId pageSize=200> 
25    <#local response   = restClient.get("/headless-admin-taxonomy/v1.0/taxonomy-vocabularies/" + vocabularyId + "/taxonomy-categories?pageSize=" + pageSize)!{} /> 
26    <#local categoryMap = {} /> 
27    <#list response.items![] as cat> 
28        <#local categoryMap = categoryMap + {vocabularyId + "-" + cat.id: cat.name} /> 
29    </#list> 
30    <#return categoryMap /> 
31</#function> 
32 
33<#function getSpecOrganismosMap organismoMap aggResult> 
34    <#local specMap = {} /> 
35    <#if !aggResult?has_content || !organismoMap?has_content><#return specMap /></#if> 
36    <#list aggResult.getBuckets() as specBucket> 
37        <#local specKey      = specBucket.getKey() /> 
38        <#local organismoAgg = specBucket.getChildAggregationResult("organismos") /> 
39        <#local orgNames     = [] /> 
40        <#if organismoAgg?has_content> 
41            <#list organismoAgg.getBuckets() as orgBucket> 
42                <#local orgName  = organismoMap[orgBucket.getKey()]!"" /> 
43                <#if orgName?has_content> 
44                    <#local orgNames = orgNames + [orgName] /> 
45                </#if> 
46            </#list> 
47        </#if> 
48        <#if orgNames?has_content> 
49            <#local specMap = specMap + {specKey: orgNames} /> 
50        </#if> 
51    </#list> 
52    <#return specMap /> 
53</#function> 
54 
55<#function getAggregationResult specificationKey> 
56    <#if !specificationKey?has_content><#return "" /></#if> 
57 
58    <#local sharedSearchResponse = renderRequest.getAttribute("LIFERAY_SHARED_PortletSharedSearchResponse") /> 
59    <#if !sharedSearchResponse?has_content><#return "" /></#if> 
60 
61    <#local searchResponse = sharedSearchResponse.get() /> 
62    <#if !searchResponse?has_content><#return "" /></#if> 
63 
64    <#local esResponse = searchResponse.getSearchResponse() /> 
65    <#if !esResponse?has_content><#return "" /></#if> 
66 
67    <#local aggregationResult = esResponse.getAggregationResult(specificationKey + "_with_organismos") /> 
68    <#if !aggregationResult?has_content><#return "" /></#if> 
69 
70    <#return aggregationResult /> 
71</#function> 
72 
73 
74 
75<#if paramNameSpecificationName == specificationName || showAllSpecificationsName> 
76 
77    <#-- ========================= --> 
78    <#-- Datos                     --> 
79    <#-- ========================= --> 
80	<#assign organismoVocabId  = getTaxonomyVocabularyId("organismos") /> 
81	<#assign organismoMap      = getTaxonomyCategoryMap(organismoVocabId) /> 
82	<#assign aggResult         = getAggregationResult(paramNameSpecificationName)! /> 
83	<#assign specOrganismosMap = getSpecOrganismosMap(organismoMap, aggResult) /> 
84			 
85			BUCKET KEY TYPE: 
86${specBucket.getKey()?string} (${specBucket.getKey()?class}) 
87			 
88 
89    <#-- ========================= --> 
90    <#-- Debug                     --> 
91    <#-- ========================= --> 
92    <#if isDebug> 
93        <div style="background:#f0f0f0;padding:8px;margin-bottom:8px;font-size:11px;border:1px solid #ccc;"> 
94            <p><strong>paramName:</strong> ${paramNameSpecificationName}</p> 
95            <p><strong>organismoMap size:</strong> ${organismoMap?size}</p> 
96            <p><strong>specOrganismosMap size:</strong> ${specOrganismosMap?size}</p> 
97            <#list specOrganismosMap?keys as spec> 
98                <p>${spec}: ${specOrganismosMap[spec]?join(", ")}</p> 
99            </#list> 
100        </div> 
101    </#if> 
102 
103    <#-- Variables --> 
104    <#assign facetId    = "facet-" + paramNameSpecificationName + "-" + renderResponse.getNamespace() /> 
105    <#assign facetClass = "facet-" + paramNameSpecificationName + "-combo-search-wrapper" /> 
106 
107    <#-- ========================= --> 
108    <#-- TOM SELECT framework      --> 
109    <#-- ========================= --> 
110    <@liferay_util["html-top"] outputKey="tom-select"> 
111        <link href="${staticHost}/scripts/vendor/tom-select/tom-select.css" rel="stylesheet"> 
112        <script src="${staticHost}/scripts/vendor/tom-select/tom-select.complete.min.js"></script> 
113    </@> 
114 
115    <#-- ========================= --> 
116    <#-- CSS                       --> 
117    <#-- ========================= --> 
118    <style> 
119        #${facetId} { 
120            --facet-font-family: Inter; 
121            --facet-font-size: 14px; 
122            --facet-font-weight: 400; 
123            --facet-line-height: 18px; 
124            --facet-letter-spacing: 0.5px; 
125            --facet-color: #66757f; 
126
127        #${facetId}-select { 
128            appearance: none; 
129            -webkit-appearance: none; 
130            visibility: hidden; 
131            position: absolute; 
132
133        #${facetId} .ts-wrapper { 
134            width: 100%; 
135            margin-bottom: 16px; 
136            opacity: 0; 
137            transition: opacity 0.1s ease; 
138
139        #${facetId} .ts-wrapper .ts-control { 
140            padding: 15.5px 16px; 
141            font-family: var(--facet-font-family); 
142            font-size: var(--facet-font-size); 
143            font-weight: var(--facet-font-weight); 
144            line-height: var(--facet-line-height); 
145            letter-spacing: var(--facet-letter-spacing); 
146            color: var(--facet-color); 
147            text-align: left; 
148            height: 55px; 
149            width: 100%; 
150            border-radius: 4px; 
151            border: none; 
152            background-color: #F5F5F5; 
153            background-image: url(/documents/d/global/ico-chevron-down-2); 
154            background-repeat: no-repeat; 
155            background-position: right 1rem center; 
156            background-size: 18px 10px; 
157            box-shadow: none; 
158            cursor: pointer; 
159            box-sizing: border-box; 
160
161        #${facetId} .ts-wrapper .ts-control:focus, 
162        #${facetId} .ts-wrapper .ts-control:focus-visible { 
163            background-image: url(/documents/d/global/ico-chevron-down-2); 
164            background-position: right 1rem center; 
165            background-size: 18px 10px; 
166            outline: none; 
167            box-shadow: none; 
168
169        #${facetId} .ts-wrapper .ts-control .item { 
170            padding-right: 0.75rem; 
171            overflow: hidden; 
172            text-overflow: ellipsis; 
173            max-width: calc(100% - 0.75rem); 
174
175        #${facetId} .ts-wrapper.single .ts-control::after { 
176            display: none; 
177
178        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input { 
179            font-family: var(--facet-font-family); 
180            font-size: var(--facet-font-size); 
181            font-weight: var(--facet-font-weight); 
182            line-height: var(--facet-line-height); 
183            letter-spacing: var(--facet-letter-spacing); 
184            color: var(--facet-color); 
185            padding: 8px 16px; 
186            border: none; 
187            border-bottom: 1px solid #d9d9d9; 
188            background-color: #fff; 
189            width: 100%; 
190            box-sizing: border-box; 
191
192        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input:focus { 
193            outline: none; 
194            box-shadow: none; 
195
196        #${facetId} .ts-dropdown .ts-dropdown-content .option { 
197            font-family: var(--facet-font-family); 
198            font-size: var(--facet-font-size); 
199            font-weight: var(--facet-font-weight); 
200            line-height: var(--facet-line-height); 
201            letter-spacing: var(--facet-letter-spacing); 
202            color: var(--facet-color); 
203            padding: 8px 16px; 
204
205        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover, 
206        #${facetId} .ts-dropdown .ts-dropdown-content .option.active { 
207            background-color: #6a9bd3; 
208            color: #fff; 
209
210        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover .badge, 
211        #${facetId} .ts-dropdown .ts-dropdown-content .option.active .badge { 
212            background-color: #fff; 
213            color: #3a6a9b; 
214
215    </style> 
216 
217    <div class="checks-container ${facetClass}" id="${facetId}"> 
218        <div class="d-flex flex-column w-100"> 
219            <label class="panel-title mb-2" for="${facetId}-select"> 
220                ${languageUtil.get(locale, "norma." + paramNameSpecificationName)} 
221                <#if isDebug> 
222                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
223                        (total options: ${entries?size}) 
224                    </p> 
225                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
226                        (facetId: ${facetId}) 
227                    </p> 
228                </#if> 
229            </label> 
230 
231            <#-- ========================= --> 
232            <#-- SELECT UI                 --> 
233            <#-- ========================= --> 
234             
235 
236             
237            <select id="${facetId}-select" data-parameter-name="${paramNameSpecificationName}"> 
238                <option value="">${languageUtil.get(locale, "search.cualquiera")}</option> 
239                <#list entries?sort_by("displayName") as entry> 
240                    <#assign specName = entry.getDisplayName() /> 
241                    <#assign orgNames = specOrganismosMap[specName]![] /> 
242									 
243							 
244									 
245                    <option value="${htmlUtil.escape(specName)}" 
246                        <#if entry.isSelected()>selected</#if> 
247                        data-organismos="${htmlUtil.escape(orgNames?join(","))}"> 
248                        ${htmlUtil.escape(specName)} (${entry.getFrequency()}) 
249                    </option> 
250                </#list> 
251            </select> 
252        </div> 
253    </div> 
254 
255    <#-- ========================= --> 
256    <#-- SCRIPT                    --> 
257    <#-- ========================= --> 
258    <script> 
259        (function () { 
260            var FACET_ID   = '${facetId}'; 
261            var PARAM_NAME = '${paramNameSpecificationName}'; 
262 
263            function applyUrlFilter(value) { 
264                var url = new URL(window.location.href); 
265                if (value) { 
266                    url.searchParams.set(PARAM_NAME, value); 
267                } else { 
268                    url.searchParams.delete(PARAM_NAME); 
269
270                window.location.href = url.toString(); 
271
272 
273            function initFacet() { 
274                var select = document.getElementById(FACET_ID + '-select'); 
275                if (!select) return; 
276                if (select.tomselect) select.tomselect.destroy(); 
277                if (select.dataset.bound === 'true') return; 
278                select.dataset.bound = 'true'; 
279 
280                new TomSelect(select, { 
281                    allowEmptyOption: true, 
282                    maxItems: 1, 
283                    create: false, 
284                    render: { 
285                        option: function(data, escape) { 
286                            var organismos = data.$option ? data.$option.getAttribute('data-organismos') : ''; 
287                            var badges = ''; 
288                            if (organismos) { 
289                                organismos.split(',').forEach(function(org) { 
290                                    badges += '<span class="badge badge-secondary mr-1">' + escape(org.trim()) + '</span>'; 
291                                }); 
292
293                            return '<div class="option py-1">' + escape(data.text) + '<div class="mt-1">' + badges + '</div></div>'; 
294                        }, 
295                        no_results: function(data, escape) { 
296                            return '<div class="no-results">${languageUtil.get(locale, "occurrence-not-found")}</div>'; 
297
298                    }, 
299                    plugins: { 
300                        dropdown_input: {} 
301                    }, 
302                    onDelete: function(value) { 
303                        this.isDelete = true; 
304                    }, 
305                    onChange: function(value) { 
306                        if (value) { 
307                            this.lastValidValue = value; 
308                            applyUrlFilter(value); 
309                            return; 
310
311                        this.lastValidValue = ''; 
312                        applyUrlFilter(''); 
313                    }, 
314                    onInitialize: function() { 
315                        this.lastValidValue = this.getValue() || ''; 
316                        this.isDelete = false; 
317                        var wrapper = document.querySelector('#' + FACET_ID + ' .ts-wrapper'); 
318                        if (wrapper) wrapper.style.opacity = '1'; 
319
320                }); 
321
322 
323            if (document.readyState === 'loading') { 
324                document.addEventListener('DOMContentLoaded', initFacet); 
325            } else { 
326                initFacet(); 
327
328        })(); 
329    </script> 
330 
331</#if> 
Se ha producido un error al procesar la plantilla.
The following has evaluated to null or missing:
==> esResponse.getAggregationResult(specificationKey + "_with_organismos")  [in template "34352066712900#33336#362204" at line 67, column 33]

----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #local aggregationResult = esResponse...  [in template "34352066712900#33336#362204" in function "getAggregationResult" at line 67, column 5]
----
1<#-- Variables --> 
2<#assign specificationName          = 'ics' /> 
3<#assign paramNameSpecificationName = cpSpecificationOptionsSearchFacetDisplayContext.getParameterName() /> 
4<#assign isDebug                    = false /> 
5<#assign showAllSpecificationsName  = false /> 
6<#assign staticHost                 = getCXConfig("ecom-static-files") /> 
7 
8<#-- ========================= --> 
9<#-- Functions freemaker       --> 
10<#-- ========================= --> 
11<#function getCXConfig clientExtensionName field="webApiUrl"> 
12    <#if !clientExtensionName?has_content><#return "" /></#if> 
13    <#local encoded = urlCodec.encodeURL(clientExtensionName) /> 
14    <#local items   = restClient.get("/c/customconfigs/?fields=clientExtensionConfig&filter=clientExtensionName eq '" + encoded + "'").items![] /> 
15    <#return items?has_content?then(items[0].clientExtensionConfig?eval[field]!"", "") /> 
16</#function> 
17 
18<#function getTaxonomyVocabularyId vocabularyName> 
19    <#local response = restClient.get("/headless-admin-taxonomy/v1.0/sites/" + groupId + "/taxonomy-vocabularies?filter=contains(name,'" + vocabularyName + "')&pageSize=1")!{} /> 
20    <#local items    = response.items![] /> 
21    <#return items?has_content?then(items[0].id, "") /> 
22</#function> 
23 
24<#function getTaxonomyCategoryMap vocabularyId pageSize=200> 
25    <#local response   = restClient.get("/headless-admin-taxonomy/v1.0/taxonomy-vocabularies/" + vocabularyId + "/taxonomy-categories?pageSize=" + pageSize)!{} /> 
26    <#local categoryMap = {} /> 
27    <#list response.items![] as cat> 
28        <#local categoryMap = categoryMap + {vocabularyId + "-" + cat.id: cat.name} /> 
29    </#list> 
30    <#return categoryMap /> 
31</#function> 
32 
33<#function getSpecOrganismosMap organismoMap aggResult> 
34    <#local specMap = {} /> 
35    <#if !aggResult?has_content || !organismoMap?has_content><#return specMap /></#if> 
36    <#list aggResult.getBuckets() as specBucket> 
37        <#local specKey      = specBucket.getKey() /> 
38        <#local organismoAgg = specBucket.getChildAggregationResult("organismos") /> 
39        <#local orgNames     = [] /> 
40        <#if organismoAgg?has_content> 
41            <#list organismoAgg.getBuckets() as orgBucket> 
42                <#local orgName  = organismoMap[orgBucket.getKey()]!"" /> 
43                <#if orgName?has_content> 
44                    <#local orgNames = orgNames + [orgName] /> 
45                </#if> 
46            </#list> 
47        </#if> 
48        <#if orgNames?has_content> 
49            <#local specMap = specMap + {specKey: orgNames} /> 
50        </#if> 
51    </#list> 
52    <#return specMap /> 
53</#function> 
54 
55<#function getAggregationResult specificationKey> 
56    <#if !specificationKey?has_content><#return "" /></#if> 
57 
58    <#local sharedSearchResponse = renderRequest.getAttribute("LIFERAY_SHARED_PortletSharedSearchResponse") /> 
59    <#if !sharedSearchResponse?has_content><#return "" /></#if> 
60 
61    <#local searchResponse = sharedSearchResponse.get() /> 
62    <#if !searchResponse?has_content><#return "" /></#if> 
63 
64    <#local esResponse = searchResponse.getSearchResponse() /> 
65    <#if !esResponse?has_content><#return "" /></#if> 
66 
67    <#local aggregationResult = esResponse.getAggregationResult(specificationKey + "_with_organismos") /> 
68    <#if !aggregationResult?has_content><#return "" /></#if> 
69 
70    <#return aggregationResult /> 
71</#function> 
72 
73 
74 
75 
76<#if paramNameSpecificationName == specificationName || showAllSpecificationsName> 
77 
78    <#-- ========================= --> 
79    <#-- Datos                     --> 
80    <#-- ========================= --> 
81	<#assign organismoVocabId  = getTaxonomyVocabularyId("organismos") /> 
82	<#assign organismoMap      = getTaxonomyCategoryMap(organismoVocabId) /> 
83	<#assign aggResult         = getAggregationResult(paramNameSpecificationName)! /> 
84	<#assign specOrganismosMap = getSpecOrganismosMap(organismoMap, aggResult) /> 
85 
86    <#-- ========================= --> 
87    <#-- Debug                     --> 
88    <#-- ========================= --> 
89    <#if isDebug> 
90        <div style="background:#f0f0f0;padding:8px;margin-bottom:8px;font-size:11px;border:1px solid #ccc;"> 
91            <p><strong>paramName:</strong> ${paramNameSpecificationName}</p> 
92            <p><strong>organismoMap size:</strong> ${organismoMap?size}</p> 
93            <p><strong>specOrganismosMap size:</strong> ${specOrganismosMap?size}</p> 
94            <#list specOrganismosMap?keys as spec> 
95                <p>${spec}: ${specOrganismosMap[spec]?join(", ")}</p> 
96            </#list> 
97        </div> 
98    </#if> 
99 
100    <#-- Variables --> 
101    <#assign facetId    = "facet-" + paramNameSpecificationName + "-" + renderResponse.getNamespace() /> 
102    <#assign facetClass = "facet-" + paramNameSpecificationName + "-combo-search-wrapper" /> 
103 
104    <#-- ========================= --> 
105    <#-- TOM SELECT framework      --> 
106    <#-- ========================= --> 
107    <@liferay_util["html-top"] outputKey="tom-select"> 
108        <link href="${staticHost}/scripts/vendor/tom-select/tom-select.css" rel="stylesheet"> 
109        <script src="${staticHost}/scripts/vendor/tom-select/tom-select.complete.min.js"></script> 
110    </@> 
111 
112    <#-- ========================= --> 
113    <#-- CSS                       --> 
114    <#-- ========================= --> 
115    <style> 
116        #${facetId} { 
117            --facet-font-family: Inter; 
118            --facet-font-size: 14px; 
119            --facet-font-weight: 400; 
120            --facet-line-height: 18px; 
121            --facet-letter-spacing: 0.5px; 
122            --facet-color: #66757f; 
123
124        #${facetId}-select { 
125            appearance: none; 
126            -webkit-appearance: none; 
127            visibility: hidden; 
128            position: absolute; 
129
130        #${facetId} .ts-wrapper { 
131            width: 100%; 
132            margin-bottom: 16px; 
133            opacity: 0; 
134            transition: opacity 0.1s ease; 
135
136        #${facetId} .ts-wrapper .ts-control { 
137            padding: 15.5px 16px; 
138            font-family: var(--facet-font-family); 
139            font-size: var(--facet-font-size); 
140            font-weight: var(--facet-font-weight); 
141            line-height: var(--facet-line-height); 
142            letter-spacing: var(--facet-letter-spacing); 
143            color: var(--facet-color); 
144            text-align: left; 
145            height: 55px; 
146            width: 100%; 
147            border-radius: 4px; 
148            border: none; 
149            background-color: #F5F5F5; 
150            background-image: url(/documents/d/global/ico-chevron-down-2); 
151            background-repeat: no-repeat; 
152            background-position: right 1rem center; 
153            background-size: 18px 10px; 
154            box-shadow: none; 
155            cursor: pointer; 
156            box-sizing: border-box; 
157
158        #${facetId} .ts-wrapper .ts-control:focus, 
159        #${facetId} .ts-wrapper .ts-control:focus-visible { 
160            background-image: url(/documents/d/global/ico-chevron-down-2); 
161            background-position: right 1rem center; 
162            background-size: 18px 10px; 
163            outline: none; 
164            box-shadow: none; 
165
166        #${facetId} .ts-wrapper .ts-control .item { 
167            padding-right: 0.75rem; 
168            overflow: hidden; 
169            text-overflow: ellipsis; 
170            max-width: calc(100% - 0.75rem); 
171
172        #${facetId} .ts-wrapper.single .ts-control::after { 
173            display: none; 
174
175        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input { 
176            font-family: var(--facet-font-family); 
177            font-size: var(--facet-font-size); 
178            font-weight: var(--facet-font-weight); 
179            line-height: var(--facet-line-height); 
180            letter-spacing: var(--facet-letter-spacing); 
181            color: var(--facet-color); 
182            padding: 8px 16px; 
183            border: none; 
184            border-bottom: 1px solid #d9d9d9; 
185            background-color: #fff; 
186            width: 100%; 
187            box-sizing: border-box; 
188
189        #${facetId} .ts-dropdown .dropdown-input-wrap .dropdown-input:focus { 
190            outline: none; 
191            box-shadow: none; 
192
193        #${facetId} .ts-dropdown .ts-dropdown-content .option { 
194            font-family: var(--facet-font-family); 
195            font-size: var(--facet-font-size); 
196            font-weight: var(--facet-font-weight); 
197            line-height: var(--facet-line-height); 
198            letter-spacing: var(--facet-letter-spacing); 
199            color: var(--facet-color); 
200            padding: 8px 16px; 
201
202        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover, 
203        #${facetId} .ts-dropdown .ts-dropdown-content .option.active { 
204            background-color: #6a9bd3; 
205            color: #fff; 
206
207        #${facetId} .ts-dropdown .ts-dropdown-content .option:hover .badge, 
208        #${facetId} .ts-dropdown .ts-dropdown-content .option.active .badge { 
209            background-color: #fff; 
210            color: #3a6a9b; 
211
212    </style> 
213 
214    <div class="checks-container ${facetClass}" id="${facetId}"> 
215        <div class="d-flex flex-column w-100"> 
216            <label class="panel-title mb-2" for="${facetId}-select"> 
217                ${languageUtil.get(locale, "norma." + paramNameSpecificationName)} 
218                <#if isDebug> 
219                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
220                        (total options: ${entries?size}) 
221                    </p> 
222                    <p style="font-size:11px;color:#999;font-weight:normal;"> 
223                        (facetId: ${facetId}) 
224                    </p> 
225                </#if> 
226            </label> 
227 
228            <#-- ========================= --> 
229            <#-- SELECT UI                 --> 
230            <#-- ========================= --> 
231            <select id="${facetId}-select" data-parameter-name="${paramNameSpecificationName}"> 
232                <option value="">${languageUtil.get(locale, "search.cualquiera")}</option> 
233                <#list entries?sort_by("displayName") as entry> 
234                    <#assign specName = entry.getDisplayName() /> 
235                    <#assign orgNames = specOrganismosMap[specName]![] /> 
236                    <option value="${htmlUtil.escape(specName)}" 
237                        <#if entry.isSelected()>selected</#if> 
238                        data-organismos="${htmlUtil.escape(orgNames?join(","))}"> 
239                        ${htmlUtil.escape(specName)} (${entry.getFrequency()}) 
240                    </option> 
241                </#list> 
242            </select> 
243        </div> 
244    </div> 
245 
246    <#-- ========================= --> 
247    <#-- SCRIPT                    --> 
248    <#-- ========================= --> 
249    <script> 
250        (function () { 
251            var FACET_ID   = '${facetId}'; 
252            var PARAM_NAME = '${paramNameSpecificationName}'; 
253 
254            function applyUrlFilter(value) { 
255                var url = new URL(window.location.href); 
256                if (value) { 
257                    url.searchParams.set(PARAM_NAME, value); 
258                } else { 
259                    url.searchParams.delete(PARAM_NAME); 
260
261                window.location.href = url.toString(); 
262
263 
264            function initFacet() { 
265                var select = document.getElementById(FACET_ID + '-select'); 
266                if (!select) return; 
267                if (select.tomselect) select.tomselect.destroy(); 
268                if (select.dataset.bound === 'true') return; 
269                select.dataset.bound = 'true'; 
270 
271                new TomSelect(select, { 
272                    allowEmptyOption: true, 
273                    maxItems: 1, 
274                    create: false, 
275                    render: { 
276                        option: function(data, escape) { 
277                            var organismos = data.$option ? data.$option.getAttribute('data-organismos') : ''; 
278                            var badges = ''; 
279                            if (organismos) { 
280                                organismos.split(',').forEach(function(org) { 
281                                    badges += '<span class="badge badge-secondary mr-1">' + escape(org.trim()) + '</span>'; 
282                                }); 
283
284                            return '<div class="option py-1">' + escape(data.text) + '<div class="mt-1">' + badges + '</div></div>'; 
285                        }, 
286                        no_results: function(data, escape) { 
287                            return '<div class="no-results">${languageUtil.get(locale, "occurrence-not-found")}</div>'; 
288
289                    }, 
290                    plugins: { 
291                        dropdown_input: {} 
292                    }, 
293                    onDelete: function(value) { 
294                        this.isDelete = true; 
295                    }, 
296                    onChange: function(value) { 
297                        if (value) { 
298                            this.lastValidValue = value; 
299                            applyUrlFilter(value); 
300                            return; 
301
302                        this.lastValidValue = ''; 
303                        applyUrlFilter(''); 
304                    }, 
305                    onInitialize: function() { 
306                        this.lastValidValue = this.getValue() || ''; 
307                        this.isDelete = false; 
308                        var wrapper = document.querySelector('#' + FACET_ID + ' .ts-wrapper'); 
309                        if (wrapper) wrapper.style.opacity = '1'; 
310
311                }); 
312
313 
314            if (document.readyState === 'loading') { 
315                document.addEventListener('DOMContentLoaded', initFacet); 
316            } else { 
317                initFacet(); 
318
319        })(); 
320    </script> 
321 
322</#if> 
(1251)
(1213)
(0)
ASTM

ASTM C61/C61M - 00(2020)

Anulada
2020-06-01
Standard Specification for Gypsum Keene's Cement
ASTM

ASTM D8342/D8342M - 21

Anulada
2021-06-01
Standard Test Method for Measuring the Probability of a Full Length Burn on a Cannabis/Hemp Pre-roll
ASTM

ASTM C666/C666M - 15

Anulada
2015-02-01
Standard Test Method for Resistance of Concrete to Rapid Freezing and Thawing (Withdrawn 2024)
ASTM

ASTM E575 - 05(2018)

Anulada
2018-07-01
Standard Practice for Reporting Data from Structural Tests of Building Constructions, Elements, Connections, and Assemblies
ASTM

ASTM D3878 - 23

Anulada
2023-05-01
Standard Terminology for Composite Materials
ASTM

ASTM D6645 - 18

Anulada
2018-10-01
Standard Test Method for Methyl (Comonomer) Content in Polyethylene by Infrared Spectrophotometry
ASTM

ASTM B322 - 99(2020)e1

Anulada
2020-11-01
Standard Guide for Cleaning Metals Prior to Electroplating
ASTM

ASTM B242 - 99(2020)

Anulada
2020-11-01
Standard Guide for Preparation of High-Carbon Steel for Electroplating