Fehler bei der Verarbeitung der Vorlage.
'json' parameter of getRelatedMediaObject() was not a hash / object and also not an empty string (maybe you forgot a 'JSONFactoryUtil.looseDeserialize()' to deserialize json earlier?): "{\"groupId\":\"252038\",\"title\":\"Ai 02_2018 Plate\",\"uuid\":\"2d1451ab-6981-3bae-1ac6-9105b87c9bc9\",\"version\":\"1.0\"}"

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #stop ("'json' parameter of getRelate...  [in template "kas-de-theme_SERVLET_CONTEXT_/templates/functions/content-functions/CFRelatedMediaObject.ftl" in function "getRelatedMediaObject" at line 51, column 9]
	- Reached through: mediaData = getRelatedMediaObject(med...  [in template "252001#252047#252845" at line 311, column 13]
	- Reached through: #assign-container  [in template "252001#252047#252845" at line 309, column 9]
----
1<#-- used @ Veranstaltung-Detailseite Intro 
2    used @ Publikation-Detailseite Intro 
3--> 
4 
5<#-- 
6Web content templates to display teaser on thema detail page 
7 
8Generic template for detail pages Intro / Teaser element 
9--> 
10<#-- 
11Display the current page title 
12--> 
13<#include "${fullTemplatesPath}/functions/relatedContentUtil.ftl" /> 
14<#include "${fullTemplatesPath}/macros/debugging.ftl" /> 
15 
16<#include "${fullTemplatesPath}/macros/page-modules/PMIntro.ftl" /> 
17<#include "${fullTemplatesPath}/macros/atomic-modules/AMMetadata.ftl" /> 
18<#include "${fullTemplatesPath}/macros/atomic-modules/AMDatetime.ftl" /> 
19 
20 
21<#-- 
22    renders the Intro for nearly all Pages 
23    TODO: remove Share? (was in the designs, but not anymore?) 
24    TODO: check if languageSelect/filter are working (js) 
25 
26    - portletId 
27    - data = { 
28        "media": string (src from image), 
29        "category": string, 
30        "title": string, 
31        "author": string, 
32        "subheadline": string, 
33        "copy": string, 
34        "filter": { 
35            "id": string, 
36            "name": string, 
37            "entries": Array<Object> ({key:value}), 
38        }, 
39        "languageSelect": { 
40            "id": string, 
41            "name": string, 
42            "entries": Array<Object> ({key:value}), 
43        }, 
44        "meta": { 
45            "pos"; string (top/bottom) 
46            "date": string, 
47            "hash": string, 
48            "info": string, (url) 
49        }, 
50        "share" : { 
51            "login": string, 
52            "print": string, 
53            "mail": string, 
54            "multishare": string?? (tbd) 
55
56        - AMMetadata: macro 
57        - position: String ("top") -> defines wether the meta-data should be rendered above or below the intro-content 
58
59--> 
60 
61<#assign 
62    JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") 
63    FrontendService = serviceLocator.findService("de.usu.kas.frontend.service.FrontendService") 
64    JSONFactoryUtil = serviceLocator.findService("com.liferay.portal.kernel.json.JSONFactoryUtil") 
65    ServiceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext() 
66 
67    DLUtil = serviceLocator.findService("com.liferay.document.library.kernel.util.DLUtil") 
68    DLAPP = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppLocalService") 
69 
70    themeDisplay = ServiceContext.getThemeDisplay() 
71    editmode = FrontendService.isPrivilegedUser(themeDisplay) 
72 
73    languageId = themeDisplay.getLocale() 
74    groupId = themeDisplay.getScopeGroupId() 
75    currentUrl = themeDisplay.getURLCurrent() 
76 
77    layout = themeDisplay.getLayout() 
78    layouttpl = layout.getTypeSettingsProperties().getProperty("layout-template-id") 
79/> 
80 
81<#setting locale="${languageId}"> 
82 
83<#-- get article from url --> 
84 
85<#assign entry = FrontendService.getArticleToUrl(currentUrl, groupId?number)! > 
86 
87 
88<#if entry?has_content> 
89 
90    <#if entry.resourcePrimKey??> 
91        <#assign primaryKey = entry.resourcePrimKey?number > 
92    <#elseif entry.classPK??> 
93        <#assign primaryKey = entry.classPK?number > 
94    </#if> 
95 
96    <#assign 
97        jsonString = FrontendService.getWebcontent(primaryKey) 
98        json = JSONFactoryUtil.looseDeserialize(jsonString) 
99 
100        title = entry.getTitle(languageId) 
101        data = { 
102            "title": title 
103
104    /> 
105    <@debugJsonString jsonString "ADT_KASDE_DYNAMIC_INTRO" /> 
106 
107    <#if hasContent('untertitel', languageId, json)> 
108        <#assign data = data + { "subheadline": getValueForLanguage('untertitel', languageId, json, "first") } > 
109    </#if> 
110 
111    <#if hasContent('beschreibung', languageId, json)> 
112        <#assign data = data + { "copy": getValueForLanguage('beschreibung', languageId, json, "first") } > 
113    </#if> 
114 
115    <#-- fill meta data --> 
116    <#assign meta = {} /> 
117 
118    <#-- PUBLIKATIONEN DETAIL --> 
119    <#if layouttpl?contains("LAYOUT_KASDE_PUBLIKATIONEN_DETAIL")> 
120 
121        <#if hasContent('coverDMTKASDEMEDIUM', languageId, json)> 
122            <#assign 
123                coverBildString = getValueForLanguage('coverDMTKASDEMEDIUM', languageId, json, "first")?trim 
124            /> 
125            <#if coverBildString?has_content> 
126                <#assign  
127                    coverBild = JSONFactoryUtil.looseDeserialize(coverBildString) 
128                    dMTJsonObject = FrontendService.getDMTJsonObject( coverBild.groupId?number, coverBild.uuid, locale ) 
129                    linkToDMT = FrontendService.getLinkToDMT(dMTJsonObject) 
130                    data = data + { "media": linkToDMT, "meta" : dMTJsonObject } 
131                /> 
132                <#if dMTJsonObject.quelle??> 
133                    <#assign meta = meta + { "quelle": dMTJsonObject.quelle } /> 
134                </#if> 
135            </#if> 
136        <#-- uncomment to display pdf cover as Intro Image 
137        <#elseif hasContent('document_pdfDMTBASICDOCUMENT', languageId, json)> 
138            <#assign 
139                pdfDocument = getValueForLanguage('document_pdfDMTBASICDOCUMENT', languageId, json, "first") 
140                fileEntry = FrontendService.getFileEntry(pdfDocument.uuid, groupId?number)!/> 
141            <#if fileEntry?has_content> 
142              <#assign 
143                  linkToThumbnail = DLUtil.getThumbnailSrc(fileEntry , themeDisplay) 
144                  data = data + { "media": linkToThumbnail } 
145              /> 
146            </#if> 
147        --> 
148        </#if> 
149 
150        <#assign 
151            meta = meta + { "orderInfo": "true" } 
152            verbundJournalArticle = FrontendService.getVerbundToPublikation( entry )!"" 
153        /> 
154         
155         
156 
157        <#if hasContent('erscheinungsdatum', languageId, json)> 
158            <#assign 
159                erscheinungsdatum = getValueForLanguage('erscheinungsdatum', languageId, json, "first") 
160            /> 
161            <#if erscheinungsdatum?has_content > 
162                <#assign 
163                    erscheinungsdatumFormatted = FrontendService.getDateFormatLong( erscheinungsdatum, languageId ) 
164                    meta = meta + { "date": erscheinungsdatumFormatted } 
165                /> 
166            </#if> 
167        </#if> 
168 
169        <#if verbundJournalArticle?has_content> 
170            <#assign 
171                verbundJsonString = FrontendService.getWebcontent(verbundJournalArticle.resourcePrimKey) 
172                verbundJson = JSONFactoryUtil.looseDeserialize(verbundJsonString) 
173                laufendenummer = getValueForLanguage('laufendenummer', languageId, verbundJson, "first")  
174            /> 
175            <@debugJsonString verbundJsonString "ADT_KASDE_DYNAMIC_INTRO-verbundJournalArticle" /> 
176            <#assign meta = meta + { "laufendenummer": laufendenummer } > 
177        </#if> 
178 
179 
180        <#if meta?has_content> 
181            <#assign data = data + {"meta": meta } > 
182        </#if> 
183 
184    </#if> 
185    <#-- PUBLIKATIONEN DETAIL END --> 
186     
187 
188    <#-- VERANSTALTUNGEN DETAIL --> 
189    <#if layouttpl?contains("LAYOUT_KASDE_VERANSTALTUNGEN_DETAIL")> 
190        <#assign 
191            friendlyUrl = FrontendService.getFriendlyUrl(primaryKey, languageId, groupId)!"" 
192            languages = entry.getAvailableLanguageIds() 
193            links = [] 
194        /> 
195        <#if languages?has_content && friendlyUrl?has_content> 
196            <#if (languages?size > 1) > 
197                <#list languages as language> 
198                    <#assign 
199                        link = { 
200                        "key": language, 
201                        "value": languageUtil.getLocale(language).getDisplayLanguage(languageId), 
202                        "url": "/c/portal/update_language?p_l_id=" + 
203                                    layout.plid + "&redirect=" + friendlyUrl + 
204                                    "&languageId=" + language 
205
206                    /> 
207                    <#if language == languageId> 
208                        <#assign link = link + { "selected": "true" } > 
209                    </#if> 
210                    <#assign links = links + [link]> 
211                </#list> 
212                <#assign 
213                    data = data + { 
214                        "languageSelect": { 
215                            "id": "languageSelectRedirect", 
216                            "name": "languageselectRedirect", 
217                            "entries": links, 
218                            "label": languageUtil.get(languageId, "diese.veranstaltung.ist.in.weiteren.sprachen.verfuegbar") 
219
220
221                /> 
222            </#if> 
223        </#if> 
224    </#if> 
225 
226    <#if hasContent('erscheinungsdatum', languageId, json)> 
227        <#assign 
228            startdate = getValueForLanguage('erscheinungsdatum', languageId, json, "first") 
229            start = { 
230                "date": "", 
231                "full": FrontendService.getDateFormatLong( startdate, locale ), 
232                "year": startdate?date.iso?string('yyyy'), 
233                "month": startdate?date.iso?string("MMM"), 
234                "day": startdate?date.iso?string("dd") 
235
236            meta = meta + { "start": start } 
237        /> 
238    </#if> 
239 
240    <#if hasContent('startdatum', languageId, json)> 
241        <#assign 
242            startdate = getValueForLanguage('startdatum', languageId, json, "first") 
243            start = { 
244                "date": startdate, 
245                "full": FrontendService.getDateFormatLong( startdate, locale ), 
246                "year": startdate?date.iso?string("yyyy"), 
247                "month": startdate?date.iso?string("MMM"), 
248                "day": startdate?date.iso?string("dd") 
249
250            meta = meta + { "start": start } 
251        /> 
252    </#if> 
253     
254    <#if hasContent('endedatum', languageId, json)> 
255        <#assign 
256            enddate = getValueForLanguage('endedatum', languageId, json, "first") 
257            end = { 
258                "date": enddate, 
259                "full": FrontendService.getDateFormatLong( enddate, locale ), 
260                "year": enddate?date.iso?string("yyyy"), 
261                "month": enddate?date.iso?string("MMM"), 
262                "day": enddate?date.iso?string("dd") 
263
264            meta = meta + { "end": end } 
265        /> 
266    </#if> 
267 
268    <#if hasContent('startzeit', languageId, json)> 
269        <#assign 
270            startzeit = getValueForLanguage('startzeit', languageId, json, "first") 
271        /> 
272        <#if startzeit?has_content > 
273                <#assign meta = meta + { "startzeit": startzeit } /> 
274        </#if> 
275    </#if> 
276     
277    <#if hasContent('endezeit', languageId, json)> 
278        <#assign 
279            endezeit = getValueForLanguage('endezeit', languageId, json, "first") 
280            meta = meta + { "endezeit": endezeit } 
281        /> 
282    </#if> 
283 
284    <#if hasContent('ortWCSKASDEORT', languageId, json)> 
285        <#assign 
286            ortWCSKASDEORT = JSONFactoryUtil.looseDeserialize(getValueForLanguage('ortWCSKASDEORT', languageId, json, "first")) 
287            ortWCSKASDEORTPrimaryKey = ortWCSKASDEORT.classPK?number 
288            ortWCSKASDEORTWebContent = FrontendService.getWebcontentByPk(ortWCSKASDEORTPrimaryKey) 
289            ortWCSKASDEORTTitle = ortWCSKASDEORTWebContent.getTitle(languageId) 
290 
291            meta = meta + { "ortWCSKASDEORT": ortWCSKASDEORTTitle } 
292        /> 
293    </#if> 
294 
295 
296    <#if hasContent('veranstaltungsnummer', languageId, json)> 
297        <#assign 
298            verauuid = getValueForLanguage('veranstaltungsnummer', languageId, json, "first") 
299            meta = meta + { "verauuid": verauuid } 
300        /> 
301    </#if> 
302 
303     
304    <#if (data.meta)?has_content > 
305        <#assign meta = data.meta /> 
306    </#if> 
307 
308    <#if !(data.media)?has_content && hasContent('mediumDMTKASDEMEDIUM', languageId, json)> 
309        <#assign  
310            medium = getValueForLanguage('mediumDMTKASDEMEDIUM', languageId, json, "first") 
311            mediaData = getRelatedMediaObject(medium, themeDisplay, languageId, FrontendService, "hd-resolution") 
312        /> 
313        <#assign data = data + { "media": mediaData.url , "meta" : mediaData.meta} > 
314        
315         
316        <#if mediaData.meta?? && mediaData.meta.quelle??> 
317            <#assign meta = meta + data.meta + { "quelle": mediaData.meta.quelle } /> 
318        </#if> 
319    </#if> 
320 
321 
322    <#if meta?has_content> 
323        <#assign data = data + {"meta": meta } > 
324    </#if> 
325 
326    <#-- END fill meta data --> 
327 
328    <#if hasContent('autorenWCSKASDEPERSON', languageId, json)> 
329        <#assign 
330            journalArticles = getValueForLanguage('autorenWCSKASDEPERSON', languageId, json) 
331            authors = [] 
332        /> 
333        <#list journalArticles as articleString> 
334            <#assign article = JSONFactoryUtil.looseDeserialize(articleString) /> 
335            <#if article?has_content &&article?is_hash && article.classPK??> 
336                <#assign articleDereferenced = FrontendService.resolveContactInstanceToPerson(article, languageId)!"" /> 
337                <#if articleDereferenced?has_content > 
338                    <#assign 
339                        author = "" 
340                        articlePrimaryKey = articleDereferenced.classPK?number 
341                        articleJsonString = FrontendService.getWebcontent(articlePrimaryKey) 
342                        articleJson = JSONFactoryUtil.looseDeserialize(articleJsonString) 
343                    /> 
344                    <@debugJsonString articleJsonString "ADT_KASDE_DYNAMIC_INTRO-autorenWCSKASDEPERSON" /> 
345                    <#if hasValue('vorname', languageId, articleJson)> 
346                        <#assign author = author + getValueForLanguage('vorname', languageId, articleJson, " ") + " "> 
347                    </#if> 
348                    <#if hasValue('nachname', languageId, articleJson)> 
349                        <#assign author = author + getValueForLanguage('nachname', languageId, articleJson, " ") + " "> 
350                    </#if> 
351                    <#assign authors = authors + [author?trim]> 
352                </#if> 
353            </#if> 
354        </#list> 
355        <#if authors?has_content> 
356            <#assign data = data + { "author": authors?join(", ") } > 
357        </#if> 
358    </#if> 
359 
360    <#if layouttpl?contains("LAYOUT_KASDE_VERANSTALTUNGEN_DETAIL") > 
361        <#assign categories = FrontendService.getCategoriesToArticle(primaryKey, "VERANSTALTUNGSTYP")! > 
362        <#if categories?has_content && categories[0]?has_content > 
363            <#assign data = data + { "category": categories[0].getTitle(languageId,true)! } > 
364        </#if> 
365 
366        <#if hasContent('ausgebucht', languageId, json)> 
367            <#assign data = data + { "ausgebucht" : getValueForLanguage('ausgebucht', languageId, json, "first") }> 
368        </#if> 
369 
370        <#if hasContent('storniert', languageId, json)> 
371            <#assign data = data + { "storniert" : getValueForLanguage('storniert', languageId, json, "first") }> 
372        </#if> 
373 
374    <#elseif layouttpl?contains("LAYOUT_KASDE_PUBLIKATIONEN_DETAIL") > 
375        <#assign categories = FrontendService.getCategoriesToArticle(primaryKey, "PUBLIKATIONSREIHE")! > 
376        <#if categories?has_content && categories[0]?has_content > 
377            <#assign data = data + { "category": categories[0].getTitle(languageId,true)! } > 
378        </#if> 
379    <#else> 
380        <#assign categories = FrontendService.getCategoriesToArticle(primaryKey, "THEMA")! > 
381        <#if categories?has_content && categories[0]?has_content > 
382                <#assign data = data + { "category": categories[0].getTitle(languageId,true)! } > 
383        </#if> 
384    </#if> 
385 
386 
387    <#if hasContent('document_pdfDMTBASICDOCUMENT', languageId, json)> 
388        <#assign 
389            languages = [] 
390        /> 
391 
392        <#list json["document_pdfDMTBASICDOCUMENT"]?keys as language> 
393            <#if language?has_content > 
394                <#assign  
395                    docRefJson = getValueForLanguage('document_pdfDMTBASICDOCUMENT', language, json, "first") 
396                    docRef = JSONFactoryUtil.looseDeserialize(docRefJson) 
397                    lang = languageUtil.getLocale(language)!"" 
398                     
399                    docGroupId = docRef["groupId"]?number 
400                    docUuid = docRef["uuid"] 
401                    dMTJsonObject = FrontendService.getDMTJsonObject( docGroupId, docUuid, locale ) 
402                    dMTLink = FrontendService.getLinkToDMT( dMTJsonObject ) 
403                /> 
404                <#if lang?has_content> 
405                    <#assign 
406                        languages = languages + [ 
407                        {  
408                            "key": language, 
409                            "value": languageUtil.getLocale(language).getDisplayLanguage(languageId), "url": dMTLink  
410                        }] 
411                    /> 
412                </#if> 
413            </#if> 
414        </#list> 
415 
416        <#if (languages?size > 1)> 
417            <#attempt> 
418            <#assign 
419                data = data + { "languageSelect": { 
420                    "id": "languageSelect", 
421                    "name": "languageselect", 
422                    "entries": languages, 
423                    "documents": "", 
424                    "button": "true" 
425                }} 
426            /> 
427            <#recover> 
428            </#attempt> 
429        </#if> 
430    </#if> 
431 
432    <@PMIntro "ADT_KASDE_DYNAMIC_INTRO" data AMMetadata AMDatetime "bottom" /> 
433    ${FrontendService.getEditArticleHtml(primaryKey, themeDisplay)} 
434 
435<#elseif (editmode?? && editmode)> 
436    <@errorMessage languageUtil.get(locale, "kein.journalArticle.gefunden") "ADT_KASDE_DYNAMIC_INTRO" layouttpl currentUrl /> 
437</#if>