Fel uppstod under bearbetning av mallen.
The following has evaluated to null or missing: ==> assetEntryLocalServiceUtil.fetchAssetEntry(assetEntryQuery) [in template "44029#44070#68029817" at line 32, column 16] ---- 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: #assign entry = assetEntryLocalServic... [in template "44029#44070#68029817" at line 32, column 1] ----
1<script type="text/javascript">
2 function disableContextMenu() {
3 window.frames["pdfframe"].contentDocument.oncontextmenu = function() {
4 return true;
5 };
6 var myFrame = document.getElementById('pdfframe');
7 myFrame.window.eval('document.addEventListener("contextmenu", function (e) {e.preventDefault();}, false)');
8 }
9</script>
10<html>
11 <head>
12 <style>
13 .embed-cover {
14 position: absolute;
15 top: 0;
16 left: 0;
17 bottom: 0;
18 right: 0;
19 /* Just for demonstration, remove this part */
20 opacity: 0.25;
21 }
22
23 .wrapper {
24 position: relative;
25 overflow: hidden;
26 }
27 </style>
28 </head>
29<#assign assetEntryLocalServiceUtil = staticUtil['com.liferay.asset.kernel.service.AssetEntryLocalServiceUtil'] />
30<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")/>
31<#assign assetEntryQuery = paramUtil.getLong(request, "assetEntry") />
32<#assign entry=assetEntryLocalServiceUtil.fetchAssetEntry(assetEntryQuery) />
33<#assign articleId=entry.getAssetRenderer().getArticle().getArticleId() />
34<#assign groupId=entry.getAssetRenderer().getArticle().getGroupId() />
35<#assign journalArticle = journalArticleLocalService.getLatestArticle(groupId, articleId, 0)/>
36<#assign ddmStructure = journalArticle.getDDMStructure() />
37<#assign ddmForm = ddmStructure.getDDMForm()/>
38<#assign ddmFieldLocalService = serviceLocator.findService("com.liferay.dynamic.data.mapping.service.DDMFieldLocalService")/>
39<#assign dlUtil = utilLocator.findUtil("com.liferay.document.library.kernel.util.DLUtil")>
40<#assign dlService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService")>
41<#assign dlAppService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppService")>
42<#assign ddmFormValues = ddmFieldLocalService.getDDMFormValues(ddmForm, journalArticle.getId()) />
43<#assign ddmFormFieldValues = ddmFormValues.getDDMFormFieldValues() />
44<#list ddmFormFieldValues as fieldName>
45 <#if fieldName.getFieldReference() == 'Upload90001913'>
46 <#assign jsonFactoryUtil = staticUtil["com.liferay.portal.kernel.json.JSONFactoryUtil"]>
47 <#assign customFieldJson = jsonFactoryUtil.createJSONObject(fieldName.getValue().getString(locale)) />
48 <#assign fileEntryId = getterUtil.getInteger(customFieldJson.get('fileEntryId'))>
49 <#if fileEntryId?? && fileEntryId!=0>
50 <#assign fileEntry = dlAppService.getFileEntry(fileEntryId) />
51 <#assign urlImage = "#">
52 <#list ddmFormFieldValues as fieldName>
53 <#if fieldName.getFieldReference() == 'Title'>
54 <#assign contentTitle =fieldName.getValue().getString(locale)>
55 <#assign viewDetailURL = "/documents/${fileEntry.getGroupId()}/${fileEntry.getFolderId()}/${fileEntry.getFileName()}/${fileEntry.getUuid()}" title="${contentTitle}" />
56 <body onLoad="disableContextMenu();" oncontextmenu="return false">
57 <div class="wrapper" style="width: 1000px; margin: auto;">
58 <embed id="pdfframe" src=${viewDetailURL}#toolbar=0" width="1000px;" height="20000px;"></embed>
59 <div class="embed-cover"></div>
60 </div>
61 </body>
62 </#if>
63 </#list>
64 <#else>
65 <#assign urlImage = "#">
66 <#list ddmFormFieldValues as fieldName>
67 <#if fieldName.getFieldReference() == 'Title'>
68 <#assign contentTitle =fieldName.getValue().getString(locale)>
69 <body onLoad="disableContextMenu();" oncontextmenu="return false">
70 <div class="wrapper" style="width: 1000px; margin: auto;">
71 <embed id="pdfframe" width="1000px;" height="20000px;">${contentTitle}</embed>
72 <div class="embed-cover"></div>
73 </div>
74 </body>
75 </#if>
76 </#list>
77 </#if>
78 </#if>
79
80 </#list>