Projeto
Linha de atuação
Os resultados da busca aparecerão aqui
É só filtrar, conferir as informações e acessar os projetos.
Um erro ocorreu enquanto processava o modelo.
The following has evaluated to null or missing: ==> assetVocabularyLocalService.fetchGroupVocabulary(groupId, "Ano") [in template "20099#20135#7806175" at line 37, column 27] ---- 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: #assign yearVocabulary = assetVocabul... [in template "20099#20135#7806175" at line 37, column 1] ----
1<#-- Conteúdo Web -> Templates: Funções gerais-->
2<#include "${templatesPath}/1975398" />
3
4<#-- Conteúdo Web -> Templates: Render - Lista de resultados - Socio ambiental e Projetos Culturais -->
5<#-- include "${templatesPath}/3034580" -->
6
7<#-- Conteúdo Web -> Templates: ExtrairInfo - Lista de resultados - Socio ambiental e Projetos Culturais -->
8<#-- include "${templatesPath}/3034586" -->
9
10<#assign journalArticleService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
11<#assign layoutLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService")>
12<#assign fileEntryService = staticUtil["com.liferay.document.library.kernel.service.DLFileEntryLocalServiceUtil"] />
13<#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")>
14<#assign assetVocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")>
15
16<#function removeSpecialCharacters text>
17 <#attempt>
18 <#assign anchor = text?lower_case />
19 <#assign anchor = anchor?replace('<^a-zA-Zs0-9>', ' ', 'r') />
20 <#assign anchor = anchor?trim />
21 <#assign anchor = anchor?replace('< >{1,}', '', 'r') />
22 <#return anchor />
23 <#recover>
24 <#return "" />
25 </#attempt>
26</#function>
27
28<#function fetchGroupVocabulary vocabularyName assetVocabularyLocalService>
29 <#assign result = "" />
30 <#assign groupVocabularies = assetVocabularyLocalService.getGroupVocabularies(groupId) />
31 <#list groupVocabularies?filter(voc -> (removeSpecialCharacters(voc.getTitle(locale)) == removeSpecialCharacters(vocabularyName))) as vocabulary>
32 <#assign result = vocabulary />
33 </#list>
34 <#return result>
35</#function>
36
37<#assign yearVocabulary = assetVocabularyLocalService.fetchGroupVocabulary(groupId, "Ano") />
38<#assign cityVocabulary = assetVocabularyLocalService.fetchGroupVocabulary(groupId, "Municipio") />
39<#assign lineActionVocabulary = fetchGroupVocabulary("Socio amb - Linha de atuacao", assetVocabularyLocalService) />
40<#assign classNumber = randomNumber (10) />
41
42<#assign allStates = {}/>
43<#assign allLineActions = {}/>
44
45<#assign projects = {} />
46
47<#if entries?has_content>
48 <#assign index = 0/>
49 <#assign fieldMap = {"reviewInWebContent":"Resumo",
50 "linkFieldSetIdInWebContent":"Fieldset14184863",
51 "linkGroupLabelInWebContent":"Rótulo do grupo de links",
52 "linkLabelInWebContent":"Rótulo do link",
53 "externUrlLabelInWebContent":"URL externa de projeto cultural",
54 "siteUrlLayoutIdInWebContent":"LinkToLayout02555162"
55 }/><#-- "linkFieldSetIdInWebContent":"Fieldset79221789" "Fieldset14184863" -->
56 <#list entries as curEntry>
57
58 <#assign info = extractInfo(curEntry fieldMap yearVocabulary cityVocabulary lineActionVocabulary journalArticleService layoutLocalService fileEntryService assetCategoryLocalService) />
59 <#if info.infoList?size gt 0 >
60 <@renderInfo info.infoList index info.hashCode/>
61 <#assign index += 1/>
62 </#if>
63 </#list>
64
65 <script id="states-json" type="text/json">
66 ${jsonFactoryUtil.createJSONObject(allStates)}
67 </script>
68
69 <script id="line-action-json" type="text/json">
70 ${jsonFactoryUtil.createJSONObject(allLineActions)}
71 </script>
72
73 <script id="projects-json" type="text/json">
74 ${jsonFactoryUtil.createJSONObject(projects)}
75 </script>
76
77</#if>
78
79
80
81<#--
82 Template para extrarir informações de itens de webcontent de Socio ambiental e Projetos Culturais.
83 ****************************************************************************************************************************
84 ****************************OBS.: NAO DEFINA A ESTRUTURA DO WEBCONTENT PARA ESSE TEMPLATE.**********************************
85 ****************************************************************************************************************************
86 curEntry - Item de AssetEntry do qual o JournalArticle deverá ser busacdo.}
87 journalArticleService: Instância de serviço para busca de JournalArticle (com.liferay.journal.service.JournalArticleLocalService)
88 fieldMap: Mapa com os campos a serem extraídos do XML do JournalArticle
89 reviewInWebContent - Rótulo do campo de Resumo
90 linkFieldSetIdInWebContent - Identificador do grupo campo de campos dos links
91 linkLabelInWebContent - Rótulo do campo de link
92 externUrlLabelInWebContent - Rótulo do campo de url externa
93 siteUrlLayoutIdInWebContent - Identificador do campo de link interno/página do site. -->
94
95<#function extractInfo curEntry fieldMap yearVocabulary cityVocabulary lineActionVocabulary journalArticleService layoutLocalService fileEntryService assetCategoryLocalService>
96 <#if (!fieldMap["reviewInWebContent"]??)>
97 <#return [] />
98 </#if>
99 <#if (!fieldMap["linkFieldSetIdInWebContent"]??)>
100 <#return [] />
101 </#if>
102 <#if (!fieldMap["linkLabelInWebContent"]??)>
103 <#return [] />
104 </#if>
105 <#if (!fieldMap["externUrlLabelInWebContent"]??)>
106 <#return [] />
107 </#if>
108 <#if (!fieldMap["siteUrlLayoutIdInWebContent"]??)>
109 <#return [] />
110 </#if>
111 <#if (!fieldMap["linkGroupLabelInWebContent"]??)>
112 <#return [] />
113 </#if>
114 <#if !curEntry??>
115 <#return [] />
116 </#if>
117 <#assign article=journalArticleService.getLatestArticle(curEntry.getClassPK()) />
118 <#if !article??>
119 <#return [] />
120 </#if>
121 <#assign ddmStructure=article.getDDMStructure() />
122 <#if !ddmStructure??>
123 <#return [] />
124 </#if>
125
126 <#assign stateIds={} />
127 <#assign lineActionIds = []/>
128 <#assign allCategories=assetCategoryLocalService.getCategories("com.liferay.journal.model.JournalArticle", article.getResourcePrimKey()) />
129 <#list allCategories as cat>
130 <#if cat.getVocabularyId()==cityVocabulary.getVocabularyId()>
131 <#if cat.isRootCategory()>
132 <#assign stateIds += {cat.getCategoryId(): []} />
133 <#assign allStates += {cat.getTitle(locale): {"id": cat.getCategoryId(), "cities": {}}} />
134 <#else>
135 <#assign parentTitle = cat.getParentCategory().getTitle(locale)/>
136 <#assign parentId = cat.getParentCategory().getCategoryId() + "" />
137 <#if stateIds[parentId]??>
138 <#assign articleCityIds = stateIds[parentId] />
139 <#assign articleCityIds += [cat.getCategoryId()] />
140 <#assign stateIds += {cat.getCategoryId(): articleCityIds} />
141 <#else>
142 <#assign stateIds += {cat.getCategoryId(): [cat.getCategoryId()]} />
143 </#if>
144 <#if allStates[parentTitle]??>
145 <#assign info = allStates[parentTitle] />
146 <#assign infoCities = info.cities />
147 <#assign infoCities += {cat.getCategoryId() + "" : cat.getTitle(locale)} />
148 <#assign allStates += {parentTitle: {"id": info.id, "cities": infoCities}} />
149 <#else>
150 <#assign allStates += {parentTitle: {"id": cat.getCategoryId(), "cities": {cat.getCategoryId() + "": cat.getTitle(locale)}}} />
151 </#if>
152 </#if>
153 </#if>
154 <#if cat.getVocabularyId()==lineActionVocabulary.getVocabularyId()>
155 <#assign lineActionIds += [cat.getCategoryId()] />
156 <#assign allLineActions += {cat.getCategoryId() : cat.getTitle(locale)}/>
157 </#if>
158 </#list>
159 <#assign fieldList=getFieldListByStructure(ddmStructure) />
160 <#assign xmlArticle=article.getDocument().getRootElement() />
161 <#assign title=article.getTitle(locale) />
162 <#assign review=getFieldValue(fieldList, xmlArticle, fieldMap.reviewInWebContent) />
163 <#assign linkGroupLabel=getFieldValue(fieldList, xmlArticle, fieldMap.linkGroupLabelInWebContent) />
164 <#assign projectImage="" />
165 <#if fieldMap.imageInWebContent?has_content>
166 <#assign projectImage=getFileFromXML(fieldMap.imageInWebContent, xmlArticle, fileEntryService) />
167 </#if>
168 <#assign linkNodeGroups=getNodes(fieldMap.linkFieldSetIdInWebContent, xmlArticle) />
169 <#assign linkInfos=[] />
170 <#list linkNodeGroups as linkNodeGroup>
171 <#assign linkLabel=getFieldValue(fieldList, linkNodeGroup, fieldMap.linkLabelInWebContent) />
172 <#assign externUrl=getFieldValue(fieldList, linkNodeGroup, fieldMap.externUrlLabelInWebContent) />
173 <#assign siteUrl=getPageLayoutLinkFromXML(fieldMap.siteUrlLayoutIdInWebContent, linkNodeGroup, layoutLocalService) />
174 <#assign linkInfos=linkInfos + [{"label": linkLabel, "externUrl": externUrl, "siteUrl": siteUrl}] />
175 </#list>
176
177 <#assign projects += {article.hashCode(): {"title" : article.getTitle(locale), "stateIds" : stateIds, "lineActionIds" : lineActionIds} } />
178 <#return {"infoList": [{"title": title, "review": review, "linkGroupLabel":linkGroupLabel, "linkList": linkInfos, "projectImage": projectImage}],
179 "hashCode" : article.hashCode()} />
180</#function>
181
182
183
184
185<#macro renderInfo infoList index entryHashCode>
186 <div class="project" search-id="${entryHashCode}" >
187 <#list infoList as infos>
188 <div>
189 <#if infos.projectImage?has_content>
190 <img src="${infos.projectImage.url}"/>
191 </#if>
192 </div>
193 <div class="breakpoint project-${classNumber}" index="${index}">
194 <div class="project-wrapper col-4-9 md-col-2-7 sm-col-1-4">
195 <div class="title">
196 <h2 class="h2">${infos.title}</h2>
197 <div class="h2 line">—</div>
198 </div>
199 <div class="richText-content paragraph-md-regular">${infos.review}</div>
200 </div>
201 <div class="links-wrapper col-4-9 md-col-2-7 sm-col-1-4">
202 <p class="title paragraph-md-bold">${infos.linkGroupLabel}</p>
203 <div class="links">
204 <@renderLinks infos.linkList/>
205 </div>
206 </div>
207 </div>
208 </#list>
209 </div>
210</#macro>
211
212<#macro renderLinks linkList>
213 <#list linkList as linkInfo>
214 <#assign url = ""/>
215 <#if linkInfo.externUrl?has_content>
216 <#assign url = linkInfo.externUrl/>
217 <#else>
218 <#if linkInfo.siteUrl?has_content>
219 <#assign url = linkInfo.siteUrl/>
220 </#if>
221 </#if>
222 <div class="link">
223 <div class="svg">
224
225 <#if linkInfo.externUrl?has_content>
226
227 <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="var(--color-primary-medium)" viewBox="0 0 256 256">
228 <path d="M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,
229 2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z">
230 </path>
231 </svg>
232 <#else>
233 <#if linkInfo.siteUrl?has_content>
234
235 <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="var(--color-primary-medium)" viewBox="0 0 256 256">
236 <path d="M136.13,187.77a6,6,0,0,1,0,8.49l-9.95,9.94A54,54,0,0,1,49.8,129.82L73.91,105.7A54,54,0,0,1,148,103.51a6,6,0,1,1-8,9,42,42,0,0,0-57.6,1.71L58.28,138.3a42,42,
237 0,0,0,59.42,59.42l9.94-9.95A6,6,0,0,1,136.13,187.77Zm70.07-138a54.06,54.06,0,0,0-76.38,0l-9.95,9.94a6,6,0,0,0,8.49,8.49l9.94-10a42,42,0,0,1,59.42,59.42L173.6,141.81a42,
238 42,0,0,1-57.6,1.71,6,6,0,1,0-8,9,54,54,0,0,0,74.07-2.19l24.11-24.12A54,54,0,0,0,206.2,49.8Z">
239 </path>
240 </svg>
241 </#if>
242 </#if>
243 </div>
244 <a class="link-md socio-environmental-project-link" href="${url}">${linkInfo.label}</a>
245 </div>
246 </#list>
247</#macro>
248
249<style>
250 .project-${classNumber} {
251 padding: var(--space-xl) 0;
252 gap: var(--space-xl, 40px);
253 box-sizing: border-box;
254 border: none;
255 font-family: var(--font-family-base, "Petrobras Sans"), sans-serif;
256 }
257 .project-${classNumber} * :not(.breakpoint) :not(.richText-content *) {
258 padding: var(--spacing-space-none, 0px);
259 margin: var(--spacing-space-none, 0px);
260 border: none;
261 font-family: var(--font-family-base, "Petrobras Sans"), sans-serif;
262 }
263 .project-${classNumber}
264 .project-wrapper {
265 display: flex;
266 padding: var(--spacing-space-none, 0px);
267 flex-direction: column;
268 gap: var(--spacing-space-lg, 32px);
269 }
270
271 .project-${classNumber}
272 .project-wrapper
273 .richText-content {
274 color: var(--color-neutral-800)
275 }
276
277 .project-${classNumber}
278 .project-wrapper
279 .title {
280 display: flex;
281 flex-direction: column;
282 align-items: flex-start;
283 align-self: stretch;
284 }
285 .project-${classNumber}
286 .project-wrapper
287 .title
288 .h2 {
289 color: var(--color-neutral-800);
290 }
291 .project-${classNumber}
292 .project-wrapper
293 .title
294 .h2.line {
295 color: var(--brand-secondary-medium, var(--color-secondary-medium, #FDC82F));
296 }
297
298 .project-${classNumber}
299 .links-wrapper {
300 display: flex;
301 flex-direction: column;
302 gap: var(--spacing-space-lg, 32px);
303 }
304
305
306 .project-${classNumber}
307 .links-wrapper
308 .title {
309 color: var(--color-neutral-800);
310 }
311
312 .project-${classNumber}
313 .links-wrapper
314 .links {
315 display: flex;
316 flex-direction: column;
317 gap: var(--spacing-space-md, 24px);
318 align-self: stretch;
319 }
320 .project-${classNumber}
321 .links-wrapper
322 .links
323 .link {
324 display: flex;
325 padding: var(--spacing-space-xxxs, 4px) 0px;
326 align-items: center;
327 gap: var(--spacing-space-xs, 12px);
328 align-self: stretch;
329 }
330 .project-${classNumber}
331 .links-wrapper
332 .links
333 .link
334 .svg {
335 display: flex;
336 width: 24px;
337 height: 24px;
338 padding: 1px 1.726px 3.346px 2px;
339 flex-direction: column;
340 justify-content: center;
341 align-items: center;
342 gap: 3.649px;
343 }
344 .project-${classNumber}
345 .links-wrapper
346 .links
347 .link
348 a {
349 color: var(--brand-primary-medium, var(--color-primary-medium, #008542));
350 }
351</style>
352
353<script>
354 <#assign setHTMLTags = "setHTMLTags${classNumber}" />
355 AUI().ready(() => {
356
357 function ${setHTMLTags}() {
358 const fragmentElements = document.querySelectorAll('.project-${classNumber}');
359
360 if (fragmentElements.length !== 0) {
361 fragmentElements.forEach(fragmentElement => {
362 const richTextContent = fragmentElement.querySelector('.richText-content');
363 const linksWrapper = fragmentElement.querySelector('.links-wrapper');
364 const links = linksWrapper.querySelectorAll('a');
365
366 if (links.length === 0) {
367 linksWrapper && (linksWrapper.classList.add('hide-links-wrapper'));
368 } else {
369 links.forEach(link => link.classList.add('link-md'));
370 }
371
372 const paragraphs = richTextContent.querySelectorAll('p');
373 paragraphs && paragraphs.forEach(paragraph => paragraph.classList.add('paragraph-md-regular'));
374 });
375 }
376 }
377
378 ${setHTMLTags}();
379
380 })
381</script>
Sua busca não encontrou nenhum resultado.
Utilize outro filtro ou outra combinação de filtros.
Você também pode se interessar por
Faça uma busca:
Sugestões de busca
Mais pesquisados
Preço dos combustíveis
Pré-Sal
Time Petrobras
Escolha um Canal:
Navegue nas Seções:
Acessibilidade
Idioma:
Selecione um idioma: