Mattia Gosetto 4 anni fa
parent
commit
e57ca91edb
  1. 30
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/mwg/sismica/bo/util/MappeUtil.java
  2. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties

30
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/mwg/sismica/bo/util/MappeUtil.java

@ -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;

4
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties

@ -13,8 +13,8 @@
##
build.namespace=portos_bo
build.number=3150
build.date=1621937915972
build.number=3155
build.date=1623147655039
build.auto.upgrade=true
##

Caricamento…
Annulla
Salva