An error occurred while processing the template.
The following has evaluated to null or missing:
==> entry['origin']  [in template "20155#20195#120498" at line 61, column 32]

----
Tip: It's the final [] step that caused this error, not those before it.
----
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 originEntry = entry["origin"]  [in template "20155#20195#120498" at line 61, column 9]
----
1<#-- 
2TEMPLATE KEY : 244077 
3TEMPLATE ID  : 120498 
4TEMPLATE NAME: HNB Regulativa detalj.ftl 
5LOCATION     : Widget Templates 
6TEMPLATE TYPE: Asset Publisher Template 
7TEMPLATE HOME: _TEMPLATE_CONTEXT_/20155/20182/20083 
8 
9TESTIRANJE: 
10PORTLET: ArchiveFilterAssetPublisher - custom portlet 
11JEDAN DOKUMENT ODLUKE: 
12https://webtest.hnb.hr/-/odluka-o-velikim-izlozenostima-kreditnih-institucija 
13JEDAN DOKUMENT ODLUKE - vise tehnickih priloga koji u korijenu naziva nemaju npt: 
14https://webtest.hnb.hr/-/odluka-o-transakcijskim-racunima 
15DVA DOKUMENTA ODLUKE - svaki ima barem jedan tehnicki prilog koji u korijenu naziva imaju npt: 
16https://webtest.hnb.hr/-/odluka-o-izvjestajima-za-potrebe-supervizije-kreditnih-institucija 
17--> 
18 
19<#-- Fileter Functions ADT --> 
20<#include "${templatesPath}/4812567" /> 
21 
22<#-- documentlibrary functions --> 
23<#include "_TEMPLATE_CONTEXT_/20155/20182/20513/4891145" /> 
24 
25${asDebug('<br />TEMPLATE KEY: 244077 TEMPLATE ID: 120498 NAME: HNB Regulativa detalji PATH: ${templatesPath}', 'npp_details_fields_1')} 
26 
27<#assign dLFileEntryLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService")> 
28<#assign dLFileEntryTypeLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryTypeLocalService")> 
29<#assign dLAppLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppLocalService")> 
30 
31<#assign ddmStructureLocalService = serviceLocator.findService("com.liferay.dynamic.data.mapping.service.DDMStructureLocalService")> 
32<#assign journalConverter = serviceLocator.findService("com.liferay.journal.util.JournalConverter")> 
33<#assign assetLinkLocalService = serviceLocator.findService("com.liferay.asset.link.service.AssetLinkLocalService" )> 
34<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService" )> 
35 
36<style> 
37    .table-container table, 
38    .table-container table th, 
39    .table-container table td { border:none; background-color: #fff; padding: 6px; } 
40    .table-container table th { text-transform: uppercase; text-align:right; } 
41    .table-container table {width:auto;} 
42    ul {list-style: none;} 
43</style> 
44 
45<#assign dLFileEntryLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService")> 
46<#assign dLFileEntryTypeLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryTypeLocalService")> 
47<#assign dLAppLocalService = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppLocalService")> 
48 
49<#assign ddmStructureLocalService = serviceLocator.findService("com.liferay.dynamic.data.mapping.service.DDMStructureLocalService")> 
50<#assign journalConverter = serviceLocator.findService("com.liferay.journal.util.JournalConverter")> 
51<#assign assetLinkLocalService = serviceLocator.findService("com.liferay.asset.link.service.AssetLinkLocalService" )> 
52<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService" )> 
53 
54<#if entries?has_content> 
55    <#list entries as curEntry> 
56        <#if !entry??> 
57            <br/> Ne postoji odluka - provjerite s urednikom. 
58            <#continue /> 
59        </#if> 
60 
61        <#assign originEntry = entry['origin'] > 
62        <#assign baseEntry = entry['base'] > 
63        <#assign historyList = entry['history']! > 
64        <#assign dodatakOdluka = entry['dodatak_odluka']! > 
65        <#assign dodatakUputa = entry['dodatak_uputa']! > 
66 
67    <#-- HANDLE LOCALE --> 
68        <#if !baseEntry.getAvailableLanguageIds()?seq_contains(locale) > 
69            <div class="no-translation">${languageUtil.get(locale,"templates.locale.contentNotAvailable")}</div> 
70 
71        <#else> 
72            <#assign naslov = baseEntry.getTitle(locale)/> 
73 
74            <#assign baseFields = getFields(baseEntry) /> 
75            <#assign baseArticle = getArticle(baseEntry) /> 
76 
77            <#if baseFields.get("najava_naslov")?has_content && baseFields.get("najava_naslov").getValue(locale)?has_content > 
78                <#assign naslov = baseFields.get("najava_naslov").getValue(locale) /> 
79            </#if> 
80 
81        <#-- ARTICLE --> 
82            <div class="article"> 
83                <h2 class="article-title">${naslov}</h2> 
84                <div class="article-action-icons"> 
85                    <div class="col-4-5" style="text-align:left;"> 
86                        <#if baseFields.get("datum_objave")?has_content && baseFields.get("datum_objave").getValue(locale)?has_content> 
87                            <span class="displayDate">${languageUtil.get(locale,"templates.article.publishDate")}: ${formatDate(baseFields.get("datum_objave").getValue(locale)?date("yyyy-MM-dd"))} </span> 
88                        </#if> 
89                        <#if baseFields.get("datum_azuriranja")?has_content && baseFields.get("datum_azuriranja").getValue(locale)?has_content> 
90                            <span class="separator"></span> 
91                            <span class="modifiedDate">${languageUtil.get(locale,"templates.article.modifiedDate")}: ${formatDate(baseFields.get("datum_azuriranja").getValue(locale)?date("yyyy-MM-dd"))} </span> 
92                        </#if> 
93                    </div> 
94                    <div class="col-1-5" style="text-align:right;"> 
95                        <#if exportUrl?has_content> 
96                            <a href='${exportUrl?replace("targetExtension=", "targetExtension=doc")}' target="_self"><i class="fa fa-file-word-o"></i></a> 
97                            <a href='${exportUrl?replace("targetExtension=", "targetExtension=pdf")}' target="_self"><i class="fa fa-file-pdf-o"></i></a> 
98                            <a href='${exportUrl?replace("targetExtension=", "targetExtension=txt")}' target="_self"><i class="fa fa-file-text-o"></i></a> 
99                        </#if> 
100                        <#if pagePrintUrl?has_content> 
101                            <a href="javascript:printPage('${pagePrintUrl}')"><i class="fa fa-print"></i></a> 
102                        <#elseif namespace?has_content> 
103                            <a href="javascript:${namespace}printPage()"><i class="fa fa-print"></i></a> 
104                        </#if> 
105                    </div> 
106                    <div class="clear"></div> 
107                </div> 
108 
109                <div class="article-content"> 
110 
111                    <div class="metadata-container margo-b-16"> 
112 
113                        <#-- ATRIBUTI --> 
114                        <@drawTable baseFields/> 
115 
116                        <#-- POVIJEST --> 
117                        <@drawHistory historyList true/> 
118 
119                        <#-- DODATAK UPUTA --> 
120                        <@drawHistory dodatakUputa false/> 
121 
122                        <#-- DODATAK ODLUKA --> 
123                        <@drawHistory dodatakOdluka false/> 
124 
125                    </div> 
126                </div> 
127                <#-- YourEurope stuff --> 
128                <#assign originFields = getFields(originEntry) /> 
129 
130 
131                <#if (originFields.get('youreurope').getValue(locale))!null?? > 
132                    <#assign prikaziYoureEuropeForm = originFields.get('youreurope').getValue()?string('da','ne') /> 
133                <#else> 
134                    <#assign prikaziYoureEuropeForm = "ne" /> 
135                </#if> 
136 
137                <#if prikaziYoureEuropeForm == "da" > 
138                    <#include "${templatesPath}/3692422" /> 
139                </#if> 
140            </div> 
141        </#if> 
142        <#break> 
143    </#list> 
144</#if> 
145 
146<#macro drawTable fields> 
147    <div class="table-container"> 
148        <table> 
149            <tbody> 
150            <#if fields.get("donositelj").getRenderedValue(locale)?has_content> 
151                <tr> 
152                    <th>${languageUtil.get(locale,"templates.regulations.table.donositelj")}</th> 
153                    <td>${fields.get("donositelj").getRenderedValue(locale)}</td> 
154                </tr> 
155            </#if> 
156            <#if fields.get("podrucje").getRenderedValue(locale)?has_content> 
157                <tr> 
158                    <th>${languageUtil.get(locale,"templates.regulations.table.podrucje")}</th> 
159                    <td>${fields.get("podrucje").getRenderedValue(locale)}</td> 
160                </tr> 
161            </#if> 
162            <#if fields.get("vrsta").getRenderedValue(locale)?has_content> 
163                <tr> 
164                    <th>${languageUtil.get(locale,"templates.regulations.table.vrsta")}</th> 
165                    <td>${fields.get("vrsta").getRenderedValue(locale)}</td> 
166                </tr> 
167            </#if> 
168            </tbody> 
169        </table> 
170 
171        <#if fields.get("nesluzbeni_procisceni_tekst")?has_content && (fields.get("nesluzbeni_procisceni_tekst").getValue(locale)?has_content)> 
172 
173            <#local nesluzbeniProcisceniTextSequence = asSequence(fields.get("nesluzbeni_procisceni_tekst").getValue(locale)) > 
174 
175                <#local singleNPTDocument = (nesluzbeniProcisceniTextSequence?size == 1)> 
176 
177                ${asDebug('<br />nesluzbeni_procisceni_tekst - COUNT: ${nesluzbeniProcisceniTextSequence?size?c}', 'npp_text')} 
178 
179                <#list nesluzbeniProcisceniTextSequence as nesluzbeniProcisceniText> 
180                    ${asDebug('<br />nesluzbeni_procisceni_tekst stavka: VALUE[${nesluzbeniProcisceniText?index}]: ${nesluzbeniProcisceniText}', 'npp_item_${nesluzbeniProcisceniText?index}')} 
181 
182                    <#local dlFileEntry = getDLFileEntry(nesluzbeniProcisceniText)> 
183                    <#if dlFileEntry?has_content> 
184                        <#local fileEntryURL = resolveFileEntryURL(nesluzbeniProcisceniText)> 
185                        <#if fileEntryURL?has_content> 
186                            <a href="${fileEntryURL}" target="_self" data_title="${dlFileEntry.getTitle()}" data_description="${dlFileEntry.getDescription()}" data_file="${dlFileEntry.getTitle()}.${dlFileEntry.getExtension()}">${dlFileEntry.getDescription()}</a> 
187                        </#if> 
188                        <#local nn_npt = fields.get("nn_npt").getRenderedValue(locale, 0)> 
189                        <#if nn_npt?has_content> 
190                            <br>${nn_npt} 
191                        </#if> 
192 
193                        <@drawAttachmentsTechnical fields=fields nptDLFileEntryName=dlFileEntry.getTitle() singleNPT=singleNPTDocument/> 
194                    </#if> 
195                </#list> 
196 
197 
198                <#local nesluzbeniProcisceniTextSequence = nesluzbeniProcisceniTextSequence[0] /> 
199 
200            <#if fields.get("nesluzbeni_procisceni_tekstFieldSet")?has_content> 
201                ${asDebug('<br />NPP stavka: fieldSet dxp74 expression: ${fields.get("nesluzbeni_procisceni_tekstFieldSet")}', 'npp_fieldSet_dxp74')} 
202            </#if> 
203        </#if> 
204    </div> 
205</#macro> 
206 
207<#macro drawAttachments fields> 
208    <#if fields.get("prilog")?has_content && (fields.get("prilog").getValue(locale)?size >= 1)> 
209 
210        <ul class="margo-t-4 margo-b-8 pad-l-16"> 
211            <#list fields.get("prilog").getValue(locale) as row> 
212 
213                <#if row?has_content> 
214                    <#local fileEntry = getDLFileEntry(row)> 
215                    <#local fileEntryURL = resolveFileEntryURL(row)> 
216 
217                    <#if fileEntry?has_content> 
218                        <#assign fileType = getDLFileEntryType(fileEntry)/> 
219                        <#if fileType?starts_with("HNB Dokument - vrijeme")> 
220                            <#local fileModifiedDate = fileEntry.getCreateDate()/> 
221                            <#if fileEntry.getModifiedDate()?has_content > 
222                                <#local fileModifiedDate = fileEntry.getModifiedDate()/> 
223                            </#if> 
224                            <li> 
225                                <i class="${chooseIcon(fileEntry.getExtension())}"></i> 
226                                <a href="${fileEntryURL}" target="_self" data_title="${fileEntry.getTitle()}" data_description="${fileEntry.getDescription()}" data_file="${fileEntry.getTitle()}.${fileEntry.getExtension()}">${fileEntry.getDescription()} - ${languageUtil.get(locale,"templates.article.modifiedDate")}: ${formatDateTime(fileModifiedDate)}</a> 
227                            </li> 
228                        <#else> 
229                            <li> 
230                                <i class="${chooseIcon(fileEntry.getExtension())}"></i> 
231                                <a href="${fileEntryURL}" target="_self" data_title="${fileEntry.getTitle()}" data_description="${fileEntry.getDescription()}" data_file="${fileEntry.getTitle()}.${fileEntry.getExtension()}">${fileEntry.getDescription()}</a> 
232 
233                                ${asDebug('prilog: item: fileType: ${fileType}', 'attachment_${row?index}')} 
234                            </li> 
235                        </#if> 
236                    </#if> 
237                </#if> 
238            </#list> 
239        </ul> 
240    </#if> 
241</#macro> 
242 
243<#macro drawAttachmentsTechnical fields nptDLFileEntryName singleNPT=true> 
244    <#if fields.get("prilog_tehnicki")?has_content && (fields.get("prilog_tehnicki").getValue(locale)?size >= 1)> 
245            <#assign technicalDLFileEntryDetected = false> 
246 
247            <#list asSequence(fields.get("prilog_tehnicki").getValue(locale)) as tehnickiPrilog> 
248 
249                ${asDebug('<br />prilog_tehnicki: ${nptDLFileEntryName} ${tehnickiPrilog}', 'prilog_teh_fieldDisplay_${tehnickiPrilog?index}')} 
250 
251                <#if singleNPT || tehnickiPrilog?contains(nptDLFileEntryName) > 
252                    <#if !technicalDLFileEntryDetected && tehnickiPrilog?is_first> 
253                        <ul class="margo-t-4 margo-b-8"> 
254 
255                        <#assign technicalDLFileEntryDetected = true> 
256                    </#if> 
257 
258                    <#local fileEntry = getDLFileEntry(tehnickiPrilog)> 
259                    <#if fileEntry?has_content> 
260                        <#local fileEntryURL = resolveFileEntryURL(tehnickiPrilog)> 
261                        <li> 
262                            <i class="${chooseIcon(fileEntry.getExtension())}"></i> 
263                            <a href="${fileEntryURL}" target="_self" data_title="${fileEntry.getTitle()}" data_description="${fileEntry.getDescription()}" data_file="${fileEntry.getTitle()}.${fileEntry.getExtension()}">${fileEntry.getDescription()}</a> 
264                        </li> 
265                    </#if> 
266 
267                    <#if technicalDLFileEntryDetected && tehnickiPrilog?is_last> 
268                        </ul> 
269                    </#if> 
270                </#if> 
271            </#list> 
272    </#if> 
273</#macro> 
274 
275<#macro drawHistory entries drawBase> 
276    <#if (( entries?has_content && entries?size > 0) || drawBase)> 
277        <div class="margo-t-4 margo-b-8 pad-t-8 pad-b-8 brd-t-grey"> 
278            <#list entries?reverse as entry> 
279                <#if entry.getTitle(locale, false)?has_content > 
280                    <@drawHistoryItem entry /> 
281                </#if> 
282            </#list> 
283            <#if baseEntry.getTitle(locale, false)?has_content && drawBase> 
284                <@drawHistoryItem baseEntry /> 
285            </#if> 
286        </div> 
287    </#if> 
288</#macro> 
289 
290<#macro drawHistoryItem historyItem> 
291    <#if !historyItem?has_content> 
292        <#return> 
293    </#if> 
294 
295    <#local fields = getFields(historyItem) /> 
296 
297    <#if (fields.get("dokument")?has_content && fields.get("dokument").getValue(locale)?has_content) 
298    || (fields.get("link")?has_content && fields.get("link").getRenderedValue(locale)?has_content) > 
299 
300    <#-- WRAPPER --> 
301        <#if historyItem.getEntryId() == originEntry.getEntryId()> 
302            <p style="font-weight:bold;"> 
303            <span><i class="fa fa-check-square" style="color:#c81818;"></i></span> 
304        <#else> 
305            <p> 
306        </#if> 
307 
308    <#-- CONTENT --> 
309 
310        <#if fields.get("najava_naslov")?has_content && fields.get("najava_naslov").getValue(locale)?has_content > 
311            <#assign naslov = fields.get("najava_naslov").getValue(locale) /> 
312        <#else> 
313            <#assign naslov = historyItem.getTitle(locale)/> 
314        </#if> 
315 
316        ${naslov} 
317 
318        <#if fields.get("nn").getRenderedValue(locale)?has_content  > 
319            <#if fields.get("nn").getRenderedValue(locale)?starts_with("[")> 
320                <#assign endIndex=fields.get("nn").getRenderedValue(locale)?last_index_of("]")> 
321                <#assign trimedValue= fields.get("nn").getRenderedValue(locale)[endIndex+1..]> 
322                <#if trimedValue?has_content  > 
323                    <br>${trimedValue} 
324                </#if> 
325            <#else> 
326                <br>${fields.get("nn").getRenderedValue(locale)} 
327            </#if> 
328        </#if> 
329 
330        <#if fields.get("dokument")?has_content && fields.get("dokument").getValue(locale)?has_content > 
331            <#local fileEntry = getDLFileEntry(fields.get("dokument").getValue(locale))> 
332 
333            <#if fileEntry?has_content> 
334                <#local fileEntryURL = resolveFileEntryURL(fields.get("dokument").getValue(locale))> 
335            </#if> 
336        </#if> 
337 
338        <#if fields.get("link").getRenderedValue(locale)?has_content> 
339            <br> 
340            <i class="fa fa-external-link"></i> 
341            <a href="${fields.get("link").getRenderedValue(locale)}" target="_self">Link</a> 
342        <#elseif fileEntryURL?has_content> 
343            <#assign fileType = getDLFileEntryType(fileEntry)/> 
344            <#local fileModifiedDate ="" /> 
345        <#-- ovo postoji u makrou drawAttachments - TODO: refactor --> 
346            <#if fileType?starts_with("HNB Dokument - vrijeme")> 
347                <#local fileModifiedDate = fileEntry.getCreateDate()/> 
348                <#if fileEntry.getModifiedDate()?has_content > 
349                    <#local fileModifiedDate = fileEntry.getModifiedDate()/> 
350                </#if> 
351                <#local fileModifiedDate = " - " + languageUtil.get(locale,"templates.article.modifiedDate")+": "+ formatDateTime(fileModifiedDate)/> 
352            </#if> 
353            <br> 
354            <i class="${chooseIcon(fileEntry.getExtension())}"></i> 
355            <a href="${fileEntryURL}" target="_self" data_title="${fileEntry.getTitle()}">${languageUtil.get(locale,"templates.link.download")}</a> 
356            ${fileModifiedDate} 
357 
358            ${asDebug('Regulativa detalji: prilog: fileType: ${fileType}', 'history_item_')} 
359        </#if> 
360 
361        <#if fields.get("napomena")?has_content && fields.get("napomena").getRenderedValue(locale)?has_content> 
362            <br/> 
363            <p> 
364            <ul class="margo-t-4 margo-b-8"> 
365                <li><h4>${fields.get("napomena").getRenderedValue(locale)}</h4></li> 
366            </ul> 
367            </p> 
368        </#if> 
369 
370        <@drawAttachments fields /> 
371 
372        </p> 
373    </#if> 
374</#macro> 
375 
376<#function getArticle entry> 
377    <#local assetRenderer = entry.getAssetRenderer() /> 
378    <#local article = assetRenderer.getArticle() /> 
379    <#return article > 
380</#function> 
381<#-- review this function and check if it can be refactored. Put coment what is return result --> 
382<#function getFields entry> 
383    <#local assetRenderer = entry.getAssetRenderer() /> 
384    <#local article = assetRenderer.getArticle() /> 
385    <#local ddmStructure = article.getDDMStructure() /> 
386    <#local fields = journalConverter.getDDMFields(ddmStructure, article.getContent()) /> 
387    <#return fields > 
388</#function> 
389 
390<#function formatDate date> 
391    <#assign date_pattern = {"hr_HR":"d.M.yyyy.", "en_US":"d/M/yyyy"}> 
392 
393    <#assign formatteddate = dateUtil.getDate(date, date_pattern[locale], locale) > 
394 
395    <#return formatteddate> 
396</#function> 
397 
398<#function formatDateTime date> 
399    <#assign date_pattern = {"hr_HR":"d.M.yyyy.", "en_US":"d/M/yyyy"}> 
400    <#assign time_pattern = {"hr_HR":"HH:mm", "en_US":"HH:mm"}> 
401 
402    <#assign formatteddate = dateUtil.getDate(date, date_pattern[locale], locale) > 
403    <#assign formattedtime = dateUtil.getDate(date, time_pattern[locale], locale) > 
404    <#if locale == "en_US" > 
405        <#return formatteddate+" at "+ formattedtime> 
406    <#else> 
407        <#return formatteddate+" u "+ formattedtime> 
408    </#if> 
409</#function>