Une erreur s'est produite lors du traitement du modèle.
Java method "jdk.proxy169.$Proxy886.getLatestArticle(long, String)" threw an exception when invoked on jdk.proxy169.$Proxy886 object [freemarker.core._DelayedJQuote.toString() failed: com.liferay.portal.kernel.exception.SystemException: javax.persistence.OptimisticLockException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [com.liferay.portlet.asset.model.impl.AssetTagImpl#3679578]]; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign Article = JournalArticleLocal... [in template "10155#10193#NEWSFEED_ARTICLE" at line 14, column 1] ----
1<#setting datetime_format="dd.MM.yyyy" />
2<#assign articleId = .vars['reserved-article-id'].data />
3<#assign articleTitle = .vars['reserved-article-title'].data />
4<#assign articleDescription = .vars['reserved-article-description'].data />
5<#assign articleImage = .vars['reserved-article-small-image-url'].data />
6<#assign webContentClassName = "com.liferay.journal.model.JournalArticle"/>
7
8<#assign AssetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") />
9<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
10
11
12
13
14<#assign Article = JournalArticleLocalService.getLatestArticle(groupId, articleId)/>
15
16<#assign AssetLinkLocalService = serviceLocator.findService("com.liferay.asset.link.service.AssetLinkLocalService")/>
17<#assign AssetVocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")>
18
19
20<#assign PrimaryKey = Article.getResourcePrimKey()/>
21<#assign Entry = AssetEntryLocalService.getEntry(webContentClassName,PrimaryKey)/>
22
23
24<#assign Categories = getCategoriesOfVocabulary(Entry, "010 Pouvoirs") />
25<#assign CategoriesType = getCategoriesOfVocabulary(Entry, "020 Typologies") />
26
27
28
29<!-- Open Graph Variable -->
30<#assign og_title = articleTitle?replace('<[^>]+>','','r') />
31<#assign og_description = articleDescription?replace('<[^>]+>','','r') />
32
33<#assign PortalUtil = staticUtil["com.liferay.portal.kernel.util.PortalUtil"] />
34
35<#assign og_language = locale.getLanguage() />
36<#assign og_languageID = themeDisplay.getLanguageId() />
37<#assign og_domain = themeDisplay.getURLPortal() />
38<#assign og_siteName = "vs.ch" />
39
40<#assign og_url = og_domain+themeDisplay.getURLCurrent() />
41<!-- Open Graph / Facebook -->
42<@liferay_util["html-top"]><meta property="og:url" content="${og_url}"></@>
43<@liferay_util["html-top"]><meta property="og:type" content="website"></@>
44<@liferay_util["html-top"]><meta property="og:title" content="${og_title}"></@>
45<@liferay_util["html-top"]><meta property="og:description" content="${og_description} - ${og_url}"></@>
46<#if Image?? && Image.getData() != "">
47 <@liferay_util["html-top"]><meta property="og:image" content="${og_domain}${Image.getData()}"></@>
48</#if>
49
50
51
52<!-- Twitter -->
53<@liferay_util["html-top"]><meta name="twitter:card" content="summary_large_image"></@>
54<@liferay_util["html-top"]><meta property="twitter:domain" content="${og_domain}"></@>
55<@liferay_util["html-top"]><meta property="twitter:url" content="${og_url}"></@>
56
57
58<@liferay_util["html-top"]><meta name="twitter:title" content="${og_title}"></@>
59<@liferay_util["html-top"]><meta name="twitter:description" content="${og_description}"></@>
60<#if Image?? && Image.getData() != "">
61 <@liferay_util["html-top"]><meta name="twitter:image" content="${og_domain}${Image.getData()}"></@>
62</#if>
63
64
65<style>
66
67 .secondaryContents .card {
68 background-color: inherit;
69 }
70
71</style>
72
73<article id="id${articleId}" class="ivs-text-body">
74
75 <div class="row">
76
77 <div class="col-12 col-md-6 col-xl-8">
78
79
80 <header>
81 <div class="mb-4">
82 <#list CategoriesType as cur_cat>
83 <#if (cur_cat.getDescription(locale)?trim)!="" >
84 <span class="bg-red text-white px-2 py-1 mr-2">${cur_cat.getDescription(locale)?trim}</span>
85 </#if>
86 </#list>
87 <span class="text-red"><time datetime="${Article.getDisplayDate()?datetime}">${Article.getDisplayDate()?datetime}</time></span>
88
89 <#list Categories as cur_cat>
90 <#if (cur_cat.getDescription(locale)?trim)!="" >
91 <span class="float-right">${cur_cat.getDescription(locale)?trim} </span>
92 </#if>
93 </#list>
94
95 </div>
96
97
98 <#if basic_data.show_title.getData() == "big">
99 <h1 id="inhalt_${articleId}" class="display-4 mb-4">${articleTitle}</h1>
100 <#elseif basic_data.show_title.getData() == "default">
101 <h1 id="inhalt_${articleId}" class="mb-3">${articleTitle}</h1>
102 </#if>
103 </header>
104
105 <div class="row">
106
107 <#if basic_data.show_small_img.getData() == "left">
108 <div class="col-12 col-sm-6 col-lg-4">
109 <img src="${articleImage}" class="img-fluid img-thumbnail" alt="">
110 </div>
111 </#if>
112 <div class="col">
113 <#if getterUtil.getBoolean(basic_data.show_description.getData())>
114 <div class="lead">${articleDescription}</div>
115 </#if>
116 </div>
117 <#if basic_data.show_small_img.getData()== "right">
118 <div class="col-12 col-sm-6 col-lg-4">
119 <img src="${articleImage}" class="img-fluid img-thumbnail" alt="">
120 </div>
121 </#if>
122
123 </div>
124
125
126 <#if introduction??>
127 <div class="module_introduction">
128 ${introduction.getData()}
129 </div>
130 </#if>
131
132 <#if basic_data.show_small_img.getData()== "left" || basic_data.show_small_img.getData()== "right">
133 <hr />
134 </#if>
135
136 <#if section.getSiblings()?has_content>
137 <#list section.getSiblings() as cur_section>
138 <#if cur_section.title.getData()?trim != "">
139 <h2 class="h4" id="s${articleId+cur_section?index}">${cur_section.title.getData()}</h2>
140 </#if>
141 ${cur_section.content.getData()}
142 </#list>
143 </#if>
144
145 <#if secondary.secondarycontent.getSiblings()?has_content>
146 <#list secondary.secondarycontent.getSiblings() as cur_webContent>
147
148
149 <#if cur_webContent.getData() != "" && cur_webContent.look?? && cur_webContent.look.getData() == "show_below">
150 <#assign article = getArticle(cur_webContent) />
151 <#if article != "" >
152 <#assign articleContent = getArticleContent(article.getGroupId(), article.getArticleId(), article.getDDMTemplateKey()) />
153 <#-- <@JournalContentPortlet article.getArticleId() article.getGroupId() />-->
154 ${articleContent}
155 <@getEditIcon article />
156 </#if>
157 </#if>
158 </#list>
159 </#if>
160
161
162
163
164
165 </div>
166 <div class="col-12 col-md-6 col-xl-4">
167
168 <#if Image?? && Image.getData() != "" >
169 <#if !Image.showImage?? || (Image.showImage?? && getterUtil.getBoolean(Image.showImage.getData()))>
170 <figure>
171 <img class="img-fluid mb-4" alt="${Image.getAttribute("alt")}" data-fileentryid="${Image.getAttribute("fileEntryId")}" src="${Image.getData()}" />
172 <#if Image.legendeImage?? && Image.legendeImage.getData() != "">
173
174 <figcaption class="text-secondary font-weight-light text-right" style="margin-top:-25px;"><small>${Image.legendeImage.getData()}</small></figcaption>
175
176 </#if>
177 </figure>
178 </#if>
179 </#if>
180
181 <#if secondary.secondarycontent.getSiblings()?has_content>
182 <div class="secondaryContents">
183 <#list secondary.secondarycontent.getSiblings() as cur_webContent>
184 <#if cur_webContent.getData() != "" && cur_webContent.look?? && cur_webContent.look.getData() != "show_below">
185 <#assign look = cur_webContent.look.getData() />
186 <#assign cssClass = "" />
187
188 <#if look == "gray" >
189 <#assign cssClass = "bg-light" />
190 </#if>
191 <#assign article = getArticle(cur_webContent) />
192 <#if article != "" >
193 <#assign articleContent = getArticleContent(article.getGroupId(), article.getArticleId(), article.getDDMTemplateKey()) />
194 <div class="${cssClass}">
195 ${articleContent}
196 </div>
197 <@getEditIcon article />
198 </#if>
199 </#if>
200 </#list>
201 </div>
202 </#if>
203
204
205 <@relatedContentCard />
206
207
208 </div>
209
210
211 </div>
212
213</article>
214
215<#macro relatedContentCard>
216 <#local relatedEntries = getRelatedContent(Entry) />
217 <#if relatedEntries?size != 0 >
218 <div class="card mt-2">
219 <div class="card-header">
220 <h3 class="h5 mb-0">Siehe auch</h3>
221 </div>
222 <ul class="list-group list-group-flush mb-2">
223 <#list relatedEntries as cur_asset_link>
224 <#local relatedAssetEntry = getAssetEntry(cur_asset_link.entryId2) />
225 <#local relatedJournalArticle = JournalArticleLocalService.getLatestArticle(relatedAssetEntry.getClassPK())/>
226 <#-- ${getArticleContent(relatedJournalArticle.getGroupId(), relatedJournalArticle.getArticleId(), "" )}-->
227 <li class="list-group-item list-group-item-action">
228 <span style="font-size:0.8rem;" class="d-block">${relatedJournalArticle.getDisplayDate()?datetime}</span>
229 <a href="#" class="stretched-link">${relatedJournalArticle.getTitle(locale)}</a>
230 </li>
231 </#list>
232 </ul>
233 </div>
234 </#if>
235</#macro>
236
237<#function getArticle webContentString>
238 <#local webContentJSON = jsonFactoryUtil.createJSONObject(webContentString.getData()) />
239 <#local webContentClassPK = getterUtil.getLong(webContentJSON.getLong("classPK")) />
240 <#if JournalArticleLocalService.fetchLatestArticle(webContentClassPK)??>
241 <#return JournalArticleLocalService.fetchLatestArticle(webContentClassPK) />
242 <#else>
243 <#return "" />
244 </#if>
245
246</#function>
247
248<#function getRelatedContent entry>
249 <#local Links = AssetLinkLocalService.getDirectLinks(Entry.getEntryId())/>
250 <#return Links />
251</#function>
252
253<#function getAssetEntry entryId>
254 <#assign entry = AssetEntryLocalService.getAssetEntry(entryId) />
255 <#return entry />
256</#function>
257
258<#function getArticleContent gid aid DDMTemplateKey>
259 <#local article = JournalArticleLocalService.getArticle(gid?number, aid?upper_case) />
260 <#local articleContent = JournalArticleLocalService.getArticleContent(article, DDMTemplateKey, null, locale, model, themeDisplay) />
261 <#if articleContent?? >
262 <#return articleContent />
263 </#if>
264 <#return "" />
265</#function>
266
267<#macro getEditIcon articleToEdit>
268
269 <#assign PrimaryKey = articleToEdit.getResourcePrimKey()/>
270 <#assign entryToEdit = AssetEntryLocalService.getEntry(webContentClassName,PrimaryKey)/>
271
272 <#local assetRenderer = entryToEdit.getAssetRenderer() />
273 <#if assetRenderer.hasEditPermission(themeDisplay.getPermissionChecker())>
274 <#assign redirectURL = renderResponse.createRenderURL() />
275 ${redirectURL.setParameter("mvcPath", "/add_asset_redirect.jsp")}
276 ${redirectURL.setWindowState("pop_up")}
277
278 <#local editPortletURL = assetRenderer.getURLEdit(renderRequest, renderResponse, windowStateFactory.getWindowState("pop_up"), redirectURL)!"" />
279 <#if validator.isNotNull(editPortletURL)>
280 <#local title = languageUtil.format(locale, "edit-x", entryTitle, false) />
281
282 <@liferay_ui["icon"]
283 cssClass="icon-monospaced visible-interaction"
284 icon="pencil"
285 markupView="lexicon"
286 message=title
287 url="javascript:Liferay.Util.openWindow({id:'" + renderResponse.getNamespace() + "editAsset', title: '" + title + "', uri:'" + htmlUtil.escapeURL(editPortletURL.toString()) + "'});"
288 />
289
290 </#if>
291 </#if>
292</#macro>
293
294
295<#macro JournalContentPortlet aid gid>
296 <#local preferencesMap = {
297 "portletSetupPortletDecoratorId": "barebone",
298 "articleId":aid,
299 "groupId":gid
300
301 } />
302
303 <@liferay_portlet["runtime"]
304 defaultPreferences= "${freeMarkerPortletPreferences.getPreferences(preferencesMap)}"
305 persistSettings=false
306 settingsScope="portletInstance"
307 instanceId="B${gid?upper_case}${aid?upper_case}"
308 portletName="com_liferay_journal_content_web_portlet_JournalContentPortlet"
309 />
310
311
312 <#local VOID = freeMarkerPortletPreferences.reset() />
313</#macro>
314
315<#function getCategoriesOfVocabulary assetEntry vocabularyName>
316
317 <#assign categories = assetEntry.getCategories() />
318 <#assign categorylist = [] />
319 <#list categories as category>
320 <#assign vocabulary = AssetVocabularyLocalService.getVocabulary(category.vocabularyId)/>
321 <#if vocabulary.name == vocabularyName>
322 <#-- <#assign categorylist = categorylist + [ category.getDescription(locale) ] /> -->
323 <#assign categorylist = categorylist + [ category ] />
324 </#if>
325 </#list>
326 <#return categorylist />
327
328</#function>