Rozpočet Medlánek - Městská část Brno-Medlánky
Při zpracování šablony došlo k chybě.
The following has evaluated to null or missing: ==> macros.printBreadcrumsHeader [in template "20097#20123#4864865" at line 95, column 7] ---- Tip: It's the step after the last dot 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: @macros.printBreadcrumsHeader [in template "20097#20123#4864865" at line 95, column 5] ----
1<#include "${templatesPath}/COMMON_SETUP" />
2<#import "${globalTemplatesPath}/GLOBAL_QUERY" as queries />
3
4<#assign
5 <#-- urcene len na DEBUG - ak je nastavene, tak sa pre kazdy JournalArticle dotahuje AssetEntry a z neho sa zisti priorita, ktora sa vypise -->
6 SHOW_PRIORITY = false
7
8 layout = themeDisplay.getLayout()
9 baseUrl = layout.getFriendlyURL(locale)
10 folderUrl = baseUrl + "?" + requestParamName.FOLDER + "="
11 articleUrl = baseUrl + "?" + requestParamName.ARTICLE + "="
12
13 requestFolderId = request.getParameter(requestParamName.FOLDER)!""
14 requestArticleId = request.getParameter(requestParamName.ARTICLE)!""
15/>
16
17<#--
18 V pripade ze rola Guest nema nastavene opravnenia VIEW na vybranej slozke, nenaplni sa hodnota entry
19 a tak je treba vytiahnut ju z preferences portletu
20-->
21<#if !entry??>
22 <#assign
23 PortletPreferencesFactoryUtil = staticUtil["com.liferay.portal.kernel.portlet.PortletPreferencesFactoryUtil"]
24
25 portletId = renderRequest.getAttribute("PORTLET_ID")!""
26 portletSetup = PortletPreferencesFactoryUtil.getStrictLayoutPortletSetup(layout, portletId)!""
27 />
28 <#if portletSetup?has_content>
29 <#assign assetEntryXml = portletSetup.getValue('assetEntryXml','')!"" />
30 <#if assetEntryXml?has_content>
31 <#assign
32 doc = saxReaderUtil.read(assetEntryXml)
33 assetEntryUuid = doc.valueOf("//asset-entry/asset-entry-uuid/text()")
34 />
35 <#if assetEntryUuid?has_content>
36 <#assign entry = AssetEntryLocalService.fetchEntry(themeDisplay.getScopeGroupId(), assetEntryUuid) />
37 </#if>
38 </#if>
39 </#if>
40</#if>
41
42<#if !entry??>
43 <@printAlert content="Není vybrána složka webového obsahu nebo tato složka není veřejně dostupná." />
44<#elseif entry.getClassName() != journalFolderClassName>
45 <@printAlert content="Položka vybraná v agregátore není typu Složka webového obsahu." />
46<#else>
47 <#assign
48 parentFolderId = entry.getClassPK()
49 parentFolder = JournalFolderLocalService.fetchFolder(parentFolderId)!""
50 title = layout.getName(locale)
51 />
52
53 <#if requestFolderId?has_content && global.isNumber(requestFolderId)>
54 <#assign requestFolder = JournalFolderLocalService.fetchFolder(requestFolderId?number)!"" />
55
56 <#if requestFolder?has_content>
57 <#assign ancestorFolderIds = requestFolder.getAncestorFolderIds() />
58
59 <#if ancestorFolderIds?seq_contains(parentFolderId)>
60 <#assign
61 parentFolderId = requestFolder.getFolderId()
62 parentFolder = requestFolder
63 title = parentFolder.getName()
64 />
65 </#if>
66 </#if>
67 </#if>
68
69 <#assign article = "" />
70
71 <#if requestArticleId?has_content>
72 <#assign requestArticle = JournalArticleLocalService.fetchLatestArticle(groupId?number, requestArticleId, WorkflowConstants.STATUS_APPROVED)!"" />
73
74 <#if requestArticle?has_content>
75 <#assign
76 requestArticleFolder = requestArticle.getFolder()
77 ancestorFolderIds = requestArticleFolder.getAncestorFolderIds()
78 />
79 <#if ancestorFolderIds?seq_contains(parentFolderId) || requestArticleFolder.getFolderId() == parentFolderId>
80 <#assign
81 parentFolderId = requestArticleFolder.getFolderId()
82 parentFolder = requestArticleFolder
83 article = requestArticle
84 title = parentFolder.getName()
85 />
86 </#if>
87 </#if>
88 </#if>
89
90 <#if article?has_content>
91 <#assign title = article.getTitle(locale) />
92 </#if>
93
94 <#-- breadcrumbs -->
95 <@macros.printBreadcrumsHeader />
96
97 <@macros.printBreadcrumbItem title=mainPageTitle url=mainPageUrl />
98
99 <#list layout.getAncestors()?reverse as ancestor>
100 <@macros.printBreadcrumbItem title=ancestor.getName(locale) url=ancestor.getFriendlyURL(locale) />
101 </#list>
102
103 <#assign isFolderOrArticleSelected = article?has_content || parentFolderId != entry.getClassPK() />
104
105 <@macros.printBreadcrumbItem title=layout.getName(locale) url=isFolderOrArticleSelected?then(layout.getFriendlyURL(locale), "") />
106
107 <#if isFolderOrArticleSelected>
108 <#assign ancestorFolders = parentFolder.getAncestors() />
109
110 <#if ancestorFolders?size gt 0>
111 <#list ancestorFolders?reverse as ancestorFolder>
112 <#if ancestorFolder.getAncestorFolderIds()?seq_contains(entry.getClassPK())>
113 <@macros.printBreadcrumbItem title=ancestorFolder.getName() url=(folderUrl + ancestorFolder.getFolderId()) />
114 </#if>
115 </#list>
116 </#if>
117
118 <#if !article?has_content>
119 <@macros.printBreadcrumbItem title=parentFolder.getName() />
120 <#else>
121 <@macros.printBreadcrumbItem title=parentFolder.getName() url=(folderUrl + parentFolder.getFolderId()) />
122
123 <@macros.printBreadcrumbItem title=article.getTitle(locale) />
124 </#if>
125 </#if>
126
127 <@macros.printBreadcrumbsFooter />
128
129 <#if !article?has_content>
130 <@macros.printHeaderTitle title=title />
131
132 <div class="bno-container bno-container--tiny-offset">
133 <div class="bno-container__content">
134 <@printFolderContent parentFolderId=parentFolderId />
135 </div>
136 </div>
137 <#else>
138 <#assign articleContentWrapperClass = "article-container" />
139 <div class="${articleContentWrapperClass}">
140 <#-- Zobrazeni obsahu WO -->
141 <@printJournalArticle article=article />
142 </div>
143 <style>
144 .${articleContentWrapperClass} .bno-breadcrumbs-container {
145 display: none;
146 }
147 </style>
148 </#if>
149</#if>
150
151<#macro printFolderContent parentFolderId>
152 <#assign parentFolder = JournalFolderLocalService.fetchFolder(parentFolderId)!"" />
153 <#if parentFolder?has_content>
154 <#assign childFolders = JournalFolderLocalService.getFolders(parentFolder.getGroupId(), parentFolder.getFolderId()) />
155
156 <h2>Dokumenty</h2>
157
158 <ul class="bno-grid bno-grid--x3 bno-list--plain">
159 <#if childFolders?size gt 0>
160 <#list childFolders as childFolder>
161 <#assign
162 grandChildFolders = JournalFolderLocalService.getFolders(childFolder.getGroupId(), childFolder.getFolderId())
163
164 <#-- Query na ziskanie JournalArticle s konkretnym folderId -->
165 query = getJournalArticlesFromFolderQuery(childFolder.getFolderId())
166
167 querySpec = {
168 "otherQueries": [ query ]
169 }
170
171 result = queries.getJournalArticleListWithQuery(querySpec)
172 grandChildArticles = result.results![]
173 />
174
175 <#if grandChildFolders?size == 0 && grandChildArticles?size == 1>
176 <#assign grandChildArticle = grandChildArticles?first />
177 <@printLinkToArticle grandChildArticle />
178 <#elseif grandChildFolders?size gt 0 || grandChildArticles?size gt 0>
179 <@printGridTile title=childFolder.getName() url=(folderUrl + childFolder.getFolderId()) icon="folder" />
180 </#if>
181 </#list>
182 <#else>
183 <#assign
184 <#-- Query na ziskanie JournalArticle s konkretnym folderId -->
185 jaFromFolderQuery = getJournalArticlesFromFolderQuery(parentFolder.getFolderId())
186
187 <#-- priority query -->
188 zeroPriorityQuery = queries.getBooleanQuery()
189 tmp = zeroPriorityQuery.addRequiredTerm("priority", "0.0")
190
191 <#-- with priority query -->
192 withPriorityQuery = queries.addMustQueries(queries.getBooleanQuery(), [ jaFromFolderQuery ])
193 withPriorityQuery = queries.addMustNotQueries(withPriorityQuery, [ zeroPriorityQuery ])
194
195 withPriorityQuerySpec = {
196 "orderByCol1": orderByCol.PRIORITY,
197 "orderByType1": orderByType.DESC,
198 "orderByCol2": orderByCol.PUBLISH_DATE,
199 "orderByType2": orderByType.DESC,
200 "otherQueries": [ withPriorityQuery ]
201 }
202
203 withPriorityResult = queries.getJournalArticleListWithQuery(withPriorityQuerySpec)
204 withPriorityArticles = withPriorityResult.results![]
205
206 <#-- without priority query -->
207 withoutPriorityQuery = queries.addMustQueries(queries.getBooleanQuery(), [ jaFromFolderQuery, zeroPriorityQuery ])
208
209 withoutPriorityQuerySpec = {
210 "orderByCol1": orderByCol.TITLE,
211 "orderByType1": orderByType.ASC,
212 "orderByCol2": orderByCol.PUBLISH_DATE,
213 "orderByType2": orderByType.DESC,
214 "otherQueries": [ withoutPriorityQuery ]
215 }
216
217 withoutPriorityResult = queries.getJournalArticleListWithQuery(withoutPriorityQuerySpec)
218 withoutPriorityArticles = withoutPriorityResult.results![]
219 />
220 <#list withPriorityArticles as article>
221 <@printLinkToArticle article />
222 </#list>
223
224 <#list withoutPriorityArticles as article>
225 <@printLinkToArticle article />
226 </#list>
227 </#if>
228 </ul>
229 </#if>
230</#macro>
231
232<#macro printLinkToArticle article>
233 <#assign priority = "unknown" />
234 <#if SHOW_PRIORITY>
235 <#assign
236 assetEntry = AssetEntryLocalService.fetchEntry(journalArticleClassName, article.getResourcePrimKey())!""
237 priority = assetEntry?has_content?then(assetEntry.getPriority(), priority)
238 />
239 </#if>
240 <@printGridTile title=article.getTitle(locale) url=(articleUrl + article.getArticleId()) icon="doc" priority=priority />
241</#macro>
242
243<#macro printJournalArticle article>
244 ${JournalArticleLocalService.getArticleContent(article, article.getDDMTemplateKey(), "VIEW", "cs_CZ", null, themeDisplay)}
245</#macro>
246
247<#macro printAlert content>
248 <div class="bno-container">
249 <div class="bno-container__content">
250 <div class="bno-alert bno-alert--error" role="alert">
251 <p>${content}</p>
252 </div>
253 </div>
254 </div>
255</#macro>
256
257<#macro printGridTile title url icon priority="">
258 <#if title?has_content && url?has_content>
259 <li class="bno-grid__tile" <#if priority?has_content>data-priority="${priority}"</#if>>
260 <a class="bno-box-link bno-box-link--with-icon" href="${url}" aria-label="${title}">
261 <#if icon?has_content>
262 <span class="bno-icon bno-icon--${icon}" aria-hidden="true"></span>
263 </#if>
264 <span class="bno-link">${title}</span>
265 </a>
266 </li>
267 </#if>
268</#macro>
269
270<#-- Query na ziskanie JournalArticle s konkretnym folderId -->
271<#function getJournalArticlesFromFolderQuery folderId>
272 <#assign query = queries.getBooleanQuery() />
273
274 <#if folderId?has_content>
275 <#assign
276 <#-- a) any JournalArticle -->
277 journalArticleQuery = queries.getJournalArticleSearchQuery("", [], langId.CZ)
278 <#-- b) folderId -->
279 folderIdQuery = queries.getBooleanQuery()
280 tmp = folderIdQuery.addRequiredTerm("folderId", folderId)
281 <#-- a) + b) -->
282 query = queries.addMustQueries(queries.getBooleanQuery(), [ journalArticleQuery, folderIdQuery ])
283 />
284 </#if>
285
286 <#return query />
287</#function>