An error occurred while processing the template.
Java method "com.sun.proxy.$Proxy217.getCategoryProperty(long, String)" threw an exception when invoked on com.sun.proxy.$Proxy217 object "com.liferay.asset.category.property.internal.service.ModularAssetCategoryPropertyLocalServiceWrapper@57a7ca88"; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: parentCategoryFriendlyUrlProperty = A... [in template "20115#20151#370788" at line 22, column 9] ----
1<#assign
2 friendlyUrlPropertyKey = "hash"
3 indexPropertyKey = "index"
4 hideInPruvodcePropertyKey = "hideInPruvodce"
5
6 AssetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")
7 AssetCategoryPropertyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryPropertyLocalService")
8 LayoutLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService")
9
10 FriendlyURLNormalizerUtil = staticUtil["com.liferay.portal.kernel.util.FriendlyURLNormalizerUtil"]
11
12 dqfu = staticUtil["com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil"]
13 ofu = staticUtil["com.liferay.portal.kernel.dao.orm.OrderFactoryUtil"]
14 rfu = staticUtil["com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil"]
15/>
16
17<#-- queryValues0 - categoryId -->
18<#if queryValues0?has_content>
19 <#assign
20 parentCategory = AssetCategoryLocalService.getAssetCategory(queryValues0?number)
21
22 parentCategoryFriendlyUrlProperty = AssetCategoryPropertyLocalService.getCategoryProperty(queryValues0?number, friendlyUrlPropertyKey)
23
24 query = dqfu.forClass(parentCategoryFriendlyUrlProperty.class)
25 tmp = query.add(rfu.eq("key", indexPropertyKey))
26 tmp = query.addOrder(ofu.asc("value"))
27
28 records = AssetCategoryPropertyLocalService.dynamicQuery(query)
29 />
30 <#-- records je list obsahujuci AssetCategoryProperty zoradene podla hodnoty property "index" -->
31 <#if records?has_content>
32 <div class="box__title-holder">
33 <div class="row">
34 <div class="col-xs-12">
35 <h2 class="box__title box__title--page">${parentCategory.getName()}</h2>
36 <p class="mt-a-20 mb-a-0 text-justify">Frequently Asked Questions related to the presently selected subject.</p>
37 </div>
38 </div>
39 </div>
40 <div class="box__inner box__inner--title">
41 <#assign numOfShownCategories = 0 />
42
43 <#list records as record>
44
45 <#assign childCategory = AssetCategoryLocalService.fetchAssetCategory(record.getCategoryId())!"">
46
47 <#if childCategory?has_content && childCategory.getVocabularyId() == parentCategory.getVocabularyId() && childCategory.getParentCategoryId() == parentCategory.getCategoryId()>
48
49 <#assign
50 categoryProperties = AssetCategoryPropertyLocalService.getCategoryProperties(childCategory.getCategoryId())
51 showCategory = true
52 />
53
54 <#if categoryProperties?has_content>
55 <#list categoryProperties as categoryProperty>
56 <#if categoryProperty.getKey() == hideInPruvodcePropertyKey && categoryProperty.getValue() == "true">
57 <#assign showCategory = false>
58 </#if>
59 </#list>
60 </#if>
61
62 <#if showCategory>
63 <#assign
64 childCategoryFriendlyUrlProperty = AssetCategoryPropertyLocalService.getCategoryProperty(childCategory.getCategoryId(), friendlyUrlPropertyKey)
65 grandChildCategories = AssetCategoryLocalService.getChildCategories(childCategory.getCategoryId())
66 />
67
68 <#if grandChildCategories?has_content>
69 <#assign numOfGrandChildCategoriesShown = 0 />
70
71 <#list records as grandChildRecord>
72
73 <#assign grandChildCategory = AssetCategoryLocalService.fetchAssetCategory(grandChildRecord.getCategoryId())!"">
74
75 <#if grandChildCategory?has_content && grandChildCategory.getVocabularyId() == parentCategory.getVocabularyId() && grandChildCategory.getParentCategoryId() == childCategory.getCategoryId()>
76 <#assign
77 grandChildCategoryProperties = AssetCategoryPropertyLocalService.getCategoryProperties(grandChildCategory.getCategoryId())
78 grandChildShowCategory = true
79 />
80
81 <#if grandChildCategoryProperties?has_content>
82 <#list grandChildCategoryProperties as grandChildCategoryProperty>
83 <#if grandChildCategoryProperty.getKey() == hideInPruvodcePropertyKey && grandChildCategoryProperty.getValue() == "true">
84 <#assign grandChildShowCategory = false>
85 </#if>
86 </#list>
87 </#if>
88
89 <#if grandChildShowCategory>
90
91 <#if entries?has_content>
92 <#assign numOfShownEntries = 0 />
93
94 <#list entries as curEntry>
95 <#if curEntry.getCategoryIds()?seq_contains(grandChildCategory.getCategoryId())>
96 <#if numOfGrandChildCategoriesShown == 0>
97 <div class="box__block ${(numOfShownCategories == 0)?string('', 'box__block--bordered')}">
98 <h3 class="h2" id="${childCategoryFriendlyUrlProperty.getValue()}">${childCategory.getName()} <a href="#${childCategoryFriendlyUrlProperty.getValue()}"><font color="white">#</font></a></h3>
99
100 <#assign numOfShownCategories += 1 />
101 </#if>
102
103 <#if numOfShownEntries == 0>
104 <#assign grandChildCategoryFriendlyUrlProperty = AssetCategoryPropertyLocalService.getCategoryProperty(grandChildCategory.getCategoryId(), friendlyUrlPropertyKey) />
105 <div class="box__block pb-a-0">
106 <h4 class="h3" id="${grandChildCategoryFriendlyUrlProperty.getValue()}">${grandChildCategory.getName()} <a href="#${grandChildCategoryFriendlyUrlProperty.getValue()}"><font color="white">#</font></a></h4>
107
108 <div class="accordion__group">
109
110 <#assign numOfGrandChildCategoriesShown += 1 />
111 </#if>
112
113 <@printItem curEntry=curEntry />
114
115 <#assign numOfShownEntries += 1 />
116 </#if>
117 </#list>
118
119 <#if numOfShownEntries gt 0>
120 </div>
121 </div>
122 </#if>
123 </#if>
124 </#if>
125 </#if>
126 </#list>
127
128 <#if numOfShownCategories gt 0>
129 </div>
130 </#if>
131 <#else>
132 <#if entries?has_content>
133 <#assign numOfShownEntries = 0 />
134
135 <#list entries as curEntry>
136 <#if curEntry.getCategoryIds()?seq_contains(childCategory.getCategoryId())>
137 <#if numOfShownEntries == 0>
138 <div class="box__block ${(numOfShownCategories == 0)?string('', 'box__block--bordered')}">
139 <h3 class="h2" id="${childCategoryFriendlyUrlProperty.getValue()}">${childCategory.getName()} <a href="#${childCategoryFriendlyUrlProperty.getValue()}"><font color="white">#</font></a></h3>
140
141 <div class="accordion__group">
142
143 <#assign numOfShownCategories += 1 />
144 </#if>
145
146 <@printItem curEntry=curEntry />
147
148 <#assign numOfShownEntries += 1 />
149 </#if>
150 </#list>
151
152 <#if numOfShownEntries gt 0>
153 </div>
154 </div>
155 </#if>
156 </#if>
157 </#if>
158
159 </#if>
160 </#if>
161 </#list>
162 </div>
163 </#if>
164</#if>
165
166<#macro printItem curEntry>
167 <#assign
168 renderer = curEntry.getAssetRenderer()
169 journalArticle = renderer.getArticle()
170 displayDate = journalArticle.getDisplayDate()?date
171 title = curEntry.getTitle(locale)
172
173 doc = saxReaderUtil.read(journalArticle.getContent())
174 otazka = doc.valueOf("//dynamic-element[@name='otazka']/dynamic-content/text()")
175 odpoved = doc.valueOf("//dynamic-element[@name='odpoved']/dynamic-content/text()")
176 />
177 <div class="accordion" id="${FriendlyURLNormalizerUtil.normalize(title)}">
178 <div class="accordion__header accordion__header--close" aria-expanded="false">
179 <h3 class="accordion__title">${title}</h3>
180 </div>
181 <div class="accordion__content" aria-hidden="true">
182 <div class="accordion__body">
183 <div class="row">
184 <div class="col-xs-12">
185
186
187 <#if otazka?has_content>
188 <h3 class="h5">Question:</h3>
189 <div class="text-justify">
190 ${otazka}
191 </div>
192 </#if>
193
194 <#if odpoved?has_content>
195 <h3 class="h5">Reply:</h3>
196 <div class="text-justify">
197 ${odpoved}
198 </div>
199 </#if>
200 </div>
201 </div>
202 </div>
203 </div>
204 </div>
205</#macro>
206
207<style>
208.asseco-theme.body__wrapper .accordion__title {
209 font-size: 16px;
210}
211</style>