Asset Publisher Asset Publisher

Fehler bei der Verarbeitung der Vorlage.
Expression file.icon is undefined on line 220, column 53 in 10097#20183917#29277611.
1<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService") /> 
2<#assign dlFileEntryLocalService = serviceLocator.findService("com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService") /> 
3<#assign imageLocalService = serviceLocator.findService("com.liferay.portal.service.ImageLocalService") /> 
4 
5<#assign journalArticleId = .vars["reserved-article-id"].data?replace('.', '-') /> 
6<#assign journalArticle = journalArticleLocalService.getArticle(getterUtil.getLong(groupId), journalArticleId) /> 
7<#assign journalArticleCreateDate = journalArticle.getCreateDate() /> 
8<#assign journalArticleModifiedDate = journalArticle.getModifiedDate() /> 
9<#assign journalArticleAuthor = .vars["reserved-article-author-name"].data /> 
10<#if coauthors?? && coauthors.data?has_content> 
11    <#assign journalArticleAuthor = coauthors.data /> 
12</#if> 
13<#if title?? && title.data?has_content> 
14    <#assign journalArticleTitle = title.data /> 
15<#else> 
16    <#assign journalArticleTitle = .vars["reserved-article-title"].data /> 
17</#if> 
18<#assign journalArticleUrlTitle = journalArticle.getUrlTitle() /> 
19 
20<#assign serviceContext = staticUtil["com.liferay.portal.service.ServiceContextThreadLocal"].getServiceContext() /> 
21<#assign themeDisplay = serviceContext.getThemeDisplay() /> 
22<#assign portletId = themeDisplay.getPortletDisplay().getId() /> 
23 
24<div id="article-${journalArticleId}" class="nfh-cp-article"> 
25 
26    <h1 class="title">${journalArticleTitle}</h1> 
27 
28    <#-- MEDIA SPOŁECZNOŚCIOWE --> 
29    <#assign printGroupId = "" /> 
30    <#if journalArticle.groupId != themeDisplay.scopeGroupId> 
31        <#assign printGroupId = themeDisplay.scopeGroupId /> 
32    </#if> 
33    <div class="social-media"> 
34        <div class="addthis_toolbox addthis_default_style"> 
35            <input type="image" alt="${languageUtil.get(locale, "print")}" src="${themeDisplay.pathThemeImages}/nfh-cp/icon-print-20x17.png"                 onclick="Nfhcp.AssetPublisherPortlet.printFullContent('${portletId}', '${journalArticleId}', '${printGroupId}', '${journalArticleUrlTitle}');" class="print"/> 
36        </div> 
37    </div> 
38 
39    <#-- ZDJĘCIA DO GALERII --> 
40    <#assign galleryImages = [] /> 
41    <#assign mainGalleryUuid = "" /> 
42    <#assign imageDesc = ""/> 
43 
44    <#-- Zdjęcie główne z galerii --> 
45    <#if mainphotogallery?? && mainphotogallery.data?has_content> 
46        <#assign url = mainphotogallery.data /> 
47        <#if url?starts_with("/image/image_gallery")> 
48            <#assign uuid = httpUtil.getParameter(url, "uuid", false)?string /> 
49            <#assign groupId = getterUtil.getLong(httpUtil.getParameter(url, "groupId", false), 0) /> 
50            <#if dlFileEntryLocalService.getDLFileEntryByUuidAndGroupId(uuid, groupId) ?? > 
51 
52                <#assign image = dlFileEntryLocalService.getDLFileEntryByUuidAndGroupId(uuid, groupId) /> 
53                <#if image??> 
54                    <#assign mainGalleryUuid = uuid /> 
55                    <#assign imageDesc = htmlUtil.escapeAttribute(image.description) /> 
56                </#if> 
57 
58                <#assign galleryImage = {"url" : mainphotogallery.data, "thumbUrl" : mainphotogallery.data + "&width=250", "desc" : imageDesc, "uuid" : mainGalleryUuid} /> 
59                <#assign galleryImages = galleryImages + [galleryImage] /> 
60            </#if> 
61        <#elseif url?contains("/documents/")> 
62            <#assign urlParts = stringUtil.split(url, "?") /> 
63            <#assign urlParts = stringUtil.split(urlParts[0]?string, "/") /> 
64            <#assign groupId = getterUtil.getLong(urlParts[2]) /> 
65            <#assign folderId = getterUtil.getLong(urlParts[3]) /> 
66            <#assign title = httpUtil.decodeURL(urlParts[4]?string, true) /> 
67 
68            <#if urlParts?size gt 5> 
69                <#assign uuid = urlParts[5]?string /> 
70                <#assign mainGalleryUuid = uuid /> 
71                <#assign image = dlFileEntryLocalService.getDLFileEntryByUuidAndGroupId(uuid, groupId) /> 
72            <#else> 
73                <#assign image = dlFileEntryLocalService.getFileEntry(groupId, folderId, title) /> 
74                <#assign mainGalleryUuid = image.uuid /> 
75            </#if> 
76 
77 
78            <#assign galleryImage = {"url" : mainphotogallery.data, "thumbUrl" : mainphotogallery.data + "&width=250", "desc" : htmlUtil.escapeAttribute(image.description), "uuid" : mainGalleryUuid} /> 
79            <#assign galleryImages = galleryImages + [galleryImage] /> 
80        </#if> 
81    <#-- Zdjęcie główne --> 
82    <#elseif mainphoto?? && mainphoto.data?has_content> 
83        <#assign galleryImage = {"url" : mainphoto.data, "thumbUrl" : mainphoto.data + "&width=250", "desc" : htmlUtil.escapeAttribute(mainphoto.maindesc.data), "uuid" : "----"} /> 
84        <#assign galleryImages = galleryImages + [galleryImage] /> 
85    </#if> 
86 
87    <#-- Zdjęcia dodatkowe z dysku --> 
88    <#list additionalphoto.getSiblings() as additionalphotoItem> 
89        <#if additionalphotoItem.data?has_content> 
90            <#assign galleryImage = {"url" : additionalphotoItem.data, "thumbUrl" : additionalphotoItem.data + "&width=250", "desc" : htmlUtil.escapeAttribute(additionalphotoItem.photodescription.data), "uuid" : "----"} /> 
91            <#assign galleryImages = galleryImages + [galleryImage] /> 
92        </#if> 
93    </#list> 
94 
95    <#-- Zdjęcia z galerii --> 
96    <#if additionalphotogallery?? && additionalphotogallery.data?has_content> 
97        <#assign url = additionalphotogallery.data /> 
98        <#if url?starts_with("/image/image_gallery")> 
99            <#assign uuid = httpUtil.getParameter(url, "uuid", false)?string /> 
100            <#assign groupId = getterUtil.getLong(httpUtil.getParameter(url, "groupId", false), 0) /> 
101 
102            <#if dlFileEntryLocalService.getDLFileEntryByUuidAndGroupId(uuid, groupId)?? > 
103                <#assign image = dlFileEntryLocalService.getDLFileEntryByUuidAndGroupId(uuid, groupId) /> 
104            </#if> 
105        <#elseif url?contains("/documents/")> 
106            <#assign urlParts = stringUtil.split(url, "/") /> 
107            <#assign groupId = getterUtil.getLong(urlParts[2]) /> 
108            <#assign folderId = getterUtil.getLong(urlParts[3]) /> 
109            <#assign title = httpUtil.decodeURL(urlParts[4]?string, true) /> 
110 
111            <#if dlFileEntryLocalService.getFileEntry(groupId, folderId, title)?? > 
112                <#assign image = dlFileEntryLocalService.getFileEntry(groupId, folderId, title) /> 
113            </#if> 
114        </#if> 
115 
116        <#if image??> 
117            <#assign folderId = image.folderId /> 
118            <#assign folderImages = dlFileEntryLocalService.getFileEntries(groupId, folderId) /> 
119            <#if folderImages??> 
120                <#list folderImages?sort_by("name") as folderImage> 
121                    <#if folderImage.uuid != mainGalleryUuid> 
122                        <#assign folderImageDescription = folderImage.description /> 
123                        <#if folderImage.description?lower_case == folderImage.title?lower_case + folderImage.extension?lower_case> 
124                            <#assign folderImageDescription = "" /> 
125                        </#if> 
126 
127                        <#assign galleryImage = {"url" : "/image/image_gallery?uuid=" + folderImage.uuid + "&groupId=" + folderImage.groupId, 
128                            "thumbUrl" : "/image/image_gallery?uuid=" + folderImage.uuid + "&groupId=" + folderImage.groupId + "&width=250", 
129                            "desc" : htmlUtil.escapeAttribute(folderImageDescription), 
130                            "uuid" : folderImage.uuid} /> 
131                        <#assign galleryImages = galleryImages + [galleryImage] /> 
132                    </#if> 
133                </#list> 
134            </#if> 
135        </#if> 
136    </#if> 
137 
138    <#-- GALERIA OBRAZÓW --> 
139    <#if galleryImages?size gt 1> 
140        <div id="gallery-${journalArticleId}" class="multiple-image-gallery royalSlider rsDefault"> 
141            <#list galleryImages as galleryImage> 
142                <a href="${galleryImage.url + "&width=560"}" class="rsImg" data-rsbigimg="${galleryImage.url}"> 
143                    <img src="${galleryImage.thumbUrl}" width="125" uuid="${galleryImage.uuid}" class="rsTmb" /> 
144                    ${galleryImage.desc} 
145                </a> 
146            </#list> 
147        </div> 
148    <#elseif galleryImages?size == 1> 
149        <div class="single-image-gallery"> 
150            <div id="gallery-${journalArticleId}"> 
151                <#list galleryImages as galleryImage> 
152                    <a href="${galleryImage.url}" rel="lightbox" title="${htmlUtil.escape(galleryImage.desc)}"> 
153                        <img src="${galleryImage.url}&width=716" alt="${htmlUtil.escape(galleryImage.desc)}" /> 
154                        <#if galleryImage.desc?has_content> 
155                            <div class="mainphotogallery-description">${galleryImage.desc}</div>  
156                        </#if> 
157                    </a> 
158                </#list> 
159            </div> 
160        </div> 
161    </#if> 
162 
163    <#-- ZAWARTOŚĆ ARTYKUŁU --> 
164    <#if abstract?? && abstract.data?has_content> 
165        <p class="description">${abstract.data}</p> 
166    <#else> 
167        <p class="description">${.vars["reserved-article-description"].data}</p> 
168    </#if> 
169 
170    <div class="content">${content.data}</div> 
171 
172    <#-- ZAŁĄCZNIKI --> 
173    <#assign hasAttachments = false /> 
174    <#if file?? && file.getSiblings()?size gt 0> 
175        <#list file.getSiblings() as fileItem> 
176            <#if fileItem.filedescription?? && fileItem.filedescription.data?has_content> 
177                <#assign fileItemName = fileItem.filedescription.data /> 
178            <#elseif fileItem.filetitle?? && fileItem.filetitle.data?has_content> 
179                <#assign fileItemName = fileItem.filetitle.data /> 
180            <#else> 
181                <#assign fileItemName = fileItem.data /> 
182            </#if> 
183            <#if fileItemName?? && fileItemName?has_content> 
184                <#assign hasAttachments = true /> 
185            </#if> 
186        </#list> 
187    </#if> 
188    <#if hasAttachments> 
189        <div class="attachments"> 
190            <h2>${languageUtil.get(locale, "resources-to-get")}</h2> 
191            <ul class="attachment-list"> 
192                <#list file.getSiblings() as fileItem> 
193                    <#if fileItem.filedescription?? && fileItem.filedescription.data?has_content> 
194                        <#assign fileItemName = fileItem.filedescription.data /> 
195                    <#elseif fileItem.filetitle?? && fileItem.filetitle.data?has_content> 
196                        <#assign fileItemName = fileItem.filetitle.data /> 
197                    <#else> 
198                        <#assign fileItemName = fileItem.data /> 
199                    </#if> 
200 
201                    <#if fileItemName?? && fileItemName?has_content> 
202                        <#assign url = fileItem.data /> 
203                        <#if url?contains("/documents/")> 
204                            <#assign urlParts = stringUtil.split(url, "?") /> 
205                            <#assign urlParts = stringUtil.split(urlParts[0]?string, "/") /> 
206                            <#assign groupId = getterUtil.getLong(urlParts[2]) /> 
207                            <#assign folderId = getterUtil.getLong(urlParts[3]) /> 
208                            <#assign title = httpUtil.decodeURL(urlParts[4]?string, true) /> 
209                            <#if urlParts?size gt 5> 
210                                <#assign uuid = urlParts[5]?string /> 
211                                <#if dlFileEntryLocalService.getDLFileEntryByUuidAndGroupId(uuid, groupId)?? > 
212                                    <#assign file = dlFileEntryLocalService.getDLFileEntryByUuidAndGroupId(uuid, groupId) /> 
213                                </#if> 
214                            <#else> 
215                                <#if dlFileEntryLocalService.getFileEntry(groupId, folderId, title)?? > 
216                                    <#assign file = dlFileEntryLocalService.getFileEntry(groupId, folderId, title) /> 
217                                </#if> 
218                            </#if> 
219                            <#if file?? > 
220                                <#assign fileIcon = file.icon + ".png" /> 
221                            </#if>                        </#if> 
222                        <#if !fileIcon?? || !fileIcon?has_content> 
223                            <#assign fileItemExt = fileItem.data /> 
224                            <#assign indexOfDot = fileItemExt?last_index_of(".") + 1 /> 
225                            <#assign indexOfSlash = fileItemExt?last_index_of("/") /> 
226                            <#if indexOfSlash gt indexOfDot> 
227                                <#assign fileItemExt = fileItemExt?substring(0, indexOfSlash) /> 
228                            </#if> 
229                            <#assign fileIcon = fileItemExt?substring(indexOfDot) + ".png" /> 
230                        </#if> 
231                        <#if fileItem.wcagdescription?? && fileItem.wcagdescription.data?has_content> 
232                            <#assign fileItemWCAGDesc = fileItem.wcagdescription.data /> 
233                        <#else> 
234                            <#assign fileItemWCAGDesc = "" /> 
235                        </#if> 
236                        <#if file?? > 
237                            <#assign 
238                            fExtension = file.extension 
239                            textFormatter = staticUtil["com.liferay.portal.kernel.util.TextFormatter"] 
240                            sizeFormatted = textFormatter.formatStorageSize(file.size, locale) 
241                            /> 
242                        </#if> 
243 
244                        <li> 
245                            <a href="${fileItem.data}" target="_blank" <#if fileItemWCAGDesc?? && fileItemWCAGDesc?has_content>title="${htmlUtil.escapeAttribute(fileItemWCAGDesc)}"</#if>><img src="${themeDisplay.pathThemeImages}/file_system/small/${fileIcon}"></a> 
246                            <a href="${fileItem.data}" target="_blank" <#if fileItemWCAGDesc?? && fileItemWCAGDesc?has_content>title="${htmlUtil.escapeAttribute(fileItemWCAGDesc)}"</#if>>${fileItemName} (${stringUtil.upperCase(fExtension)}, ${sizeFormatted})</a> 
247                        </li> 
248                    </#if> 
249                </#list> 
250            </ul> 
251        </div> 
252    </#if> 
253</div>