ABQM Awards

Publicador de Conteúdos e Mídias

2023 - Rédeas

Um erro ocorreu enquanto processava o modelo.
The following has evaluated to null or missing:
==> category[curEntry.Select13948226.getData()]  [in template "20096#20122#811421" at line 57, column 126]

----
Tip: It's the final [] step 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: ${category[curEntry.Select13948226.ge...  [in template "20096#20122#811421" at line 57, column 124]
----
1<#--  SERVIÇOS  --> 
2<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") /> 
3<#assign AssetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") /> 
4 
5<#--  CONTEÚDO WEB  --> 
6<#assign journalArticleModel = "com.liferay.journal.model.JournalArticle" /> 
7<#assign currentArticle = JournalArticleLocalService.getArticle(articleGroupId, .vars['reserved-article-id'].data) /> 
8<#assign categories = AssetCategoryLocalService.getCategories(journalArticleModel, currentArticle.getResourcePrimKey()) /> 
9<#assign title = .vars["reserved-article-title"].data /> 
10<#assign modality = title?keep_after_last(" ") /> 
11 
12<#if entry.getSiblings()?has_content> 
13	<#if (entry.getSiblings()?size > 1)> 
14		<h5 class="font-weight-bold text-center text-gray-1 c-mb-48">${title}</h5> 
15		<div class="awards"> 
16			<#if (entry.getSiblings()?size > 3)> 
17				<div class="row align-items-center text-center mb-5"> 
18					<#list entry.getSiblings()[0..2] as curEntry> 
19						<div class="col-md"> 
20							<@ranking entry=curEntry /> 
21						</div> 
22					</#list> 
23				</div> 
24 
25				<ul class="list-group"> 
26					<#list entry.getSiblings()[3..] as curEntry> 
27						<li class="list-group-item"> 
28							<div class="row align-items-center"> 
29								<div class="col-md-6 d-flex align-items-center mb-3 mb-md-0"> 
30									<div class="sticker sticker-secondary rounded-circle"> 
31										<span class="inline-item"> 
32											<#if (category[curEntry.Select13948226.getData()]?? && category[curEntry.Select13948226.getData()] != "")> 
33												<img  
34													src="${getIconURL(category[curEntry.Select13948226.getData()])}" 
35													alt="Ícone"  
36													width="36" 
37												/> 
38											</#if> 
39										</span> 
40									</div> 
41 
42									<p class="font-weight-semi-bold c-ml-32">${curEntry.title.getData()}</p> 
43								</div> 
44 
45								<div class="col-md-6 d-flex align-items-center justify-content-between"> 
46									<#if curEntry.score_c.getData()?? && curEntry.score_c.getData() != "0"> 
47										<#if modality?lower_case == "corrida"> 
48											<#assign score = curEntry.score_c.getData() /> 
49											<#assign real = "R$ " + score?number?string(",##0.00")/> 
50											<p><b>${real}</b></p> 
51										<#else> 
52											<p><b>${curEntry.score_c.getData()}</b> pontos</p> 
53										</#if> 
54									</#if> 
55 
56									<span class="label label-inverse-secondary"> 
57										<span class="label-item label-item-expand">${category[curEntry.Select13948226.getData()]}</span> 
58									</span> 
59								</div> 
60							</div> 
61						</li>				 
62					</#list> 
63				</ul> 
64			<#else> 
65				<div class="row align-items-center text-center mb-5"> 
66					<#list entry.getSiblings() as curEntry> 
67						<div class="col-md"> 
68							<@ranking entry=curEntry /> 
69						</div> 
70					</#list> 
71				</div>	 
72			</#if> 
73		</div> 
74	<#else> 
75		<p class="text-center">Para esta modalidade não houve premiação</p> 
76	</#if> 
77 
78	<#if categories?has_content> 
79		<#list categories as item> 
80			<script> 
81				Liferay.on("allPortletsReady", function () { 
82					let currentYear = "${item.getName()}"; 
83 
84					if ($("[data-category-id]").length > 0 && typeof currentYear  !== "undefined"){ 
85						$("[data-category-id]").each(function () { 
86							let currentURL = Liferay.currentURL; 
87							let curNavYear = $(this).find(".nav-text").text(); 
88							let newUrl = currentURL.replace(currentYear, curNavYear); 
89							//newUrl = newUrl[0] + "?c=" + $(this).attr("data-category-id"); 
90 
91							if (currentYear == curNavYear) { 
92								$(this).addClass("active"); 
93							} else { 
94								$(this).attr('href', newUrl); 
95
96						}); 
97
98				}); 
99			</script> 
100		</#list> 
101	</#if> 
102</#if> 
103 
104<#macro ranking entry> 
105	<#assign category = entry.Select13948226.getOptionsMap() /> 
106	 
107	<div data-aos="flip-left"> 
108		<#if (category[entry.Select13948226.getData()]?? && category[entry.Select13948226.getData()] != "")> 
109			<img  
110				src="${getIconURL(category[entry.Select13948226.getData()])}" 
111				alt="Ícone"  
112				width="95" 
113
114		</#if> 
115	</div> 
116 
117	<p class="mt-3"> 
118		<#if (category[entry.Select13948226.getData()]?? && category[entry.Select13948226.getData()] != "")> 
119			${category[entry.Select13948226.getData()]}: 
120		</#if> 
121	</p> 
122	<p class="font-weight-semi-bold m-0">${entry.title.getData()}</p> 
123 
124	<div class="ranking c-p-32 mt-5" data-aos="fade-up"> 
125		<div class="d-flex align-items-center mb-3"> 
126			<#if modality?lower_case == "corrida"> 
127				<#assign score = entry.score_c.getData() /> 
128				<#assign real = "R$ " + score?number?string(",##0.00")/> 
129				<span class="font-weight-semi-bold p1 mr-2">${real}</span> 
130			<#else> 
131				<span class="font-weight-semi-bold p1 mr-2">${entry.score_c.getData()}</span> 
132				<span class="p2">pontos</span> 
133			</#if> 
134		</div> 
135 
136		<#if entry.owner.getData()??> 
137			<p class="p2">Proprietário(a): <b>${entry.owner.getData()}</b></p> 
138		</#if> 
139 
140		<#if (entry.breeder.getData())??> 
141			<p class="p2 m-0">Criador(a): <b>${entry.breeder.getData()}</b></p> 
142		</#if> 
143	</div> 
144</#macro> 
145 
146<#function getIconURL category> 
147	<#switch category> 
148		<#case "Melhor Macho"> 
149			<#return "https://abqm.com.br/documents/d/awards/group-75-1-" /> 
150			<#break> 
151		<#case "Melhor Fêmea"> 
152			<#return "https://abqm.com.br/documents/d/awards/group-75-1-" /> 
153			<#break> 
154		<#case "Puro Castrado"> 
155			<#return "https://abqm.com.br/documents/d/awards/group-75-1-" /> 
156			<#break> 
157		<#case "Reprodutor"> 
158			<#return "https://abqm.com.br/documents/d/awards/image-1-1-" /> 
159			<#break> 
160		<#case "Competidor Aberta"> 
161			<#return "https://abqm.com.br/documents/d/awards/image-2-1-" /> 
162			<#break> 
163		<#case "Amazona"> 
164			<#return "https://abqm.com.br/documents/d/awards/image-2-1-" /> 
165			<#break> 
166		<#case "Competidor Amador"> 
167			<#return "https://abqm.com.br/documents/d/awards/image-2-1-" /> 
168			<#break> 
169		<#case "Competidor Jovem"> 
170			<#return "https://abqm.com.br/documents/d/awards/image-2-1-" /> 
171			<#break> 
172		<#case "Proprietário"> 
173			<#return "https://abqm.com.br/documents/d/awards/image-3-1-" /> 
174			<#break> 
175		<#case "Criador"> 
176			<#return "https://abqm.com.br/documents/d/awards/image-3-1-" /> 
177			<#break> 
178		<#default> 
179			<#return "https://abqm.com.br/documents/d/awards/animal-1-1-" /> 
180	</#switch> 
181</#function>