Ricerca - Comune di Carmiano
Si è verificato un errore nell'elaborarazione del modello.
The following has evaluated to null or missing: ==> ricerca_components["ricerca-pagination"] [in template "281621#281649#297134" at line 219, column 63] ---- Tip: It's the final [] step that caused this error, not those before it. ---- 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: @ricerca_components["ricerca-paginati... [in template "281621#281649#297134" at line 219, column 61] ----
1<#-- instance id -->
2<#assign instanceId = themeDisplay.getPortletDisplay().getId()?keep_after("INSTANCE_") />
3
4<#-- Ricavo servizi utili in seguito -->
5<#-- Servizio per i layout di pagina -->
6<#assign layoutLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService") />
7<#-- Servizio utile per ricavare i documenti della DM -->
8<#assign dlFileEntryLocalService = serviceLocator.findService('com.liferay.document.library.kernel.service.DLFileEntryLocalService') />
9
10<#-- Etichette -->
11<#assign label_elenco = languageUtil.get(locale, "label_elenco") />
12<#assign label_leggi_piu = languageUtil.get(locale, "label_leggi_piu") />
13<#assign label_ordinamento = languageUtil.get(locale, "label_ordinamento") />
14<#assign label_numero_risultati = languageUtil.get(locale, "label_numero_risultati") />
15<#assign label_ricerca_testo = languageUtil.get(locale, "label_ricerca_testo") />
16<#assign label_placeholder_ricerca_testo = languageUtil.get(locale, "label_placeholder_ricerca_testo") />
17<#assign label_filtra = languageUtil.get(locale, "label_filtra") />
18<#assign label_categorie = languageUtil.get(locale, "label_categorie") />
19<#assign label_categorie_tutte = languageUtil.get(locale, "label_categorie_tutte") />
20<#assign label_button_cerca = languageUtil.get(locale, "label_button_cerca") />
21<#assign label_dal = languageUtil.get(locale, "label_dal") />
22<#assign label_al = languageUtil.get(locale, "label_al") />
23
24<#-- Inclusione widget template con macros e relativi servizi -->
25<#include "${templatesPath}/RICERCA_COMMON_MACROS" />
26
27<#-- html -->
28<div class="col-12 mt-5">
29 <div class="search-template search-template-full">
30 <div class="container">
31
32 <div class="row">
33 <div class="col-12">
34 <h2 class="mb-4">${themeDisplay.getLayout().getName(locale)}</h2>
35 </div>
36 </div>
37
38 <div class="row">
39 <#if entries?has_content>
40 <#list entries as curEntry>
41 <#-- colonna elenco risultati -->
42 <div class="order-last order-sm-last order-md-last order-lg-first col-lg-9">
43
44 <#-- barra ordinamento -->
45 <div class="row">
46 <div class="col-12">
47 <div class="d-flex justify-content-between align-items-center">
48 <div></div>
49 <#-- ordinamento: ricordarsi del campo hidden che deve stare nel form -->
50 <div class="form-group">
51 <label for="orderBySelect" class="sr-only">${label_ordinamento}</label>
52 <select class="form-control form-control-orderBy" id="orderBySelect" name="orderBySelect" onchange="changeOrder(this);">
53 <#list enabledSortFieldsAsKeyValue?keys as prop>
54 <#assign isSelected = "" />
55 <#if searchInput.orderBy?has_content>
56 <#if searchInput.orderBy?string == prop>
57 <#assign isSelected = "selected" />
58 </#if>
59 </#if>
60 <option value="${prop}" ${isSelected}>${enabledSortFieldsAsKeyValue[prop]}</option>
61 </#list>
62 </select>
63 </div>
64 </div>
65 </div>
66 </div>
67
68 <#-- numero risultati -->
69 <div class="row">
70 <div class="col-12">
71 <p class="text-right">${label_numero_risultati}: <strong>${curEntry.paging.totalRecordsCount}</strong></p>
72 </div>
73 </div>
74
75 <#-- elenco risultati -->
76 <#if curEntry.records?has_content>
77 <div class="row">
78 <#list curEntry.records as record>
79 <#if record.metadata?has_content>
80
81 <#-- titolo di struttura: sempre presente e obbligatorio nella maggior parte dei casi -->
82 <#assign titoloScheda = "" />
83 <#if record.metadata.title?has_content && record.metadata.title.value?has_content>
84 <#assign titoloScheda = record.metadata.title.value />
85 </#if>
86 <#-- caso di personale politico e/o amministrativo: non esiste un title ma un name e un surname -->
87 <#if (record.metadata.name?has_content && record.metadata.name.value?has_content) && (record.metadata.surname?has_content && record.metadata.surname.value?has_content)>
88 <#assign titoloScheda = record.metadata.name.value + record.metadata.surname.value />
89 </#if>
90
91 <div class="col-12 col-lg-6">
92 <#-- start card -->
93 <article class="card-wrapper card-space">
94 <div class="card card-bg card-img rounded shadow">
95 <#if record.structureName != "Documento albo pretorio">
96 <#-- immagine principale + data inizio evento -->
97 <#if (record.metadata.image?has_content && record.metadata.image.value?has_content && record.metadata.image.value != "{}") || (record.metadata.startDate?has_content && record.metadata.startDate.value?has_content)>
98 <div class="img-responsive-wrapper">
99 <div class="img-responsive img-responsive-panoramic">
100 <#-- immagine -->
101 <#if record.metadata.image?has_content && record.metadata.image.value?has_content>
102 <#attempt>
103 <#assign imageJson = jsonFactoryUtil.createJSONObject(record.metadata.image.value) />
104 <#if imageJson?? && imageJson?has_content && imageJson.uuid?? && imageJson.groupId??>
105 <#assign imageDLFileEntry = dlFileEntryLocalService.getFileEntryByUuidAndGroupId(imageJson.uuid,imageJson.groupId?number) />
106 <#assign imageUrl = "/documents/"+groupId+"/"+imageDLFileEntry.getFolderId()+"/"+imageDLFileEntry.getFileName()+"/"+imageJson.uuid />
107 <figure class="img-wrapper">
108 <img src="${imageUrl}" alt="${htmlUtil.escapeAttribute(titoloScheda)}">
109 </figure>
110 </#if>
111 <#recover>
112 <#-- in caso di problemi sull'immagine, non visualizzo nulla -->
113 </#attempt>
114 </#if>
115 <#-- data inizio evento -->
116 <#if record.metadata.startDate?has_content && record.metadata.startDate.value?has_content>
117 <#assign eventoDate_DateObj = dateUtil.parseDate("yyyy-MM-dd", record.metadata.startDate.value, locale)>
118 <div class="card-calendar d-flex flex-column justify-content-center">
119 <span class="card-date">${dateUtil.getDate(eventoDate_DateObj, "dd", locale)}</span>
120 <span class="card-day">${dateUtil.getDate(eventoDate_DateObj, "MMM", locale)}</span>
121 </div>
122 </#if>
123 </div>
124 </div>
125 </#if>
126 </#if>
127
128 <div class="card-body p-4">
129 <#-- categoria + data (caso di novita) -->
130 <div class="category-top">
131 <svg class="icon icon-sm">
132 <use href="/o/portale-istituzionale-theme/svg/sprite.svg#it-file"></use>
133 </svg>
134 <span class="category">${record.structureName}</span>
135
136 <#if record.metadata.date?has_content && record.metadata.date.value?has_content>
137 <#assign date_DateObj = dateUtil.parseDate("yyyy-MM-dd", record.metadata.date.value, locale)>
138 <span class="data">${dateUtil.getDate(date_DateObj, "dd MMM yyyy", locale)}</span>
139 </#if>
140 </div>
141
142 <#-- titolo di struttura: sempre presente e obbligatorio nella maggior parte dei casi -->
143 <#if record.metadata.title?has_content && record.metadata.title.value?has_content>
144 <#if record.detailUrl?has_content>
145 <h3 class="card-title check-highlight mb-2">
146 <a href="${record.detailUrl}" title="${label_leggi_piu}: ${htmlUtil.escapeAttribute(record.metadata.title.value)}">${record.metadata.title.value}</a>
147 </h3>
148 <#else>
149 <h3 class="card-title check-highlight mb-2">
150 ${record.metadata.title.value?trim}
151 </h3>
152 </#if>
153 </#if>
154 <#-- caso di personale politico e/o amministrativo: non esiste un title ma un name e un surname -->
155 <#if (record.metadata.name?has_content && record.metadata.name.value?has_content) && (record.metadata.surname?has_content && record.metadata.surname.value?has_content)>
156 <#if record.detailUrl?has_content>
157 <h3 class="card-title check-highlight mb-2">
158 <a href="${record.detailUrl}" title="${label_leggi_piu}: ${htmlUtil.escapeAttribute(record.metadata.name.value)} ${htmlUtil.escapeAttribute(record.metadata.surname.value)}">${record.metadata.name.value} ${record.metadata.surname.value}</a>
159 </h3>
160 <#else>
161 <h3 class="card-title check-highlight mb-2">
162 ${record.metadata.name.value} ${record.metadata.surname.value}
163 </h3>
164 </#if>
165 </#if>
166
167 <#-- abstract -->
168 <#if record.metadata.abstract?has_content && record.metadata.abstract.value?has_content>
169 <div class="card-text check-highlight mb-2">${record.metadata.abstract.value}</div>
170 </#if>
171
172 <#-- metodo tramite record (ricerca) -->
173 <#-- recupero l'elenco delle categorie dall'oggetto record anzichè passando dall'articolo -->
174 <#if record.categories?? && (record.categories?size > 0)>
175 <#list record.categories as key, value>
176 <#if (key?? && key != 0) && (value?? && value != "" && value?substring(0,1) != PREFIX_SERVICE_CATEGORY)>
177 <div class="chip chip-simple chip-primary chip-no-link">
178 <span class="chip-label">${value}</span>
179 </div>
180 </#if>
181 </#list>
182 </#if>
183
184 <#-- categorie: metodo tramite api - COMMENTATO -->
185 <#--
186 <#assign categorie = []>
187 <#assign categorie = getListCategoryByArticlePrimKey(record.entryClassPk) />
188 <#if categorie?? && (categorie?size > 0)>
189 <#list categorie as cur_cat>
190 <#if validator.isNotNull(cur_cat) && cur_cat != "">
191 <div class="chip chip-simple chip-primary chip-no-link">
192 <span class="chip-label">${cur_cat.getTitle(locale)}</span>
193 </div>
194 </#if>
195 </#list>
196 </#if>
197 -->
198
199 <#-- read-more link -->
200 <a class="read-more" href="${record.detailUrl}" title="${label_leggi_piu}: ${htmlUtil.escapeAttribute(titoloScheda)}">
201 <span class="text">${label_leggi_piu}</span>
202 <svg class="icon">
203 <use xlink:href="/o/portale-istituzionale-theme/svg/sprite.svg#it-arrow-right"></use>
204 </svg>
205 </a>
206
207 </div>
208 </div>
209 </article>
210 </div>
211 </#if>
212 </#list>
213 </div>
214 </#if>
215
216 <#-- paginazione mediante taglib-->
217 <div class="row">
218 <div class="col-12 text-center">
219 <@ricerca_components["ricerca-pagination"]
220 currentPage=curEntry.paging.page?number
221 totalPages=curEntry.paging.totalPagesCount?number
222 paginationUrl="${portletURL}"></@>
223 </div>
224 </div>
225 </div>
226
227 <#-- colonna form ricerca: dopo breakpoint lg viene visualizzata come prima colonna -->
228 <div class="order-first order-sm-first corder-md-first order-lg-last col-lg-3">
229
230 <#-- form ricerca -->
231 <@ricerca_components["ricerca-form"] searchUrl="${searchUrl}" method="get" id="search-full-form">
232
233 <#-- campo hidden per ordinamento -->
234 <input type="hidden" value="${searchInput.orderBy}" name="orderBy" id="orderByInputHidden">
235
236 <#-- campo di ricerca testuale -->
237 <div class="form-group">
238 <label for="input-ricerca-q" class="sr-only">${label_ricerca_testo}</label>
239 <@ricerca_components["ricerca-input-q"] cssClass="form-control form-control-search-rounded-input"
240 value="${searchInput.q}"
241 placeholder="${label_placeholder_ricerca_testo}">
242 </@>
243 </div>
244
245 <#-- inizio collapse che racchiude tutti i filtri: poichè ci sono solo categorie, il controllo è unico a monte di tutto -->
246 <#-- leggo valore impostato a livello di configurazione sulla ricerca per categorie -->
247 <#if ((ricercaPortletConfig.configSearchByCategories == true) && (categoriesAsKeyValue?size > 0)) || (ricercaPortletConfig.configShowSearchByDates == true)>
248 <a class="simple-collapse-button" data-toggle="collapse" href="#searchFilters" role="button" aria-expanded="true" aria-controls="searchFilters">
249 <strong>${label_filtra}</strong>
250 </a>
251 <div class="collapse show" id="searchFilters">
252
253 <#-- ricerca per categorie -->
254 <#if (ricercaPortletConfig.configSearchByCategories == true) && (categoriesAsKeyValue?size > 0)>
255 <div class="form-group">
256 <#if ricercaPortletConfig.configSelectMultipleCategories == true>
257
258 <#-- caso di elenco di categorie e sottocategorie indentate con nome vocabolario - sfrutta macro presente nel template RICERCA_COMMON_MACROS -->
259 <#if ricercaPortletConfig.configAllowVocabulariesLabelFilter == true>
260 <strong>${label_categorie}</strong>
261 <ul class="list-unstyled ml-2">
262 <#list hierarchicalVocabulariesOptions as voKey, voValue>
263 <li>
264 <strong>${voValue.value.label}</strong>
265 <@getAllCategories voValue.children />
266 </li>
267 </#list>
268 </ul>
269 <#else>
270 <#-- caso di elenco categorie e sottocategorie indentate ma senza nome vacabolario - sfrutta macro presente nel template RICERCA_COMMON_MACROS -->
271 <#if hierarchicalCategoriesOptions?? && hierarchicalCategoriesOptions?has_content>
272 <strong>${label_categorie}</strong>
273 <@getAllCategories hierarchicalCategoriesOptions />
274 </#if>
275 </#if>
276 <#else>
277 <#-- visualizzo una select singola -->
278 <label for="select-ricerca-categorie">${label_categorie}</label>
279 <select name="categoryIds" class="form-control" id="select-ricerca-categorie">
280 <#list categoriesAsKeyValue?keys as prop>
281 <#assign isSelected = "" />
282 <#if searchInput.categoryIds?has_content>
283 <#list searchInput.categoryIds as categoryId>
284 <#if categoryId?string == prop>
285 <#assign isSelected = "selected" />
286 </#if>
287 </#list>
288 </#if>
289 <option value="${prop}" ${isSelected}>${categoriesAsKeyValue[prop]}</option>
290 </#list>
291 </select>
292 </#if>
293 </div>
294 </#if>
295
296 <#-- ricerca per date -->
297 <#if ricercaPortletConfig.configShowSearchByDates == true>
298 <div class="datepicker-wrapper">
299 <div class="form-group mb-2">
300 <label for="input-dateFrom">${label_dal}</label>
301 <input type="text" class="form-control" name="dateFrom"
302 id="input-dateFrom" autocomplete="off"
303 placeholder="gg/mm/aaaa"
304 <#if searchInput.dateFrom?has_content>
305 value="${dateUtil.getDate(searchInput.dateFrom?date, "dd/MM/yyyy", locale)}"
306 </#if>
307 >
308 </div>
309 </div>
310 <div class="datepicker-wrapper">
311 <div class="form-group">
312 <label for="input-dateTo">${label_al}</label>
313 <input type="text" class="form-control" name="dateTo"
314 id="input-dateTo" autocomplete="off"
315 placeholder="gg/mm/aaaa"
316 <#if searchInput.dateTo?has_content>
317 value="${dateUtil.getDate(searchInput.dateTo?date, "dd/MM/yyyy", locale)}"
318 </#if>
319 >
320 </div>
321 </div>
322 </#if>
323
324 </div>
325 </#if>
326
327 <#-- pulsante di ricerca -->
328 <div class="row">
329 <div class="col-12 text-center mt-4 mb-4">
330 <button type="submit" class="btn btn-primary btn-block">${label_button_cerca}</button>
331 </div>
332 </div>
333 </@>
334 </div>
335 </#list>
336 </#if>
337 </div>
338
339 </div>
340 </div>
341</div>
342
343<script>
344 // funzione per cambiare ordinamento sull'onchange
345 function changeOrder(elem){
346 $("#orderByInputHidden").val($(elem).val());
347 $("#search-full-form").submit();
348 }
349
350 $(document).ready(function(){
351 // funzioni di inizializzazione per i datepicker della ricerca per date
352 var locale = themeDisplay.getLanguageId().substr(0, themeDisplay.getLanguageId().indexOf('_'));
353 $('#input-dateFrom').datepicker({
354 markup : 'bootstrap4',
355 theme : 'bootstrap',
356 inputFormat : [ 'dd/MM/yyyy' ],
357 outputFormat : 'dd/MM/yyyy',
358 locale: locale,
359 format: 'DD/MM/YYYY',
360 next: '#input-dateTo',
361 gainFocusOnConstruction: false
362 });
363 $('#input-dateTo').datepicker({
364 markup : 'bootstrap4',
365 theme : 'bootstrap',
366 inputFormat : [ 'dd/MM/yyyy' ],
367 outputFormat : 'dd/MM/yyyy',
368 locale: locale,
369 format: 'DD/MM/YYYY',
370 previous: '#input-dateFrom',
371 gainFocusOnConstruction: false
372 });
373 })
374</script>
Quanto sono chiare le informazioni su questa pagina?
Grazie, il tuo parere ci aiuterà a migliorare il servizio!