Sfoglia il codice sorgente

mappe aggiornate con readonly e fix per openstreetmap

master
Mattia Gosetto 4 anni fa
parent
commit
b575c3eccb
  1. 44
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/mwg/sismica/bo/util/MappeUtil.java
  2. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties
  3. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties
  4. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_dettagli_principali.jsp
  5. 61
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/ricerca-posizione/view.jsp
  6. 15
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/js/main.js
  7. 17
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_dettagli_principali.jsp
  8. 25
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_dettagli.jsp
  9. 21
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_riepilogo.jsp
  10. 11
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/js/main.js

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

@ -19,35 +19,59 @@ import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.util.WebKeys;
import com.liferay.portal.theme.ThemeDisplay;
public class MappeUtil {
private final static Log _log = LogFactoryUtil.getLog(MappeUtil.class);
public static String getUrlFe(HttpServletRequest request, DettPratica dettPratica, Comune comune)
public static String getUrlFe(HttpServletRequest request, DettPratica dettPratica, Comune comune, boolean readOnly)
throws UnsupportedEncodingException, PortalException, SystemException {
String baseUrl = ConfigurazioneLocalServiceUtil.findByC_ChiaveString(comune.getCompanyId(),
ThemeDisplay td = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
long companyId = td.getCompanyId();
String baseUrl = ConfigurazioneLocalServiceUtil.findByC_ChiaveString(companyId,
ConfigurazioneConstants.MAPPE_URL_IFRAME_FE);
return getUrlComune(request, baseUrl, dettPratica, comune);
return getUrlComune(request, baseUrl, dettPratica, comune, readOnly);
}
public static String getUrlBo(HttpServletRequest request, DettPratica dettPratica, Comune comune)
public static String getUrlBo(HttpServletRequest request, DettPratica dettPratica, Comune comune, boolean readOnly)
throws UnsupportedEncodingException, PortalException, SystemException {
String baseUrl = ConfigurazioneLocalServiceUtil.findByC_ChiaveString(comune.getCompanyId(),
ThemeDisplay td = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
long companyId = td.getCompanyId();
String baseUrl = ConfigurazioneLocalServiceUtil.findByC_ChiaveString(companyId,
ConfigurazioneConstants.MAPPE_URL_IFRAME_BO);
return getUrlComune(request, baseUrl, dettPratica, comune);
return getUrlComune(request, baseUrl, dettPratica, comune, readOnly);
}
private static String getUrlComune(HttpServletRequest request, String baseUrl, DettPratica dettPratica,
Comune comune) throws UnsupportedEncodingException, PortalException, SystemException {
long companyId = comune.getCompanyId();
Comune comune, boolean readOnly) throws UnsupportedEncodingException, PortalException, SystemException {
ThemeDisplay td = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
long companyId = td.getCompanyId();
String sharedSecret = ConfigurazioneLocalServiceUtil.findByC_ChiaveString(companyId,
ConfigurazioneConstants.MAPPE_SHARED_SECRET);
long date = new Date().getTime() / 1000;
String auth = DigestUtils.sha256Hex(date + sharedSecret + request.getServerName());
String url = baseUrl.replace("{{COD_BELFIORE}}", urlEncode(comune.getCodiceBelfiore())).replace(
"{{ESTREMI_CAT}}", urlEncode(dettPratica.getEstremiCatastali()));
String url = baseUrl;
if(Validator.isNotNull(comune))
url = url.replace("{{COD_BELFIORE}}", urlEncode(comune.getCodiceBelfiore()));
else
url = url.replace("{{COD_BELFIORE}}", "");
if(Validator.isNotNull(dettPratica))
url = url.replace("{{ESTREMI_CAT}}", urlEncode(dettPratica.getEstremiCatastali()));
else
url = url.replace("{{ESTREMI_CAT}}", "");
url = url.replace("{{READONLY}}", (readOnly ? "true" : "false"));
String query = StringPool.BLANK;
String[] parti = StringUtils.split(url, StringPool.QUESTION);

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties

@ -199,7 +199,6 @@ dp-ppp = Piano paesaggistico provinciale
dett-principali = Dettagli principali
dp = Piano paesaggistico provinciale
piano-paesaggistico = Piano paesaggistico provinciale
dp-zona-sismica = Livello di tutela
paesaggio-locale = Contesto paesaggistico
livello-di-tutela = Livello di tutela
vincoli = Vincoli

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=3148
build.date=1621869003568
build.number=3150
build.date=1621937915972
build.auto.upgrade=true
##

4
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_dettagli_principali.jsp

@ -24,7 +24,7 @@ Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getT
Comune comune = ComuneLocalServiceUtil.getComune(territorio.getComuneId());
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia());
boolean isDisabledMap = ParamUtil.getBoolean(request, "isDisabledMap", false);
String urlIframeMappe = MappeUtil.getUrlBo(request, dettPratica, comune);
String urlIframeMappe = MappeUtil.getUrlBo(request, dettPratica, comune, true);
%>
<c:if test="<%= Validator.isNull(dettPraticaId) %>">
<liferay-util:include page="/html/fascicolo/navigator/header.jsp" servletContext="<%= application %>"/>
@ -218,7 +218,7 @@ String urlIframeMappe = MappeUtil.getUrlBo(request, dettPratica, comune);
</div>
</c:if>
<div class="row">
<div class="col-xs-12">
<div class="col-xs-12 cont_maps">
<% String[] geolocalization = dettPratica.getLocalizzazioneGeografica().split(Pattern.quote("|")); %>
<aui:input name="lat" label="" type="hidden"
value='<%= geolocalization.length > 0 ? geolocalization[0] : StringPool.BLANK %>' />

61
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/ricerca-posizione/view.jsp

@ -10,6 +10,8 @@
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Locale"%>
<%@page import="javax.portlet.PortletURL"%>
<%@page import="it.mwg.sismica.bo.util.MappeUtil"%>
<%
String numeroProgetto = ParamUtil.getString(request, "numeroProgetto", StringPool.BLANK);
@ -51,6 +53,8 @@ DecimalFormat fmt = (DecimalFormat) NumberFormat.getInstance(Locale.ITALY);
boolean showNotes = false;
int[] raggi = { 500, 1000, 2000, 3000, 5000, 10000 };
String urlIframeMappe = MappeUtil.getUrlBo(request, null, null, false);
%>
<liferay-portlet:actionURL name="ricerca" var="ricercaURL" />
<liferay-portlet:actionURL name="localizzaProgetto" var="localizzaProgettoURL" />
@ -120,14 +124,69 @@ int[] raggi = { 500, 1000, 2000, 3000, 5000, 10000 };
<aui:button type="submit" value="search" />
</aui:form>
</div>
<div class="col-xs-6">
<div class="col-xs-6 cont_maps">
<liferay-ui:tabs names="mappe-bbcc,mappe-openstreetmap" refresh="false">
<liferay-ui:section>
<div class="col-xs-12">
<!-- Integrazione geoportal -->
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<div style="border:none;width:100%;height:700px">
<iframe src="<%= urlIframeMappe %>" style="border:none;width:100%;height:700px"></iframe>
</div>
<script>
document.addEventListener('DOMContentLoaded', function(event) {
window.addEventListener('message', messageListener, false);
});
function messageListener(event) {
try {
var data = JSON.parse(event.data);
} catch (e) {
return;
}
var trasferiti = [];
for (key in data) {
switch (key) {
case 'latitudine':
var name = 'lat';
break;
case 'longitudine':
var name = 'long';
break;
default:
var name = 'input_' + key;
}
var el = document.getElementById('<portlet:namespace/>' + name);
if (null !== el) {
el.value = data[key];
trasferiti.push(key);
}
}
if (trasferiti.length > 0) {
//console.log('Trasferiti correttamente: ' + trasferiti.join(', '));
}
}
</script>
</div>
</div>
</div>
</div>
</liferay-ui:section>
<liferay-ui:section>
<c:set var="mapitNamespace" scope="request" value="<%= renderResponse.getNamespace() %>" />
<liferay-portlet:runtime portletName="<%= PortletKeys.MAPIT %>"
queryString="&mapitNamespace=${mapitNamespace}&verifyComune=false" />
</liferay-ui:section>
<aui:input type="hidden" name="geoIsEditable" value="true" />
<aui:input type="hidden" name="lat_hidden" value="" />
<aui:input type="hidden" name="long_hidden" value="" />
<aui:input type="hidden" name="zoom" value="12" />
</liferay-ui:tabs>
</div>
</div>
</div>

15
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/js/main.js

@ -101,3 +101,18 @@ var sliderVersion = {
},
}
*/
if($('.cont_maps').length){
$('.cont_maps ul li').click(function(){
var map = mapItMap.getInstance();
setTimeout(function(){
map.updateSize();
if(map.layers.length > 0)
map.layers[0].redraw();
}, 100);
});
}

17
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_dettagli_principali.jsp

@ -44,7 +44,7 @@ boolean enabledByIntegrazione = DelegheUtil.hasDelegaCompilazioneDomanda(user.ge
&& TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equals(dettPratica.getTipoIntegrazione());
boolean isDisabled = disabledInput && !enabledByIntegrazione;
boolean isNewVariante = ParamUtil.getBoolean(request, "isNewVariante");
String urlIframeMappe = MappeUtil.getUrlFe(request, dettPratica, comune);
String urlIframeMappe = MappeUtil.getUrlFe(request, dettPratica, comune, (disabledInput || isGeoEditable));
%>
<liferay-util:include page="/html/fascicolofe/navigator/header.jsp" servletContext="<%= application %>">
@ -226,9 +226,9 @@ String urlIframeMappe = MappeUtil.getUrlFe(request, dettPratica, comune);
<div class="module-group group_dati_catastali">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="dp-dc">
<div class="dati_catastali">
<div class="col-xs-12">
<div class="col-xs-12 cont_maps">
<liferay-ui:tabs names="mappe-bbcc,mappe-openstreetmap"
refresh="false" value="mappe-openstreetmap">
refresh="false" value="mappe-bbcc">
<liferay-ui:section>
<div class="col-xs-12">
<!-- Integrazione geoportal -->
@ -268,7 +268,7 @@ function messageListener(event) {
}
}
if (trasferiti.length > 0) {
console.log('Trasferiti correttamente: ' + trasferiti.join(', '));
//console.log('Trasferiti correttamente: ' + trasferiti.join(', '));
}
}
</script>
@ -282,6 +282,7 @@ function messageListener(event) {
</liferay-ui:section>
</liferay-ui:tabs>
</div>
<div class="col-xs-12 col-md-12" style="margin-top:40px;"></div>
<aui:row>
<div class="col-xs-12 col-md-6">
<div class="container-fluid">
@ -341,7 +342,7 @@ function messageListener(event) {
</div>
<div class="col-xs-12 col-md-6">
<div class="container-fluid">
<div class="row">
<div class="row" style="margin-bottom:20px;">
<div class="col-xs-12">
<aui:input disabled="<%= isDisabled %>" type="text" name="estremiCatastali" id="input_estremiCatastali"
label="estremi-catastali"/>
@ -350,15 +351,15 @@ function messageListener(event) {
<label class="control-label text-uppercase"><%= LanguageUtil.get(pageContext, "dp-ppp") %></label>
<div class="row">
<div class="col-xs-12">
<aui:input disabled="<%= isDisabled %>" type="textarea" name="paesaggioLocale" id="input_paesaggioLocale" label="dp-paesaggio-locale" value="" />
<aui:input disabled="<%= isDisabled %>" type="textarea" name="paesaggioLocale" id="input_paesaggioLocale" label="paesaggio-locale" value="" />
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<aui:input disabled="<%= isDisabled %>" type="textarea" name="livelloDiTutela" id="input_livelloDiTutela" label="dp-livello-di-tutela" value="" />
<aui:input disabled="<%= isDisabled %>" type="textarea" name="livelloDiTutela" id="input_livelloDiTutela" label="livello-di-tutela" value="" />
</div>
<div class="col-xs-12 col-md-6">
<aui:input disabled="<%= isDisabled %>" type="textarea" id="input_vincoli" name="vincoli" rows="4" cols="250" label="dp-vincoli"></aui:input>
<aui:input disabled="<%= isDisabled %>" type="textarea" id="input_vincoli" name="vincoli" rows="4" cols="250" label="vincoli"></aui:input>
</div>
</div>
</div>

25
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_dettagli.jsp

@ -38,6 +38,7 @@
<%@page import="java.util.ArrayList"%>
<%@page import="com.liferay.portal.kernel.util.KeyValuePair"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@page import="it.mwg.sismica.bo.util.MappeUtil" %>
<%
@ -62,6 +63,8 @@
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
Comune comune = ComuneLocalServiceUtil.getComune(territorio.getComuneId());
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia());
String urlIframeMappe = MappeUtil.getUrlFe(request, dettPratica, comune, true);
%>
<liferay-ui:error key="error-download-pdf-domanda" message="error-download-pdf-domanda" />
@ -273,7 +276,7 @@
</div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<div class="container-fluid">
<div class="row">
<div class="row cont_maps">
<%
String[] geolocalization = BeanPropertiesUtil.getString(dettPratica, "localizzazioneGeografica","").split(Pattern.quote("|"));
%>
@ -287,8 +290,26 @@
</div>
<aui:input type="hidden" name="geoIsEditable" value='<%= false %>' label=""/>
<liferay-portlet:runtime portletName="5_WAR_trefmapitmapportlet" />
<liferay-ui:tabs names="mappe-bbcc,mappe-openstreetmap" refresh="false" value="mappe-openstreetmap">
<liferay-ui:section>
<div class="col-xs-12">
<!-- Integrazione geoportal -->
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<iframe src="<%= urlIframeMappe %>" style="border:none;width:100%;height:700px"></iframe>
</div>
</div>
</div>
</div>
</liferay-ui:section>
<liferay-ui:section>
<div style="border:none;width:100%;height:700px">
<liferay-portlet:runtime portletName="<%= PortletKeys.MAPIT %>" queryString='<%= "mapitNamespace=" + renderResponse.getNamespace() %>' />
</div>
</liferay-ui:section>
</liferay-ui:tabs>
</div>
</div>
</div>

21
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_riepilogo.jsp

@ -121,7 +121,7 @@
</div>
</div>
<div class="row">
<div class="col-sm-8 col-md-8">
<div class="col-sm-7 col-md-7">
<div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="fascicolo_title_progetti" >
<div class="col-sm-6 col-md-3">
@ -334,7 +334,7 @@
</liferay-ui:panel>
</div>
</div>
<div class="col-sm-4 col-md-4">
<div class="col-sm-5 col-md-5">
<div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="fascicolo_title_ubicazione" >
<div class="container-fluid">
@ -451,23 +451,6 @@
</div>
</c:if>
</div>
<div class="row">
<div class="col-md-12">
<%
String[] geolocalization = BeanPropertiesUtil.getString(dettPratica, "localizzazioneGeografica","").split(Pattern.quote("|"));
%>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<aui:input name="lat" label="" type="hidden"
value='<%=geolocalization.length>0?geolocalization[0]:StringPool.BLANK %>' />
</div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<aui:input name="long" label="" type="hidden"
value='<%=geolocalization.length>1?geolocalization[1]:StringPool.BLANK %>'/>
</div>
<aui:input type="hidden" name="geoIsEditable" value='<%= false %>' label=""/>
<liferay-portlet:runtime portletName="5_WAR_trefmapitmapportlet" />
</div>
</div>
</div>
</liferay-ui:panel>
</div>

11
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/js/main.js

@ -93,3 +93,14 @@ $('body').on('mouseup', 'label.radio', function(){
if(radio.length)
uncheck_radio_before_click(radio);
})
if($('.cont_maps').length){
$('.cont_maps ul li').click(function(){
var map = mapItMap.getInstance();
setTimeout(function(){
map.updateSize();
if(map.layers.length > 0)
map.layers[0].redraw();
}, 100);
});
}
Caricamento…
Annulla
Salva