|
|
|
@ -2,7 +2,9 @@ package it.mwg.sismica.bo.util;
|
|
|
|
|
|
|
|
|
|
import it.tref.liferay.portos.bo.model.Comune; |
|
|
|
|
import it.tref.liferay.portos.bo.model.DettPratica; |
|
|
|
|
import it.tref.liferay.portos.bo.model.IntPratica; |
|
|
|
|
import it.tref.liferay.portos.bo.service.ConfigurazioneLocalServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants; |
|
|
|
|
|
|
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
@ -48,11 +50,16 @@ public class MappeUtil {
|
|
|
|
|
return getUrlComune(request, baseUrl, dettPratica, comune, readOnly); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static String getUrlComune(HttpServletRequest request, String baseUrl, DettPratica dettPratica, |
|
|
|
|
Comune comune, boolean readOnly) throws UnsupportedEncodingException, PortalException, SystemException { |
|
|
|
|
|
|
|
|
|
private static String getUrlComune(HttpServletRequest request, |
|
|
|
|
String baseUrl, DettPratica dettPratica, Comune comune, |
|
|
|
|
boolean readOnly) throws UnsupportedEncodingException, |
|
|
|
|
PortalException, SystemException { |
|
|
|
|
|
|
|
|
|
ThemeDisplay td = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
|
long companyId = td.getCompanyId(); |
|
|
|
|
|
|
|
|
|
long intPraticaId = dettPratica.getIntPraticaId(); |
|
|
|
|
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); |
|
|
|
|
|
|
|
|
|
String sharedSecret = ConfigurazioneLocalServiceUtil.findByC_ChiaveString(companyId, |
|
|
|
|
ConfigurazioneConstants.MAPPE_SHARED_SECRET); |
|
|
|
@ -70,7 +77,22 @@ public class MappeUtil {
|
|
|
|
|
url = url.replace("{{ESTREMI_CAT}}", urlEncode(dettPratica.getEstremiCatastali())); |
|
|
|
|
else |
|
|
|
|
url = url.replace("{{ESTREMI_CAT}}", ""); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String localizzazione = dettPratica.getLocalizzazioneGeografica(); |
|
|
|
|
String lat = ""; |
|
|
|
|
String lng = ""; |
|
|
|
|
if(Validator.isNotNull(localizzazione)){ |
|
|
|
|
String[] coordinate = StringUtils.split(localizzazione, "|"); |
|
|
|
|
if(coordinate.length > 1){ |
|
|
|
|
lat = coordinate[0]; |
|
|
|
|
lng = coordinate[1]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
url = url.replace("{{LAT}}", lat); |
|
|
|
|
url = url.replace("{{LNG}}", lng); |
|
|
|
|
|
|
|
|
|
url = url.replace("{{IDPRATICA}}", String.valueOf(intPraticaId)); |
|
|
|
|
url = url.replace("{{NPRATICA}}", String.valueOf(intPratica.getNumeroProgetto())); |
|
|
|
|
url = url.replace("{{READONLY}}", (readOnly ? "true" : "false")); |
|
|
|
|
|
|
|
|
|
String query = StringPool.BLANK; |
|
|
|
|