Faça uma busca:
Mais pesquisados
Preço dos combustíveis
Pré-Sal
Time Petrobras
Title
O uso deste material é autorizado apenas para fins editoriais.
Petrobras divulga Comissão Avaliadora do programa de bolsas para jornalistas
Mais recentes
Java method "com.liferay.journal.model.impl.JournalArticleImpl.getDocument()" threw an exception when invoked on com.liferay.journal.model.impl.JournalArticleImpl object "{\"mvccVersion\": 1, \"ctCollectionId\": 0, \"uuid\": \"788c378f-e97f-d7b9-09ab-d786cc30c2fa\", \"id\": 34693409, \"resourcePrimKey\": 34563720, \"groupId\": 10623376, \"companyId\": 20099, \"userId\": 11888211, \"userName\": \"Leonardo Bruno Pimenta Melo\", \"createDate\": \"Mon Apr 07 12:59:54 GMT 2025\", \"modifiedDate\": \"Tue Apr 15 12:56:49 GMT 2025\", \"externalReferenceCode\": \"fd97794b-9942-2025-3baa-6e9d4c4df110\", \"folderId\": 34530929, \"classNameId\": 0, \"classPK\": 0, \"treePath\": \"/10628776/34530929/\", \"articleId\": \"34563718\", \"version\": 2.1, \"urlTitle\": \"selecao-de-jornalismo/petrobras-lanca-selecao-de-jornalismo\", \"DDMStructureId\": 10628772, \"DDMTemplateKey\": \"\", \"defaultLanguageId\": \"pt_BR\", \"layoutUuid\": \"\", \"displayDate\": \"Mon Apr 07 12:51:00 GMT 2025\", \"expirationDate\": null, \"reviewDate\": null, \"indexable\": true, \"smallImage\": false, \"smallImageId\": 0, \"smallImageSource\": 1, \"smallImageURL\": \"\", \"lastPublishDate\": null, \"status\": 0, \"statusByUserId\": 11888211, \"statusByUserName\": \"Leonardo Bruno Pimenta Melo\", \"statusDate\": \"Tue Apr 15 12:56:49 GMT 2025\"}"; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign xmlArticle = journalArticle.g... [in template "20099#20135#10832147" in function "getCardData" at line 53, column 5] ----
1<#-- Conteúdo Web -> Templates: Site de Crise - Include de templates-->
2<#-- include "${templatesPath}/1975602" -->
3
4<#-- Conteúdo Web -> Templates: Site de Crise - Funções gerais-->
5<#include "${templatesPath}/1975398" />
6
7<#assign journalArticleService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
8<#assign fileEntryService = staticUtil["com.liferay.document.library.kernel.service.DLFileEntryLocalServiceUtil"] />
9<#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") />
10<#assign assetVocabularyService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyService") />
11<#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") />
12<#assign vocabularies = assetVocabularyService.getGroupVocabularies(groupId) />
13<#assign editoriaVocabulary = findVocabulary("Editorial", vocabularies) />
14
15
16
17<#function getFirstCategoryFromVocabulary entry vocabulary>
18 <#assign categories = assetCategoryLocalService.getCategories("com.liferay.journal.model.JournalArticle", entry.getClassPK()) />
19 <#list categories as category>
20 <#assign vocabulary = assetVocabularyService.getVocabulary(category.getVocabularyId()) />
21
22 <#if vocabulary.getVocabularyId() == category.getVocabularyId()>
23 <#return category>
24 </#if>
25 </#list>
26 <#return "">
27</#function>
28
29<#assign rootCss = "card-news_" + randomNumber(4586) />
30<#assign cardMap = {} />
31
32<#-- Função para obter os dados de um card no Web Content (Journal Article) -->
33<#function getCardData entry journalArticleLocalService fileEntryService cardMap>
34
35 <#assign editoria = getFirstCategoryFromVocabulary(entry, editoriaVocabulary) />
36 <#assign editoriaId = -1 />
37 <#if editoria?has_content>
38 <#assign editoriaId = editoria.getCategoryId() />
39 </#if>
40 <#if editoriaId == -1>
41 <#return {} />
42 </#if>
43 <#if cardMap[ editoriaId?string]??>
44 <#if cardMap[editoriaId?string]?size gt 7 >
45 <#return {} />
46 </#if>
47 </#if>
48
49 <#assign articleId = entry.classPK />
50 <#assign journalArticle = journalArticleLocalService.getLatestArticle(entry.getClassPK()) />
51 <#assign ddmStructure = journalArticle.getDDMStructure() />
52 <#assign fieldList = getFieldListByStructure(ddmStructure) />
53 <#assign xmlArticle = journalArticle.getDocument().getRootElement() />
54 <#assign ddmStructure = journalArticle.getDDMStructure() />
55
56 <#assign imagesGroup = getNodes(getIdFromFieldName(fieldList, "Imagem de destaque da notícia"), xmlArticle) />
57 <#assign image = "" />
58 <#list imagesGroup as imageGroup >
59 <#assign image = getMediaInfo(fieldList, imageGroup, "Imagem de destaque", fileEntryService) /> />
60 </#list>
61
62 <#assign title = getFieldValue(fieldList, xmlArticle, "Título de destaque da notícia") />
63
64 <#assign lastPublishDate = journalArticle.getDisplayDate()>
65 <#assign createDate = journalArticle.getCreateDate()>
66
67 <#assign editoria = getFirstCategoryFromVocabulary(entry, editoriaVocabulary) />
68 <#assign editoriaId = -1 />
69 <#if editoria?has_content>
70 <#assign editoriaId = editoria.getCategoryId() />
71 </#if>
72
73 <#assign review = getFieldValue(fieldList, xmlArticle, "Subtítulo") />
74
75 <#assign urlNews = "/">
76 <#if themeDisplay.getPortalURL()?contains("webserver")>
77 <#assign urlNews = themeDisplay.getPortalURL() + themeDisplay.getPathFriendlyURLPublic() + layout.getGroup().friendlyURL + "/w/" + journalArticle.getUrlTitle()>
78 <#else>
79 <#assign urlNews = "/w/" + journalArticle.getUrlTitle()>
80 </#if>
81
82 <#assign cardInfo = {
83 "articleId": articleId,
84 "image": image,
85 "title": title,
86 "lastPublishDate": lastPublishDate,
87 "createDate" : createDate,
88 "editoriaId": editoriaId,
89 "urlNews": urlNews,
90 "review": review} />
91
92 <#if cardMap[editoriaId?string]??>
93 <#assign cardMap = cardMap + {editoriaId : cardMap[editoriaId?string] + [cardInfo]} />
94 <#else>
95 <#assign cardMap = cardMap + {editoriaId : [cardInfo]} />
96 </#if>
97
98 <#return cardInfo />
99
100</#function>
101
102
103<#macro renderCard cardData>
104 <#if !cardData["image"]??>
105 <#return />
106 </#if>
107 <div class="card ${rootCss}" category-id="${cardData.editoriaId}" article-id="${cardData.articleId}">
108 <a class="default-news-card-link" href="${cardData.urlNews}"></a>
109 <#if cardData.image.url?has_content>
110 <img class="image" src="/o/adaptive-media/image/${cardData.image.fileEntryId}/Thumbnail-300x300/image" alt="${cardData.image.alt}"/>
111 </#if>
112 <div class="news-content">
113 <div class="head">
114 <p class="date">${formatDate(cardData.lastPublishDate)}</p>
115 <h2 class="title h4">${cardData.title}</h2>
116 <div class="bar"></div>
117 </div>
118 <div class="bottom-wrapper">
119 <div class="review-container">
120 ${cardData.review}
121 </div>
122 <div class="link-container">
123 <p class="read-more">
124 <#if locale?lower_case == "pt_br"> Continuar lendo <#else> Keep reading </#if>
125 </p>
126 </div>
127 </div>
128 </div>
129 </div>
130
131</#macro>
132
133<#-- Renderizar Lista de cards -->
134<#if entries?has_content>
135 <#list entries as entry>
136 <#assign cardData = getCardData(entry journalArticleService fileEntryService cardMap) />
137 <@renderCard cardData/>
138 </#list>
139
140 <style>
141
142
143 .${rootCss} {
144 display: flex;
145 flex-direction: column;
146 width: 306px;
147 border-radius: 16px;
148 border: 1px solid var(--color-neutral-400, #EEE);
149 background: var(--color-neutral-100, #FFF);
150 margin: 0;
151 position: relative;
152 }
153
154 .${rootCss} *:not(.default-news-card-link) {
155 pointer-events: none;
156 }
157
158 .${rootCss} a.default-news-card-link {
159 position: absolute;
160 width: 100%;
161 height: 100%;
162 opacity: 0;
163 }
164
165 .${rootCss}:hover {
166 box-shadow: var(--box-shadow-neutral);
167 transition: box-shadow 300ms ease-in-out;
168 }
169
170 .${rootCss} .news-content {
171 padding: var(--space-md, 24px);
172 display: flex;
173 flex-direction: column;
174 height: 100%;
175 background: var(--color-background-card);
176 border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
177 }
178
179
180 .${rootCss} img {
181 background: lightgray 50% / cover no-repeat;
182 height: 170px;
183 width: 100%;
184 border-radius: 16px 16px 0 0;
185 /*transform: translateX(-1px);*/
186 object-fit: cover;
187 }
188
189 .${rootCss} .head {
190 display: flex;
191 flex-direction: column;
192 gap: var(--space-xxs, 8px);
193 }
194
195 .${rootCss} .head .date {
196 color: var(--color-neutral-800, #373737);
197 font-family: var(--font-family-base, "Petrobras Sans");
198 font-size: 14px;
199 font-style: normal;
200 font-weight: 400;
201 line-height: 160%; /* 19.2px */
202 }
203
204 .${rootCss} .head .title {
205 color: var(--color-neutral-800);
206 }
207
208 .${rootCss} .head .bar {
209 background-color: var(--color-secondary-solid-to-bright-200, #FDC82F);
210 height: 4px;
211 width: 20px;
212 margin: 12px 0 16px 0;
213 }
214
215 .${rootCss} .bottom-wrapper {
216 height: 100%;
217 display: flex;
218 flex-direction: column;
219 justify-content: space-between;
220 }
221
222 .${rootCss} .bottom-wrapper .review-container {
223 color: var(--color-neutral-800, #373737);
224 font-family: var(--font-family-base, "Petrobras Sans");
225 font-size: 16px;
226 font-style: normal;
227 font-weight: 400;
228 line-height: 160%; /* 22.4px */
229 }
230
231 .${rootCss} .bottom-wrapper .link-container {
232 flex: 0 1 auto;
233 }
234
235 .${rootCss} .bottom-wrapper .link-container .read-more {
236 color: var(--color-primary-solid-to-bright-200, var(--color-primary-medium));
237 font-family: var(--font-family-base, "Petrobras Sans");
238 font-size: 16px;
239 font-style: normal;
240 font-weight: 700;
241 line-height: 144%; /* 23.04px */
242 text-decoration-line: underline;
243 }
244
245 @media screen and (max-width: 1024px) {
246 .${rootCss} {
247 flex-direction: column;
248 /*gap: 16px;*/
249 min-width: 296px;
250 }
251
252 .${rootCss} img {
253 height: 140px;
254 }
255
256 .${rootCss} .head .date {
257 font-size: 12px;
258 }
259
260 .${rootCss} .head .title {}
261
262 .${rootCss} .head .bar {
263 width: 18px;
264 margin: 8px 0 16px 0;
265 }
266
267 .${rootCss} .review-container {
268 font-size: 14px;
269 }
270 }
271 </style>
272 <script>
273 (function() {
274 let cards = document.querySelectorAll('.${rootCss}.card');
275
276 cards.forEach((card) => {
277 const cardLink = card.querySelector('a.default-news-card-link');
278 const cardTitle = card.querySelector('.title');
279 cardLink.textContent = cardTitle.textContent;
280 });
281
282 document.addEventListener('DOMContentLoaded', () => {
283 const bannerCards = document.querySelectorAll('.banner-container .card[article-id]');
284 const bannerCardIds = Array.from(bannerCards).map(card => card.getAttribute('article-id'));
285 const maxNumberOfCards = 8;
286
287 // removes the cards from the banner and shows the rest
288 cards.forEach(card => bannerCardIds.includes(card.getAttribute('article-id')) && card.remove());
289 // limita o número máximo de cards
290 cards = document.querySelectorAll('.${rootCss}.card');
291 if(cards.length > maxNumberOfCards) {
292 for (let i = cards.length; i > maxNumberOfCards; i--) {
293 cards[i-1].remove();
294 }
295 }
296 });
297 })();
298 </script>
299</#if>
Mais lidos
Java method "com.liferay.journal.model.impl.JournalArticleImpl.getDocument()" threw an exception when invoked on com.liferay.journal.model.impl.JournalArticleImpl object "{\"mvccVersion\": 1, \"ctCollectionId\": 0, \"uuid\": \"8a9de6c4-0fa9-a6df-60ea-d977ee86dd12\", \"id\": 14943962, \"resourcePrimKey\": 12776928, \"groupId\": 10623376, \"companyId\": 20099, \"userId\": 11888211, \"userName\": \"Leonardo Bruno Pimenta Melo\", \"createDate\": \"Tue Jan 30 17:45:09 GMT 2024\", \"modifiedDate\": \"Tue Mar 19 18:59:28 GMT 2024\", \"externalReferenceCode\": \"bd93fbbc-db2c-2546-a3e0-b5e4b55c654a\", \"folderId\": 11451017, \"classNameId\": 0, \"classPK\": 0, \"treePath\": \"/10628776/11451017/\", \"articleId\": \"12776926\", \"version\": 1.4, \"urlTitle\": \"institucional/petrobras-apoia-projetos-de-reciclagem-no-rio-e-na-baixada-fluminense-com-capacidade-de-reaproveitar-600-toneladas-de-materiais-por-ano\", \"DDMStructureId\": 10628772, \"DDMTemplateKey\": \"\", \"defaultLanguageId\": \"pt_BR\", \"layoutUuid\": \"\", \"displayDate\": \"Tue Jan 30 17:35:00 GMT 2024\", \"expirationDate\": null, \"reviewDate\": null, \"indexable\": true, \"smallImage\": false, \"smallImageId\": 0, \"smallImageSource\": 1, \"smallImageURL\": \"\", \"lastPublishDate\": null, \"status\": 0, \"statusByUserId\": 10761258, \"statusByUserName\": \"Francisco Gabriel Pinillos Lopez\", \"statusDate\": \"Tue Mar 19 18:59:28 GMT 2024\"}"; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign xmlArticle = journalArticle.g... [in template "20099#20135#10832147" in function "getCardData" at line 53, column 5] ----
1<#-- Conteúdo Web -> Templates: Site de Crise - Include de templates-->
2<#-- include "${templatesPath}/1975602" -->
3
4<#-- Conteúdo Web -> Templates: Site de Crise - Funções gerais-->
5<#include "${templatesPath}/1975398" />
6
7<#assign journalArticleService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
8<#assign fileEntryService = staticUtil["com.liferay.document.library.kernel.service.DLFileEntryLocalServiceUtil"] />
9<#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") />
10<#assign assetVocabularyService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyService") />
11<#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") />
12<#assign vocabularies = assetVocabularyService.getGroupVocabularies(groupId) />
13<#assign editoriaVocabulary = findVocabulary("Editorial", vocabularies) />
14
15
16
17<#function getFirstCategoryFromVocabulary entry vocabulary>
18 <#assign categories = assetCategoryLocalService.getCategories("com.liferay.journal.model.JournalArticle", entry.getClassPK()) />
19 <#list categories as category>
20 <#assign vocabulary = assetVocabularyService.getVocabulary(category.getVocabularyId()) />
21
22 <#if vocabulary.getVocabularyId() == category.getVocabularyId()>
23 <#return category>
24 </#if>
25 </#list>
26 <#return "">
27</#function>
28
29<#assign rootCss = "card-news_" + randomNumber(4586) />
30<#assign cardMap = {} />
31
32<#-- Função para obter os dados de um card no Web Content (Journal Article) -->
33<#function getCardData entry journalArticleLocalService fileEntryService cardMap>
34
35 <#assign editoria = getFirstCategoryFromVocabulary(entry, editoriaVocabulary) />
36 <#assign editoriaId = -1 />
37 <#if editoria?has_content>
38 <#assign editoriaId = editoria.getCategoryId() />
39 </#if>
40 <#if editoriaId == -1>
41 <#return {} />
42 </#if>
43 <#if cardMap[ editoriaId?string]??>
44 <#if cardMap[editoriaId?string]?size gt 7 >
45 <#return {} />
46 </#if>
47 </#if>
48
49 <#assign articleId = entry.classPK />
50 <#assign journalArticle = journalArticleLocalService.getLatestArticle(entry.getClassPK()) />
51 <#assign ddmStructure = journalArticle.getDDMStructure() />
52 <#assign fieldList = getFieldListByStructure(ddmStructure) />
53 <#assign xmlArticle = journalArticle.getDocument().getRootElement() />
54 <#assign ddmStructure = journalArticle.getDDMStructure() />
55
56 <#assign imagesGroup = getNodes(getIdFromFieldName(fieldList, "Imagem de destaque da notícia"), xmlArticle) />
57 <#assign image = "" />
58 <#list imagesGroup as imageGroup >
59 <#assign image = getMediaInfo(fieldList, imageGroup, "Imagem de destaque", fileEntryService) /> />
60 </#list>
61
62 <#assign title = getFieldValue(fieldList, xmlArticle, "Título de destaque da notícia") />
63
64 <#assign lastPublishDate = journalArticle.getDisplayDate()>
65 <#assign createDate = journalArticle.getCreateDate()>
66
67 <#assign editoria = getFirstCategoryFromVocabulary(entry, editoriaVocabulary) />
68 <#assign editoriaId = -1 />
69 <#if editoria?has_content>
70 <#assign editoriaId = editoria.getCategoryId() />
71 </#if>
72
73 <#assign review = getFieldValue(fieldList, xmlArticle, "Subtítulo") />
74
75 <#assign urlNews = "/">
76 <#if themeDisplay.getPortalURL()?contains("webserver")>
77 <#assign urlNews = themeDisplay.getPortalURL() + themeDisplay.getPathFriendlyURLPublic() + layout.getGroup().friendlyURL + "/w/" + journalArticle.getUrlTitle()>
78 <#else>
79 <#assign urlNews = "/w/" + journalArticle.getUrlTitle()>
80 </#if>
81
82 <#assign cardInfo = {
83 "articleId": articleId,
84 "image": image,
85 "title": title,
86 "lastPublishDate": lastPublishDate,
87 "createDate" : createDate,
88 "editoriaId": editoriaId,
89 "urlNews": urlNews,
90 "review": review} />
91
92 <#if cardMap[editoriaId?string]??>
93 <#assign cardMap = cardMap + {editoriaId : cardMap[editoriaId?string] + [cardInfo]} />
94 <#else>
95 <#assign cardMap = cardMap + {editoriaId : [cardInfo]} />
96 </#if>
97
98 <#return cardInfo />
99
100</#function>
101
102
103<#macro renderCard cardData>
104 <#if !cardData["image"]??>
105 <#return />
106 </#if>
107 <div class="card ${rootCss}" category-id="${cardData.editoriaId}" article-id="${cardData.articleId}">
108 <a class="default-news-card-link" href="${cardData.urlNews}"></a>
109 <#if cardData.image.url?has_content>
110 <img class="image" src="/o/adaptive-media/image/${cardData.image.fileEntryId}/Thumbnail-300x300/image" alt="${cardData.image.alt}"/>
111 </#if>
112 <div class="news-content">
113 <div class="head">
114 <p class="date">${formatDate(cardData.lastPublishDate)}</p>
115 <h2 class="title h4">${cardData.title}</h2>
116 <div class="bar"></div>
117 </div>
118 <div class="bottom-wrapper">
119 <div class="review-container">
120 ${cardData.review}
121 </div>
122 <div class="link-container">
123 <p class="read-more">
124 <#if locale?lower_case == "pt_br"> Continuar lendo <#else> Keep reading </#if>
125 </p>
126 </div>
127 </div>
128 </div>
129 </div>
130
131</#macro>
132
133<#-- Renderizar Lista de cards -->
134<#if entries?has_content>
135 <#list entries as entry>
136 <#assign cardData = getCardData(entry journalArticleService fileEntryService cardMap) />
137 <@renderCard cardData/>
138 </#list>
139
140 <style>
141
142
143 .${rootCss} {
144 display: flex;
145 flex-direction: column;
146 width: 306px;
147 border-radius: 16px;
148 border: 1px solid var(--color-neutral-400, #EEE);
149 background: var(--color-neutral-100, #FFF);
150 margin: 0;
151 position: relative;
152 }
153
154 .${rootCss} *:not(.default-news-card-link) {
155 pointer-events: none;
156 }
157
158 .${rootCss} a.default-news-card-link {
159 position: absolute;
160 width: 100%;
161 height: 100%;
162 opacity: 0;
163 }
164
165 .${rootCss}:hover {
166 box-shadow: var(--box-shadow-neutral);
167 transition: box-shadow 300ms ease-in-out;
168 }
169
170 .${rootCss} .news-content {
171 padding: var(--space-md, 24px);
172 display: flex;
173 flex-direction: column;
174 height: 100%;
175 background: var(--color-background-card);
176 border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
177 }
178
179
180 .${rootCss} img {
181 background: lightgray 50% / cover no-repeat;
182 height: 170px;
183 width: 100%;
184 border-radius: 16px 16px 0 0;
185 /*transform: translateX(-1px);*/
186 object-fit: cover;
187 }
188
189 .${rootCss} .head {
190 display: flex;
191 flex-direction: column;
192 gap: var(--space-xxs, 8px);
193 }
194
195 .${rootCss} .head .date {
196 color: var(--color-neutral-800, #373737);
197 font-family: var(--font-family-base, "Petrobras Sans");
198 font-size: 14px;
199 font-style: normal;
200 font-weight: 400;
201 line-height: 160%; /* 19.2px */
202 }
203
204 .${rootCss} .head .title {
205 color: var(--color-neutral-800);
206 }
207
208 .${rootCss} .head .bar {
209 background-color: var(--color-secondary-solid-to-bright-200, #FDC82F);
210 height: 4px;
211 width: 20px;
212 margin: 12px 0 16px 0;
213 }
214
215 .${rootCss} .bottom-wrapper {
216 height: 100%;
217 display: flex;
218 flex-direction: column;
219 justify-content: space-between;
220 }
221
222 .${rootCss} .bottom-wrapper .review-container {
223 color: var(--color-neutral-800, #373737);
224 font-family: var(--font-family-base, "Petrobras Sans");
225 font-size: 16px;
226 font-style: normal;
227 font-weight: 400;
228 line-height: 160%; /* 22.4px */
229 }
230
231 .${rootCss} .bottom-wrapper .link-container {
232 flex: 0 1 auto;
233 }
234
235 .${rootCss} .bottom-wrapper .link-container .read-more {
236 color: var(--color-primary-solid-to-bright-200, var(--color-primary-medium));
237 font-family: var(--font-family-base, "Petrobras Sans");
238 font-size: 16px;
239 font-style: normal;
240 font-weight: 700;
241 line-height: 144%; /* 23.04px */
242 text-decoration-line: underline;
243 }
244
245 @media screen and (max-width: 1024px) {
246 .${rootCss} {
247 flex-direction: column;
248 /*gap: 16px;*/
249 min-width: 296px;
250 }
251
252 .${rootCss} img {
253 height: 140px;
254 }
255
256 .${rootCss} .head .date {
257 font-size: 12px;
258 }
259
260 .${rootCss} .head .title {}
261
262 .${rootCss} .head .bar {
263 width: 18px;
264 margin: 8px 0 16px 0;
265 }
266
267 .${rootCss} .review-container {
268 font-size: 14px;
269 }
270 }
271 </style>
272 <script>
273 (function() {
274 let cards = document.querySelectorAll('.${rootCss}.card');
275
276 cards.forEach((card) => {
277 const cardLink = card.querySelector('a.default-news-card-link');
278 const cardTitle = card.querySelector('.title');
279 cardLink.textContent = cardTitle.textContent;
280 });
281
282 document.addEventListener('DOMContentLoaded', () => {
283 const bannerCards = document.querySelectorAll('.banner-container .card[article-id]');
284 const bannerCardIds = Array.from(bannerCards).map(card => card.getAttribute('article-id'));
285 const maxNumberOfCards = 8;
286
287 // removes the cards from the banner and shows the rest
288 cards.forEach(card => bannerCardIds.includes(card.getAttribute('article-id')) && card.remove());
289 // limita o número máximo de cards
290 cards = document.querySelectorAll('.${rootCss}.card');
291 if(cards.length > maxNumberOfCards) {
292 for (let i = cards.length; i > maxNumberOfCards; i--) {
293 cards[i-1].remove();
294 }
295 }
296 });
297 })();
298 </script>
299</#if>
Navegue por editoria
Java method "com.liferay.journal.model.impl.JournalArticleImpl.getDocument()" threw an exception when invoked on com.liferay.journal.model.impl.JournalArticleImpl object "{\"mvccVersion\": 1, \"ctCollectionId\": 0, \"uuid\": \"788c378f-e97f-d7b9-09ab-d786cc30c2fa\", \"id\": 34693409, \"resourcePrimKey\": 34563720, \"groupId\": 10623376, \"companyId\": 20099, \"userId\": 11888211, \"userName\": \"Leonardo Bruno Pimenta Melo\", \"createDate\": \"Mon Apr 07 12:59:54 GMT 2025\", \"modifiedDate\": \"Tue Apr 15 12:56:49 GMT 2025\", \"externalReferenceCode\": \"fd97794b-9942-2025-3baa-6e9d4c4df110\", \"folderId\": 34530929, \"classNameId\": 0, \"classPK\": 0, \"treePath\": \"/10628776/34530929/\", \"articleId\": \"34563718\", \"version\": 2.1, \"urlTitle\": \"selecao-de-jornalismo/petrobras-lanca-selecao-de-jornalismo\", \"DDMStructureId\": 10628772, \"DDMTemplateKey\": \"\", \"defaultLanguageId\": \"pt_BR\", \"layoutUuid\": \"\", \"displayDate\": \"Mon Apr 07 12:51:00 GMT 2025\", \"expirationDate\": null, \"reviewDate\": null, \"indexable\": true, \"smallImage\": false, \"smallImageId\": 0, \"smallImageSource\": 1, \"smallImageURL\": \"\", \"lastPublishDate\": null, \"status\": 0, \"statusByUserId\": 11888211, \"statusByUserName\": \"Leonardo Bruno Pimenta Melo\", \"statusDate\": \"Tue Apr 15 12:56:49 GMT 2025\"}"; see cause exception in the Java stack trace. ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign xmlArticle = journalArticle.g... [in template "20099#20135#11536932" in function "getCardData" at line 63, column 5] ----
1<#-- Conteúdo Web -> Templates: Site de Crise - Include de templates-->
2<#-- include "${templatesPath}/1975602" -->
3
4<#-- Conteúdo Web -> Templates: Site de Crise - Funções gerais-->
5<#include "${templatesPath}/1975398" />
6
7<#assign journalArticleService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
8<#assign fileEntryService = staticUtil["com.liferay.document.library.kernel.service.DLFileEntryLocalServiceUtil"] />
9<#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") />
10<#assign assetVocabularyService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyService") />
11<#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") />
12<#assign vocabularies = assetVocabularyService.getGroupVocabularies(groupId) />
13<#assign editoriaVocabulary = findVocabulary("Editorial", vocabularies) />
14<#assign mediaVocabulary = findVocabulary("Multimidia", vocabularies) />
15
16<#-- Categoria para filtrar registros para idioma em inglês -->
17<#assign PAGE_ENGLISH_CATEGORY = 12780360 >
18
19<#assign assetEntryQuery = objectUtil('com.liferay.asset.kernel.service.persistence.AssetEntryQuery')>
20<#assign portalUtil = staticUtil["com.liferay.portal.kernel.util.PortalUtil"]>
21<#assign assetEntryLocalServiceUtil = objectUtil("com.liferay.asset.kernel.service.AssetEntryLocalServiceUtil").getService()>
22
23<#function getFirstCategoryFromVocabulary entry vocabulary>
24 <#assign categories = assetCategoryLocalService.getCategories("com.liferay.journal.model.JournalArticle", entry.getClassPK()) />
25 <#list categories as category>
26 <#assign vocabulary = assetVocabularyService.getVocabulary(category.getVocabularyId()) />
27
28 <#if vocabulary.getVocabularyId() == category.getVocabularyId()>
29 <#return category>
30 </#if>
31 </#list>
32 <#return "">
33</#function>
34
35<#assign rootCss = "card-news_" + randomNumber(4586) />
36<#assign cardMap = {} />
37
38<#-- Função para obter os dados de um card no Web Content (Journal Article) -->
39<#function getCardData entry journalArticleLocalService fileEntryService cardMap>
40
41 <#assign editoria = getFirstCategoryFromVocabulary(entry, editoriaVocabulary) />
42 <#assign editoriaId = -1 />
43 <#if editoria?has_content>
44 <#assign editoriaId = editoria.getCategoryId() />
45 </#if>
46 <#if editoriaId == -1>
47 <#return {} />
48 </#if>
49 <#if cardMap[ editoriaId?string]??>
50 <#if cardMap[editoriaId?string]?size gt 7 >
51 <#return {} />
52 </#if>
53 </#if>
54
55 <#assign journalArticle = journalArticleLocalService.getLatestArticle(entry.getClassPK()) />
56 <#assign structName = getStructName(journalArticle) />
57 <#if structName != "Agência de Notícias - Notícia">
58 <#return {}/>
59 </#if>
60
61 <#assign ddmStructure = journalArticle.getDDMStructure() />
62 <#assign fieldList = getFieldListByStructure(ddmStructure) />
63 <#assign xmlArticle = journalArticle.getDocument().getRootElement() />
64
65
66 <#assign imagesGroup = getNodes(getIdFromFieldName(fieldList, "Imagem de destaque da notícia"), xmlArticle) />
67 <#assign image = "" />
68 <#list imagesGroup as imageGroup >
69 <#assign image = getMediaInfo(fieldList, imageGroup, "Imagem de destaque", fileEntryService) /> />
70 </#list>
71
72 <#assign title = getFieldValue(fieldList, xmlArticle, "Título de destaque da notícia") />
73
74 <#assign lastPublishDate = journalArticle.getDisplayDate()>
75 <#assign createDate = journalArticle.getCreateDate()>
76
77 <#assign editoria = getFirstCategoryFromVocabulary(entry, editoriaVocabulary) />
78 <#assign editoriaId = -1 />
79 <#if editoria?has_content>
80 <#assign editoriaId = editoria.getCategoryId() />
81 </#if>
82
83 <#assign review = getFieldValue(fieldList, xmlArticle, "Subtítulo") />
84
85 <#assign urlNews = "/">
86 <#if themeDisplay.getPortalURL()?contains("webserver")>
87 <#assign urlNews = themeDisplay.getPortalURL() + themeDisplay.getPathFriendlyURLPublic() + layout.getGroup().friendlyURL + "/w/" + journalArticle.getUrlTitle()>
88 <#else>
89 <#assign urlNews = "/w/" + journalArticle.getUrlTitle()>
90 </#if>
91
92 <#assign cardInfo = {"image": image,
93 "title": title,
94 "lastPublishDate": lastPublishDate,
95 "createDate" : createDate,
96 "editoriaId": editoriaId,
97 "urlNews": urlNews,
98 "review": review} />
99
100 <#if cardMap[editoriaId?string]??>
101 <#assign cardMap = cardMap + {editoriaId : cardMap[editoriaId?string] + [cardInfo]} />
102 <#else>
103 <#assign cardMap = cardMap + {editoriaId : [cardInfo]} />
104 </#if>
105
106 <#return cardInfo />
107
108</#function>
109
110
111<#macro renderCard cardData>
112 <#if !cardData["image"]??>
113 <#return />
114 </#if>
115
116 <div class="card ${rootCss}" category-id="${cardData.editoriaId}">
117 <a class="filtered-news-card-link" href="${cardData.urlNews}"></a>
118 <#if cardData.image.url?has_content>
119 <img class="image" src="/o/adaptive-media/image/${cardData.image.fileEntryId}/Thumbnail-300x300/image" alt="${cardData.image.alt}"/>
120 </#if>
121 <div class="news-content">
122 <div class="head">
123 <p class="date">${formatDate(cardData.lastPublishDate)}</p>
124 <h2 class="title h4">${cardData.title}</h2>
125 <div class="bar"></div>
126 </div>
127 <div class="bottom-wrapper">
128 <div class="review-container">
129 ${cardData.review}
130 </div>
131 <div class="link-container">
132 <p class="read-more" class="card-news-container">
133 <#if locale?lower_case == "pt_br"> Continuar lendo <#else> Keep reading </#if>
134 </p>
135 </div>
136 </div>
137 </div>
138 </div>
139
140</#macro>
141
142
143
144<#function getAssetEntries portalUtil assetEntryLocalServiceUtil vocabulary>
145 <#attempt >
146 <#assign groupId = themeDisplay.getScopeGroupId()>
147 <#assign companyId = themeDisplay.getCompanyId()>
148 <#assign realUserId = themeDisplay.getDefaultUserId() />
149 <#assign className = "com.liferay.journal.model.JournalArticle">
150 <#assign classNameId = portalUtil.getClassNameId(className)>
151
152 <#assign assetEntryQuery = objectUtil('com.liferay.asset.kernel.service.persistence.AssetEntryQuery') />
153 ${assetEntryQuery.setClassNameIds([classNameId]) }
154 ${assetEntryQuery.setEnd(8)}
155 <#assign notAllCategoryIds = [] />
156 <#list mediaVocabulary.getCategories() as category>
157 <#assign notAllCategoryIds += [category.getCategoryId()] />
158 </#list>
159 ${assetEntryQuery.setNotAllCategoryIds(notAllCategoryIds)}
160
161 <#assign allAssets = []/>
162 <#list vocabulary.getCategories() as category>
163 <#if locale?lower_case == "pt_br">
164 ${assetEntryQuery.setAllCategoryIds([category.getCategoryId()])}
165 <#else>
166 ${assetEntryQuery.setAllCategoryIds([category.getCategoryId(), PAGE_ENGLISH_CATEGORY])}
167 </#if>
168 <#assign ents = assetEntryLocalServiceUtil.getEntries(assetEntryQuery) />
169 <#assign allAssets = allAssets + ents />
170 </#list>
171
172 <#return allAssets />
173 <#recover >
174 <#return [] />
175 </#attempt>
176</#function>
177
178
179
180<#assign allAssets = getAssetEntries(portalUtil, assetEntryLocalServiceUtil, editoriaVocabulary) />
181
182<#-- Renderizar Lista de cards -->
183<#if allAssets?has_content>
184
185 <#list allAssets?sort_by("publishDate")?reverse as assetEntry>
186 <#assign cardData = getCardData(assetEntry journalArticleService fileEntryService cardMap) />
187 <@renderCard cardData/>
188 </#list>
189
190 <style>
191 .${rootCss} {
192 display: flex;
193 flex-direction: column;
194 width: 306px;
195 border-radius: 16px;
196 border: 1px solid var(--color-neutral-400, #EEE);
197 background: var(--color-neutral-100, #FFF);
198 margin: 0;
199 position: relative;
200 height: 484px;
201 overflow: hidden;
202 }
203
204 .${rootCss} .head .title {
205 display: -webkit-box;
206 -webkit-line-clamp: 3;
207 -webkit-box-orient: vertical;
208 overflow: hidden;
209 text-overflow: ellipsis;
210 }
211
212 .${rootCss} .bottom-wrapper .review-container {
213 display: -webkit-box;
214 -webkit-line-clamp: 2;
215 -webkit-box-orient: vertical;
216 overflow: hidden;
217 text-overflow: ellipsis;
218 }
219
220 .${rootCss} p {
221 margin-bottom: 0rem;
222 margin-top: 0;
223 }
224
225 .${rootCss} *:not(.filtered-news-card-link) {
226 pointer-events: none;
227 }
228
229 .${rootCss} a.filtered-news-card-link {
230 position: absolute;
231 width: 100%;
232 height: 100%;
233 opacity: 0;
234 }
235
236 .${rootCss}:hover {
237 box-shadow: var(--box-shadow-neutral);
238 transition: box-shadow 300ms ease-in-out;
239 }
240
241 .${rootCss} .news-content {
242 border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
243 background: var(--color-background-card);
244 padding: var(--space-md, 24px);
245 display: flex;
246 flex-direction: column;
247 height: 100%;
248 }
249
250 .${rootCss} img {
251 background: lightgray 50% / cover no-repeat;
252 height: 170px;
253 width: 100%;
254 border-radius: 16px 16px 0 0;
255 /*transform: translateX(-1px);*/
256 object-fit: cover;
257 }
258
259 .${rootCss} .head {
260 display: flex;
261 flex-direction: column;
262 /*gap: var(--space-xxs, 8px);*/
263 }
264
265 .${rootCss} .head .date {
266 color: var(--color-neutral-800, #373737);
267 font-family: var(--font-family-base, "Petrobras Sans");
268 font-size: 14px;
269 font-style: normal;
270 font-weight: 400;
271 line-height: 160%; /* 19.2px */
272 }
273
274 .${rootCss} .head .title {
275 color: var(--color-neutral-800);
276 }
277
278 .${rootCss} .head .bar {
279 background-color: var(--color-secondary-medium, #FDC82F);
280 height: 4px;
281 width: 20px;
282 margin: 12px 0 16px 0;
283 }
284
285 .${rootCss} .bottom-wrapper {
286 height: 100%;
287 display: flex;
288 flex-direction: column;
289 justify-content: space-between;
290 }
291
292 .${rootCss} .bottom-wrapper .review-container {
293 color: var(--color-neutral-800, #373737);
294 font-family: var(--font-family-base, "Petrobras Sans");
295 font-size: 16px;
296 font-style: normal;
297 font-weight: 400;
298 line-height: 160%; /* 22.4px */
299 }
300
301 .${rootCss} .bottom-wrapper .link-container {
302 flex: 0 1 auto;
303 }
304
305 .${rootCss} .bottom-wrapper .link-container .read-more {
306 color: var(--color-primary-solid-to-bright-200, var(--color-primary-medium));
307 font-family: var(--font-family-base, "Petrobras Sans");
308 font-size: 16px;
309 font-style: normal;
310 font-weight: 700;
311 line-height: 144%; /* 23.04px */
312 text-decoration-line: underline;
313 }
314
315
316 @media screen and (max-width: 1024px) {
317 .${rootCss} {
318 flex-direction: column;
319 gap: 16px;
320 min-width: 296px;
321 }
322
323 .${rootCss} img {
324 height: 140px;
325 }
326
327 .${rootCss} .head .date {
328 font-size: 12px;
329 }
330
331 .${rootCss} .head .title {
332 }
333
334 .${rootCss} .head .bar {
335 width: 18px;
336 margin: 8px 0 16px 0;
337 }
338
339 .${rootCss} .review-container {
340 font-size: 14px;
341 }
342 }
343
344 @media screen and (max-width: 767px) {
345 .${rootCss} {
346 width: 296px;
347 height: 410px;
348 }
349
350 .${rootCss} .head .title {
351 -webkit-line-clamp: 2;
352 }
353 }
354
355 </style>
356 <script>
357 (function() {
358 const cards = document.querySelectorAll('.${rootCss}.card');
359
360 cards.forEach((card) => {
361 const cardLink = card.querySelector('a.filtered-news-card-link');
362 const cardTitle = card.querySelector('.title');
363 cardLink.textContent = cardTitle.textContent;
364 });
365 })();
366 </script>
367</#if>

Aviso
Este é um canal exclusivo para atendimento a veículos de imprensa. Solicitamos que demandas não relacionadas a conteúdo jornalístico (por exemplo: conteúdos publicitários, jurídicos, participação de empregados em eventos, pesquisas acadêmicas, entre outros) não sejam enviadas para esse contato.
O canal Fale Conosco ou o 0800 728 9001 são os canais adequados para solicitações de informações gerais sobre a companhia.
Utilize nossa busca para encontrar o que procura
Faça uma busca:
Mais pesquisados
Preço dos combustíveis
Pré-Sal
Time Petrobras
SAC Petrobras
0800 728 9001
Acesso à Informação
Portal da Transparência- Assessoria de Imprensa
- Categorias
- Acesse também
© Copyright Petrobras 2024. Todos os direitos reservados.
Canais
Idioma
Acessibilidade
Busca
Faça uma busca:
Mais pesquisados
Preço dos combustíveis
Pré-Sal
Time Petrobras
Acessibilidade
Alto-Contraste
Desligado
Ligado
Texto Grande
Desligado
Ligado
Idioma:
Selecione um idioma: