Wystąpił błąd podczas przetwarzania szablonu.
The following has evaluated to null or missing: ==> renderer.getArticle [in template "1812923#1812963#1814147" at line 23, column 34] ---- 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: journalArticle = renderer.getArticle() [in template "1812923#1812963#1814147" at line 23, column 17] ----
1<#if !entries?has_content>
2 <#if !themeDisplay.isSignedIn()>
3 ${renderRequest.setAttribute("PORTLET_CONFIGURATOR_VISIBILITY", true)}
4 </#if>
5
6 <div class="alert alert-info">
7 <@liferay_ui["message"] key="there-are-no-results" />
8 </div>
9</#if>
10
11
12<div class="news news-full list-group">
13 <#if entries?has_content>
14 <#list entries as entry>
15 <#assign
16 entry = entry
17 assetRenderer = entry.getAssetRenderer()
18 entryTitle = htmlUtil.escape(entry.getTitle(locale))
19 entryDescription = htmlUtil.escape(entry.getDescription(locale))
20 viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, assetRenderer, entry, !stringUtil.equals(assetLinkBehavior, "showFullContent"))?split("?")[0]
21
22 renderer = entry.getAssetRenderer()<#-- JournalArticleAssetRenderer -->
23 journalArticle = renderer.getArticle() <#-- JournalArticleImpl -->
24 structureKey = journalArticle.getDDMStructureKey()
25 document = saxReaderUtil.read(journalArticle.getContentByLocale(locale))
26 rootElement = document.getRootElement()
27 elements = rootElement.elements()
28 categories = entry.getCategories()
29 link = ""
30 imageContent = ""
31 imageContentSecondary=""
32 displayLocales = ""
33 newsType = ""
34 />
35
36 <#if categories?has_content>
37 <#list categories as cat>
38 <#if (cat.getVocabularyId()?long == 1814586)>
39 <#assign displayLocales = cat.getName() + ", " + displayLocales/>
40 </#if>
41 <#if (cat.getVocabularyId()?long == 1815496)>
42 <#assign newsType = cat.getTitle(locale)/>
43 </#if>
44 </#list>
45 </#if>
46
47 <#if !displayLocales?has_content || displayLocales?contains(locale) || ( stringUtil.equals("228126", structureKey) && displayLocales?contains("en_US") ) >
48 <#list elements as element>
49 <#if "cisionMainImage" == element.attributeValue("name")>
50 <#assign imageContent = element.element("dynamic-content").getText() />
51 <#elseif "cisionDocumentLibraryImage" == element.attributeValue("name") && element.element("dynamic-content").getText()?has_content>
52 <#assign imageContent = element.element("dynamic-content").getText() />
53 <#break>
54 <#elseif "newsMainImage" == element.attributeValue("name")>
55 <#assign imageContent = getImageUrl(element.element("dynamic-content").getText()) />
56 </#if>
57
58 <#if "link" == element.attributeValue("name")>
59 <#assign link = element.element("dynamic-content").getText() />
60 </#if>
61 <#if "contentRow" == element.attributeValue("name")>
62 <#list element.elements() as e2>
63 <#if "image" == e2.attributeValue("name")>
64 <#assign imageContentSecondary = e2.element("dynamic-content").getText() />
65 <#break>
66 </#if>
67 </#list>
68 </#if>
69 </#list>
70
71 <#if !imageContent?has_content>
72 <#assign imageContent = "/o/ponsse-theme/images/service_placeholder.jpg" />
73 </#if>
74
75 <a href = "${viewURL}" class="row no-gutters list-group-item js-link news-item">
76 <div class="col-sm-5 col-md-4 news-image"><img src="${imageContent}" /></div>
77 <div class="col-sm-7 col-md-8 news-details">
78 <p class="date"><@getMetadataField fieldName="publish-date" /></p>
79
80 <h3 class="assetTitle">${entryTitle}</h3>
81 <p class="assetDescription">
82 <#if newsType?has_content>
83 <span class="highlightBox hidden-xs">
84 ${newsType}
85 </span>
86 </#if>
87
88 ${entryDescription}
89 </p>
90 <p class="visible-xs">
91 <span class="highlightBox hidden-xs">
92 ${newsType}
93 </span>
94 </p>
95 <#if link?has_content>
96 <div class="js-link" onclick="link.openInTab('${link}');">
97 ${link}
98 </div>
99 </#if>
100 </div>
101 </a>
102 </#if>
103 </#list>
104 </#if>
105</div>
106
107<#macro getEditIcon>
108 <#if assetRenderer.hasEditPermission(themeDisplay.getPermissionChecker())>
109 <#assign redirectURL = renderResponse.createRenderURL() />
110
111 ${redirectURL.setParameter("mvcPath", "/add_asset_redirect.jsp")}
112 ${redirectURL.setWindowState("pop_up")}
113
114 <#assign editPortletURL = assetRenderer.getURLEdit(renderRequest, renderResponse, windowStateFactory.getWindowState("pop_up"), redirectURL)!"" />
115
116 <#if validator.isNotNull(editPortletURL)>
117 <#assign title = languageUtil.format(locale, "edit-x", entryTitle, false) />
118
119 <@liferay_ui["icon"]
120 cssClass="icon-monospaced visible-interaction"
121 icon="pencil"
122 markupView="lexicon"
123 message=title
124 url="javascript:Liferay.Util.openWindow({id:'" + renderResponse.getNamespace() + "editAsset', title: '" + title + "', uri:'" + htmlUtil.escapeURL(editPortletURL.toString()) + "'});"
125 />
126 </#if>
127 </#if>
128</#macro>
129
130<#macro getFlagsIcon>
131 <#if getterUtil.getBoolean(enableFlags)>
132 <@liferay_flags["flags"]
133 className=entry.getClassName()
134 classPK=entry.getClassPK()
135 contentTitle=entry.getTitle(locale)
136 label=false
137 reportedUserId=entry.getUserId()
138 />
139 </#if>
140</#macro>
141
142<#macro getMetadataField
143fieldName
144>
145 <#if stringUtil.split(metadataFields)?seq_contains(fieldName)>
146 <#assign dateFormat = "dd.MM.yyyy" />
147 <#if stringUtil.equals(fieldName, "author")>
148 <@liferay.language key="by" /> ${htmlUtil.escape(portalUtil.getUserName(assetRenderer.getUserId(), assetRenderer.getUserName()))}
149 <#elseif stringUtil.equals(fieldName, "categories")>
150 <@liferay_ui["asset-categories-summary"]
151 className=entry.getClassName()
152 classPK=entry.getClassPK()
153 portletURL=renderResponse.createRenderURL()
154 />
155 <#elseif stringUtil.equals(fieldName, "create-date")>
156 ${dateUtil.getDate(entry.getCreateDate(), dateFormat, locale)}
157 <#elseif stringUtil.equals(fieldName, "expiration-date")>
158 ${dateUtil.getDate(entry.getExpirationDate(), dateFormat, locale)}
159 <#elseif stringUtil.equals(fieldName, "modified-date")>
160 ${dateUtil.getDate(entry.getModifiedDate(), dateFormat, locale)}
161 <#elseif stringUtil.equals(fieldName, "priority")>
162 ${entry.getPriority()}
163 <#elseif stringUtil.equals(fieldName, "publish-date")>
164 <#if entry.getPublishDate()?has_content>
165 ${dateUtil.getDate(entry.getPublishDate(), dateFormat, locale)}
166 </#if>
167 <#elseif stringUtil.equals(fieldName, "tags")>
168 <@liferay_ui["asset-tags-summary"]
169 className=entry.getClassName()
170 classPK=entry.getClassPK()
171 portletURL=renderResponse.createRenderURL()
172 />
173 <#elseif stringUtil.equals(fieldName, "view-count")>
174 ${entry.getViewCount()} <@liferay.language key="views" />
175 </#if>
176 </#if>
177</#macro>
178
179<#macro getPrintIcon>
180 <#if getterUtil.getBoolean(enablePrint)>
181 <#assign printURL = renderResponse.createRenderURL() />
182
183 ${printURL.setParameter("mvcPath", "/view_content.jsp")}
184 ${printURL.setParameter("assetEntryId", entry.getEntryId()?string)}
185 ${printURL.setParameter("viewMode", "print")}
186 ${printURL.setParameter("type", entry.getAssetRendererFactory().getType())}
187
188 <#if assetRenderer.getUrlTitle()?? && validator.isNotNull(assetRenderer.getUrlTitle())>
189 <#if assetRenderer.getGroupId() != themeDisplay.getScopeGroupId()>
190 ${printURL.setParameter("groupId", assetRenderer.getGroupId()?string)}
191 </#if>
192
193 ${printURL.setParameter("urlTitle", assetRenderer.getUrlTitle())}
194 </#if>
195
196 ${printURL.setWindowState("pop_up")}
197
198 <@liferay_ui["icon"]
199 iconCssClass="icon-print"
200 message="print"
201 url="javascript:Liferay.Util.openWindow({id:'" + renderResponse.getNamespace() + "printAsset', title: '" + languageUtil.format(locale, "print-x-x", ["hide-accessible", entryTitle], false) + "', uri: '" + htmlUtil.escapeURL(printURL.toString()) + "'});"
202 />
203 </#if>
204</#macro>
205
206<#macro getRatings>
207 <#if getterUtil.getBoolean(enableRatings) && assetRenderer.isRatable()>
208 <div class="asset-ratings">
209 <@liferay_ui["ratings"]
210 className=entry.getClassName()
211 classPK=entry.getClassPK()
212 />
213 </div>
214 </#if>
215</#macro>
216
217<#macro getRelatedAssets>
218 <#if getterUtil.getBoolean(enableRelatedAssets)>
219 <@liferay_ui["asset-links"] assetEntryId=entry.getEntryId() />
220 </#if>
221</#macro>
222
223<#macro getSocialBookmarks>
224 <#if getterUtil.getBoolean(enableSocialBookmarks)>
225 <@liferay_ui["social-bookmarks"]
226 displayStyle="${socialBookmarksDisplayStyle}"
227 target="_blank"
228 title=entry.getTitle(locale)
229 url=viewURL
230 />
231 </#if>
232</#macro>
233
234<#function dateDiff date days>
235 <#assign timeInMilliseconds = (1000 * 60 * 60 * 24 * days) >
236 <#assign aDate = date?long - timeInMilliseconds?long>
237 <#return aDate?number_to_date>
238</#function>
239
240<#function getImageUrl content>
241 <#local imageURL = "/o/ponsse-theme/images/default-thumbnail-ponsse-304x171.jpg" />
242 <#if content?has_content>
243 <#local
244 imageUUID = jsonFactoryUtil.createJSONObject(content).getString("uuid")
245 siteId = themeDisplay.getSiteGroupId()
246 imageURL = "/documents/${siteId}/${imageUUID}"
247 />
248 </#if>
249 <#return imageURL>
250</#function>