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