Articles, events i notícies de la Oficina de Ciutat Intel·ligent i Smart City València - Smart City - València
S'ha produït un error mentre es processava la plantilla.
The following has evaluated to null or missing: ==> assetCategoryService.getAssetEntryAssetCategories [in template "20115#20151#18788116" at line 61, column 54] ---- Tip: It's the step after the last dot 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: #assign categorys = assetCategoryServ... [in template "20115#20151#18788116" at line 61, column 33] ----
1<#assign JournalArticleService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
2<#assign journalArticleClassname = "com.liferay.journal.model.JournalArticle" >
3<#assign AssetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") />
4<#assign assetCategoryService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") />
5<#assign dlFileEntryLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService") />
6
7
8
9<#-- DEFINICIÓN DEL IDIOMA LOCAL -->
10<#assign lang = themeDisplay.getLocale()>
11
12<#-- VARIABLES DE IDIOMA -->
13<#if lang == "es_ES" >
14 <#assign urlContext = "/cas/actualidad">
15<#elseif lang == "en_GB" >
16 <#assign urlContext = "/cas/actualidad">
17<#elseif lang == "ca_ES" >
18 <#assign urlContext= "/val/actualitat">
19<#else>
20 <#assign urlContext= "/val/actualitat">
21</#if>
22
23
24<div class="container">
25 <div class="noticies">
26 <div class="section-container">
27 <ul>
28
29 <#if entries?has_content>
30
31 <#-- RECORREMOS CADA ARTICULO DE NOTICIAS -->
32 <#list entries as curEntry>
33
34 <#assign journalArticle = JournalArticleService.fetchLatestArticle(getterUtil.getLong(curEntry.getClassPK())) />
35 <#assign document = saxReaderUtil.read(journalArticle.getContentByLocale(lang))>
36 <#assign rootElement = document.getRootElement() />
37
38 <#-- OBTENER IMAGEN DE LA NOTICIA -->
39
40 <#assign jsonObjectString = document.valueOf("//dynamic-element[@name='multimedia']/dynamic-content/text()") />
41 <#if jsonObjectString?has_content>
42 <#assign jsonObject = jsonObjectString?eval>
43 <#assign entryUuid = jsonObject.uuid />
44 <#assign entryGroupId = getterUtil.getLong(jsonObject.groupId) />
45 <#attempt>
46 <#assign dlFileEntry = dlFileEntryLocalService.getDLFileEntryByUuidAndGroupId(entryUuid, entryGroupId) />
47 <#recover>
48 <#assign dlFileEntry = dlFileEntryLocalService.getDLFileEntryByUuidAndGroupId("f210c305-77c0-5891-b21c-439ff1267042", 20142) />
49 </#attempt>
50
51 <#assign assetEntry = AssetEntryLocalService.getEntry("com.liferay.document.library.kernel.model.DLFileEntry",dlFileEntry.fileEntryId) />
52 <#assign assetRenderer = assetEntry.assetRenderer />
53 <#assign imagenURL = assetRenderer.getURLDownload(themeDisplay) />
54 </#if>
55 <#-- OBTENCION FECHA DISPLAY -->
56
57 <#assign displayDate = dateUtil.getDate(journalArticle.createDate, "dd/MM/yyyy", locale, timeZone)?string />
58
59 <#-- OBTENCION DE CATEGORIA -->
60 <#assign journaArticleEntry = AssetEntryLocalService.getEntry(journalArticleClassname, journalArticle.getResourcePrimKey())/>
61 <#assign categorys = assetCategoryService.getAssetEntryAssetCategories(journaArticleEntry.getEntryId()) />
62 <#assign categoryName = categorys[0].getTitle(lang) />
63 <#assign categoryId = categorys[0].getCategoryId() >
64
65 <#-- OBTENCION DEL TITULAR -->
66 <#assign selectorTitular = saxReaderUtil.createXPath("dynamic-element[@name='Titular']") />
67 <#if selectorTitular.selectSingleNode(rootElement)?has_content>
68 <#assign titular = selectorTitular.selectSingleNode(rootElement).getStringValue()?replace("\"", "") />
69 </#if>
70
71 <#-- OBTENCION DEL ANTETITULO -->
72 <#assign selectorAntetitulo = saxReaderUtil.createXPath("dynamic-element[@name='Antetitulo']") />
73 <#if selectorAntetitulo.selectSingleNode(rootElement)?has_content>
74 <#assign antetitulo = selectorAntetitulo.selectSingleNode(rootElement).getStringValue()?replace("\"", "") />
75 </#if>
76
77 <li>
78 <div class="${categoryId}">
79 <div>
80 <a href="${urlContext}/-/content/${journalArticle.getUrlTitle(locale)}" target="_blank" rel="noopener noreferrer" title="${titular}" alt="${titular}">
81 <img src="${imagenURL}" alt="${journalArticle.getTitle(lang)}">
82 </a>
83 </div>
84 <p class="fecha">
85 ${displayDate}
86 </p>
87 <h3>
88 <a href="${urlContext}/-/content/${journalArticle.getUrlTitle(locale)}" target="_blank" rel="noopener noreferrer" title="${titular}">
89 ${titular}
90 </a>
91 </h3>
92 <p>
93 <span>
94 ${categoryName}
95 </span>
96 <a href="${urlContext}/-/content/${journalArticle.getUrlTitle(locale)}" target="_blank" rel="noopener noreferrer" title="${titular}" alt="${titular}">${antetitulo}
97 </a>
98 </p>
99 </div>
100 </li>
101 </#list>
102 </#if>
103 </ul>
104 </div>
105 </div>
106</div>
107
108<style>
109@import url("/documents/12828538/0/publicador-noticias.css/6cf6501a-4d0b-98c2-6180-ab774891b8e7?t=1655900562004");
110</style>