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 225, column 72]

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




Canais

Idioma

Acessibilidade

Um inesperado erro ocorreu.
Um inesperado erro ocorreu.

Faça uma busca:

Buscar

Sugestões de busca

Link do botão
Ícone do botão Exibir mais resultados
Ícone de carregamento

Mais pesquisados

Preço dos combustíveis

Pré-Sal

Time Petrobras

Um inesperado erro ocorreu.
Um inesperado erro ocorreu.