Nav Bar do usuário deslogado.

Adicionar organização no mapa

An error occurred while processing the template.
Can't convert this string to number: ""
The blamed expression:
==> orgId?number  [in template "34764#34807#204086" at line 15, column 98]

----
FTL stack trace ("~" means nesting-related):
	- Failed at: org = OrganizationLocalService.fetchO...  [in template "34764#34807#204086" at line 15, column 49]
----
1<#assign  
2	JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") 
3	OrganizationLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService") 
4
5<div class="bioec_profile-form-control"> 
6	<label for="orgName" required>Nome da organização</label> 
7	<input class="form-control search-select-org" list="orgList" id="orgName" placeholder="Nome da organização" onblur="verificarSelecao()" required> 
8	<input type="hidden" class="form-control search-select-org" id="orgId" required> 
9		<#if entries?has_content> 
10			<datalist id="orgList"> 
11				<#list entries as entry> 
12					<#assign 
13						journalArticle = JournalArticleLocalService.getLatestArticle(entry.getClassPK()) 
14						orgId = journalArticle.getExpandoBridge().getAttribute("organization")!"" 
15						org = OrganizationLocalService.fetchOrganization(orgId?number)!"" 
16						nome = org.getName()!"" 
17						articleXml = journalArticle.getDocument().getRootElement() 
18						tipo = articleXml.selectSingleNode("dynamic-element[@field-reference='Text77560090']").getStringValue()!"" 
19						tipo = tipo?replace("[^a-zA-Z]", "", "r") 
20						tipo = tipo?replace("amp", "") 
21
22						 
23					<#if tipo == "GrupodePesquisaUniversidade" || tipo == "OutrasICTs" || tipo == "Startup"> 
24						<option value="${nome}"> 
25					</#if> 
26						 
27				</#list> 
28			</datalist> 
29		</#if> 
30</div> 
31<div id="formInputs" class="d-none"> 
32	<div class="bioec_profile-form-control"> 
33   	<label for="setores-de-atuacao" required>Tipos de atuação</label> 
34   	<select id="setores-de-atuacao" name="setores" required> 
35      <option value="Grupo de Pesquisa/Universidade">Grupo de Pesquisas / Universidades</option> 
36      <option value="Startup">Startups</option> 
37      <option value="Outras ICTs">Outras ICTs</option> 
38   	</select> 
39	</div> 
40	<div class="bioec_profile-form-control"> 
41   	<label for="orgLink" required>Link do site da organização</label> 
42   	<input type="text" class="form-control" id="orgLink" aria-describedby="orgLinkWarning" placeholder="Site, rede social ou similar" required> 
43	</div> 
44</div> 
45<script> 
46	let ruaObjeto = ""; 
47        let numeroObjeto = ""; 
48   function verificarSelecao() { 
49			if(document.getElementById('orgName').value) { 
50				document.getElementById('formInputs').classList.remove('d-none'); 
51					let arrNomes = []; 
52					<#list entries as entry> 
53						<#assign 
54							journalArticle = JournalArticleLocalService.getLatestArticle(entry.getClassPK()) 
55							orgId = journalArticle.getExpandoBridge().getAttribute("organization")!"" 
56							org = OrganizationLocalService.fetchOrganization(orgId?number)!"" 
57							nome = org.getName()!"" 
58							articleXml = journalArticle.getDocument().getRootElement() 
59							tipo = articleXml.selectSingleNode("dynamic-element[@field-reference='Text77560090']").getStringValue()!"" 
60							tipo = tipo?replace("\n\t\t", "") 
61							tipo = tipo?replace("\n\t", "") 
62							tipo = tipo?replace("&amp;#39;", "") 
63							site = articleXml.selectSingleNode("dynamic-element[@field-reference='Text98857063']").getStringValue()!"" 
64							site = site?replace("\n\t\t", "") 
65							site = site?replace("\n\t", "")	 
66
67						arrNomes.push({ nome: "${nome}", id: "${orgId}", site: "${site}", tipo: "${tipo}" }); 
68					</#list> 
69		 
70				 
71				 
72				 
73					let objetoEncontrado = arrNomes.find(objeto => objeto.nome === document.getElementById('orgName').value); 
74				 
75						 
76				let params; 
77				 
78         
79				 
80					if(objetoEncontrado) { 
81				 
82							document.getElementById('orgId').value = objetoEncontrado.id; 
83							document.getElementById('orgLink').value = objetoEncontrado.site; 
84							document.getElementById('setores-de-atuacao').value = objetoEncontrado.tipo; 
85						 
86						if (objetoEncontrado.id != "") { 
87            params = new URLSearchParams({ 
88                filter: `idOrganizacao eq ` + "'" + objetoEncontrado.id + "'" 
89            }) 
90        } else { 
91            params = new URLSearchParams({ 
92                filter: `nome eq ` +  "'" + objetoEncontrado.nome + "'" 
93            }) 
94
95				 
96        fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/c/localizacaos?" + params, 
97
98                method: "GET", 
99                headers: { 
100                    "x-csrf-token": Liferay.authToken, 
101                    "Content-Type": "application/json" 
102
103            }).then(res => { 
104                res.json().then((data) => { 
105                    if (data.items.length > 0) { 
106                        let ruaObjeto = data.items[0]['rua'] 
107												let numeroObjeto = data.items[0]['numero'] 
108												console.log("numero: " + numeroObjeto); 
109											document.querySelector('#orgAddress input').value = ruaObjeto; 
110											document.querySelector("#popup_end_numero").value = numeroObjeto; 
111										 
112										document.getElementById('searchButtonBioec').click(); 
113												 
114
115                }) 
116            }) 
117						 
118						 
119						 
120             
121						  
122											 
123					} else { 
124							//console.log('não existe'); 
125							document.getElementById('orgId').value = ""; 
126							document.getElementById('orgLink').value = ""; 
127							document.getElementById('setores-de-atuacao').value = ""; 
128						ocument.querySelector('#orgAddress input').value = "";  
129
130				 
131			 
132			} else { 
133				document.getElementById('formInputs').classList.add('d-none'); 
134
135    
136
137</script>