Wydawca treści Wydawca treści

Wystąpił błąd podczas przetwarzania szablonu.
Error on line 212, column 33 in 10097#20183917#ARTICLE-EVENT
dlFileEntryLocalService.getFileEntryByUuidAndGroupId(uuid, groupId) is undefined.
It cannot be assigned to file
1<#setting locale="${locale?string}"> 
2 
3<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService") /> 
4<#assign dlFileEntryLocalService = serviceLocator.findService("com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService") /> 
5 
6<#assign journalArticleId = .vars["reserved-article-id"].data?replace('.', '-') /> 
7<#assign journalArticle = journalArticleLocalService.getArticle(getterUtil.getLong(groupId), journalArticleId) /> 
8<#assign journalArticleCreateDate = journalArticle.getCreateDate() /> 
9<#assign journalArticleModifiedDate = journalArticle.getModifiedDate() /> 
10<#assign journalArticleAuthor = .vars["reserved-article-author-name"].data /> 
11<#if coauthors?? && coauthors.data?has_content> 
12    <#assign journalArticleAuthor = coauthors.data /> 
13</#if> 
14<#if title?? && title.data?has_content> 
15    <#assign journalArticleTitle = title.data /> 
16<#else> 
17    <#assign journalArticleTitle = .vars["reserved-article-title"].data /> 
18</#if> 
19<#assign journalArticleUrlTitle = journalArticle.getUrlTitle() /> 
20 
21<#assign serviceContext = staticUtil["com.liferay.portal.service.ServiceContextThreadLocal"].getServiceContext() /> 
22<#assign themeDisplay = serviceContext.getThemeDisplay() /> 
23<#assign portletId = themeDisplay.getPortletDisplay().getId() /> 
24 
25<div id="article-${journalArticleId}" class="nfh-cp-article"> 
26 
27    <h1 class="title">${journalArticleTitle}</h1> 
28 
29    <div class="metadata">${journalArticleModifiedDate?string["dd.MM.yyyy"]} | ${journalArticleAuthor}</div> 
30 
31    <#-- MEDIA SPOŁECZNOŚCIOWE --> 
32    <#assign printGroupId = "" /> 
33    <#if journalArticle.groupId != themeDisplay.scopeGroupId> 
34        <#assign printGroupId = themeDisplay.scopeGroupId /> 
35    </#if> 
36    <div class="social-media"> 
37        <div class="addthis_toolbox addthis_default_style"> 
38            <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a> 
39            <a class="addthis_button_google_plusone" g:plusone:size="medium"></a> 
40            <a class="addthis_button_tweet"></a> 
41            <img title="${languageUtil.get(locale, "print")}" src="${themeDisplay.pathThemeImages}/nfh-cp/icon-print-20x17.png"  
42                onclick="Nfhcp.AssetPublisherPortlet.printFullContent('${portletId}', '${journalArticleId}', '${printGroupId}', '${journalArticleUrlTitle}');" class="print"> 
43            <script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script> 
44            <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-55c31ccb1e1d814d"></script> 
45        </div> 
46    </div> 
47 
48    <#-- ZDJĘCIE GÓRNE --> 
49    <#assign showImageGallery = false /> 
50    <#if mainphoto?? && mainphoto.data?has_content> 
51        <#assign showImageGallery = true /> 
52    </#if> 
53    <#if showImageGallery> 
54        <div id="gallery-${journalArticleId}" class="event"> 
55            <#assign eventDateFromAsString1 = "" /> 
56            <#assign eventDateFromAsString2 = "" /> 
57            <#assign eventDateToAsString2 = "" /> 
58 
59            <#if event?? && event.datefrom?? && event.datefrom.data?has_content> 
60                <#if event.datefrom.data?matches("^\\d+$")> 
61                    <#assign eventDateFrom = event.datefrom.data?number?number_to_datetime /> 
62                <#else> 
63                    <#assign eventDateFrom = event.datefrom.data?datetime("yyyy-MM-dd HH:mm") /> 
64                </#if> 
65 
66                <#assign eventDateFromAsString1 = eventDateFrom?string("d '<span>'MMMM'</span>'") /> 
67                <#assign eventDateFromAsString2 = eventDateFrom?string("d MMMM 'godz.' HH:mm") /> 
68 
69                <#assign eventDateFromAsString1 = eventDateFromAsString1?replace("styczeń", "stycznia") /> 
70                <#assign eventDateFromAsString1 = eventDateFromAsString1?replace("luty", "lutego") /> 
71                <#assign eventDateFromAsString1 = eventDateFromAsString1?replace("marzec", "marca") /> 
72                <#assign eventDateFromAsString1 = eventDateFromAsString1?replace("kwiecień", "kwietnia") /> 
73                <#assign eventDateFromAsString1 = eventDateFromAsString1?replace("maj$", "maja") /> 
74                <#assign eventDateFromAsString1 = eventDateFromAsString1?replace("czerwiec", "czerwca") /> 
75                <#assign eventDateFromAsString1 = eventDateFromAsString1?replace("lipiec", "lipca") /> 
76                <#assign eventDateFromAsString1 = eventDateFromAsString1?replace("sierpień", "sierpnia") /> 
77                <#assign eventDateFromAsString1 = eventDateFromAsString1?replace("wrzesień", "września") /> 
78                <#assign eventDateFromAsString1 = eventDateFromAsString1?replace("październik$", "października") /> 
79                <#assign eventDateFromAsString1 = eventDateFromAsString1?replace("listopad$", "listopada") /> 
80                <#assign eventDateFromAsString1 = eventDateFromAsString1?replace("grudzień", "grudnia") /> 
81 
82                <#assign eventDateFromAsString2 = eventDateFromAsString2?replace("styczeń", "stycznia") /> 
83                <#assign eventDateFromAsString2 = eventDateFromAsString2?replace("luty", "lutego") /> 
84                <#assign eventDateFromAsString2 = eventDateFromAsString2?replace("marzec", "marca") /> 
85                <#assign eventDateFromAsString2 = eventDateFromAsString2?replace("kwiecień", "kwietnia") /> 
86                <#assign eventDateFromAsString2 = eventDateFromAsString2?replace("maj$", "maja") /> 
87                <#assign eventDateFromAsString2 = eventDateFromAsString2?replace("czerwiec", "czerwca") /> 
88                <#assign eventDateFromAsString2 = eventDateFromAsString2?replace("lipiec", "lipca") /> 
89                <#assign eventDateFromAsString2 = eventDateFromAsString2?replace("sierpień", "sierpnia") /> 
90                <#assign eventDateFromAsString2 = eventDateFromAsString2?replace("wrzesień", "września") /> 
91                <#assign eventDateFromAsString2 = eventDateFromAsString2?replace("październik$", "października") /> 
92                <#assign eventDateFromAsString2 = eventDateFromAsString2?replace("listopad$", "listopada") /> 
93                <#assign eventDateFromAsString2 = eventDateFromAsString2?replace("grudzień", "grudnia") /> 
94            </#if> 
95            <#if event?? && event.dateto?? && event.dateto.data?has_content> 
96                <#if event.dateto.data?matches("^\\d+$")> 
97                    <#assign eventDateTo = event.dateto.data?number?number_to_datetime /> 
98                <#else> 
99                    <#assign eventDateTo = event.dateto.data?datetime("yyyy-MM-dd HH:mm") /> 
100                </#if> 
101 
102                <#assign eventDateToAsString2 = eventDateTo?string("d MMMM 'godz.' HH:mm") /> 
103 
104                <#assign eventDateToAsString2 = eventDateToAsString2?replace("styczeń", "stycznia") /> 
105                <#assign eventDateToAsString2 = eventDateToAsString2?replace("luty", "lutego") /> 
106                <#assign eventDateToAsString2 = eventDateToAsString2?replace("marzec", "marca") /> 
107                <#assign eventDateToAsString2 = eventDateToAsString2?replace("kwiecień", "kwietnia") /> 
108                <#assign eventDateToAsString2 = eventDateToAsString2?replace("maj$", "maja") /> 
109                <#assign eventDateToAsString2 = eventDateToAsString2?replace("czerwiec", "czerwca") /> 
110                <#assign eventDateToAsString2 = eventDateToAsString2?replace("lipiec", "lipca") /> 
111                <#assign eventDateToAsString2 = eventDateToAsString2?replace("sierpień", "sierpnia") /> 
112                <#assign eventDateToAsString2 = eventDateToAsString2?replace("wrzesień", "września") /> 
113                <#assign eventDateToAsString2 = eventDateToAsString2?replace("październik$", "października") /> 
114                <#assign eventDateToAsString2 = eventDateToAsString2?replace("listopad$", "listopada") /> 
115                <#assign eventDateToAsString2 = eventDateToAsString2?replace("grudzień", "grudnia") /> 
116            </#if> 
117 
118            <div class="image-wrapper"> 
119                <div class="event-date">${eventDateFromAsString1}</div> 
120                <img src="${mainphoto.data}&height=305"> 
121            </div> 
122 
123            <div class="event-data"> 
124                <div class="header">${languageUtil.get(locale, "event-information")}</div> 
125 
126                <div class="subheader">${languageUtil.get(locale, "event-date")}</div> 
127                <div class="date table"> 
128                    <div class="row"> 
129                        <div class="from-date cell"><img src="${themeDisplay.pathThemeImages}/nfh-cp/event-from-date-marker-10x9.png"/></div> 
130                        <div class="from-date cell"><span>${eventDateFromAsString2}</span></div> 
131                    </div> 
132                    <div class="row"> 
133                        <div class="to-date cell"><img src="${themeDisplay.pathThemeImages}/nfh-cp/event-to-date-marker-10x9.png"/></div> 
134                        <div class="to-date cell"><span>${eventDateToAsString2}</span></div> 
135                    </div> 
136                </div> 
137                 
138                <div class="subheader">${languageUtil.get(locale, "location")}</div> 
139                <div class="location table"> 
140                    <#if event?? && event.place?? && event.place.data?has_content> 
141                        <div class="row"> 
142                            <div class="cell"><span>${event.place.data}</span></div> 
143                        </div> 
144                    </#if> 
145                    <#if (event?? && event.person?? && event.person.data?has_content) || (event?? && event.email?? && event.email.data?has_content)> 
146                        <div class="row"> 
147                            <div class="cell"><a href="mailto:${event.email.data}">${event.person.data}</a></div> 
148                        </div> 
149                    <#elseif event?? && event.email?? && event.email.data?has_content> 
150                        <div class="row"> 
151                            <div class="cell"><span>${event.email.data}</span></div> 
152                        </div> 
153                    </#if> 
154                    <#if event?? && event.phone?? && event.phone.data?has_content> 
155                        <div class="row"> 
156                            <div class="cell"><span>${languageUtil.get(locale, "phone-abbreviation")}: ${event.phone.data}</span></div> 
157                        </div> 
158                    </#if> 
159                </div> 
160            </div> 
161        </div> 
162    </#if> 
163 
164    <#-- ZAWARTOŚĆ ARTYKUŁU --> 
165    <#if abstract?? && abstract.data?has_content> 
166        <p class="description">${abstract.data}</p> 
167    <#else> 
168        <p class="description">${.vars["reserved-article-description"].data}</p> 
169    </#if> 
170 
171    <div class="content">${content.data}</div> 
172 
173    <#-- ZAŁĄCZNIKI --> 
174    <#assign hasAttachments = false /> 
175    <#if file?? && file.getSiblings()?size gt 0> 
176        <#list file.getSiblings() as fileItem> 
177            <#if fileItem.filedescription?? && fileItem.filedescription.data?has_content> 
178                <#assign fileItemName = fileItem.filedescription.data /> 
179            <#elseif fileItem.filetitle?? && fileItem.filetitle.data?has_content> 
180                <#assign fileItemName = fileItem.filetitle.data /> 
181            <#else> 
182                <#assign fileItemName = fileItem.data /> 
183            </#if> 
184            <#if fileItemName?? && fileItemName?has_content> 
185                <#assign hasAttachments = true /> 
186            </#if> 
187        </#list> 
188    </#if> 
189    <#if hasAttachments> 
190        <div class="attachments"> 
191            <h2>${languageUtil.get(locale, "resources-to-get")}</h2> 
192            <ul class="attachment-list"> 
193                <#list file.getSiblings() as fileItem> 
194                    <#if fileItem.filedescription?? && fileItem.filedescription.data?has_content> 
195                        <#assign fileItemName = fileItem.filedescription.data /> 
196                    <#elseif fileItem.filetitle?? && fileItem.filetitle.data?has_content> 
197                        <#assign fileItemName = fileItem.filetitle.data /> 
198                    <#else> 
199                        <#assign fileItemName = fileItem.data /> 
200                    </#if> 
201 
202                    <#if fileItemName?? && fileItemName?has_content> 
203                        <#assign url = fileItem.data /> 
204                        <#if url?contains("/documents/")> 
205                            <#assign urlParts = stringUtil.split(url, "?") /> 
206                            <#assign urlParts = stringUtil.split(urlParts[0]?string, "/") /> 
207                            <#assign groupId = getterUtil.getLong(urlParts[2]) /> 
208                            <#assign folderId = getterUtil.getLong(urlParts[3]) /> 
209                            <#assign title = httpUtil.decodeURL(urlParts[4]?string, true) /> 
210                            <#if urlParts?size gt 5> 
211                                <#assign uuid = urlParts[5]?string /> 
212                                <#assign file = dlFileEntryLocalService.getFileEntryByUuidAndGroupId(uuid, groupId) /> 
213                            <#else> 
214                                <#assign file = dlFileEntryLocalService.getFileEntry(groupId, folderId, title) /> 
215                            </#if> 
216                            <#assign fileIcon = file.icon + ".png" /> 
217                        </#if> 
218                        <#if !fileIcon?? || !fileIcon?has_content> 
219                            <#assign fileItemExt = fileItem.data /> 
220                            <#assign indexOfDot = fileItemExt?last_index_of(".") + 1 /> 
221                            <#assign indexOfSlash = fileItemExt?last_index_of("/") /> 
222                            <#if indexOfSlash gt indexOfDot> 
223                                <#assign fileItemExt = fileItemExt?substring(0, indexOfSlash) /> 
224                            </#if> 
225                            <#assign fileIcon = fileItemExt?substring(indexOfDot) + ".png" /> 
226                        </#if> 
227                        <li> 
228                            <a href="${fileItem.data}" target="_blank"><img src="${themeDisplay.pathThemeImages}/file_system/small/${fileIcon}"></a> 
229                            <a href="${fileItem.data}" target="_blank">${fileItemName}</a> 
230                        </li> 
231                    </#if> 
232                </#list> 
233            </ul> 
234        </div> 
235    </#if> 
236</div>