Во время обработки запрошенного шаблона произошла ошибка...
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 ${dateUtil.getDate(entry.getPublishDate(), dateFormat, locale)}
165 <#elseif stringUtil.equals(fieldName, "tags")>
166 <@liferay_ui["asset-tags-summary"]
167 className=entry.getClassName()
168 classPK=entry.getClassPK()
169 portletURL=renderResponse.createRenderURL()
170 />
171 <#elseif stringUtil.equals(fieldName, "view-count")>
172 ${entry.getViewCount()} <@liferay.language key="views" />
173 </#if>
174 </#if>
175</#macro>
176
177<#macro getPrintIcon>
178 <#if getterUtil.getBoolean(enablePrint)>
179 <#assign printURL = renderResponse.createRenderURL() />
180
181 ${printURL.setParameter("mvcPath", "/view_content.jsp")}
182 ${printURL.setParameter("assetEntryId", entry.getEntryId()?string)}
183 ${printURL.setParameter("viewMode", "print")}
184 ${printURL.setParameter("type", entry.getAssetRendererFactory().getType())}
185
186 <#if assetRenderer.getUrlTitle()?? && validator.isNotNull(assetRenderer.getUrlTitle())>
187 <#if assetRenderer.getGroupId() != themeDisplay.getScopeGroupId()>
188 ${printURL.setParameter("groupId", assetRenderer.getGroupId()?string)}
189 </#if>
190
191 ${printURL.setParameter("urlTitle", assetRenderer.getUrlTitle())}
192 </#if>
193
194 ${printURL.setWindowState("pop_up")}
195
196 <@liferay_ui["icon"]
197 iconCssClass="icon-print"
198 message="print"
199 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()) + "'});"
200 />
201 </#if>
202</#macro>
203
204<#macro getRatings>
205 <#if getterUtil.getBoolean(enableRatings) && assetRenderer.isRatable()>
206 <div class="asset-ratings">
207 <@liferay_ui["ratings"]
208 className=entry.getClassName()
209 classPK=entry.getClassPK()
210 />
211 </div>
212 </#if>
213</#macro>
214
215<#macro getRelatedAssets>
216 <#if getterUtil.getBoolean(enableRelatedAssets)>
217 <@liferay_ui["asset-links"] assetEntryId=entry.getEntryId() />
218 </#if>
219</#macro>
220
221<#macro getSocialBookmarks>
222 <#if getterUtil.getBoolean(enableSocialBookmarks)>
223 <@liferay_ui["social-bookmarks"]
224 displayStyle="${socialBookmarksDisplayStyle}"
225 target="_blank"
226 title=entry.getTitle(locale)
227 url=viewURL
228 />
229 </#if>
230</#macro>
231
232<#function dateDiff date days>
233 <#assign timeInMilliseconds = (1000 * 60 * 60 * 24 * days) >
234 <#assign aDate = date?long - timeInMilliseconds?long>
235 <#return aDate?number_to_date>
236</#function>
237
238<#function getImageUrl content>
239 <#local imageURL = "/o/ponsse-theme/images/default-thumbnail-ponsse-304x171.jpg" />
240 <#if content?has_content>
241 <#local
242 imageUUID = jsonFactoryUtil.createJSONObject(content).getString("uuid")
243 siteId = themeDisplay.getSiteGroupId()
244 imageURL = "/documents/${siteId}/${imageUUID}"
245 />
246 </#if>
247 <#return imageURL>
248</#function>