All News
閉じる
recent-searches
クイックリンク
テンプレート処理中にエラーが発生しました。
Java method "com.sun.proxy.$Proxy1558.getStructuredContent(Long)" threw an exception when invoked on com.sun.proxy.$Proxy1558 object "com.liferay.headless.delivery.internal.resource.v1_0.StructuredContentResourceImpl@488874db"; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: structuredContent = structuredContent... [in template "44549#44620#98653" at line 84, column 13] ----
1<#assign
2 structuredContentResource = resourceLocator.locate("/headless-delivery/v1.0", "StructuredContent")
3/>
4
5<#attempt>
6<#assign
7 categories = restClient.get("/headless-admin-taxonomy/v1.0/taxonomy-vocabularies/" + 64873 + "/taxonomy-categories?fields=id&restricFields=actions,availableLanguages,taxonomyCategoryUsageCount&page=1&pageSize=30").items
8/>
9<#recover>
10 <#assign categories = [5] />
11</#attempt>
12
13<#function getVocabularyCategoriesIds>
14 <#attempt>
15 <#return categories?map(category -> category.id?number)/>
16 <#recover>
17 <#return 5 />
18 </#attempt>
19</#function>
20
21<#function getPressTopicsFilterEndpoint structuredContent>
22 <#attempt>
23 <#local
24 structuredContentCategoriesIds = structuredContent.getTaxonomyCategoryBriefs()
25 ?map(taxonomyCategoryBrief -> taxonomyCategoryBrief.getTaxonomyCategoryId())
26 pressTopicsCategoriesId = getVocabularyCategoriesIds()
27 categoryId = structuredContentCategoriesIds?filter(c -> pressTopicsCategoriesId?seq_contains(c))?first
28 />
29 <#recover>
30 <#assign categoryId = 5 />
31 </#attempt>
32 <#return "/-/categories/" + categoryId/>
33</#function>
34
35<#function getCustomDisplayPageUrl structuredContent>
36 <#local
37 structuredContentFields = structuredContent.getContentFields()
38 customDisplayPageField = structuredContentFields?filter(f -> f.getName() == "customDisplayPage")?first
39 />
40 <#return customDisplayPageField.getContentFieldValue().getLink()/>
41</#function>
42
43<#function getPressViewUrl structuredContent>
44 <#local
45 friendlyUrl = "/w/" + structuredContent.getFriendlyUrlPath()
46
47 categoryFilterEndpoint = getPressTopicsFilterEndpoint(structuredContent)
48 customDisplayPageUrl = getCustomDisplayPageUrl(structuredContent)!""
49 />
50 <#return customDisplayPageUrl?has_content?then(customDisplayPageUrl, friendlyUrl) + categoryFilterEndpoint/>
51</#function>
52
53<#assign images_path = "/documents/d/guest/" />
54<#assign total = searchContainer.getTotal() />
55<#assign start = searchContainer.getStart() />
56<#assign delta = searchContainer.getDelta() />
57<#assign totalPages = (total/delta)?ceiling />
58<#assign currentPage = ((start+1)/delta)?ceiling />
59<#assign isFirstPage = currentPage == 1 />
60<#assign isLastPage = currentPage == totalPages />
61<#assign iteratorURL = searchContainer.getIteratorURL().toString() />
62<#assign iteratorURL += iteratorURL?contains("?")?then("", "?") />
63<#assign firstPageURL = iteratorURL + '&start=1'/>
64<#assign lastPageURL = iteratorURL + '&start=' + totalPages?string/>
65<#assign previousURL = iteratorURL + '&start=' + (currentPage - 1)?string />
66<#assign nextURL = iteratorURL + '&start=' + (currentPage + 1)?string />
67
68<#assign startPage = (currentPage < 3)?then(1, currentPage - 1) />
69<#assign endPage = 2 + startPage />
70<#assign endPage = (totalPages < endPage)?then(totalPages, endPage) />
71<#assign diff = startPage - endPage + 2 />
72<#assign startPage -= (startPage - diff > 0)?then(diff, 0) />
73
74<#assign
75 categoriesIds = getVocabularyCategoriesIds()
76/>
77
78<div class="vale-widget-resultados-busca-imprensa">
79 <div class="d-sm-flex justify-content-between flex-wrap">
80 <#if entries?has_content >
81 <#list entries as entry >
82 <#if entry.getTitle()?has_content >
83 <#assign
84 structuredContent = structuredContentResource.getStructuredContent(entry.getClassPK())
85 url = getPressViewUrl(structuredContent)
86 structuredContentDataField = structuredContent.getContentFields()?filter(
87 field -> field.name == "data"
88 )?first
89 data = structuredContentDataField.getContentFieldValue().getData()?datetime.iso
90 date_localized = dateUtil.formatDate("yyyyMMdd", data?string("yyyyMMdd"), locale)
91 />
92 <#attempt>
93 <#assign
94 taxonomyCategory = structuredContent.getTaxonomyCategoryBriefs()?filter(category -> categoriesIds?seq_contains(category.getTaxonomyCategoryId()))?first
95 categoryName = taxonomyCategory.getTaxonomyCategoryName()
96 />
97 <#recover>
98 <#assign categoryName = "" />
99 </#attempt>
100 <a class="text-decoration-none" href="${url}">
101 <div
102 class="box d-flex mb-6"
103 >
104 <div class="yellow-bar h-100"></div>
105 <div
106 class=" d-flex flex-column justify-content-between h-100 p-3 overflow-hidden"
107 >
108 <div>
109 <p class="font-weight-medium text-verde-aqua mb-2">${categoryName}</p>
110 <p class="title text-verde-vale">${entry.getHighlightedTitle()}</p>
111 </div>
112 <p class="texto-sm text-cinza-escuro">
113 ${date_localized}
114 </p>
115 </div>
116 </div>
117 </a>
118 </#if>
119 </#list>
120 </#if>
121 </div>
122 <div class="line-divider"></div>
123 <div class="pagination d-flex justify-content-center my-5">
124 <a
125 class="pagination-option text-decoration-none mr-sm-5 ${isFirstPage?then('disabled', '')}"
126 href="${previousURL}"
127 disabled="${isFirstPage?string}"
128 >
129 <img
130 class="btn btn-primary border-amarelo-vale bg-amarelo-vale mr-2 p-1 rounded-circle"
131 src="${images_path}seta-2-esq_bra"
132 alt="button-prev"
133 />
134 <span class="btn btn-link text-amarelo-vale p-0 d-none d-sm-inline">
135 <@liferay.language key="previous" />
136 </span>
137 </a>
138
139 <#if (startPage > 1)>
140 <a
141 class="mr-2"
142 href="${firstPageURL}"
143 >
144 <span
145 class="pagination-item btn btn-primary p-1 rounded-circle"
146 alt="first-page-button"
147 >1
148 </span>
149 </a>
150 <#if currentPage != 3>
151 <span class="elipsis h-100 mt-auto mr-2">...</span>
152 </#if>
153 </#if>
154
155 <#list startPage..endPage as i>
156 <a
157 class="mr-2 ${(i == currentPage)?then('disabled', '')}"
158 href="${iteratorURL + '&start=' + i?string}"
159 >
160 <span
161 class="pagination-item ${(currentPage == i)?then('is-active', '')} btn btn-primary p-1 rounded-circle"
162 alt="first-page-button"
163 >${i}
164 </span>
165 </a>
166 </#list>
167
168 <#if (endPage < totalPages)>
169 <#if currentPage != totalPages - 2>
170 <span class="elipsis h-100 mt-auto mr-2">...</span>
171 </#if>
172 <a
173 class="mr-2"
174 href="${lastPageURL}"
175 >
176 <span
177 class="pagination-item btn btn-primary p-1 rounded-circle"
178 alt="last-page-button"
179 >${totalPages}
180 </span>
181 </a>
182 </#if>
183
184 <a
185 class="pagination-option text-decoration-none ml-sm-5 ${isLastPage?then('disabled', '')}"
186 href="${nextURL}"
187 disabled="${isLastPage?string}"
188 >
189 <span class="btn btn-link text-amarelo-vale mr-2 p-0 d-none d-sm-inline">
190 <@liferay.language key="next" />
191 </span>
192 <img
193 class="btn btn-primary border-amarelo-vale bg-amarelo-vale p-1 rounded-circle"
194 src="${images_path}seta-2-dir_bra"
195 alt="button-next"
196 />
197 </a>
198 </div>
199</div>
200
201<style>
202 .vale-widget-resultados-busca-imprensa .box {
203 background-image: url("/documents/d/guest/box-flutuante_com-borda");
204 background-size: cover;
205 aspect-ratio: 65/37;
206 width: 21.5625rem;
207}
208
209.vale-widget-resultados-busca-imprensa .yellow-bar {
210 background-color: var(--amarelo-vale);
211 flex-basis: 20px;
212 flex-grow: 0;
213 flex-shrink: 0;
214}
215
216.vale-widget-resultados-busca-imprensa .pagination img {
217 width: 2.03125rem;
218}
219
220.vale-widget-resultados-busca-imprensa .pagination-item {
221 color: var(--cinza-escuro);
222 background-color: var(--branco);
223 border: 2px solid var(--cinza-escuro);
224 line-height: 1.30625rem;
225 opacity: 0.6;
226 width: 2.03125rem;
227 height: 2.03125rem;
228}
229
230.vale-widget-resultados-busca-imprensa .pagination-item:hover {
231 box-shadow: 0px 0px 6px #55555594;
232}
233
234.vale-widget-resultados-busca-imprensa .pagination-item.is-active {
235 color: var(--branco);
236 background-color: var(--amarelo-vale);
237 border-color: var(--amarelo-vale);
238 opacity: 1;
239}
240
241.vale-widget-resultados-busca-imprensa .pagination-item.is-active:hover {
242 box-shadow: 0px 0px 6px #ecb11f94;
243}
244
245.vale-widget-resultados-busca-imprensa .title {
246 display: -webkit-box;
247 line-clamp: 3;
248 overflow: hidden;
249 -webkit-line-clamp: 3;
250 -webkit-box-orient: vertical;
251}
252
253.vale-widget-resultados-busca-imprensa .elipsis {
254 opacity: 0.6;
255}
256
257.vale-widget-resultados-busca-imprensa ~ form .pagination-bar {
258 display: none;
259}
260
261.vale-widget-resultados-busca-imprensa .pagination .disabled {
262 pointer-events: none;
263}
264
265.vale-widget-resultados-busca-imprensa .pagination .pagination-option.disabled {
266 opacity: 0.5;
267}
268
269.line-divider {
270 background-color: var(--cinza-escuro);
271 color: var(--cinza-escuro);
272 height: 1px;
273 width: 100%;
274 opacity: 0.2;
275}
276
277@media screen and (max-width: 992px) {
278 .vale-widget-resultados-busca-imprensa .box {
279 width: 20.625rem;
280 }
281}
282
283@media screen and (max-width: 768px) {
284 .vale-widget-resultados-busca-imprensa .box {
285 width: 15.625rem;
286 }
287
288 .vale-widget-resultados-busca-imprensa .title {
289 line-clamp: 2;
290 -webkit-line-clamp: 2;
291 }
292
293 .vale-widget-resultados-busca-imprensa .yellow-bar {
294 flex-basis: 10px;
295 }
296}
297
298@media screen and (max-width: 576px) {
299 .vale-widget-resultados-busca-imprensa .box {
300 width: 100%;
301 }
302
303 .vale-widget-resultados-busca-imprensa .title {
304 line-clamp: 3;
305 -webkit-line-clamp: 3;
306 }
307}
308
309</style>