Asset Publisher Asset Publisher

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