Nos actualités - Fonds Hôpitaux Vendée
Actualités par page
Une erreur s'est produite lors du traitement du modèle.
Java method "jdk.proxy3.$Proxy68.getAssetEntry(long)" threw an exception when invoked on jdk.proxy3.$Proxy68 object "com.liferay.asset.internal.service.AssetEntryLocalServiceWrapper@ae9adc"; see cause exception in the Java stack trace.
----
FTL stack trace ("~" means nesting-related):
- Failed at: #assign assetEntry = AssetEntryLocalS... [in template "20101#20127#ACTUALITE_PAGINATION" at line 79, column 17]
----
1<#--
2Add elements from the sidebar to define your template. Type "${" to use the
3autocomplete feature.
4-->
5
6<#--------------- Decodage des URL ---------------->
7<#assign replacements = {
8 "%e9": "é",
9 "%e8": "è",
10 "%e0": "à",
11 "%e7": "ç",
12 "%f9": "ù",
13 "%ee": "î",
14
15 "%E9": "é",
16 "%E8": "è",
17 "%E0": "à",
18 "%E7": "ç",
19 "%F9": "ù",
20 "%EE": "î"
21 }
22>
23<#function decodeUrl str>
24 <#assign url = str>
25 <#list replacements?keys as k>
26 <#assign url = url?replace(k, replacements[k])>
27 </#list>
28 <#return url>
29</#function>
30<#------------------------------------------------------>
31
32<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
33<#assign AssetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService")>
34<#assign DDMStructureLocalService = serviceLocator.findService("com.liferay.dynamic.data.mapping.service.DDMStructureLocalService")>
35<#assign classNameLocalServiceUtil = staticUtil["com.liferay.portal.kernel.service.ClassNameLocalServiceUtil"]>
36<#assign assetEntryQuery = objectUtil("com.liferay.asset.kernel.service.persistence.AssetEntryQuery")>
37
38<#assign structureClassName = classNameLocalServiceUtil.getClassName("com.liferay.journal.model.JournalArticle")>
39<#assign structureClassNameId= structureClassName.getClassNameId()?number>
40<#assign structure = DDMStructureLocalService.getStructure(themeDisplay.getCompanyGroupId(), structureClassNameId, "ACTUALITE")![] >
41
42<#-- Récupération de l'URL complete -->
43<#assign currentURL = request.getAttribute('CURRENT_URL') >
44<#assign currentURL = decodeUrl(currentURL) >
45
46<#-- setting date_format = "MM/yyy" -->
47<#-- recuperation des parametres dans l'URL : periode et page -->
48<#assign periodeSelect = request.getParameter("periodeSelect")!0>
49<#assign periodeSelect = periodeSelect?string>
50<#-- Nb d'articles par page -->
51<#assign pageSize = 9>
52<#if (ItemParPage.getData())??>
53 <#assign pageSize = ItemParPage.getData()?number>
54</#if>
55
56<#-- Back Office URL -->
57<#assign backofficeURL = themeDisplay.getPathFriendlyURLPrivateGroup() + themeDisplay.getScopeGroup().getFriendlyURL() + "/~/control_panel/manage">
58
59<#-- Récupération de la page courante -->
60<#assign page = request.getParameter("page")!1>
61<#assign pageNumber = convert(page) >
62
63<#if currentURL?has_content && currentURL?index_of("/-/journal/") gt 0 >
64 <#--
65 # SELECTION D'UNE SEULE ACTUALITE
66 -->
67 <#-- Récupération du friendly de l'actualité -->
68 <#assign friendlyURL = currentURL?keep_after("/-/journal/")?keep_before_last("?") >
69 <#attempt>
70 <#assign currentArticle = JournalArticleLocalService.fetchArticleByUrlTitle(groupId, friendlyURL) >
71 <#recover>
72 </#attempt>
73<#elseif currentURL?has_content && currentURL?index_of("/-/asset_publisher/") gt 0 >
74 <#--
75 # SELECTION D'UNE SEULE ACTUALITE (format Agrégateur de contenu)
76 -->
77 <#if currentURL?index_of("/content/id/") gt 0 >
78 <#assign assetId = currentURL?keep_after("/content/id/")?keep_before_last("?")?number >
79 <#assign assetEntry = AssetEntryLocalService.getAssetEntry( assetId ) >
80 <#attempt>
81 <#assign currentArticle = JournalArticleLocalService.getLatestArticle( assetEntry.getClassPK() ) >
82 <#recover>
83 </#attempt>
84 <#else>
85 <#assign friendlyURL = currentURL?keep_after("/content/")?keep_before_last("?") >
86 <#attempt>
87 <#assign currentArticle = JournalArticleLocalService.fetchArticleByUrlTitle(groupId, friendlyURL) >
88 <#recover>
89 </#attempt>
90 </#if>
91</#if>
92
93<#assign start = 0
94 end = NbMaxItem.getData()?number >
95
96<#assign void = assetEntryQuery.setGroupIds([groupId])>
97<#assign void = assetEntryQuery.setClassNameIds([structureClassNameId])>
98<#assign void = assetEntryQuery.setClassTypeIds([structure.structureId])>
99<#assign void = assetEntryQuery.setStart(0)>
100<#assign void = assetEntryQuery.setEnd(NbMaxItem.getData()?number)>
101<#assign void = assetEntryQuery.setOrderByCol1(TriPrincipal.ParamPrincipal.getData())>
102<#assign void = assetEntryQuery.setOrderByCol2(TriSecondaire.ParamSecondaire.getData())>
103<#assign void = assetEntryQuery.setOrderByType1(TriPrincipal.OrdrePrincipal.getData())>
104<#assign void = assetEntryQuery.setOrderByType2(TriSecondaire.OrdreSecondaire.getData())>
105
106<#assign assetEntries = AssetEntryLocalService.getEntries(assetEntryQuery) >
107
108<#-- recuperation des périodes des actualités et dédoublonnage de la liste -->
109<#assign periodes = {} >
110<#assign assetEntriesFiltres = [] >
111<#list assetEntries as assetEntry>
112
113 <#-- Récupération de la date pour la sélection -->
114 <#assign
115 dateTri = filtre(assetEntry, TriPrincipal.ParamPrincipal.getData(), TriSecondaire.ParamSecondaire.getData())
116 dateId = dateTri?string["MM/yyy"]
117 dateValue = dateUtil.getDate(dateTri, "MMMM yyyy", locale)
118 periodes = periodes + {dateId : dateValue}
119 />
120
121 <#-- Recherche de l'article sélectionné dans la liste -->
122 <#if currentArticle?? >
123 <#if currentArticle.getResourcePrimKey() == assetEntry.classPK >
124 <#assign currentIndex = assetEntry?index >
125 </#if>
126 </#if>
127 <#-- Filtre par date -->
128 <#if periodeSelect != "0">
129 <#if dateId == periodeSelect>
130 <#assign assetEntriesFiltres = assetEntriesFiltres + [ assetEntry ]>
131 </#if>
132 </#if>
133</#list>
134
135<#-- Pas de Filtre par date : On affiche toute la liste -->
136<#if !(periodeSelect != "0")>
137 <#assign assetEntriesFiltres = assetEntries >
138</#if>
139
140<#--
141# CONSTRUCTION DE LA PAGINATION POUR LA LISTE D'ACTUALITE
142-->
143<#if !(currentArticle??)>
144 <#-- Date sélectionnée : Reset de la pagination -->
145 <#if periodeSelect != "0">
146 <#assign pageNumber = 1>
147 </#if>
148 <#-- Calcul de la pagination -->
149 <#assign start = (pageNumber?number - 1) * pageSize
150 end = ([(start + pageSize), assetEntriesFiltres?size]?min) - 1
151 pagesAvailable = ((assetEntriesFiltres?size - 1) / pageSize)?floor + 1>
152
153 <#-- Construction de la pagination -->
154 <#assign paginationData = { "pageNumber": pageNumber, "pageSize": pageSize, "pagesAvailable": pagesAvailable } >
155</#if>
156
157<div class="actualites-interieur">
158 <#-- Barre de Titre + Ajout de l'icone "Add" si permission -->
159 <h2 class="d-flex justify-content-between align-items-center titre">
160 <#if (Titre.getData())??><span>${Titre.getData()}</span></#if>
161
162 <#-- Astuce : si on peut modifier l'article courant, alors on peut modifier les actualités -->
163 <#if permissionChecker.hasPermission(groupId, "com.liferay.journal.model.JournalArticle", .vars["reserved-article-resource-prim-key"].data, "UPDATE") &&
164 (assetEntriesFiltres?has_content) && (currentArticle?? == false)>
165
166 <#-- Construction de l'url d'ajout -->
167 <#assign renderer = assetEntriesFiltres[0].getAssetRenderer()
168 localActualite = renderer.getArticle() >
169 <#assign addURL = backofficeURL + "?p_p_id=com_liferay_journal_web_portlet_JournalPortlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view" >
170 <#assign addURL = addURL + "&_com_liferay_journal_web_portlet_JournalPortlet_mvcRenderCommandName=%2Fjournal%2Fedit_article">
171 <#assign addURL = addURL + "&_com_liferay_journal_web_portlet_JournalPortlet_groupId=" + groupId + "&_com_liferay_journal_web_portlet_JournalPortlet_ddmStructureId=" + structure.structureId >
172 <#assign addURL = addURL + "&_com_liferay_journal_web_portlet_JournalPortlet_folderId=" + localActualite.folderId >
173 <#assign addURL = addURL + "&_com_liferay_journal_web_portlet_JournalPortlet_redirect=" + currentURL >
174
175 <div class="mr-5 add-icon">
176 <a class="text-4 align-top" href="${addURL}" aria-label="Ajouter une actualité" title="Ajouter une actualité">
177 <@liferay_ui["icon"]
178 icon="plus"
179 markupView="lexicon"
180 />
181 </a>
182 </div>
183 </#if>
184 </h2>
185
186 <div class="actualites-interieur-form-periode">
187 <h6><label for="adt-periode-select">Période :</label></h6>
188 <fieldset>
189 <select id="adt-periode-select" name="periodeSelect" onChange="checkPeriode()" class="form-control">
190 <option value="0">Tous les mois</option>
191 <#list periodes?keys as periode>
192 <#if periode == periodeSelect><#assign selected="selected"><#else><#assign selected=""></#if>
193 <option value="${periode}" ${selected}>${periodes[periode]?capitalize}</option>
194 </#list>
195 </select>
196 </fieldset>
197 </div>
198
199 <#if currentArticle?? >
200 <div class="align-items-center d-flex mb-2 justify-content-between">
201 <p class="component-title h4">
202
203 <#assign redirectURL = currentURL?keep_before("/-/journal/") >
204 <#assign redirectURL = redirectURL?keep_before("/-/asset_publisher/") >
205 <#assign retourURL = redirectURL >
206 <#assign parameters = "?">
207 <#if currentIndex?? && (currentIndex gte pageSize)>
208 <#assign parameters = parameters + "page=" + ((currentIndex / pageSize) + 1)?floor>
209 </#if>
210 <#if periodeSelect != "0">
211 <#assign parameters = parameters + "&periodeSelect=" + periodeSelect>
212 </#if>
213 <#if parameters?length gt 2>
214 <#assign retourURL = retourURL + parameters >
215 </#if>
216 <a class="header-back-to lfr-portal-tooltip" href="${retourURL}" aria-label="Retour" title="Retour">
217 <@liferay_ui["icon"]
218 icon="angle-left"
219 markupView="lexicon"
220 />
221 </a>
222 </p>
223 <#if permissionChecker.hasPermission(currentArticle.getGroupId(), "com.liferay.journal.model.JournalArticle", currentArticle.getResourcePrimKey(), "UPDATE")>
224 <p class="">
225 <#-- Construction de l'url d'édition -->
226 <#assign editURL = backofficeURL + "?p_p_id=com_liferay_journal_web_portlet_JournalPortlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view" >
227 <#assign editURL = editURL + "&_com_liferay_journal_web_portlet_JournalPortlet_mvcRenderCommandName=%2Fjournal%2Fedit_article&_com_liferay_journal_web_portlet_JournalPortlet_articleId=" + currentArticle.articleId>
228 <#assign editURL = editURL + "&_com_liferay_journal_web_portlet_JournalPortlet_groupId=" + groupId + "&_com_liferay_journal_web_portlet_JournalPortlet_version=" + currentArticle.version >
229 <#assign editURL = editURL + "&_com_liferay_journal_web_portlet_JournalPortlet_redirect=" + redirectURL + "/-/journal/" + currentArticle.urlTitle>
230
231 <a class="edit-icon" href="${editURL}" aria-label="Modifier l'actualité" title="Modifier l'actualité">
232 <@liferay_ui["icon"]
233 icon="pencil"
234 markupView="lexicon"
235 />
236 </a>
237 </p>
238 </#if>
239 </div>
240
241 <#-- Le nom de l'onglet prend le nom de l'article ???? -->
242
243 <#-- Affichage du détail de l'actualité -->
244 <@liferay_journal["journal-article"]
245 articleId=currentArticle.getArticleId()
246 groupId=currentArticle.getGroupId()
247 ddmTemplateKey="ACTUALITE"
248 />
249
250 <#-- Affichage des réseaux sociaux -->
251 <#if (ChoixRS.getData())??>
252 <#assign cssURL = "/o/social-bookmarks-taglib/css/main.css?languageId=${locale}&minifierType=css&themeId=${themeDisplay.themeId}&t=${.now?long}">
253 <#assign sharedURL = request.getAttribute('CURRENT_COMPLETE_URL')>
254 <#assign sharedURL = sharedURL?keep_before("/-/journal/") >
255 <#assign sharedURL = sharedURL?keep_before("/-/asset_publisher/") >
256 <#assign sharedURL = sharedURL + "/-/journal/" + currentArticle.urlTitle>
257 <link data-senna-track="permanent" href="${cssURL}" rel="stylesheet" type="text/css">
258 <hr class="separator">
259 <div class="autofit-row autofit-float autofit-row-center asset-details">
260 <div class="autofit-col">
261 <div class="taglib-social-bookmarks" id="ykmt_column_2d_1_0_socialBookmarks">
262 <ul class="list-unstyled inline">
263 <#assign ChoixRS = ChoixRS.getData()>
264 <#list ChoixRS?eval as reseau>
265 <#switch reseau>
266 <#case "facebook">
267 <li class="taglib-social-bookmark taglib-social-bookmark-facebook">
268 <div class="lfr-tooltip-scope">
269 <a class="lfr-portal-tooltip btn btn-monospaced btn-outline-borderless btn-sm btn-outline-secondary" title="Facebook"
270 href="http://www.facebook.com/sharer.php?u=${sharedURL}" aria-label="Facebook">
271 <@liferay_ui["icon"]
272 icon="social-facebook"
273 markupView="lexicon"
274 />
275 </a>
276 </div>
277 </li>
278 <#break>
279 <#case "twitter">
280 <li class="taglib-social-bookmark taglib-social-bookmark-twitter">
281 <div class="lfr-tooltip-scope">
282 <a class="lfr-portal-tooltip btn btn-monospaced btn-outline-borderless btn-sm btn-outline-secondary"
283 href="https://twitter.com/intent/tweet?text=${currentArticle.getTitle(locale)}&tw_p=tweetbutton&url=${sharedURL}"
284 aria-label="Twitter" title="Twitter">
285 <@liferay_ui["icon"]
286 icon="twitter-x"
287 markupView="lexicon"
288 />
289 </a>
290 </div>
291 </li>
292 <#break>
293 <#case "linkedin">
294 <li class="taglib-social-bookmark taglib-social-bookmark-linkedin">
295 <div class="lfr-tooltip-scope">
296 <a class="lfr-portal-tooltip btn btn-monospaced btn-outline-borderless btn-sm btn-outline-secondary"
297 href="http://www.linkedin.com/shareArticle?title=${currentArticle.getTitle(locale)}&mini=true&url=${sharedURL}&summary=${currentArticle.getDescription(locale)}"
298 aria-label="LinkedIn" title="LinkedIn">
299 <@liferay_ui["icon"]
300 icon="social-linkedin"
301 markupView="lexicon"
302 />
303 </a>
304 </div>
305 </li>
306 <#break>
307 <#default>
308 </#switch>
309 </#list>
310 </ul>
311 </div>
312 </div>
313 </div>
314 </#if>
315
316 <#else>
317
318 <div class="actualites-interieur-list">
319 <div class="actualites-interieur-list-article row">
320 <#if assetEntriesFiltres?size gt 0>
321
322
323 <#list start..end as i>
324 <div class="col-lg-4">
325 <#assign renderer = assetEntriesFiltres[i].getAssetRenderer()
326 localActualite = renderer.getArticle() >
327 <@liferay_journal["journal-article"]
328 articleId=localActualite.getArticleId()
329 groupId=localActualite.getGroupId()
330 ddmTemplateKey="ACTUALITE_PAGE_PAR_PAGE"
331 />
332 </div>
333 </#list>
334 <#else>
335 <div class="alert alert-info">
336 <@liferay_ui["message"] key="there-are-no-results" />
337 </div>
338 </#if>
339 </div>
340 </div>
341 </#if>
342</div>
343
344<#if paginationData?? && (paginationData.pagesAvailable gt 1) >
345 <div class="actualites-pagination offres-pagination pagination pagination-focused" style="justify-content: space-between;">
346 <div style="margin: 10px; padding: 10px;">
347 <@pagination_Counter />
348 </div>
349 <ul class="actualites-pagination-content pagination pagination-content" style="margin: 0;">
350 <@pagination_First />
351 <@pagination_Previous />
352 <@pagination_Numbers maxPages = 5 separator = ""/>
353 <@pagination_Next />
354 <@pagination_Last />
355 </ul>
356 </div>
357</#if>
358
359<#function convert param>
360 <#attempt>
361 <#assign currentPage = param?number>
362 <#recover>
363 <#assign currentPage = 1>
364 </#attempt>
365 <#return currentPage />
366</#function>
367
368<#function filtre assetEntry param1 param2 >
369 <#switch param1>
370 <#case "publishDate">
371 <#return assetEntry.publishDate />
372 <#case "modifiedDate">
373 <#return assetEntry.modifiedDate />
374 <#case "createDate">
375 <#return assetEntry.createDate />
376 <#default>
377 <#switch param2>
378 <#case "publishDate">
379 <#return assetEntry.publishDate />
380 <#case "modifiedDate">
381 <#return assetEntry.modifiedDate />
382 <#case "createDate">
383 <#return assetEntry.createDate />
384 <#default>
385 <#return assetEntry.publishDate />
386 </#switch>
387 </#switch>
388</#function>
389
390<#--
391 Pagination macros.
392-->
393
394<#-- Premier Page -->
395<#macro pagination_First>
396 <#if (paginationData.pageNumber <= 1)>
397 <#local classAttr = "class=\"disabled\"" />
398 <#else>
399 <#local classAttr = "" />
400 </#if>
401 <#local text><@liferay_ui["message"] key="first" /></#local>
402 <@pagination_Link 1, text, classAttr/>
403</#macro>
404
405<#-- Dernière page -->
406<#macro pagination_Last>
407 <#if (paginationData.pageNumber >= paginationData.pagesAvailable - 1)>
408 <#local classAttr = "class=\"disabled\"" />
409 <#else>
410 <#local classAttr = "" />
411 </#if>
412 <#local text><@liferay_ui["message"] key="last" /></#local>
413 <@pagination_Link paginationData.pagesAvailable, text, classAttr/>
414</#macro>
415
416<#-- Page suivante -->
417<#macro pagination_Next>
418 <#if (paginationData.pageNumber >= paginationData.pagesAvailable)>
419 <#local pageNumber = paginationData.pageNumber />
420 <#local classAttr = "class=\"disabled\"" />
421 <#else>
422 <#local pageNumber = paginationData.pageNumber + 1 />
423 <#local classAttr = "" />
424 </#if>
425 <#local text><@liferay_ui["message"] key="next" /></#local>
426 <@pagination_Link pageNumber, text, classAttr/>
427</#macro>
428
429<#-- Page précédente -->
430<#macro pagination_Previous>
431 <#if (paginationData.pageNumber <= 1)>
432 <#local pageNumber = paginationData.pageNumber />
433 <#local classAttr = "class=\"disabled\"" />
434 <#else>
435 <#local pageNumber = paginationData.pageNumber - 1 />
436 <#local classAttr = "" />
437 </#if>
438 <#local text><@liferay_ui["message"] key="previous" /></#local>
439 <@pagination_Link pageNumber, text, classAttr/>
440</#macro>
441
442<#--
443 * Construction des liens intermédiaires
444 *
445 * @param maxPages (Optional) Nombre max de liens à afficher
446 * @param separator (Optional) Séparateur
447-->
448<#macro pagination_Numbers maxPages = 9 separator = " | ">
449 <#local pagesBefore = (maxPages / 2)?floor />
450 <#local pagesAfter = (maxPages / 2)?floor />
451 <#if maxPages % 2 == 0>
452 <#local pagesBefore = pagesBefore - 1 />
453 </#if>
454 <#local pageNumMin = paginationData.pageNumber - pagesBefore />
455 <#local pageNumMax = paginationData.pageNumber + pagesBefore />
456 <#if (pageNumMin < 1)>
457 <#local pageNumMax = pageNumMax + (1 - pageNumMin) />
458 <#local pageNumMin = 1 />
459 </#if>
460 <#if (pageNumMax >= paginationData.pagesAvailable)>
461 <#local pageNumMin = pageNumMin - (pageNumMax - paginationData.pagesAvailable) />
462 <#local pageNumMax = paginationData.pagesAvailable />
463 <#if (pageNumMin < 1)>
464 <#local pageNumMin = 1 />
465 </#if>
466 <#if (pageNumMax < 1)>
467 <#local pageNumMax = 1 />
468 </#if>
469 </#if>
470 <#list pageNumMin..pageNumMax as pageNumber>
471 <#if pageNumber == paginationData.pageNumber>
472 <#local classAttr = "class=\"selected\"" />
473 <#else>
474 <#local classAttr = "" />
475 </#if>
476 <@pagination_Link pageNumber, "", classAttr/><#if pageNumber_has_next>${separator}</#if>
477 </#list>
478</#macro>
479
480<#--
481 * Construction du lien vers la page
482 *
483 * @param pageNumber Numéro de la page
484 * @param text (Optional) Texte du lien
485 * @param attributes (Optional) Attributs ajoutés à l'URL
486-->
487<#macro pagination_Link pageNumber text = "" attributes = "">
488 <#if text == "">
489 <#local text = (pageNumber)?string />
490 </#if>
491 <#if (attributes != "" && attributes?starts_with(" ") == false)>
492 <#local attributes = " " + attributes />
493 </#if>
494 <li ${attributes}><a href="?page=${pageNumber}">${text?html}</a></li>
495</#macro>
496
497<#-- Nombre total de pages -->
498<#macro pagination_Counter>
499 <#if paginationData.pagesAvailable == 0>
500 <#local pagesAvailable = 1 />
501 <#else>
502 <#local pagesAvailable = paginationData.pagesAvailable />
503 </#if>
504 ${languageUtil.format(locale, "page-x-of-x", [paginationData.pageNumber, pagesAvailable])}
505</#macro>
506
507<style>
508.actualites-pagination li.disabled a {
509 background-color: white;
510 pointer-events: none;
511 border: 1px solid #f5f5f5;
512}
513.actualites-pagination li.selected a {
514 /* background-color: #d1cfcf;
515 color: #7d7d7d; */
516 font-weight: bolder;
517 pointer-events: none;
518}
519.actualites-interieur .titre .add-icon {
520 z-index: 100;
521}
522</style>
523
524<script>
525
526function checkPeriode() {
527
528 var periodeSelect = document.getElementById("adt-periode-select").value;
529
530 /*Get current URL*/
531 var _url = location.href;
532 var index = _url.indexOf('?');
533 if ( index !== -1 ) {
534 _url = _url.substring(0,index);
535 }
536 _url = _url + '?';
537 if (periodeSelect) {
538 _url = _url + 'periodeSelect='+periodeSelect;
539 }
540 /*reload the page */
541 window.location.href = _url;
542}
543
544</script>

