Filtrovat
Při zpracování šablony došlo k chybě.
Java method "com.sun.proxy.$Proxy139.getFileEntryByUuidAndGroupId(String, long)" threw an exception when invoked on com.sun.proxy.$Proxy139 object "com.liferay.portlet.documentlibrary.service.impl.DLAppLocalServiceImpl@883573"; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign fileEntry = DLAppLocalService... [in template "20115#20151#1033758" in macro "printFileEntry" at line 54, column 9] - Reached through: @printFileEntry downloadURL=dokument ... [in template "20115#20151#1033758" at line 21, column 21] ----
1<#assign
2 DLAppLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppLocalService")
3/>
4<div class="box__inner">
5
6 <h1>Poskytnuté informace</h1>
7
8 <ul class="no-bullets">
9 <#if entries?has_content>
10 <#list entries as curEntry>
11 <#assign
12 renderer = curEntry.getAssetRenderer()
13 journalArticle = renderer.getArticle()
14 link = renderer.getURLViewInContext(renderRequest, renderResponse, '')
15
16 doc = saxReaderUtil.read(journalArticle.getContent())
17 nazev = doc.valueOf("//dynamic-element[@name='nazev']/dynamic-content/text()")
18 dokument = doc.valueOf("//dynamic-element[@name='dokument']/dynamic-content/text()")
19 />
20 <li>
21 <@printFileEntry downloadURL=dokument title=nazev />
22 <p class="smaller">Poslední aktualizace: ${journalArticle.getDisplayDate()?string("d. M. yyyy")}</p>
23 </li>
24 </#list>
25 </#if>
26 </ul>
27</div>
28
29<#macro printFileEntry downloadURL title>
30
31 <#assign
32 i = 0
33 docUuid = null!
34 />
35
36 <#list downloadURL?split("/") as x>
37 <#if i == 2>
38 <#assign docGroupId = x>
39 <#elseif i == 3>
40 <#assign docFolderId = x>
41 <#elseif i == 4>
42 <#assign docName = x>
43 <#elseif i == 5>
44 <#assign docUuid = x>
45 </#if>
46 <#assign i = i + 1>
47 </#list>
48
49 <#if docUuid?contains("?")>
50 <#assign docUuid = docUuid?split("?")[0] />
51 </#if>
52
53 <#if docGroupId?has_content && docUuid?has_content>
54 <#assign fileEntry = DLAppLocalService.getFileEntryByUuidAndGroupId(docUuid, docGroupId?number) />
55 <#elseif docGroupId?has_content && docFolderId?has_content && docName?has_content>
56 <#attempt>
57 <#assign fileEntry = DLAppLocalService.getFileEntry(docGroupId?number, docFolderId?number, docName) />
58 <#recover>
59 </#attempt>
60 </#if>
61
62 <#if fileEntry?has_content>
63 <a class="download-icon" href="${downloadURL}" target="_blank">
64 <span class="mpsv-icons-${fileEntry.getExtension()}"></span>
65 <span>
66 <span class="text-underline">${title}</span>
67 <@createSpanForDoc fileEntry = fileEntry />
68 </span>
69 </a>
70 </#if>
71</#macro>
72
73<#macro createSpanForDoc fileEntry>
74 <#assign
75 fileSize = fileEntry.getSize()
76 fileSizeType = "B"
77 />
78
79 <#list 1..2 as i>
80 <#if fileSize gt 1024>
81 <#assign fileSize = fileSize / 1024>
82 <#if i == 1>
83 <#assign fileSizeType = "kB">
84 <#else>
85 <#assign fileSizeType = "MB">
86 </#if>
87 </#if>
88 </#list>
89
90 <span class="text-sm ml-a-5">(${fileEntry.getExtension()?upper_case} ${fileSize?round} ${fileSizeType})</span>
91
92</#macro>