Notizie Dati e pubblicazioni - ANPAL
Testo introduttivo Dati e Pubblicazioni
Notizie Dati e Pubblicazioni
Analisi, monitoraggio e valutazione delle politiche attive e dei servizi per il lavoro
Asset Publisher
An error occurred while processing the template.
Java method "com.liferay.portal.kernel.util.DateUtil_IW.parseDate(String, String, Locale)" threw an exception when invoked on com.liferay.portal.kernel.util.DateUtil_IW object "com.liferay.portal.kernel.util.DateUtil_IW@479e8bc3"; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign dateNewsObj = dateUtil.parseD... [in template "20099#20135#629652" at line 23, column 25] ----
1<#include "${templatesPath}/611477" />
2<#assign jsonFactoryServiceUtil = serviceLocator.findService("com.liferay.portal.kernel.json.JSONFactoryUtil") />
3<#assign journalArticleList=[]>
4<#if entries?has_content>
5 <#list entries as curEntry>
6 <#assign renderer = curEntry.getAssetRenderer() >
7 <#assign journalArticle = renderer.getArticle() >
8 <#assign document = saxReaderUtil.read(journalArticle.getContentByLocale(locale)) >
9 <#assign rootElement = document.document.getRootElement() >
10 <#assign jsonObjectArticle=jsonFactoryServiceUtil.createJSONObject()>
11
12 <#assign xPathSelectorTitoloNews = saxReaderUtil.createXPath("dynamic-element[@name='titolo_news']") >
13 <#if xPathSelectorTitoloNews.selectSingleNode(rootElement)?has_content>
14 <#assign titolo_news = xPathSelectorTitoloNews.selectSingleNode(rootElement).getStringValue() >
15 <#assign jsonObjectArticle= jsonObjectArticle.put("titoloNews",titolo_news)>
16 <#else>
17 <#assign jsonObjectArticle= jsonObjectArticle.put("titoloNews","")>
18 </#if>
19
20 <#assign xPathSelectorData= saxReaderUtil.createXPath("dynamic-element[@name='data_news']") >
21 <#if xPathSelectorData.selectSingleNode(rootElement)?has_content>
22 <#assign data_news = xPathSelectorData.selectSingleNode(rootElement).getStringValue() >
23 <#assign dateNewsObj = dateUtil.parseDate("yyyy-MM-dd", data_news?trim, locale)>
24 <#assign jsonObjectArticle= jsonObjectArticle.put("dateNewsObj",dateNewsObj)>
25 </#if>
26
27 <#assign categories=curEntry.getCategories()/>
28 <#if categories?? && categories?has_content>
29 <#assign categorieEntry=categories[0] />
30 <#assign jsonObjectArticle=jsonObjectArticle.put("categorieTitle",categorieEntry.getTitle(locale))>
31 <#else>
32 <#assign jsonObjectArticle=jsonObjectArticle.put("categorieTitle","")>
33 </#if>
34 <#if categorieEntry?? && categorieEntry?has_content>
35 <#assign imgDefault=categorieEntry.getName()?replace(" ","-")?lower_case/>
36 <#assign imgDefault=imgDefault+".JPG"/>
37 <#else>
38 <#assign imgDefault="default.JPG"/>
39
40 </#if>
41 <#assign xPathSelectorImmagine = saxReaderUtil.createXPath("dynamic-element[@name='img_news']") >
42 <#assign imgUrl="">
43
44 <#if xPathSelectorImmagine.selectSingleNode(rootElement)?has_content>
45 <#assign img_news = xPathSelectorImmagine.selectSingleNode(rootElement).getStringValue()?trim />
46 <#if img_news !="" && validator.isContent(img_news)>
47 <#assign jsonImmagine=jsonFactoryUtil.createJSONObject(img_news)>
48 <#assign groupId=jsonImmagine.getLong("groupId")>
49 <#assign uuId=jsonImmagine.getString("uuid")>
50 <#assign imgName=jsonImmagine.getString("title")>
51 <#assign imgUrl = "/documents/"+groupId+"/"+0+"/"+imgName+"/"+uuId />
52 <#assign jsonObjectArticle= jsonObjectArticle.put("imgUrl",imgUrl)>
53 <#else>
54 <#assign imgUrl = "/documents/"+themeDisplay.getLayout().getGroupId()+"/"+586348+"/"+imgDefault />
55 <#assign jsonObjectArticle= jsonObjectArticle.put("imgUrl",imgUrl)>
56 </#if>
57 </#if>
58 <#if curEntry.getSummaryCurrentValue()?? && curEntry.getSummaryCurrentValue()!="">
59 <#assign jsonObjectArticle= jsonObjectArticle.put("summaryCurrentValue",curEntry.getSummaryCurrentValue())>
60 <#else>
61 <#assign jsonObjectArticle= jsonObjectArticle.put("summaryCurrentValue","")>
62 </#if>
63
64 <#if journalArticle.getUrlTitle()?? && journalArticle.getUrlTitle()!="">
65 <#assign jsonObjectArticle= jsonObjectArticle.put("urlDisplayPage",journalArticle.getUrlTitle())>
66 <#else>
67 <#assign jsonObjectArticle= jsonObjectArticle.put("urlDisplayPage","")>
68 </#if>
69
70 <#assign journalArticleList=journalArticleList+[jsonObjectArticle]>
71 </#list>
72</#if>
73<#if journalArticleList?has_content>
74 <div class="container">
75 <div class="p-4 px-sm-0">
76 <div class="row">
77 <#list (journalArticleList?sort_by("dateNewsObj"))?reverse as journalArticle>
78 <#assign dateRelatedArticle= dateUtil.getDate(journalArticle.get("dateNewsObj"), "dd.MM.yy", locale) />
79 <#if (journalArticle?index)%3==0>
80 <#assign classDivPrincipale="col-12 col-md-4 my-4 b-line"/>
81 <#else>
82 <#assign classDivPrincipale="col-12 col-md-4 my-4 b-line b-left"/>
83 </#if>
84 <div class="${classDivPrincipale}">
85 <div class="card card-news h-100">
86
87 <div class="card-body pl-1 pr-2 py-0 flex flex-column">
88 <div class="img200h mb-2"><img src="${journalArticle.get('imgUrl')}" alt='immagine ${journalArticle.get("titoloNews")}'></div>
89 <#if journalArticle.get("categorieTitle")!="">
90 <p class="text-primary text-14p text-spacing font-weight-bold mb-2"><span class="category uppercase"> ${journalArticle.get("categorieTitle")}</span> — ${dateRelatedArticle}</p>
91 <#else>
92 <p class="text-primary text-14p text-spacing font-weight-bold mb-2">${dateRelatedArticle}</p>
93 </#if>
94
95 <p class="text-28p line-h40p font-weight-600 mb-2">${journalArticle.get("titoloNews")}</p>
96 <p class="text-chambray font-lora mb-4">${journalArticle.get("summaryCurrentValue")}</p>
97 </div>
98 <div class="mt-auto pl-1 pl-sm-2 pb-4">
99 <a href="-/${journalArticle.get('urlDisplayPage')}" class="text-14p font-weight-bold" "${translate(locale, 'Leggi di più')}">
100 ${translate(locale, "Leggi di più")}
101 <span aria-hidden="true">→</span>
102 <span class="sr-only">
103 Riguardo ${journalArticle.get("titoloNews")}
104 </span>
105 </a>
106 </div>
107 </div>
108 </div>
109 </#list>
110 </div>
111 </div>
112 </div>
113</#if>