Slider cabecera Sala de prensa
Navegació per categories
Contenido Ancla Filtro Categorias
Resultats noticies
Publicador de continguts
S'ha produït un error mentre es processava la plantilla.
The following has evaluated to null or missing:
==> button_obj.classPK  [in template "20116#20152#695946" at line 86, column 48]

----
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 classPK = button_obj.classPK  [in template "20116#20152#695946" at line 86, column 29]
----
1<#-- $Id: NOTICIA.ftl 2736 2021-12-02 17:23:49Z patricia.hevia $ --> 
2<#assign companyId = themeDisplay['companyId'] /> 
3<#assign layoutService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService") /> 
4<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")> 
5<#assign journalArticleResourceLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleResourceLocalService")> 
6<#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")> 
7<#assign assetTagLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetTagLocalService")> 
8<#assign DLAppLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppLocalService")> 
9<#assign dlUtil = serviceLocator.findService("com.liferay.document.library.kernel.util.DLUtil")> 
10 
11<#if entries?has_content> 
12    <ul class="news-list list-unstyled"> 
13        <#list entries as curEntry> 
14 
15            <#if curEntry.getClassName() == "com.liferay.journal.model.JournalArticle"> 
16                <#assign assetRenderer = curEntry.getAssetRenderer()/> 
17                <#assign journalArticle =  assetRenderer.getAssetObject() /> 
18                <#assign document = saxReaderUtil.read(journalArticle.getContent())> 
19                <#assign rootElement = document.getRootElement()> 
20                <#assign defaultLanguageId = parseXml ("@default-locale", rootElement)> 
21 
22            <#-- assign content values to variables --> 
23                <#assign newsImage = getField("newsImage", locale, defaultLanguageId, rootElement)!> 
24                <#assign newsImageAlt = getFieldAttribute("alt","newsImage", locale, 
25                defaultLanguageId, rootElement)!> 
26                <#assign newsTitle = getField("newsTitle", locale, defaultLanguageId, rootElement)!> 
27                <#assign newsDate = getField("newsDate", locale, defaultLanguageId, rootElement)!> 
28                <#if newsDate?? && newsDate != ""> 
29                    <#assign displaydate = newsDate?datetime("yyyy-MM-dd")> 
30                </#if> 
31                <#assign newsSummary = getField("newsSummary", locale, defaultLanguageId, rootElement)!> 
32                <#assign buttonWebContent = getField("buttonWebContent", locale, defaultLanguageId, rootElement)!> 
33 
34                <#assign layoutUuid = journalArticle.layoutUuid /> 
35                <#assign layoutURL = journalArticle.urlTitle /> 
36                <#assign layoutObject = layoutService.getLayoutsByUuidAndCompanyId(layoutUuid, companyId) /> 
37                <#assign articleId = journalArticle.articleId> 
38 
39                <#assign articleResourcePK = journalArticle.getResourcePrimKey()/> 
40                <#assign categoryList=assetCategoryLocalService.getCategories("com.liferay.journal.model.JournalArticle",articleResourcePK) > 
41                <#assign tagList=assetTagLocalService.getTags("com.liferay.journal.model.JournalArticle",articleResourcePK) > 
42 
43                <#assign categoryURL = ""> 
44                <#if categoryList?has_content> 
45                    <#assign categoryURL = "&p_r_p_categoryId="+categoryList[0].categoryId > 
46                </#if> 
47 
48                <#assign tagURL = ""> 
49                <#if tagList?has_content> 
50                    <#assign tagURL = "&p_r_p_tag="+tagList[0].name > 
51                </#if> 
52 
53            <#-- Create url to view --> 
54                <#assign viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, curEntry,true)/> 
55            <#-- Remove param redirect --> 
56                <#assign pos = viewURL?index_of("?")/> 
57                <#assign valueViewURL = viewURL?substring(0,pos)/> 
58 
59                <li class="news-item row" tabindex="0" title="<@liferay.language key="news.accessibility.view.more" /> ${newsTitle}" aria-label="<@liferay.language key="news.accessibility.view.more" /> ${newsTitle}" onclick="location.href='${valueViewURL}'"> 
60 
61                    <div class="col-12 col-md-3 news-image"> 
62                        <#if newsImage?? && newsImage != ""> 
63                            <#assign imageJson = newsImage?eval /> 
64                            <#assign imgFileEntry = DLAppLocalService.getFileEntryByUuidAndGroupId(imageJson.uuid,imageJson.groupId?number) > 
65                            <#assign viewUrl = dlUtil.getPreviewURL(imgFileEntry, imgFileEntry.getFileVersion(), themeDisplay, "") /> 
66                            <#if newsImageAlt?? && newsImageAlt != ""> 
67                                <img alt="${newsImageAlt.data}" src="${viewUrl}" /> 
68                            <#else> 
69                                <img alt="" src="${viewUrl}" /> 
70                            </#if> 
71                        </#if> 
72                    </div> 
73                    <div class="col-12 col-md-8 news-content"> 
74                        <h3 class="news-title"> 
75                            ${newsTitle} 
76                        </h3> 
77                        <#if displaydate??> 
78                            <p class="news-date">${displaydate?string["dd/MM/yyyy"]}</p> 
79                        </#if> 
80                        <div class="summary">${newsSummary}</div> 
81 
82                    </div> 
83                    <div class="news-button"> 
84                        <#if buttonWebContent?? && buttonWebContent != ""> 
85                            <#assign button_obj = buttonWebContent?eval> 
86                            <#assign classPK = button_obj.classPK> 
87                            <#assign embeddedJournalArticleButton =  JournalArticleLocalService.getLatestArticle(classPK?number)> 
88                        <#-- Display content with its own defined template --> 
89                            <a title="<@liferay.language key="news.accessibility.view.more" /> ${newsTitle}" aria-label="<@liferay.language key="news.accessibility.view.more" /> ${newsTitle}" href="${valueViewURL}"> 
90                                <@liferay_journal["journal-article"] 
91                                articleId=embeddedJournalArticleButton.getArticleId() 
92                                ddmTemplateKey=embeddedJournalArticleButton.getDDMTemplateKey() 
93                                groupId=embeddedJournalArticleButton.getGroupId() 
94                                /> 
95                            </a> 
96                        </#if> 
97                    </div> 
98                </li> 
99            </#if> 
100        </#list> 
101    </ul> 
102</#if> 
103 
104<#function getField field languageId defaultLanguageId xml> 
105    <#local defaultSelector = "//dynamic-content[@language-id='" + defaultLanguageId + "' and ancestor-or-self::*[@name='" + field + "']]"> 
106    <#local localeSelector = "//dynamic-content[@language-id='" + languageId + "' and parent::*[@name='" + field + "']]"> 
107 
108    <#local selector = saxReaderUtil.createXPath(localeSelector)> 
109    <#local value = selector.selectSingleNode(xml)!> 
110 
111    <#if value?has_content> 
112        <#return value.getText()> 
113    </#if> 
114 
115    <#local selector = saxReaderUtil.createXPath(defaultSelector)> 
116    <#local value = selector.selectSingleNode(xml)!> 
117 
118    <#if value?has_content> 
119        <#return value.getText()> 
120    </#if> 
121 
122    <#return ""> 
123</#function> 
124 
125<#function getFieldAttribute attribute field languageId defaultLanguageId xml> 
126    <#local defaultSelector = "//dynamic-content[@language-id='" + defaultLanguageId + "' and ancestor-or-self::*[@name='" + field + "']]"> 
127    <#local localeSelector = "//dynamic-content[@language-id='" + languageId + "' and parent::*[@name='" + field + "']]"> 
128 
129    <#local selector = saxReaderUtil.createXPath(localeSelector)> 
130    <#local value = selector.selectSingleNode(xml)!> 
131 
132    <#if value?has_content> 
133        <#return value.attribute(attribute)> 
134    </#if> 
135 
136    <#local selector = saxReaderUtil.createXPath(defaultSelector)> 
137    <#local value = selector.selectSingleNode(xml)!> 
138 
139    <#if value?has_content> 
140        <#return value.attribute(attribute)> 
141    </#if> 
142 
143    <#return ""> 
144</#function> 
145 
146<#function parseXml xpath xml> 
147    <#local selector = saxReaderUtil.createXPath(xpath)> 
148    <#local result = selector.selectSingleNode(xml)!> 
149 
150    <#if result?has_content> 
151        <#return result.getStringValue()> 
152    </#if> 
153 
154    <#return ""> 
155</#function>