X
O uso deste material é autorizado apenas para fins editoriais.
X
Um erro ocorreu enquanto processava o modelo.
The following has evaluated to null or missing: ==> firstNewsInfo.newsImageFieldSet.newsImage.fileEntryId [in template "20099#20135#10832144" at line 190, column 97] ---- 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: ${firstNewsInfo.newsImageFieldSet.new... [in template "20099#20135#10832144" at line 190, column 95] ----
1<#assign codGlobalSite = 20135 />
2
3<#if codGlobalSite != themeDisplay.getScopeGroupId() >
4
5<#-- Conteúdo Web -> Templates: Site de Crise - Include de templates-->
6<#-- include "${templatesPath}/1975602" -->
7
8
9<#-- Conteúdo Web -> Templates: Site de Crise - Funções gerais-->
10<#include "${templatesPath}/1975398" />
11
12<#-- Conteúdo Web -> Templates: Site de Crise - Notícia - Extrair dados de Notícias -->
13<#--include "${templatesPath}/7762031" -->
14
15<#-- Conteúdo Web -> Templates: Site de Crise - Notícia - Título -->
16<#-- include "${templatesPath}/7761976" -->
17
18<#-- Conteúdo Web -> Templates: Site de Crise - Notícia - Redes sociais e data de publicação -->
19<#--include "${templatesPath}/7762069" -->
20
21<#-- Conteúdo Web -> Templates: Site de Crise - Notícia - Áudios do conteúdo da notícia -->
22<#-- include "${templatesPath}/7761972" -->
23
24<#-- Nome das midias adaptativas de imagem para desktop e mobile -->
25<#assign adaptativeMediaDesktopResolutionName = "Preview-1000x0" />
26<#assign adaptativeMediaMobileResolutionName = "Thumbnail-300x300" />
27
28<#function getNodesByLabel fieldList parentNode label>
29 <#assign result = []/>
30 <#attempt>
31 <#assign groupId = getIdFromFieldName(fieldList, label) />
32 <#assign xSeletorCaminho = saxReaderUtil.createXPath("dynamic-element[@name='${groupId}' ]") />
33 <#assign result = xSeletorCaminho.selectNodes(parentNode) />
34 <#return result />
35 <#recover>
36 <#return result />
37 </#attempt>
38</#function>
39
40<#function findVocabulary vocabularyName vocabularies>
41 <#assign vocabularyNameLowerCase = vocabularyName?lower_case>
42 <#list vocabularies as vocabulary>
43 <#if vocabulary.name?lower_case == vocabularyNameLowerCase>
44 <#return vocabulary>
45 </#if>
46 </#list>
47 <#return {}>
48</#function>
49
50<#-- ############# Conteúdo Web -> Templates: Site de Crise - Include de templates #################################### -->
51<#function getSiteUrl>
52 <#assign portalUtil = staticUtil["com.liferay.portal.kernel.util.PortalUtil"]>
53 <#if layout?? && layout?has_content>
54 <#return portalUtil.getLayoutFriendlyURL(layout, themeDisplay)?replace(layout.getFriendlyURL(), "")>
55 </#if>
56 <#return portalUtil.getLayoutFriendlyURL(layout, themeDisplay)>
57</#function>
58
59<#function getSiteName>
60 <#return layout.getGroup().getDescriptiveName(locale)>
61</#function>
62
63<#function mountUrlToPage targetPage>
64 <#return getSiteUrl()+ "/" + targetPage>
65</#function>
66
67
68<#function getCategories journalArticle vocabularyId assetCategoryLocalService>
69 <#assign categories = []>
70 <#assign categoriesFromJournalArticleList = assetCategoryLocalService.getCategories("com.liferay.journal.model.JournalArticle", journalArticle.getResourcePrimKey()) />
71 <#list categoriesFromJournalArticleList as cat>
72 <#if cat.getVocabularyId() == vocabularyId>
73 <#assign categories += [cat]>
74 </#if>
75 </#list>
76 <#return categories>
77</#function>
78<#-- ################################################################################################################## -->
79
80
81<#assign
82journalArticleService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")
83assetVocabularyService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")
84categoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")
85vocabularies = assetVocabularyService.getGroupVocabularies(groupId)
86tagsLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetTagLocalService")
87tagVocabulary = findVocabulary("Tag", vocabularies)
88editoriaVocabulary = findVocabulary("Editorial", vocabularies)
89tagCategoryTitles = extractVocabularyTitles(tagVocabulary)
90editoriaCategoryTitles = extractVocabularyTitles(editoriaVocabulary)
91assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService")
92fileEntryService = staticUtil["com.liferay.document.library.kernel.service.DLFileEntryLocalServiceUtil"]
93layoutLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService")
94/>
95
96<#assign newsJournalArticle = "">
97<#assign assetEntry = getAssetEntryFromRequest(assetEntryLocalService)>
98<#if assetEntry?? && assetEntry?has_content>
99 <#assign newsJournalArticle = journalArticleService.fetchLatestArticle(assetEntry.classPK)/>
100</#if>
101
102<#function getSingleNode name root>
103 <#attempt>
104 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@name='${name}']/dynamic-content[@language-id='${locale}']") />
105 <#return xPathSelector.selectSingleNode( root ) />
106 <#recover>
107 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@name='${name}']") />
108 <#return xPathSelector.selectSingleNode( root ) />
109 </#attempt>
110</#function>
111
112
113<#-- <#list vocabularies as voc>
114 <h1>${voc.getTitle(locale)}</h1>
115 <#list voc.getCategories() as cat>
116 <h4>${cat.getTitle(locale)}</h4>
117 </#list>
118 </#list>
119
120-->
121<#assign cssRoot = "banner_" + randomNumber(5) />
122
123<#if entries?has_content>
124 <#assign newsInfoList = [] />
125 <#list entries as curEntry>
126 <#attempt >
127 <#assign newsJournalArticle = journalArticleService.fetchLatestArticle(curEntry.classPK)/>
128 <#assign
129 articleId = curEntry.classPK
130 ddmStructure = newsJournalArticle.getDDMStructure()
131 fieldList = getFieldListByStructure(ddmStructure)
132 xmlArticle = newsJournalArticle.getDocument().getRootElement()
133 />
134
135 <#assign
136 <#-- Título principal da notícia -->
137 mainHeadlineOfTheNews = newsJournalArticle.getTitle(locale, true)
138 <#-- Título de destaque da notícia -->
139 featuredNewsHeadline = extractFeaturedNewsHeadline(fieldList, xmlArticle)
140 />
141
142
143 <#-- Flag da notícia ---------------------------------------------------------------------------------->
144 <#assign journalArticleEditoriaCategories = getCategories(newsJournalArticle, editoriaVocabulary.getVocabularyId(), categoryLocalService) />
145 <#--list journalArticleEditoriaCategories as jCat>
146 <h2>Jcat: ${jCat.getTitle(locale)}</h2>
147 </#list -->
148
149 <#-- Url amigável da notícia para visualização em DisplayPage ----------------------------------------->
150 <#assign newsJournalArticleFriendlyUrl = "/">
151 <#if themeDisplay.getPortalURL()?contains("webserver")>
152 <#assign newsJournalArticleFriendlyUrl = themeDisplay.getPortalURL() + themeDisplay.getPathFriendlyURLPublic() + layout.getGroup().friendlyURL + "/w/" + newsJournalArticle.getUrlTitle()>
153 <#else>
154 <#assign newsJournalArticleFriendlyUrl = "/w/" + newsJournalArticle.getUrlTitle()>
155 </#if>
156
157 <#assign editoriaCategory = ""/>
158 <#--list journalArticleEditoriaCategories as cat>
159 <p>${cat.getTitle(locale)}</p>
160 </#list -->
161 <#if journalArticleEditoriaCategories?size gt 0>
162 <#assign editoriaCategory = journalArticleEditoriaCategories[0].getTitle(locale)/>
163 </#if>
164
165
166 <#assign newsInfoList = newsInfoList + [{
167 "articleId": articleId,
168 "mainHeadlineOfTheNews": mainHeadlineOfTheNews,
169 "featuredNewsHeadline" : featuredNewsHeadline,
170 "newsImageFieldSet": extractNewsImage(fieldList, xmlArticle, fileEntryService),
171 "editoriaCategory": editoriaCategory,
172 "url": newsJournalArticleFriendlyUrl
173 } ] />
174 <#recover>
175 </#attempt>
176 </#list>
177
178
179 <#if newsInfoList?size gt 0>
180 <#assign firstNewsInfo = newsInfoList[0] />
181 <#assign hashC = "css_" + randomNumber(5) />
182
183 <div class="${cssRoot} ">
184 <div class="breakpoint">
185 <div class="banner-container col-1-12 md-col-1-8 sm-col-1-4">
186 <div article-id="${firstNewsInfo.articleId}" class="card first ">
187
188 <div class="big ${hashC}">
189 <picture >
190 <source media="(max-width:767px)" srcset="/o/adaptive-media/image/${firstNewsInfo.newsImageFieldSet.newsImage.fileEntryId}/${adaptativeMediaMobileResolutionName}/image">
191 <img class="card-news-image background" loading="lazy" src="/o/adaptive-media/image/${firstNewsInfo.newsImageFieldSet.newsImage.fileEntryId}/${adaptativeMediaDesktopResolutionName}/image" alt="YouTube Thumbnail"/>
192 </picture>
193 <div class="overlay-filter"></div>
194 <div class="editoria">${firstNewsInfo.editoriaCategory}</div>
195 <h2 class="title">${firstNewsInfo.featuredNewsHeadline}</h2>
196 <div class="bar"></div>
197 <div class="link-container">
198 <a class="link home-banner-btn-link" href="${firstNewsInfo.url}">
199 <#if locale == "pt_BR"> Ler notícia <#else> Read news</#if>
200 <svg viewBox="0 0 46 28" fill="none" xmlns="http://www.w3.org/2000/svg" style="pointer-events: none">
201 <path d="M36.5303 14.5303C36.8232 14.2374 36.8232 13.7626 36.5303 13.4697L31.7574 8.6967C31.4645 8.40381 30.9896 8.40381 30.6967 8.6967C30.4038 8.9896 30.4038 9.46447 30.6967 9.75736L34.9393 14L30.6967 18.2426C30.4038 18.5355 30.4038 19.0104 30.6967 19.3033C30.9896 19.5962 31.4645 19.5962 31.7574 19.3033L36.5303 14.5303ZM-6.34173e-08 14.75L36 14.75L36 13.25L6.34173e-08 13.25L-6.34173e-08 14.75Z" fill="white"/>
202 </svg>
203 </a>
204 </div>
205 </div>
206 </div>
207 <div class="right">
208 <#list newsInfoList as newsInfo>
209 <#if newsInfo?index gt 0>
210 <div article-id="${newsInfo.articleId}" class="card">
211 <#if newsInfo.newsImageFieldSet.newsImage.url != "" >
212 <picture >
213 <source media="(max-width:767px)" srcset="/o/adaptive-media/image/${newsInfo.newsImageFieldSet.newsImage.fileEntryId}/${adaptativeMediaMobileResolutionName}/image">
214 <img loading="lazy" src="/o/adaptive-media/image/${newsInfo.newsImageFieldSet.newsImage.fileEntryId}/${adaptativeMediaDesktopResolutionName}/image" alt="${newsInfo.newsImageFieldSet.newsImage.alt}" />
215 </picture>
216 </#if>
217 <div>
218 <div class="editoria">${newsInfo.editoriaCategory}</div>
219 <a class="link title home-banner-card-link" href="${newsInfo.url}">${newsInfo.featuredNewsHeadline}</a>
220 </div>
221 </div>
222 </#if>
223 </#list>
224 </div>
225 </div>
226
227 </div>
228 </div>
229 </#if>
230
231 <style>
232 .${cssRoot} .breakpoint * {
233 margin: 0;
234 padding: 0;
235 }
236
237 .${cssRoot} .breakpoint {
238 row-gap: var(--space-xl, 40px);
239 }
240
241
242 .${cssRoot} .breakpoint .banner-container {
243 display: flex;
244 gap: 32px;
245 }
246
247 .${cssRoot} .card:hover {
248 box-shadow: var(--box-shadow-neutral);
249 transition: box-shadow 300ms ease-in-out;
250 }
251
252 .${cssRoot} .card {
253 border-radius: var(--border-radius-md);
254 border: 1px solid var(--color-neutral-500, #D7D7D7);
255 background: var(--color-neutral-100, #FFF);
256 box-shadow: none;
257 position: relative;
258 overflow: hidden;
259 }
260
261 .${cssRoot} .bar {
262 width: 40px;
263 height: 4px;
264 min-height: 4px;
265 min-width: 40px;
266 background-color: var(--color-secondary-solid-to-bright-200, #FDC82F);
267 position: relative;
268 }
269
270 .${cssRoot} .card.first >div {
271 padding: 0 var(--size-xxl, 48px);
272 display: flex;
273 flex-direction: column;
274 justify-content: flex-end;
275 height: 100%;
276 gap: var(--size-xs, 16px);
277 border-radius: var(--border-radius-md, 8px);
278 padding-bottom: 22px;
279 }
280
281 .${cssRoot} .card.first img.background {
282 position: absolute;
283 top: 0;
284 left: 0;
285 width: 100%;
286 height: 100%;
287 pointer-events: none;
288 object-fit: cover;
289 }
290
291 .${cssRoot} .card.first .overlay-filter {
292 width: 100%;
293 height: 100%;
294 background: var(--color-opacity-dark-level-02);
295 position: absolute;
296 top: 0;
297 left: 0;
298 border-radius: var(--border-radius-md, 8px);
299 }
300
301 .${cssRoot} .card.first .link-container {
302 border-radius: 100px;
303 background: var(--color-opacity-level-03, rgba(255, 255, 255, 0.48));
304 box-shadow: 0 var(--size-micro,4px) var(--size-xs,16px) 0 rgba(0, 0, 0, 0.16);
305 backdrop-filter: blur(8px);
306 max-width: 296px;
307 padding: var(--font-size-xs, 18px) var(--font-size-xl, 32px);
308 }
309
310 .${cssRoot} .card.first .link-container .link {
311 display: flex;
312 flex-direction: row;
313 gap: var(--space-sm, 16px);
314 align-items: center;
315 justify-content: space-between;
316 color: var(--color-neutral-100, #FFF);
317 font-family: var(--font-family-base);
318 font-size: var(--size-xs, 18px);
319 font-style: var(--font-style-normal, normal);;
320 font-weight: var(--font-weight-bold, 700);
321 line-height: var(--line-height-lg, 144%); /* 25.92px */
322 }
323
324 .${cssRoot} .card.first .link-container .hidden-text {
325 position: absolute;
326 opacity: 0;
327 pointer-events: none;
328 }
329
330 .${cssRoot} .card.first .link-container .link svg {
331 width: 46px;
332 height: 28px;
333 }
334
335 .${cssRoot} .card.first .editoria {
336 color: var(--color-neutral-100, #FFF);
337 font-family: var(--font-family-base);
338 font-size: var(--font-size-xxs, 16px);
339 font-style: var(--font-style-normal, normal);;
340 font-weight: var(--font-weight-regular, 400);
341 line-height: var(--line-height-xl, 160%); /* 25.6px */
342 position: relative;
343 }
344
345 .${cssRoot} .card .editoria {
346 color: var(--color-neutral-800, #373737);
347
348 font-family: var(--font-family-base);
349 font-size: var(--font-size-xxxs, 14px);
350 font-style: var(--font-style-normal, normal);;
351 font-weight: var(--font-weight-regular, 400);
352 line-height: var(--line-height-xl, 160%); /* 22.4px */
353 }
354
355 .${cssRoot} .card .title{
356 color: var(--color-neutral-100, #FFF);
357 font-family: var(--font-family-base);
358 font-size: var(--font-size-xxl, 38px);
359 font-style: var(--font-style-normal, normal);
360 font-weight: var(--font-weight-bold, 700);
361 line-height: var(--line-height-xs, 100%);
362 padding-bottom: var(--space-sm, 16px);
363 position: relative;
364 }
365
366 .${cssRoot} .right {
367 display: flex;
368 gap: var(--space-md, 24px);
369 flex-direction: column;
370 width: 452px;
371 flex-shrink: 0;
372 }
373
374 .${cssRoot} .right .card {
375 overflow: hidden;
376 display: flex;
377 max-height: 136px;
378 }
379 .${cssRoot} .right .card >div{
380 border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
381 padding: var(--space-sm, 16px);
382 display: flex;
383 flex-direction: column;
384 gap: var(--space-xxs, 8px);
385 background: var(--color-background-card);
386 width: 100%;
387 }
388 .${cssRoot} .right .card .title {
389 overflow: hidden;
390 color: var(--color-neutral-800, #373737);
391 text-overflow: ellipsis;
392 font-family: var(--font-family-base);
393 font-size: var(--font-size-xs, 18px);
394 font-style: var(--font-style-normal, normal);;
395 font-weight: var(--font-weight-bold, 700);
396 line-height: var(--line-height-md, 132%);
397 }
398
399 .${cssRoot} .right .card .title {
400 display: flex;
401 flex-direction: column;
402 gap: var(--space-xxs, 8px);
403 }
404
405 .${cssRoot} .right .card img {
406 width: 154px;
407 height: 134px;
408 border-radius: var(--size-xxxs, 8px) 0 0 var(--size-xxxs, 8px);
409 object-fit: cover;
410 }
411
412
413 @media screen and (max-width: ${MAX_TABLET_WIDTH}px) {
414 .${cssRoot} .card.first >div {
415 padding: var(--space-xxl, 56px) var(--space-lg, 32px) 22px;
416 }
417
418 .${cssRoot} .card .title {
419 font-size: var(--font-size-xl, 32px);
420 line-height: var(--line-height-sm, 120%);
421 padding-bottom: var(--space-md, 24px);
422 }
423
424 .${cssRoot} .card.first .link-container {
425 margin-top: var(--space-md, 24px);
426 }
427
428 .${cssRoot} .card.first .editoria {
429 color: var(--color-neutral-100, #FFF);
430 font-family: var(--font-family-base);
431 font-size: var(--font-size-xxxs, 14px);
432 font-style: var(--font-style-normal, normal);;
433 font-weight: var(--font-weight-regular, 400);
434 line-height: var(--line-height-xl, 160%);
435 }
436
437 .${cssRoot} .card.first >div {
438 gap: var(--space-xxs, 8px);
439 }
440
441 .${cssRoot} .bar {
442 min-width: 32px;
443 }
444 }
445
446 @media screen and (max-width: 1024px) {
447 .${cssRoot} .breakpoint .banner-container {
448 flex-direction: column;
449 }
450
451 .${cssRoot} .breakpoint .banner-container .right {
452 width: 100%;
453 }
454 }
455
456
457 @media screen and (max-width: ${MAX_MOBILE_WIDTH}px) {
458 header.cadmin.portlet-topper {
459 display: none !important;
460 }
461 }
462 </style>
463 <script>
464 const highlightCardTitle = document.querySelector('.${cssRoot} .card.first .title');
465 const highlightCardLink = document.querySelector('.${cssRoot} .card.first .link-container a.home-banner-btn-link');
466
467 const GTMLinkSpan = document.createElement('span');
468 GTMLinkSpan.textContent = highlightCardTitle.textContent;
469 GTMLinkSpan.classList.add('hidden-text');
470 highlightCardLink.appendChild(GTMLinkSpan);
471 </script>
472</#if>
473
474
475<#-- ############# Site de Crise - Notícia - Extrair dados de Notícias ################################################ -->
476<#--
477Add elements from the sidebar to define your template. Type "${" to use the
478autocomplete feature.
479-->
480<#function extractFeaturedNewsHeadline fieldList xmlArticle>
481 <#return getFieldValue(fieldList, xmlArticle, "Título de destaque da notícia")>
482</#function>
483
484<#function extractNewsSummary fieldList xmlArticle>
485 <#return getFieldValue(fieldList, xmlArticle, "Subtítulo")>
486</#function>
487
488<#function extractPublishDate journalArticle>
489 <#--assign lastPublishDate = journalArticle.getModifiedDate()>
490 <#if journalArticle.getLastPublishDate()??>
491 <#assign lastPublishDate = journalArticle.getLastPublishDate()>
492 <#else>
493 <#assign lastPublishDate = journalArticle.getModifiedDate()>
494 </#if>
495 <#return lastPublishDate -->
496 <#return journalArticle.getDisplayDate() />
497</#function>
498
499
500<#function getFlagColor flag>
501 <#attempt >
502 <#list getFlagsCategoriesAndProperties() as catProps>
503 <#if catProps.name == flag>
504 <#return catProps.color>
505 </#if>
506 </#list>
507 <#recover >
508 </#attempt>
509 <#return "">
510</#function>
511
512<#-- Seção da imagem de destaque ---------------------------------------------------------------------->
513<#function extractNewsImage fieldList xmlArticle fileEntryService>
514 <#assign
515 <#-- Grupo da imagem de destaque -->
516 newsImageGroupList = getNodes("Fieldset71035101", newsJournalArticle.getDocument().getRootElement())
517 <#-- Url e descrição da imagem de destaque -->
518 newsImage = {"url": "--", "alt": "--", "mimeType" :"image/jpg"}
519 <#-- Créditos da imagem de destaque -->
520 newsImageCredits = ""
521 <#-- Legenda da imagem de destaque -->
522 newsImageLegend = ""
523 <#-- Texto do link para download -->
524 downloadLinkTitle = ""
525 >
526
527 <#list newsImageGroupList as newsImageGroup>
528 <#assign newsImage = getFileFromXML("Image05319221", newsImageGroup, fileEntryService) />
529 <#-- Grupo com as informações de crédito e legenda da imagem de destaque -->
530 <#assign labelGroupList = getNodes("Fieldset43702900", newsImageGroup) />
531 <#list labelGroupList as labelGroup>
532 <#-- Investigar do porquê não está funcionando o getFieldValue
533 <#assign
534 newsImageCredits = getFieldValue(fieldList, labelGroup, "Crédito da imagem de destaque da notícia")
535 newsImageLegend = getFieldValue(fieldList, labelGroup, "Legenda da imagem de destaque da notícia")
536 downloadLinkTitle = getFieldValue(fieldList, labelGroup, "Texto do link para download")
537 />
538 -->
539 <#assign
540 newsImageCredits = getSingleNodeString("Text47590088", labelGroup)
541 newsImageLegend = getSingleNodeString("Text03239077", labelGroup)
542 downloadLinkTitle = getSingleNodeString("Text48804898", labelGroup) />
543 </#list>
544 </#list>
545
546 <#return {"newsImage": newsImage,
547 "credits": newsImageCredits,
548 "legend": newsImageLegend,
549 "linkTitle" : downloadLinkTitle
550 }/>
551</#function>
552
553<#function featureNewsVideo xmlArticle fileEntryService>
554<#-- Seção do video de destaque ----------------------------------------------------------------------->
555 <#assign
556 youtubeId = ""
557 internalVideoUrl = ""
558 featureNewsVideoGroup = getNodes("Fieldset09746751", xmlArticle)
559 >
560 <#list featureNewsVideoGroup as newsImageFieldSet>
561 <#assign
562 youtubeId = getFieldValue(fieldList,featureNewsVideoGroup, "ID do vídeo do YouTube do vídeo de destaque")
563 internalVideoUrl = getFileFromXML("DocumentLibrary80545771", featureNewsVideoGroup, fileEntryService)
564 >
565 </#list>
566
567 <#return {"youtube": youtubeId, "internalVideoUrl" : internalVideoUrl}>
568</#function>
569
570
571
572<#function extractInfo journalArticle editoriaCategoryTitles fileEntryService categoryLocalService layoutLocalService>
573 <#attempt >
574 <#assign
575 ddmStructure = journalArticle.getDDMStructure()
576 fieldList = getFieldListByStructure(ddmStructure)
577 xmlArticle = journalArticle.getDocument().getRootElement()
578 >
579
580 <#assign
581 <#-- Título principal da notícia -->
582 mainHeadlineOfTheNews = journalArticle.getTitle(locale, true)
583 <#-- Título de destaque da notícia -->
584 featuredNewsHeadline = extractFeaturedNewsHeadline(fieldList, xmlArticle)
585 <#-- Sumário da notícia -->
586 newsSummary = extractNewsSummary(fieldList, xmlArticle)
587 <#-- Data de publicação da notícia -->
588 lastPublishDate = extractPublishDate(journalArticle)
589 <#-- Data de criação da notícia -->
590 createDate = journalArticle.getCreateDate()
591 >
592
593
594 <#-- Flag da notícia ---------------------------------------------------------------------------------->
595 <#assign flag = getFirstCategoryTitle(journalArticle, editoriaCategoryTitles, categoryLocalService)>
596 <#assign flagColor = getFlagColor(flag)>
597
598 <#-- Url amigável da notícia para visualização em DisplayPage ----------------------------------------->
599 <#assign journalArticleFriendlyUrl = themeDisplay.getPortalURL() + themeDisplay.getPathFriendlyURLPublic() + layout.getGroup().friendlyURL + "/w/" + journalArticle.getUrlTitle()>
600 <#assign journalArticleFriendlyUrl = "/">
601 <#if themeDisplay.getPortalURL()?contains("webserver")>
602 <#assign journalArticleFriendlyUrl = themeDisplay.getPortalURL() + themeDisplay.getPathFriendlyURLPublic() + layout.getGroup().friendlyURL + "/w/" + journalArticle.getUrlTitle()>
603 <#else>
604 <#assign journalArticleFriendlyUrl = "/w/" + journalArticle.getUrlTitle()>
605 </#if>
606
607 <#-- Conteúdo da notícia ------------------------------------------------------------------------------>
608 <#assign newsContent = getFieldValue(fieldList, xmlArticle, "Corpo da notícia")>
609
610 <#-- Seção do áudio para o conteúdo da notícia -------------------------------------------------------->
611 <#assign audios = []
612 audioIdentifierFieldSetList = getNodes("Fieldset65862311", xmlArticle)
613 >
614 <#list audioIdentifierFieldSetList as audioIdentifierFieldSet>
615 <#assign
616 <#-- Grupo com as informações de url e legenda do áudio -->
617 audioInfoFieldSet = getGroupNode("Fieldset24035689",audioIdentifierFieldSet)>
618 <#assign
619 externalAudioUrl = getFieldValue(fieldList, audioInfoFieldSet, "URL externa do áudio")
620 internalAudioUrl = getFileFromXML("DocumentLibrary24170668", audioInfoFieldSet, fileEntryService)
621 audioLegend = getFieldValue(fieldList, audioInfoFieldSet, "Legenda do áudio")>
622
623 <#if externalAudioUrl?has_content || internalAudioUrl.url?has_content >
624 <#assign audios += [{
625 "id": getFieldValue(fieldList, audioIdentifierFieldSet, "Identificador de Áudio"),
626 "externalUrl" : externalAudioUrl,
627 "internalUrl" : internalAudioUrl,
628 "legend" : audioLegend
629 }]>
630 </#if>
631 </#list>
632
633 <#-- Seção de vídeo para o conteúdo da notícia -------------------------------------------------------->
634 <#assign videos = []
635 videoIdentifierFieldSetList = getNodes("Fieldset24460782", xmlArticle)
636 >
637 <#list videoIdentifierFieldSetList as videoIdentifierFieldSet>
638 <#assign
639 <#-- Grupo com as informações de url e legenda do áudio -->
640 videoInfoFieldSet = getGroupNode("Fieldset51040010",videoIdentifierFieldSet)
641
642 videos += [{
643 "id": getFieldValue(fieldList,videoIdentifierFieldSet, "Identificador de Vídeo"),
644 "youtubeID" : getFieldValue(fieldList, videoInfoFieldSet, "ID do vídeo do YouTube"),
645 "internalUrl" : getFileFromXML("DocumentLibrary15265409", videoInfoFieldSet, fileEntryService),
646 "legend" : getFieldValue(fieldList, videoInfoFieldSet, "Legenda do vídeo")
647 }]
648 >
649 </#list>
650
651
652 <#-- Seção de links para o conteúdo da notícia -------------------------------------------------------->
653 <#assign
654 links = []
655 linksFieldSetList = getNodes("Fieldset37770113", xmlArticle)
656 >
657 <#list linksFieldSetList as linksFieldSet>
658 <#assign linkFieldSetList = getNodes("Fieldset10524367", linksFieldSet)>
659
660 <#list linkFieldSetList as linkFieldSet>
661 <#assign
662 linkId = getFieldValue(fieldList, linkFieldSet, "Identificador do link")
663
664 <#-- Grupo com as informações de url e legenda do áudio -->
665 linkInfoFieldSeet = getGroupNode("Fieldset86037074", linkFieldSet)
666
667 iconType = getFieldValue(fieldList, linkInfoFieldSeet, "Ícone do link")
668 links += [{
669 "id": linkId,
670 "externalLink" : getFieldValue(fieldList, linkInfoFieldSeet, "Link externo"),
671 "pageLink" : getPageLayoutLinkFromXML("LinkToLayout77941175", linkInfoFieldSeet, layoutLocalService),
672 "file" : getFileFromXML("DocumentLibrary34820760", linkInfoFieldSeet, fileEntryService),
673 "title" : getFieldValue(fieldList, linkInfoFieldSeet, "Título do link"),
674 "iconType" : iconType
675 }]
676 >
677 </#list>
678 </#list>
679
680
681
682 <#-- Seção de imagens da galeria para o conteúdo da notícia ------------------------------------------->
683 <#assign galleries = []
684 carouselIdentifierFieldSetList = getNodes("Fieldset39804431", xmlArticle)
685 >
686 <#list carouselIdentifierFieldSetList as carouselIdentifierFieldSet>
687 <#assign
688 galleryId = getFieldValue(fieldList,carouselIdentifierFieldSet, "Identificador de Galeria")
689
690 <#-- Grupo com as informações de url e legenda da galeria -->
691 carouselImgFieldSetList = getNodes("Fieldset23271674",carouselIdentifierFieldSet)
692 >
693
694 <#assign galleryItems = []>
695 <#list carouselImgFieldSetList as carouselImgFieldSet>
696 <#assign galleryItems += [{
697 "img" : getFileFromXML("Image44073821", carouselImgFieldSet, fileEntryService),
698 "externalLink" : getFieldValue(fieldList, carouselImgFieldSet, "Associar imagem a link externo"),
699 "title": getFieldValue(fieldList, carouselImgFieldSet, "Título do item da galeria"),
700 "legend": getFieldValue(fieldList, carouselImgFieldSet, "Legenda da imagem")
701 }
702 ]>
703 </#list>
704 <#assign galleries += [{"id": galleryId, "items": galleryItems}]>
705 </#list>
706
707 <#assign mediaGroupList = getNodes(getIdFromFieldName(fieldList, "Galeria de multimídia"), xmlArticle) />
708 <#assign galleryItems = []/>
709
710 <#list mediaGroupList as mediaGroup >
711 <#assign nodeId = getIdFromFieldName(fieldList, "Selecione o Conteúdo Web da mídia") />
712 <#assign nodes = getNodes(nodeId, mediaGroup) />
713 <#list nodes as node>
714 <#assign medJson = jsonFactoryUtil.createJSONObject(node.getStringValue()) />
715 <#assign mediaJournalArticle = journalArticleService.fetchLatestArticle(medJson.classPK?number)/>
716 <#assign mediaDdmStructure = mediaJournalArticle.getDDMStructure()/>
717 <#assign fieldListMedia = getFieldListByStructure(mediaDdmStructure)/>
718 <#assign xmlArticleMedia = mediaJournalArticle.getDocument().getRootElement() />
719
720 <#assign cardTitle = getFieldValue(fieldListMedia, xmlArticleMedia, "Título Home")/>
721 <#assign subtitle = getFieldValue(fieldListMedia, xmlArticleMedia, "Legenda")/>
722 <#assign author = getFieldValue(fieldListMedia, xmlArticleMedia, "Autor")/>
723 <#assign thumbnailImage = getMediaInfo(fieldListMedia, xmlArticleMedia, "Imagem de thumbnail", fileEntryService) />
724
725 <#assign originalFileGroup = getGroupNode(getIdFromFieldName(fieldListMedia, "Arquivo original"), xmlArticleMedia) />
726
727 <#assign originalFile = getMediaInfo(fieldListMedia, originalFileGroup, "Arquivo selecionado", fileEntryService) />
728 <#assign originalFileExternalUrl = getFieldValue(fieldListMedia, originalFileGroup, "URL externa") />
729
730 <#assign galleryItems += [{"cardTitle": cardTitle,
731 "subtitle" : subtitle,
732 "author": author,
733 "thumbnailImage": thumbnailImage,
734 "originalFile": originalFile,
735 "originalFileExternalUrl": originalFileExternalUrl
736 }] />
737
738 </#list>
739 </#list>
740
741 <#return {
742 "mainHeadlineOfTheNews": mainHeadlineOfTheNews,
743 "featuredNewsHeadline" : featuredNewsHeadline,
744 "displayDate" : formatDate(createDate),
745 "createDate": createDate,
746 "newsSummary" : newsSummary,
747 "newsImageFieldSet": extractNewsImage(fieldList, xmlArticle, fileEntryService),
748 "featureNewsVideo" : featureNewsVideo(xmlArticle, fileEntryService),
749 "lastPublishDate": lastPublishDate,
750 "flag": flag,
751 "flagColor": flagColor,
752 "url": journalArticleFriendlyUrl,
753 "newsContent": newsContent,
754 "audios": audios,
755 "videos": videos,
756 "galleryItems": galleryItems,
757 "links": links
758 }>
759
760 <#recover>
761 <#return "">
762 </#attempt>
763
764</#function>
765
766<#function extractNewsInfoForCard curEntry editoriaCategoryTitles journalArticleService fileEntryService categoryLocalService>
767 <#if !curEntry?? >
768 <#return {}>
769 </#if>
770
771 <#assign article = journalArticleService.getLatestArticle(curEntry.getClassPK()) />
772 <#if !article??>
773 <#return {}>
774 </#if>
775
776 <#assign ddmStructure = article.getDDMStructure()>
777 <#if !ddmStructure??>
778 <#return {}>
779 </#if>
780
781 <#assign fieldList = getFieldListByStructure(ddmStructure) />
782 <#assign xmlArticle = article.getDocument().getRootElement() />
783
784 <#assign mainHeadlineOfTheNews = article.getTitle(locale, true)>
785 <#assign featuredNewsHeadline = getFieldValue(fieldList, xmlArticle, "Título de destaque da notícia")>
786 <#assign newsSummary = getFieldValue(fieldList, xmlArticle, "Subtítulo")>
787 <#assign createDate = article.getCreateDate()>
788
789 <#assign lastPublishDate = extractPublishDate(article)>
790
791 <#assign newsImageFieldSetGroup = getNodes( "Fieldset79335573",xmlArticle)>
792 <#assign newsImage = {"url": "", "alt": ""}>
793 <#list newsImageFieldSetGroup as newsImageFieldSet>
794 <#assign newsImage = getFileFromXML("Image51357996", newsImageFieldSet, fileEntryService)>
795 </#list>
796
797 <#assign youtubeId = "">
798 <#assign internalVideoUrl = "">
799 <#assign featureNewsVideoGroup = getNodes("Fieldset09746751", xmlArticle)>
800 <#list featureNewsVideoGroup as newsImageFieldSet>
801 <#assign youtubeId = getFieldValue(fieldList,featureNewsVideoGroup, "ID do vídeo do YouTube do vídeo de destaque")>
802 <#assign internalVideoUrl = getFileFromXML("DocumentLibrary80545771", featureNewsVideoGroup, fileEntryService)>
803 </#list>
804
805
806 <#assign flag = getFirstCategoryTitle(article, editoriaCategoryTitles, categoryLocalService)>
807 <#assign flagColor = getFlagColor(flag)>
808
809 <#assign url = "/">
810 <#if themeDisplay.getPortalURL()?contains("webserver")>
811 <#assign url = themeDisplay.getPortalURL() + themeDisplay.getPathFriendlyURLPublic() + layout.getGroup().friendlyURL + "/w/" + article.getUrlTitle()>
812 <#else>
813 <#assign url = "/w/" + article.getUrlTitle()>
814 </#if>
815
816 <#return {
817 "mainHeadlineOfTheNews": mainHeadlineOfTheNews,
818 "featuredNewsHeadline" : featuredNewsHeadline,
819 "displayDate" : formatDate(createDate),
820 "createDate" : createDate,
821 "newsSummary" : newsSummary,
822 "newsImage": newsImage,
823 "featureNewsVideo" : {"youtube": youtubeId, "videoUrl" : internalVideoUrl},
824 "lastPublishDate": lastPublishDate,
825 "flag": flag,
826 "flagColor": flagColor,
827 "url": url
828 }>
829
830</#function>
831
832<#-- ################################################################################################################## -->
833
834</#if>
Mais recentes
Mais lidos
Navegue nas Seções:
Escolha um Canal:
Acessibilidade
Idioma:
Selecione um idioma: