|
|
|
@ -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,12 +50,17 @@ 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); |
|
|
|
|
long date = new Date().getTime() / 1000; |
|
|
|
@ -71,6 +78,21 @@ public class MappeUtil {
|
|
|
|
|
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; |
|
|
|
|