Mattia Gosetto 4 anni fa
parent
commit
e57ca91edb
  1. 26
      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

26
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.Comune;
import it.tref.liferay.portos.bo.model.DettPratica; 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.ConfigurazioneLocalServiceUtil;
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants; import it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
@ -48,12 +50,17 @@ public class MappeUtil {
return getUrlComune(request, baseUrl, dettPratica, comune, readOnly); return getUrlComune(request, baseUrl, dettPratica, comune, readOnly);
} }
private static String getUrlComune(HttpServletRequest request, String baseUrl, DettPratica dettPratica, private static String getUrlComune(HttpServletRequest request,
Comune comune, boolean readOnly) throws UnsupportedEncodingException, PortalException, SystemException { String baseUrl, DettPratica dettPratica, Comune comune,
boolean readOnly) throws UnsupportedEncodingException,
PortalException, SystemException {
ThemeDisplay td = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY); ThemeDisplay td = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
long companyId = td.getCompanyId(); long companyId = td.getCompanyId();
long intPraticaId = dettPratica.getIntPraticaId();
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
String sharedSecret = ConfigurazioneLocalServiceUtil.findByC_ChiaveString(companyId, String sharedSecret = ConfigurazioneLocalServiceUtil.findByC_ChiaveString(companyId,
ConfigurazioneConstants.MAPPE_SHARED_SECRET); ConfigurazioneConstants.MAPPE_SHARED_SECRET);
long date = new Date().getTime() / 1000; long date = new Date().getTime() / 1000;
@ -71,6 +78,21 @@ public class MappeUtil {
else else
url = url.replace("{{ESTREMI_CAT}}", ""); 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")); url = url.replace("{{READONLY}}", (readOnly ? "true" : "false"));
String query = StringPool.BLANK; 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.namespace=portos_bo
build.number=3150 build.number=3155
build.date=1621937915972 build.date=1623147655039
build.auto.upgrade=true build.auto.upgrade=true
## ##

Caricamento…
Annulla
Salva