Notícias

Detran palestra sobre sinalização e segurança no trânsito aos trabalhadores da obra do BRT

Um erro ocorreu enquanto processava o modelo.
The following has evaluated to null or missing:
==> imageData.fileEntryId  [in template "20154#20194#21081" at line 39, column 83]

----
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: #return "${themeDisplay.getURLPortal(...  [in template "20154#20194#21081" in function "getAdaptiveMediaFromFileUploadField" at line 39, column 17]
	- Reached through: ${getAdaptiveMediaFromFileUploadField...  [in template "20154#20194#21081" at line 351, column 14]
----
1<meta property="og:title" content="${front_title.getData()}" /> 
2<meta property="og:description" content="${sub_title.getData()}" /> 
3<meta property="og:image" content="${full_image.getData()}" /> 
4<meta property="og:url" content="${.vars["reserved-article-url-title"].data}" /> 
5<meta property="og:type" content="article" /> 
6 
7<#setting url_escaping_charset='UTF-8' /> 
8<#setting locale = locale /> 
9<#setting time_zone="GMT-4" /> 
10<#setting datetime_format="dd 'de' MMMM 'de' yyyy 'às' HH:mm"> 
11 
12<#assign  
13	journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") 
14	FriendlyURLEntryLocalServiceUtil = serviceLocator.findService("com.liferay.friendly.url.service.FriendlyURLEntryLocalService") 
15	dlFileEntryLocalService =	serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService") 
16 
17	articleId = .vars['reserved-article-id'].data 
18	journalArticle = journalArticleLocalService.getArticle( groupId, articleId ) 
19	dataPublicacao = journalArticle["displayDate"]?datetime 
20	titulo = journalArticle["title"]!"" 
21	chapeu = (.vars['hat'].getData())!"" 
22	tituloCapa = (.vars['front_title'].getData())!"" 
23	subTitulo = (.vars['sub_title'].getData())!"" 
24	autor = (.vars['author'].getData())!"" 
25	local = (.vars['source'].getData())!"" 
26	imagemDestaque = (.vars['full_image'].getData())!"" 
27	imagemLegenda = (.vars['legenda_da_foto'].getData())!"" 
28	imagemCredito = (.vars['credito_da_foto'].getData())!"" 
29	urlVideo = (.vars['video'].getData())!"" 
30	idGaleria = (.vars['gallery'].getData())!"" 
31	anexos = (.vars['attach'])!"" 
32	resourceprimKey = journalArticle.getResourcePrimKey() 
33	classFileEntryID = 20423?long 
34/> 
35 
36<#function getAdaptiveMediaFromFileUploadField imageField> 
37	<#if imageField?? && imageField?has_content> 
38        <#assign imageData = imageField.data?eval> 
39		<#return "${themeDisplay.getURLPortal()}/o/adaptive-media/image/${imageData.fileEntryId}/Thumbnail-1024x1024/${imageData.title}"> 
40	<#else> 
41		<#return "Imagem não encontrada!"> 
42	</#if> 
43</#function> 
44 
45<style> 
46	.btn-warning{ 
47		margin-left: 230px;font-size: 15px; 
48
49	.component-title:before { 
50		content:"${chapeu}"; 
51		font-size: 13px; 
52		display: -webkit-box; 
53		line-height: 15px; 
54		text-transform: uppercase; 
55		font-family: Arial,Helvetica,sans-serif; 
56		display: block; 
57		text-align: left; 
58
59	.align-items-center.d-flex.mb-2 .header-back-to a { 
60		margin-top: 5px; 
61		font-size: 1.8em; 
62		margin-left: -10px; 
63
64	.portlet-boundary_com_liferay_portal_search_web_portlet_SearchPortlet_ { 
65		display: none; 
66
67	.increaseFont, 
68	.decreaseFont { 
69		cursor: pointer; 
70
71	.increaseFont a:hover, 
72	.decreaseFont a:hover { 
73		text-decoration: none !important; 
74
75	.increaseFont { 
76		font-size: 24px; 
77
78	.increaseFont i, 
79	.decreaseFont i { 
80		font-size: 14px; 
81
82	.full-content img { 
83		padding: 0px !important; 
84
85	.attach-content ol li { 
86		text-align: left; 
87
88	div.imgCaption { 
89		background: rgba(0, 0, 0, 0.5); 
90		color: rgb(220, 220, 220); 
91		font-size: 11px; 
92		padding: 0px 4px; 
93		position: relative; 
94
95	.full-content picture img { 
96		height: 100% !important; 
97		width: 100% !important; 
98
99	.full-content { 
100		font-size: 18px; 
101
102	.anexos > span { 
103		background: var(--color-azul-01); 
104		padding: 5px; 
105		font-weight: bold; 
106		color: white; 
107
108</style> 
109 
110<@liferay_util["html-top"]> 
111	<meta property="og:image:type" content="image/jpeg"> 
112	<meta property="og:image" content="${(themeDisplay.getURLPortal())!''}${(full_image.getData())!''}"> 
113	<meta property="og:image:secure_url" content="${(themeDisplay.getURLPortal())!''}${(full_image.getData())!''}" /> 
114	<meta property="og:image:alt" content="${(sub_title.getData())!''}"/> 
115	<meta property="og:image:width" content="400" /> 
116	<meta property="og:image:height" content="300" /> 
117	<meta property="og:description" content="${(sub_title.getData())!''}" /> 
118	<meta property="og:updated_time" content="${.now?string("yyyy-MM-dd HH:mm:ss")}"> 
119</@> 
120 
121<#macro exibeCorpoNoticia> 
122	<#assign legendasArray = [] /> 
123	<#assign regexImg = r'<img[^>]*src="([^"]*)"[^>]*>' /> 
124	<#assign listaImgs = ((full_text.getData())!'')?matches(regexImg) /> 
125	<#assign corpoFinal = (full_text.getData())!'' /> 
126	<#list listaImgs as curImg> 
127		<#assign srcUrl = curImg?groups[1] /> 
128		<#assign temThumb = srcUrl?contains('imageThumbnail') /> 
129		<#if !temThumb> 
130			<#if srcUrl?contains('?') > 
131				<#assign separador = '&' /> 
132			<#else> 
133				<#assign separador = '?' /> 
134			</#if> 
135			<#assign corpoFinal = corpoFinal?replace(srcUrl, "${srcUrl}${separador}imageThumbnail=3", 'f') /> 
136		</#if> 
137		<#assign urlNovoFormato = srcUrl?starts_with("/documents/d/") /> 
138		<#assign filename = srcUrl?split("/")?last?split("?")?first /> 
139		<#if urlNovoFormato> 
140			<#-- 
141			<#assign returnFriendUrlHash =	FriendlyURLEntryLocalServiceUtil.fetchFriendlyURLEntry(groupId, classFileEntryID, filename)/> 
142			<#assign returnClassPKfetchFriendlyURL =	returnFriendUrlHash.classPK /> 
143			<#assign  
144				restReturn = restClient.get("/headless-delivery/v1.0/documents/${returnClassPKfetchFriendlyURL}")  
145				documentType = (restReturn["documentType"])![] 
146			/> 
147			<#if documentType["name"] == "Imagem"> 
148				<#list documentType["contentFields"] as contentField> 
149					<#if (contentField["name"]!'') == "image_text" > 
150						<#assign subTitleImg = (contentField["contentFieldValue"]["data"])!'' /> 
151					</#if> 
152					<#if (contentField["name"]!'') == "image_credits" > 
153						<#assign creditImg = (contentField["contentFieldValue"]["data"])!'' /> 
154					</#if> 
155					<#assign fullLegenda = ''> 
156					<#if subTitleImg?has_content && !creditImg?has_content> 
157						<#assign fullLegenda = "Legenda - ${subTitleImg}" /> 
158					<#elseif !subTitleImg?has_content && creditImg?has_content> 
159						<#assign fullLegenda = "Créditos - ${creditImg}" /> 
160					<#elseif subTitleImg?has_content && creditImg?has_content> 
161						<#assign fullLegenda = "Legenda - ${subTitleImg} - Créditos - ${creditImg}" /> 
162					</#if> 
163				</#list> 
164				<#assign legendasArray = legendasArray + [fullLegenda]> 
165			<#else> 
166				<#assign legendasArray = legendasArray + [" "]> 
167			</#if> 
168			<#-- --> 
169		<#elseif srcUrl?starts_with("/documents/") && srcUrl?split("/")[2]?matches(r"\d+")> 
170			<#assign fileEntryObj = (dlFileEntryLocalService.fetchFileEntry(filename, groupId))!"ERRO" /> 
171			<#if fileEntryObj?is_hash_ex > 
172				<#assign extRefCode = (fileEntryObj.getExternalReferenceCode())!'' /> 
173				<#if extRefCode?matches(r"\d+")> 
174					<#assign restReturn = restClient.get("/headless-delivery/v1.0/documents/${extRefCode}") /> 
175					<#assign documentType = (restReturn["documentType"])![] /> 
176					<#if documentType["name"] == "Imagem"> 
177						<#list documentType["contentFields"] as contentField> 
178							<#if contentField["name"]?? > 
179								<#if (contentField["name"]!'') == "image_text" > 
180									<#assign subTitleImg = (contentField["contentFieldValue"]["data"])!'' /> 
181								</#if> 
182							</#if> 
183							<#if contentField["name"]?? > 
184								<#if (contentField["name"]!'') == "image_credits" > 
185									<#assign creditImg = (contentField["contentFieldValue"]["data"])!'' /> 
186								</#if> 
187							</#if> 
188							<#assign fullLegenda = '' /> 
189							<#if subTitleImg?has_content && !creditImg?has_content> 
190								<#assign fullLegenda = "Legenda - ${subTitleImg}" /> 
191							<#elseif !subTitleImg?has_content && creditImg?has_content> 
192								<#assign fullLegenda = "Créditos - ${creditImg}" /> 
193							<#elseif subTitleImg?has_content && creditImg?has_content> 
194								<#assign fullLegenda = "Legenda - ${subTitleImg} - Créditos - ${creditImg}" /> 
195							</#if> 
196						</#list> 
197						<#assign legendasArray = legendasArray + [fullLegenda]> 
198					<#else> 
199						<#assign legendasArray = legendasArray + [" "]> 
200					</#if> 
201				<#else> 
202					<#assign legendasArray = legendasArray + [" "]> 
203				</#if> 
204			<#else> 
205				<#assign legendasArray = legendasArray + [" "]> 
206			</#if> 
207		<#else> 
208			<#assign legendasArray = legendasArray + [" "]> 
209		</#if> 
210	</#list> 
211	${corpoFinal} 
212	<script> 
213		let legendas = [ 
214			<#list legendasArray as legenda> 
215				"${legenda?js_string}"<#sep>, </#sep> 
216			</#list> 
217		]; 
218		$(function() { 
219			let images = document.querySelectorAll('.full-content img'); 
220			let pictures = document.querySelectorAll('.full-content picture'); 
221			 
222			function checkImageWidth(image, callback, tentativa = 0) { 
223				const maxAttempts = 10; 
224				const delay = 100; // tempo de espera entre as tentativas em milissegundos 
225 
226				if (image.width > 0 || tentativa >= maxAttempts) { 
227					callback(); 
228				} else { 
229					setTimeout(() => { 
230						checkImageWidth(image, callback, tentativa + 1); 
231					}, delay); 
232
233
234 
235			pictures.forEach(function(picture, index) { 
236				checkImageWidth(images[index], function() { 
237					if(legendas[index] != " "){ 
238						let caption = document.createElement('div'); 
239						 
240						caption.id = 'imgCaption_' + index; 
241						caption.classList.add('imgCaption'); 
242						caption.style.width = images[index].width + 'px'; 
243						caption.style.float = images[index].style.float; 
244						caption.textContent = legendas[index]; 
245 
246 
247						// Div da legenda por cima da foto: 
248						// caption.style.transform = 'translateY(-100%)'; 
249 
250						if (picture.parentNode.style.textAlign === 'center') { 
251							caption.style.left = '50%'; 
252							caption.style.translate = '-50%'; 
253
254						 
255						let wrapper = document.createElement('div'); 
256 
257						wrapper.appendChild(picture.cloneNode(true)); 
258						wrapper.appendChild(caption); 
259 
260						picture.parentNode.replaceChild(wrapper, picture); 
261
262				}); 
263			}); 
264		}); 
265	</script> 
266</#macro> 
267 
268<#-- Ajustar valores para ativar a validação de conteúdo apropriado para época de eleição --> 
269<#assign  
270	validarEleicao = false  
271	tagEleicao = "eleicao2026_nova" 
272/> 
273 
274<#if validarEleicao > 
275	<#assign 
276		assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") 
277		assetEntry = assetEntryLocalService.getEntry("com.liferay.journal.model.JournalArticle", resourceprimKey) 
278		jaTags = serviceLocator.findService("com.liferay.portal.kernel.service.AssetTagLocalService") 
279		listaTags = jaTags.getAssetEntryAssetTags(assetEntry.entryId) 
280	/> 
281	<#-- sites que não validam eleição (todo conteúdo é permitido) --> 
282	<#assign conteudoPermitido = groupId == 9777918 || groupId == 22572295 /> 
283 
284	<#-- Se conteudo possui tag de eleição ou é de site que não valida, permite o conteúdo --> 
285	<#assign conteudoPermitido = listaTags?seq_contains(tagEleicao) || conteudoPermitido /> 
286<#else> 
287	<#assign conteudoPermitido = true /> 
288</#if> 
289 
290<#if !conteudoPermitido > 
291	<style> 
292	.portlet-body { display: none; } 
293	</style> 
294<#else> 
295	<!--<small>${chapeu}</small> 
296	<h2><strong>${titulo}</strong></h2> 
297	<hr>--> 
298	<h5 style="font-size:12px;text-align: right;">${dataPublicacao}</h5> 
299	<h5 style="text-align: left;">${subTitulo}</h5> 
300	<#if local != "" > 
301		<div style="text-align:left;"> 
302			<span style="font-size:11px;">${autor}</span> | <span style="font-size:11px;">${local}</span> 
303		</div> 
304	<#else> 
305		<div style="text-align:left;"> 
306			<span style="font-size:12px;">${autor}</span></span> 
307		</div> 
308	</#if> 
309	<br/><br/> 
310	<#if imagemDestaque != "" > 
311		<#if imagemLegenda != "" > 
312			<#if imagemCredito != "" > 
313				<#assign imagemCredito = " - Foto por: " + imagemCredito > 
314			</#if> 
315		<#else> 
316			<#assign destaqueNovoFormato = imagemDestaque?contains("/documents/d/") /> 
317			<#assign destaqueEmLista = imagemDestaque?split("/") /> 
318			<#if destaqueEmLista?size gt 2> 
319				<#if destaqueNovoFormato > 
320					<#assign destaqueFileName = (destaqueEmLista[destaqueEmLista?size - 2]?split("?")?first)! /> 
321					<#if destaqueFileName != ''> 
322						<#assign  
323							destaqueFue =	FriendlyURLEntryLocalServiceUtil.fetchFriendlyURLEntry(groupId, classFileEntryID, destaqueFileName) 
324							destaqueClassPK =	destaqueFue.classPK 
325							restReturn = restClient.get("/headless-delivery/v1.0/documents/${destaqueClassPK}")  
326							documentType = (restReturn["documentType"])![] 
327						/> 
328						<#if documentType["name"] == "Imagem"> 
329							<#list documentType["contentFields"] as contentField> 
330								<#if (contentField["name"]!'') == "image_text" > 
331									<#assign imagemLegenda = (contentField["contentFieldValue"]["data"])!'' /> 
332								</#if> 
333								<#if (contentField["name"]!'') == "image_credits" > 
334									<#assign imagemCredito = (contentField["contentFieldValue"]["data"])!'' /> 
335								</#if> 
336							</#list> 
337						</#if> 
338					</#if> 
339				</#if> 
340				<#if imagemLegenda != "" && imagemCredito != "" > 
341					<#assign imagemCredito = " - Foto por: " + imagemCredito > 
342				</#if> 
343			</#if> 
344		</#if> 
345		<div style="position:relative;margin-bottom:20px;"> 
346			<div style="position: absolute;right: 0px;background: rgba(0,0,0,.5);color: #dcdcdc;font-size: 11px;bottom: 0;padding: 0 4px;"> 
347				${imagemLegenda!} ${imagemCredito!} 
348			</div> 
349			<img  
350        alt="${titulo} - ${imagemLegenda}"  
351        src="${getAdaptiveMediaFromFileUploadField(full_image)}"  
352        class="featured-image img-fluid"  
353        title="${imagemLegenda} ${imagemCredito}" 
354       /> 
355		</div> 
356	</#if> 
357 
358	<div style="text-align: right;"> 
359		<a class="increaseFont">A<i class="icon-plus-sign"></i></a> |  
360		<a class="decreaseFont">A<i class="icon-minus-sign"></i></a> 
361	</div> 
362	<div class="full-content" style="text-align:justify;"> 
363		<@exibeCorpoNoticia/> 
364	</div> 
365	<br/> 
366	<#if urlVideo != "" && urlVideo??> 
367		<#if urlVideo?starts_with("https://youtu.be/")> 
368			<#assign urlVideo = urlVideo?split("/")[3]> 
369		<#else> 
370			<#assign urlVideo = ""> 
371			<button type="button" class="btn btn-lg btn-warning" data-toggle="popover" title="Verifique a URL" data-content="A Url tem que começar com https://youtu.be/ Para achar essa Url, vai no video que deseja colocar e clica em compartilhar.">Verifique a URL</button> 
372			<script> 
373				$(function () { 
374					$('[data-toggle="popover"]').popover() 
375				}) 
376			</script> 
377 
378		</#if> 
379		<object width="100%" height="360" class="hidden-phone"> 
380			<param name="movie" value="https://www.youtube.com/embed/${urlVideo}?version=3&amp;theme=light&quot;&gt;&lt;/param> 
381			<param name="allowScriptAccess" value="always"></param> 
382			<embed src="https://www.youtube.com/embed/${urlVideo}?version=3&amp;theme=light&quot; allowscriptaccess="always" width="100%" height="360"></embed> 
383		</object> 
384		<object width="100%" height="240" class="visible-phone"> 
385			<param name="movie" value="https://www.youtube.com/embed/${urlVideo}?version=3&amp;theme=light&quot;&gt;&lt;/param> 
386			<param name="allowScriptAccess" value="always"></param> 
387			<embed src="https://www.youtube.com/embed/${urlVideo}?version=3&amp;theme=light&quot; allowscriptaccess="always" width="100%" height="240"></embed> 
388		</object> <br/><br/> 
389	</#if> 
390	<br/> 
391	<#if anexos?is_hash> 
392		<#if ((anexos.getSiblings()?size)!0) gt 0> 
393			<#list anexos.getSiblings() as cur_item> 
394				<#assign attachURL = cur_item.getData() > 
395				<#if attachURL?trim != ''> 
396					<#if cur_item["data"]?starts_with("{") && cur_item["data"]?ends_with("}") > 
397						<#assign attachTitle = ((cur_item["data"]?eval)["title"])!'Anexo' /> 
398					<#else> 
399						<#assign attachTitle = 'Anexo' /> 
400					</#if> 
401					<#assign links_anexos = (links_anexos![]) + ["<a href=\"${attachURL}\" target=\"_blank\"><i class=\"fa-solid fa-download\"></i>${attachTitle}</a>"] /> 
402				</#if> 
403			</#list> 
404		</#if> 
405		<#if (links_anexos![])?size gt 0> 
406			<div class="container mt-5"> 
407				<div class="row justify-content-md-center"> 
408					<div class="col-sm-12 anexos"> 
409						<span>Anexos</span><br><br> 
410						<#list links_anexos as cur_link> 
411							${cur_link} 
412						</#list> 
413					</div> 
414				</div> 
415			</div> 
416		</#if> 
417	</#if> 
418 
419</#if> 
420 
421<#if idGaleria?has_content> 
422	<div class="mb-4"> 
423		<@liferay_journal["journal-article"] 
424			articleId=idGaleria 
425			groupId=groupId 
426		/> 
427	</div> 
428</#if>