Mattia Gosetto
3 anni fa
114 ha cambiato i file con 4189 aggiunte e 1923 eliminazioni
@ -0,0 +1 @@
|
||||
{"ide":{"scriptPaths":[]},"plugins":{"aui":{},"liferay":{},"yui":{}},"libs":["ecma5","browser"]} |
@ -0,0 +1,123 @@
|
||||
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; |
||||
import java.net.URLEncoder; |
||||
import java.util.Date; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
|
||||
import org.apache.commons.codec.digest.DigestUtils; |
||||
import org.apache.commons.lang.StringUtils; |
||||
|
||||
import com.liferay.portal.kernel.exception.PortalException; |
||||
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, boolean readOnly) |
||||
throws UnsupportedEncodingException, PortalException, SystemException { |
||||
|
||||
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, readOnly); |
||||
} |
||||
|
||||
public static String getUrlBo(HttpServletRequest request, DettPratica dettPratica, Comune comune, boolean readOnly) |
||||
throws UnsupportedEncodingException, PortalException, SystemException { |
||||
|
||||
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, readOnly); |
||||
} |
||||
|
||||
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; |
||||
String auth = DigestUtils.sha256Hex(date + sharedSecret + request.getServerName()); |
||||
|
||||
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}}", ""); |
||||
|
||||
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; |
||||
String[] parti = StringUtils.split(url, StringPool.QUESTION); |
||||
if (parti.length > 1) { |
||||
query = parti[1]; |
||||
} |
||||
if (query == null) { |
||||
query = StringPool.BLANK; |
||||
} else if (!query.equals(StringPool.BLANK)) { |
||||
query += StringPool.AMPERSAND; |
||||
} |
||||
query += "date=" + date + "&auth=" + auth; |
||||
url = parti[0] + StringPool.QUESTION + query; |
||||
_log.info(url); |
||||
return url; |
||||
} |
||||
|
||||
private static String urlEncode(String str) { |
||||
String encoded; |
||||
try { |
||||
encoded = URLEncoder.encode(str, StringPool.UTF8); |
||||
} catch (UnsupportedEncodingException e) { |
||||
encoded = str; |
||||
} |
||||
return encoded; |
||||
} |
||||
} |
File diff soppresso perché troppo grande
Load Diff
@ -0,0 +1,133 @@
|
||||
package it.mwg.sismica.bo.portlet; |
||||
|
||||
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.model.Provincia; |
||||
import it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil; |
||||
import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; |
||||
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; |
||||
import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil; |
||||
import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil; |
||||
|
||||
import java.io.IOException; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
import javax.portlet.ActionRequest; |
||||
import javax.portlet.ActionResponse; |
||||
import javax.portlet.PortletException; |
||||
import javax.portlet.ResourceRequest; |
||||
import javax.portlet.ResourceResponse; |
||||
|
||||
import org.apache.commons.lang.StringUtils; |
||||
|
||||
import com.liferay.portal.kernel.exception.PortalException; |
||||
import com.liferay.portal.kernel.exception.SystemException; |
||||
import com.liferay.portal.kernel.json.JSONArray; |
||||
import com.liferay.portal.kernel.json.JSONFactoryUtil; |
||||
import com.liferay.portal.kernel.json.JSONObject; |
||||
import com.liferay.portal.kernel.log.Log; |
||||
import com.liferay.portal.kernel.log.LogFactoryUtil; |
||||
import com.liferay.portal.kernel.util.ParamUtil; |
||||
import com.liferay.portal.kernel.util.StringPool; |
||||
import com.liferay.portal.kernel.util.Validator; |
||||
import com.liferay.portal.service.ServiceContext; |
||||
import com.liferay.portal.service.ServiceContextFactory; |
||||
import com.liferay.util.bridges.mvc.MVCPortlet; |
||||
|
||||
public class RicercaPosizionePortlet extends MVCPortlet { |
||||
private static final Log _log = LogFactoryUtil.getLog(RicercaPosizionePortlet.class); |
||||
|
||||
@SuppressWarnings("serial") |
||||
private static final List<String> campi = new ArrayList<String>() { |
||||
{ |
||||
add("tabs1"); |
||||
add("numeroProgetto"); |
||||
add("provincia"); |
||||
add("comune"); |
||||
add("via"); |
||||
add("lat"); |
||||
add("long"); |
||||
add("raggio"); |
||||
} |
||||
}; |
||||
|
||||
public void ricerca(ActionRequest actionRequest, ActionResponse actionResponse) { |
||||
// PortalUtil.copyRequestParameters(actionRequest, actionResponse);
|
||||
for (String campo : campi) { |
||||
String val = ParamUtil.getString(actionRequest, campo, StringPool.BLANK); |
||||
actionResponse.setRenderParameter(campo, val); |
||||
} |
||||
} |
||||
|
||||
public void localizzaProgetto(ActionRequest actionRequest, ActionResponse actionResponse) |
||||
throws IOException, SystemException { |
||||
String numeroProgetto = ParamUtil.getString(actionRequest, "numeroProgetto"); |
||||
JSONObject object = JSONFactoryUtil.createJSONObject(); |
||||
if (Validator.isNotNull(numeroProgetto)) { |
||||
IntPratica pratica = IntPraticaLocalServiceUtil.findByNumeroProgetto(numeroProgetto); |
||||
if (Validator.isNotNull(pratica)) { |
||||
DettPratica dett = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(pratica |
||||
.getIntPraticaId()); |
||||
if (Validator.isNotNull(dett)) { |
||||
String localizzazione = dett.getLocalizzazioneGeografica(); |
||||
if (Validator.isNotNull(localizzazione)) { |
||||
String[] parti = StringUtils.split(localizzazione, '|'); |
||||
if (parti.length > 1) { |
||||
object.put("lat", Double.valueOf(parti[0])); |
||||
object.put("lng", Double.valueOf(parti[1])); |
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
||||
} |
||||
writeJSON(actionRequest, actionResponse, object); |
||||
} |
||||
|
||||
@Override |
||||
public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) |
||||
throws IOException, PortletException { |
||||
String id = resourceRequest.getResourceID(); |
||||
ServiceContext serviceContext; |
||||
try { |
||||
serviceContext = ServiceContextFactory.getInstance(resourceRequest); |
||||
long companyId = serviceContext.getCompanyId(); |
||||
JSONArray array = JSONFactoryUtil.createJSONArray(); |
||||
switch (id) { |
||||
case "province": |
||||
for (String codice : TerritorioLocalServiceUtil.getActiveProvince()) { |
||||
JSONObject object = JSONFactoryUtil.createJSONObject(); |
||||
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(companyId, codice); |
||||
object.put("id", provincia.getCodiceProvincia()); |
||||
object.put("nome", provincia.getProvincia()); |
||||
|
||||
array.put(object); |
||||
} |
||||
writeJSON(resourceRequest, resourceResponse, array); |
||||
break; |
||||
case "comuni": |
||||
String provinciaId = ParamUtil.getString(resourceRequest, "provinciaId"); |
||||
if (Validator.isNotNull(provinciaId)) { |
||||
List<Long> comuni = TerritorioLocalServiceUtil |
||||
.getActiveComuniByCodiceProvincia(provinciaId); |
||||
for (long comuneId : comuni) { |
||||
JSONObject object = JSONFactoryUtil.createJSONObject(); |
||||
Comune comune = ComuneLocalServiceUtil.getComune(comuneId); |
||||
object.put("id", comune.getComuneId()); |
||||
object.put("nome", comune.getDenominazione()); |
||||
|
||||
array.put(object); |
||||
} |
||||
} |
||||
writeJSON(resourceRequest, resourceResponse, array); |
||||
break; |
||||
default: |
||||
super.serveResource(resourceRequest, resourceResponse); |
||||
} |
||||
} catch (PortalException | SystemException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
} |
||||
} |
@ -1,2 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"/> |
||||
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> |
||||
</web-app> |
@ -0,0 +1,551 @@
|
||||
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> |
||||
<%@include file="/html/init.jsp" %> |
||||
<%@page import="com.liferay.portal.kernel.util.HtmlUtil"%> |
||||
<%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%> |
||||
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%> |
||||
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%> |
||||
<%@page import="it.tref.liferay.portos.bo.util.PraticaUtil"%> |
||||
<%@page import="java.text.NumberFormat"%> |
||||
<%@page import="java.text.DecimalFormat"%> |
||||
<%@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); |
||||
String codiceProvincia = ParamUtil.getString(request, "provincia", StringPool.BLANK); |
||||
String idComune = ParamUtil.getString(request, "comune", StringPool.BLANK); |
||||
String via = ParamUtil.getString(request, "via", StringPool.BLANK); |
||||
String lat = ParamUtil.getString(request, "lat", StringPool.BLANK); |
||||
String lng = ParamUtil.getString(request, "long", StringPool.BLANK); |
||||
String raggio = ParamUtil.getString(request, "raggio", StringPool.BLANK); |
||||
|
||||
boolean targetBlank = ParamUtil.getBoolean(request, "blank", true); |
||||
String target = (targetBlank ? "_blank" : StringPool.BLANK); |
||||
|
||||
PortletURL iteratorURL = liferayPortletResponse.createRenderURL(); |
||||
if (Validator.isNotNull(numeroProgetto)) { |
||||
iteratorURL.setParameter("numeroProgetto", numeroProgetto); |
||||
} |
||||
if (Validator.isNotNull(codiceProvincia)) { |
||||
iteratorURL.setParameter("provincia", codiceProvincia); |
||||
} |
||||
if (Validator.isNotNull(idComune)) { |
||||
iteratorURL.setParameter("comune", idComune); |
||||
} |
||||
if (Validator.isNotNull(via)) { |
||||
iteratorURL.setParameter("via", via); |
||||
} |
||||
if (Validator.isNotNull(lat)) { |
||||
iteratorURL.setParameter("lat", lat); |
||||
} |
||||
if (Validator.isNotNull(lng)) { |
||||
iteratorURL.setParameter("long", lng); |
||||
} |
||||
if (Validator.isNotNull(raggio)) { |
||||
iteratorURL.setParameter("raggio", raggio); |
||||
} |
||||
iteratorURL.setParameter("blank", String.valueOf(targetBlank)); |
||||
|
||||
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" /> |
||||
<div class="container-fluid"> |
||||
<div class="row"> |
||||
<div class="module-group"> |
||||
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="ricerca-posizione"> |
||||
<div class="container-fluid"> |
||||
<div class="row"> |
||||
<div class="col-xs-6"> |
||||
<aui:form method="POST" name="ricerca" action="<%= ricercaURL %>"> |
||||
<liferay-ui:tabs names="ricerca-indirizzo,ricerca-progetto" refresh="false"> |
||||
<liferay-ui:section> |
||||
<br/> |
||||
<div class="row"> |
||||
<div class="col-xs-12 col-md-6"> |
||||
<aui:select name="provincia" label="dp-dc-prov" showEmptyOption="true"> |
||||
</aui:select> |
||||
</div> |
||||
<div class="col-xs-12 col-md-6"> |
||||
<aui:select name="comune" label="dp-dc-comune" showEmptyOption="true"> |
||||
</aui:select> |
||||
</div> |
||||
</div> |
||||
<div class="row"> |
||||
<div class="col-xs-12"> |
||||
<aui:input name="via" label="dp-dc-via" /> |
||||
</div> |
||||
</div> |
||||
<div class="row"> |
||||
<div class="col-xs-12"> |
||||
<aui:button name="localizzaBtn" cssClass="btn btn-primary pull-right" onClick="localize(true)" value="Localizza"/> |
||||
</div> |
||||
</div> |
||||
</liferay-ui:section> |
||||
<liferay-ui:section> |
||||
<br/> |
||||
<div class="row"> |
||||
<div class="col-xs-12"> |
||||
<aui:input name="numeroProgetto" label="n-progetto" /> |
||||
</div> |
||||
</div> |
||||
<div class="row"> |
||||
<div class="col-xs-12"> |
||||
<aui:button name="localizzaProgettoBtn" cssClass="btn btn-primary pull-right" onClick="localizzaProgetto()" value="Localizza"/> |
||||
</div> |
||||
</div> |
||||
</liferay-ui:section> |
||||
</liferay-ui:tabs> |
||||
<div class="row"> |
||||
<div class="col-xs-12 col-md-6"> |
||||
<aui:input name="lat" label="dp-lat" required="true" /> |
||||
</div> |
||||
<div class="col-xs-12 col-md-6"> |
||||
<aui:input name="long" label="dp-long" required="true" /> |
||||
</div> |
||||
</div> |
||||
<div class="row"> |
||||
<div class="col-xs-12 col-md-6"> |
||||
<aui:select name="raggio" label="dp-raggio"> |
||||
<% for (int i = 0; i < raggi.length; i++) { %> |
||||
<aui:option value="<%= raggi[i] %>"><%= fmt.format(raggi[i] / 1000.0) %> Km</aui:option> |
||||
<% } %> |
||||
</aui:select> |
||||
</div> |
||||
</div> |
||||
<aui:button type="submit" value="search" /> |
||||
</aui:form> |
||||
</div> |
||||
<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> |
||||
</liferay-ui:panel> |
||||
</div> |
||||
</div> |
||||
<div class="row"> |
||||
<liferay-ui:search-container emptyResultsMessage="no-entries-were-found" iteratorURL="<%= iteratorURL %>" > |
||||
<% |
||||
int indice = searchContainer.getStart(); |
||||
double dlat = 0; |
||||
double dlng = 0; |
||||
List<IntPratica> pratiche; |
||||
try { |
||||
dlat = Double.valueOf(lat); |
||||
dlng = Double.valueOf(lng); |
||||
int iraggio = Integer.valueOf(raggio); |
||||
pratiche = IntPraticaLocalServiceUtil.findByPosizione(dlat, dlng, iraggio, indice, |
||||
searchContainer.getEnd()); |
||||
searchContainer.setTotal(IntPraticaLocalServiceUtil.countByPosizione(dlat, dlng, iraggio)); |
||||
showNotes = pratiche.size() > 0; |
||||
} catch (Exception e) { |
||||
pratiche = new ArrayList<IntPratica>(); |
||||
searchContainer.setTotal(0); |
||||
} |
||||
%> |
||||
<liferay-ui:search-container-results results="<%= pratiche %>" /> |
||||
<liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.IntPratica" modelVar="pratica"> |
||||
<% |
||||
long intPraticaId = pratica.getIntPraticaId(); |
||||
DettPratica dettaglio = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica( |
||||
intPraticaId); |
||||
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(pratica.getTerritorioId()); |
||||
Comune comune = ComuneLocalServiceUtil.getComune(territorio.getComuneId()); |
||||
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(themeDisplay.getCompanyId(), |
||||
comune.getCodiceProvincia()); |
||||
|
||||
Soggetto titolare = null; |
||||
String committenti = StringPool.BLANK; |
||||
String esito = StringPool.BLANK; |
||||
|
||||
if (Validator.isNotNull(dettaglio)) { |
||||
List<Soggetto> titolari = SoggettoLocalServiceUtil.getValidByIntPratica_CodiceFiscale( |
||||
intPraticaId, dettaglio.getCodiceFiscaleDelegatoCommittente()); |
||||
if (!titolari.isEmpty()) { |
||||
titolare = titolari.get(0); |
||||
} |
||||
StringBuilder builder = new StringBuilder(); |
||||
List<Soggetto> soggetti = SoggettoLocalServiceUtil |
||||
.findByIntPratica_TipologiaSoggetto(intPraticaId, TipoSoggettoUtil.COMMITTENTE); |
||||
for (Soggetto soggetto : soggetti) { |
||||
if (builder.length() > 0) { |
||||
builder.append("<hr/>"); |
||||
} |
||||
builder.append(soggetto.getTitle()) |
||||
.append("<br/>") |
||||
.append(soggetto.getCodiceFiscale()); |
||||
} |
||||
committenti = builder.toString(); |
||||
esito = LanguageUtil.get(pageContext, PraticaUtil.getStatoPraticaLabel( |
||||
pratica.getStatoPratica(), intPraticaId)); |
||||
} |
||||
List<Avviso> avvisi = AvvisoLocalServiceUtil.findByIntPratica(intPraticaId, |
||||
QueryUtil.ALL_POS, |
||||
QueryUtil.ALL_POS, |
||||
OrderByComparatorFactoryUtil.create("portos_bo_Avviso", "createDate", false)); |
||||
int variantiCount = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica( |
||||
intPraticaId, Arrays.asList(TipoIntegrazioneUtil.VARIANTE)); |
||||
int integrazioniCount = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica( |
||||
intPraticaId, Arrays.asList(TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE)); |
||||
%> |
||||
|
||||
<liferay-portlet:renderURL var="viewURL" > |
||||
<liferay-portlet:param name="mvcPath" value="/html/fascicolo/view_fascicolo.jsp"/> |
||||
<liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" /> |
||||
<liferay-portlet:param name="backURL" value="<%= iteratorURL.toString() %>" /> |
||||
</liferay-portlet:renderURL> |
||||
|
||||
<liferay-ui:search-container-column-text name="#" cssClass="text-center"> |
||||
<%= ++indice %> |
||||
</liferay-ui:search-container-column-text> |
||||
|
||||
<liferay-ui:search-container-column-text name="distanza" title="distanza-tooltip" cssClass="text-center"> |
||||
<%= numeroProgetto.equals(pratica.getNumeroProgetto()) ? "Riferimento<br/>ricerca" : fmt.format(pratica.getDistanzaOrtodromica()) %> |
||||
</liferay-ui:search-container-column-text> |
||||
|
||||
<liferay-ui:search-container-column-text name="n-progetto" href="<%= viewURL %>" target="<%= target %>" cssClass="text-nowrap"> |
||||
<%= pratica.getTitle(locale, true) %> |
||||
</liferay-ui:search-container-column-text> |
||||
|
||||
<liferay-ui:search-container-column-text name="titolare-digitale" href="<%= viewURL %>" target="<%= target %>" cssClass="text-nowrap"> |
||||
<c:if test="<%= Validator.isNotNull(titolare) %>"> |
||||
<%= titolare.getTitle() %><br/><%= titolare.getCodiceFiscale() %> |
||||
</c:if> |
||||
</liferay-ui:search-container-column-text> |
||||
|
||||
<liferay-ui:search-container-column-text name="committenti" href="<%= viewURL %>" target="<%= target %>"> |
||||
<%= committenti %> |
||||
</liferay-ui:search-container-column-text> |
||||
|
||||
<liferay-ui:search-container-column-text name="esito" href="<%= viewURL %>" target="<%= target %>" cssClass="text-nowrap text-center middle-aligned"> |
||||
<strong><%= LanguageUtil.get(pageContext, PraticaUtil.getStatoPraticaLabel(pratica.getStatoPratica(), intPraticaId)) %></strong> |
||||
<span class="text-center display-block" style="margin-top:5px"> |
||||
<% |
||||
if (!avvisi.isEmpty()) { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append("<ul class='avvisi-tooltip'>"); |
||||
for (Avviso avviso : avvisi) { |
||||
sb.append("<li class='avviso-tooltip'>"); |
||||
sb.append(LanguageUtil.get(pageContext, avviso.translateTipoDocumento())); |
||||
sb.append("</li>"); |
||||
} |
||||
sb.append("</ul>"); |
||||
%> |
||||
<liferay-portlet:renderURL var="fascicoloAvvisiURL"> |
||||
<liferay-portlet:param name="mvcPath" value="/html/fascicolo/view_fascicolo.jsp" /> |
||||
<liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>" /> |
||||
</liferay-portlet:renderURL> |
||||
<a class="btn status-icon tooltip-info btn-action" |
||||
title="<%= HtmlUtil.escapeAttribute(sb.toString()) %>" |
||||
href="<%= fascicoloAvvisiURL.toString() + "#_" + PortletKeys.FASCICOLO |
||||
+ "_tab=_" + PortletKeys.FASCICOLO + "_page_avvisi" %>" target="<%= target %>"> |
||||
<i class="fa fa-envelope relative"> |
||||
<span class="fa-hover fa-top-right txt-bold"><%= avvisi.size() %></span> |
||||
</i> |
||||
</a> |
||||
<% |
||||
} |
||||
%> |
||||
<c:if test="<%= variantiCount > 0 %>"> |
||||
<span class="btn status-icon tooltip-info btn-action" title="Varianti Presentate"> |
||||
<span class="relative txt-bold status-icon-text"> |
||||
V |
||||
<span class="sup top-right txt-bold"><%= variantiCount %></span> |
||||
</span> |
||||
</span> |
||||
</c:if> |
||||
<c:if test="<%= integrazioniCount > 0 %>"> |
||||
<span class="btn status-icon tooltip-info btn-action txt-bold" title="Integrazioni Presentate"> |
||||
<span class="relative txt-bold status-icon-text"> |
||||
I |
||||
<span class="sup top-right txt-bold"><%= integrazioniCount %></span> |
||||
</span> |
||||
</span> |
||||
</c:if> |
||||
<c:if test="<%= pratica.isFineLavoriParziale() || pratica.isFineLavoriTotale() %>"> |
||||
<c:if test="<%= !pratica.isFineLavoriTotale()%>"> |
||||
<span class="btn status-icon tooltip-info btn-action" title="Fine Lavori Parziale presente"> |
||||
<i class="fa fa-gavel relative"> |
||||
<span class="fa-hover fa-top-right txt-orange txt-bold">P</span> |
||||
</i> |
||||
</span> |
||||
</c:if> |
||||
<c:if test="<%= pratica.isFineLavoriTotale()%>"> |
||||
<span class="btn status-icon tooltip-info btn-action" title="Fine Lavori Totale presente"> |
||||
<i class="fa fa-gavel relative"> |
||||
<span class="fa-hover fa-top-right txt-green txt-bold">T</span> |
||||
</i> |
||||
</span> |
||||
</c:if> |
||||
</c:if> |
||||
<c:if test="<%= pratica.isCollaudoParziale() || pratica.isCollaudoTotale() %>"> |
||||
<c:if test="<%= !pratica.isCollaudoTotale() %>"> |
||||
<span class="btn status-icon tooltip-info btn-action" title="Collaudo Parziale presente"> |
||||
<i class="fa fa-briefcase relative"> |
||||
<span class="fa-hover fa-top-right txt-orange txt-bold">P</span> |
||||
</i> |
||||
</span> |
||||
</c:if> |
||||
<c:if test="<%= pratica.isCollaudoTotale() %>"> |
||||
<span class="btn status-icon tooltip-info btn-action" title="Collaudo Totale presente"> |
||||
<i class="fa fa-briefcase relative"> |
||||
<span class="fa-hover fa-top-right txt-green txt-bold">T</span> |
||||
</i> |
||||
</span> |
||||
</c:if> |
||||
</c:if> |
||||
</span> |
||||
</liferay-ui:search-container-column-text> |
||||
|
||||
<liferay-ui:search-container-column-text name="col-desc-interv" href="<%= viewURL %>" target="<%= target %>"> |
||||
Territorio: <strong><%= comune.getDenominazione() %> |
||||
<%= (dettaglio == null || dettaglio.getLocalita().isEmpty()) ? |
||||
"" : |
||||
"(Loc. " + dettaglio.getLocalita() + ")" |
||||
%> - <%= provincia.getProvincia() %></strong><br/> |
||||
Localizzazione: <strong><%= dettaglio == null ? "" : dettaglio.getVia() %></strong><br/> |
||||
<strong><%= LanguageUtil.get(pageContext, "tipo_procedura_" + pratica.getTipoProcedura()) %></strong><br/><br/> |
||||
<%= dettaglio == null ? "" : dettaglio.getDescLongIntervento() %> |
||||
</liferay-ui:search-container-column-text> |
||||
</liferay-ui:search-container-row> |
||||
<liferay-ui:search-iterator paginate="true" /> |
||||
</liferay-ui:search-container> |
||||
<c:if test="<%= showNotes %>"> |
||||
<div class="col-xs-12"> |
||||
<br/> |
||||
<small> |
||||
Note:<br/> |
||||
<%= LanguageUtil.get(pageContext, "distanza-tooltip") %> |
||||
</small> |
||||
</div> |
||||
</c:if> |
||||
</div> |
||||
</div> |
||||
<script> |
||||
var <portlet:namespace/>comuneSelezionato = ''; |
||||
|
||||
Liferay.on('mapIt-ready',function(event) { |
||||
AUI().one('#_<%= PortletKeys.MAPIT %>_container_btn .bloccamap').set('disabled', false).removeClass('disabled'); |
||||
}); |
||||
|
||||
function localize(showAlert) { |
||||
AUI().use('aui-io-request', function(A) { |
||||
|
||||
var indirizzo = AUI().one('#<portlet:namespace/>via').val().trim() |
||||
var comune = AUI().one('#<portlet:namespace/>comune option:selected'); |
||||
if (undefined == comune) { |
||||
comune = ''; |
||||
} else { |
||||
comune = comune.text().trim(); |
||||
} |
||||
var provincia = AUI().one('#<portlet:namespace/>provincia option:selected'); |
||||
if (undefined == provincia) { |
||||
provincia = ''; |
||||
} else { |
||||
provincia = provincia.text().trim(); |
||||
} |
||||
|
||||
var localization = [indirizzo, comune, provincia]; |
||||
|
||||
var url = 'https://nominatim.openstreetmap.org/search?format=json&addressdetails=0&q=' |
||||
+ encodeURIComponent(localization.join(' ')); |
||||
|
||||
A.io.request(url, { |
||||
dataType: 'json', |
||||
on: { |
||||
success: function() { |
||||
var response = this.get('responseData'); |
||||
if (response.length == 0) { |
||||
if (showAlert) { |
||||
alert('Nessun risultato per i dati immessi'); |
||||
} |
||||
} else if (response && response[0]) { |
||||
Liferay.fire( |
||||
'geolocation-ready', |
||||
{ |
||||
latitude: response[0].lat, |
||||
longitude : response[0].lon, |
||||
fullAddress : indirizzo !== '' |
||||
} |
||||
); |
||||
} |
||||
}, |
||||
} |
||||
}); |
||||
}); |
||||
} |
||||
|
||||
function localizzaProgetto() { |
||||
AUI().use('aui-io-request', function(A) { |
||||
var numeroProgetto = AUI().one('#<portlet:namespace/>numeroProgetto').val().trim(); |
||||
A.io.request('<%= localizzaProgettoURL %>', { |
||||
dataType: 'json', |
||||
data: { |
||||
<portlet:namespace/>numeroProgetto: numeroProgetto, |
||||
}, |
||||
on: { |
||||
success: function() { |
||||
var data = this.get('responseData'); |
||||
console.log(data); |
||||
if ((undefined == data.lat) || (undefined == data.lng)) { |
||||
alert('Nessun risultato per i dati immessi'); |
||||
} else { |
||||
AUI().one('#<portlet:namespace/>lat').val(data.lat); |
||||
AUI().one('#<portlet:namespace/>long').val(data.lng); |
||||
} |
||||
}, |
||||
} |
||||
}); |
||||
}); |
||||
} |
||||
|
||||
YUI().use( |
||||
'aui-tooltip', |
||||
function(Y) { |
||||
new Y.TooltipDelegate({ |
||||
trigger: '.tooltip-info', |
||||
position: 'top', |
||||
cssClass: 'tooltip-help', |
||||
html: true, |
||||
opacity: 1, |
||||
}); |
||||
} |
||||
); |
||||
</script> |
||||
<liferay-portlet:resourceURL id="province" var="getProvinceURL" /> |
||||
<liferay-portlet:resourceURL id="comuni" var="getComuniURL" /> |
||||
<aui:script use="aui-io-request,liferay-dynamic-select"> |
||||
var getProvince = function(callback) { |
||||
A.io.request( |
||||
'<%= getProvinceURL %>', |
||||
{ |
||||
dataType: 'json', |
||||
on: { |
||||
success: function() { |
||||
var data = this.get('responseData'); |
||||
<portlet:namespace/>province = {}; |
||||
for (var i = 0; i < data.length; i++) { |
||||
<portlet:namespace/>province[data[i].nome.replaceAll(' ', '-').toLowerCase()] = data[i].id; |
||||
} |
||||
callback(data); |
||||
} |
||||
} |
||||
} |
||||
); |
||||
}; |
||||
|
||||
var getComuni = function(callback, provinciaId) { |
||||
A.io.request( |
||||
'<%= getComuniURL %>', |
||||
{ |
||||
dataType: 'json', |
||||
data: { |
||||
<portlet:namespace />provinciaId: provinciaId |
||||
}, |
||||
on: { |
||||
success: function() { |
||||
var data = this.get('responseData'); |
||||
callback(data); |
||||
if ('' !== <portlet:namespace/>comuneSelezionato) { |
||||
for (var i = 0; i < data.length; i++) { |
||||
if (data[i].nome.replaceAll(' ', '-').toLowerCase() === <portlet:namespace/>comuneSelezionato) { |
||||
A.one('#<portlet:namespace/>comune').set('value', data[i].id); |
||||
} |
||||
} |
||||
<portlet:namespace/>comuneSelezionato = ''; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
); |
||||
}; |
||||
new Liferay.DynamicSelect([ |
||||
{ |
||||
select: '<portlet:namespace />provincia', |
||||
selectData: getProvince, |
||||
selectDesc: 'nome', |
||||
selectId: 'id', |
||||
selectSort: true, |
||||
selectVal: '<%= codiceProvincia %>', |
||||
}, |
||||
{ |
||||
select: '<portlet:namespace />comune', |
||||
selectData: getComuni, |
||||
selectDesc: 'nome', |
||||
selectId: 'id', |
||||
selectSort: true, |
||||
selectDisableOnEmpty: true, |
||||
selectVal: '<%= idComune %>', |
||||
}, |
||||
]); |
||||
</aui:script> |
@ -1,103 +1,13 @@
|
||||
/* |
||||
var versionamento = { |
||||
changes : [], |
||||
init : function(idPratica, lastVersion, currentVersion) { |
||||
var scope = this; |
||||
this.loadJsonVersion(idPratica, lastVersion, true); |
||||
if (currentVersion > 0) { |
||||
this.loadJsonVersion(idPratica, currentVersion, false); |
||||
setTimeout(function() { |
||||
scope.getChanges(idPratica, currentVersion); |
||||
}, 300) |
||||
} else { |
||||
$('#_1_WAR_portosboportlet_version_number .version_body').html( |
||||
"<p class=\"text-center version_item\">Nessuna Versione precedente all'attuale</p>") |
||||
} |
||||
}, |
||||
sliderChange : function(idPratica, currentVersion) { |
||||
var scope = this; |
||||
this.loadJsonVersion(idPratica, currentVersion, false); |
||||
setTimeout(function() { |
||||
scope.getChanges(idPratica, currentVersion); |
||||
}, 300) |
||||
}, |
||||
loadJsonVersion : function(idPratica, versionNumber, last) { |
||||
var scope = this; |
||||
Liferay.Service('/portos-bo-portlet.dettpratica/get-json-version', { |
||||
intPraticaId : idPratica, |
||||
version : versionNumber |
||||
}, function(obj) { |
||||
var item = last ? "_1_WAR_portosboportlet_version_last" : "_1_WAR_portosboportlet_version_number"; |
||||
scope.updateHTML(JSON.parse(obj), item, last ? false : versionNumber); |
||||
}); |
||||
}, |
||||
getChanges : function(idPratica, versionNumber) { |
||||
var scope = this; |
||||
Liferay.Service('/portos-bo-portlet.dettpratica/call-for-changes', |
||||
{ |
||||
intPraticaId : idPratica, |
||||
version : versionNumber |
||||
}, |
||||
function(obj) { |
||||
var arr = JSON.parse(obj); |
||||
$("#_1_WAR_portosboportlet_version_number .version_item").removeClass("background-red") |
||||
$("#_1_WAR_portosboportlet_version_last .version_item").removeClass("background-green") |
||||
for (index in arr) { |
||||
var key = arr[index]; |
||||
var left = $("#_1_WAR_portosboportlet_version_number .item_" + key), right = $("#_1_WAR_portosboportlet_version_last .item_" |
||||
+ key); |
||||
left.addClass("background-red") |
||||
right.addClass("background-green") |
||||
var heights = [ left, right ].map(function(item) { |
||||
return $(item).outerHeight(); |
||||
}); |
||||
left.css('height', Math.max.apply(null, heights)); |
||||
right.css('height', Math.max.apply(null, heights)); |
||||
} |
||||
} |
||||
); |
||||
}, |
||||
updateHTML : function(obj, containerId, versionNumber) { |
||||
var scope = this; |
||||
var version_container = $('#' + containerId); |
||||
if (versionNumber) { |
||||
version_container.find(".number").html(versionNumber); |
||||
} |
||||
for (item in obj) { |
||||
var item_value = obj[item].replace(/</g, "<").replace(/>/g, ">").replace(/"/g, "\""); |
||||
version_container.find('.item_' + item + " .item_value").html("<strong>" + item_value + "</strong>") |
||||
} |
||||
} |
||||
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); |
||||
}); |
||||
} |
||||
|
||||
var sliderVersion = { |
||||
init : function(val, idPratica) { |
||||
var initialValue = val; |
||||
var min = 1; |
||||
var maxValue = (val - 1) > 0 ? val - 1 : 0; |
||||
versionamento.init(idPratica, val, maxValue); |
||||
$("#label-slider").text(maxValue); |
||||
if (maxValue <= 1) { |
||||
$("#label-slider").css("margin-left", '0'); |
||||
} |
||||
$(function() { |
||||
$("#slider").slider({ |
||||
value : val, |
||||
min : 1, |
||||
max : maxValue, |
||||
step : 1, |
||||
slide : function(event, ui) { |
||||
$("#label-slider").text(ui.value); |
||||
if (maxValue == 0) { |
||||
$("#label-slider").css("margin-left", '0'); |
||||
} else { |
||||
$("#label-slider").css("margin-left", (ui.value - min) / (maxValue - min) * 100 + '%'); |
||||
} |
||||
$("#label-slider").css("left", "-15px"); |
||||
versionamento.sliderChange(idPratica, ui.value); |
||||
} |
||||
}); |
||||
}); |
||||
}, |
||||
} |
||||
*/ |
||||
|
||||
|
||||
|
@ -0,0 +1 @@
|
||||
{"ide":{"scriptPaths":[]},"plugins":{"aui":{},"liferay":{},"yui":{}},"libs":["ecma5","browser"]} |
File binario non mostrato.
File binario non mostrato.
File binario non mostrato.
File binario non mostrato.
File binario non mostrato.
File binario non mostrato.
@ -1,572 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
||||
<taglib xmlns="http://java.sun.com/xml/ns/javaee" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd" |
||||
version="2.1"> |
||||
|
||||
<description>JSTL 1.2 core library</description> |
||||
<display-name>JSTL core</display-name> |
||||
<tlib-version>1.2</tlib-version> |
||||
<short-name>c</short-name> |
||||
<uri>http://java.sun.com/jsp/jstl/core</uri> |
||||
|
||||
<validator> |
||||
<description> |
||||
Provides core validation features for JSTL tags. |
||||
</description> |
||||
<validator-class> |
||||
org.apache.taglibs.standard.tlv.JstlCoreTLV |
||||
</validator-class> |
||||
</validator> |
||||
|
||||
<tag> |
||||
<description> |
||||
Catches any Throwable that occurs in its body and optionally |
||||
exposes it. |
||||
</description> |
||||
<name>catch</name> |
||||
<tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class> |
||||
<body-content>JSP</body-content> |
||||
<attribute> |
||||
<description> |
||||
Name of the exported scoped variable for the |
||||
exception thrown from a nested action. The type of the |
||||
scoped variable is the type of the exception thrown. |
||||
</description> |
||||
<name>var</name> |
||||
<required>false</required> |
||||
<rtexprvalue>false</rtexprvalue> |
||||
</attribute> |
||||
</tag> |
||||
|
||||
<tag> |
||||
<description> |
||||
Simple conditional tag that establishes a context for |
||||
mutually exclusive conditional operations, marked by |
||||
<when> and <otherwise> |
||||
</description> |
||||
<name>choose</name> |
||||
<tag-class>com.liferay.taglib.core.ChooseTag</tag-class> |
||||
<body-content>JSP</body-content> |
||||
</tag> |
||||
|
||||
<tag> |
||||
<description> |
||||
Simple conditional tag, which evalutes its body if the |
||||
supplied condition is true and optionally exposes a Boolean |
||||
scripting variable representing the evaluation of this condition |
||||
</description> |
||||
<name>if</name> |
||||
<tag-class>com.liferay.taglib.core.IfTag</tag-class> |
||||
<body-content>JSP</body-content> |
||||
<attribute> |
||||
<description> |
||||
The test condition that determines whether or |
||||
not the body content should be processed. |
||||
</description> |
||||
<name>test</name> |
||||
<required>true</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
<type>boolean</type> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Name of the exported scoped variable for the |
||||
resulting value of the test condition. The type |
||||
of the scoped variable is Boolean. |
||||
</description> |
||||
<name>var</name> |
||||
<required>false</required> |
||||
<rtexprvalue>false</rtexprvalue> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Scope for var. |
||||
</description> |
||||
<name>scope</name> |
||||
<required>false</required> |
||||
<rtexprvalue>false</rtexprvalue> |
||||
</attribute> |
||||
</tag> |
||||
|
||||
<tag> |
||||
<description> |
||||
Retrieves an absolute or relative URL and exposes its contents |
||||
to either the page, a String in 'var', or a Reader in 'varReader'. |
||||
</description> |
||||
<name>import</name> |
||||
<tag-class>org.apache.taglibs.standard.tag.rt.core.ImportTag</tag-class> |
||||
<tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class> |
||||
<body-content>JSP</body-content> |
||||
<attribute> |
||||
<description> |
||||
The URL of the resource to import. |
||||
</description> |
||||
<name>url</name> |
||||
<required>true</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Name of the exported scoped variable for the |
||||
resource's content. The type of the scoped |
||||
variable is String. |
||||
</description> |
||||
<name>var</name> |
||||
<required>false</required> |
||||
<rtexprvalue>false</rtexprvalue> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Scope for var. |
||||
</description> |
||||
<name>scope</name> |
||||
<required>false</required> |
||||
<rtexprvalue>false</rtexprvalue> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Name of the exported scoped variable for the |
||||
resource's content. The type of the scoped |
||||
variable is Reader. |
||||
</description> |
||||
<name>varReader</name> |
||||
<required>false</required> |
||||
<rtexprvalue>false</rtexprvalue> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Name of the context when accessing a relative |
||||
URL resource that belongs to a foreign |
||||
context. |
||||
</description> |
||||
<name>context</name> |
||||
<required>false</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Character encoding of the content at the input |
||||
resource. |
||||
</description> |
||||
<name>charEncoding</name> |
||||
<required>false</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
</attribute> |
||||
</tag> |
||||
|
||||
<tag> |
||||
<description> |
||||
The basic iteration tag, accepting many different |
||||
collection types and supporting subsetting and other |
||||
functionality |
||||
</description> |
||||
<name>forEach</name> |
||||
<tag-class>org.apache.taglibs.standard.tag.rt.core.ForEachTag</tag-class> |
||||
<tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class> |
||||
<body-content>JSP</body-content> |
||||
<attribute> |
||||
<description> |
||||
Collection of items to iterate over. |
||||
</description> |
||||
<name>items</name> |
||||
<required>false</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
<type>java.lang.Object</type> |
||||
<deferred-value> |
||||
<type>java.lang.Object</type> |
||||
</deferred-value> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
If items specified: |
||||
Iteration begins at the item located at the |
||||
specified index. First item of the collection has |
||||
index 0. |
||||
If items not specified: |
||||
Iteration begins with index set at the value |
||||
specified. |
||||
</description> |
||||
<name>begin</name> |
||||
<required>false</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
<type>int</type> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
If items specified: |
||||
Iteration ends at the item located at the |
||||
specified index (inclusive). |
||||
If items not specified: |
||||
Iteration ends when index reaches the value |
||||
specified. |
||||
</description> |
||||
<name>end</name> |
||||
<required>false</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
<type>int</type> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Iteration will only process every step items of |
||||
the collection, starting with the first one. |
||||
</description> |
||||
<name>step</name> |
||||
<required>false</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
<type>int</type> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Name of the exported scoped variable for the |
||||
current item of the iteration. This scoped |
||||
variable has nested visibility. Its type depends |
||||
on the object of the underlying collection. |
||||
</description> |
||||
<name>var</name> |
||||
<required>false</required> |
||||
<rtexprvalue>false</rtexprvalue> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Name of the exported scoped variable for the |
||||
status of the iteration. Object exported is of type |
||||
javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested |
||||
visibility. |
||||
</description> |
||||
<name>varStatus</name> |
||||
<required>false</required> |
||||
<rtexprvalue>false</rtexprvalue> |
||||
</attribute> |
||||
</tag> |
||||
|
||||
<tag> |
||||
<description> |
||||
Iterates over tokens, separated by the supplied delimeters |
||||
</description> |
||||
<name>forTokens</name> |
||||
<tag-class>org.apache.taglibs.standard.tag.rt.core.ForTokensTag</tag-class> |
||||
<body-content>JSP</body-content> |
||||
<attribute> |
||||
<description> |
||||
String of tokens to iterate over. |
||||
</description> |
||||
<name>items</name> |
||||
<required>true</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
<type>java.lang.String</type> |
||||
<deferred-value> |
||||
<type>java.lang.String</type> |
||||
</deferred-value> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
The set of delimiters (the characters that |
||||
separate the tokens in the string). |
||||
</description> |
||||
<name>delims</name> |
||||
<required>true</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
<type>java.lang.String</type> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Iteration begins at the token located at the |
||||
specified index. First token has index 0. |
||||
</description> |
||||
<name>begin</name> |
||||
<required>false</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
<type>int</type> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Iteration ends at the token located at the |
||||
specified index (inclusive). |
||||
</description> |
||||
<name>end</name> |
||||
<required>false</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
<type>int</type> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Iteration will only process every step tokens |
||||
of the string, starting with the first one. |
||||
</description> |
||||
<name>step</name> |
||||
<required>false</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
<type>int</type> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Name of the exported scoped variable for the |
||||
current item of the iteration. This scoped |
||||
variable has nested visibility. |
||||
</description> |
||||
<name>var</name> |
||||
<required>false</required> |
||||
<rtexprvalue>false</rtexprvalue> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Name of the exported scoped variable for the |
||||
status of the iteration. Object exported is of |
||||
type |
||||
javax.servlet.jsp.jstl.core.LoopTag |
||||
Status. This scoped variable has nested |
||||
visibility. |
||||
</description> |
||||
<name>varStatus</name> |
||||
<required>false</required> |
||||
<rtexprvalue>false</rtexprvalue> |
||||
</attribute> |
||||
</tag> |
||||
|
||||
<tag> |
||||
<description> |
||||
Like <%= ... >, but for expressions. |
||||
</description> |
||||
<name>out</name> |
||||
<tag-class>org.apache.taglibs.standard.tag.rt.core.OutTag</tag-class> |
||||
<body-content>JSP</body-content> |
||||
<attribute> |
||||
<description> |
||||
Expression to be evaluated. |
||||
</description> |
||||
<name>value</name> |
||||
<required>true</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Default value if the resulting value is null. |
||||
</description> |
||||
<name>default</name> |
||||
<required>false</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Determines whether characters <,>,&,'," in the |
||||
resulting string should be converted to their |
||||
corresponding character entity codes. Default value is |
||||
true. |
||||
</description> |
||||
<name>escapeXml</name> |
||||
<required>false</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
</attribute> |
||||
</tag> |
||||
|
||||
|
||||
<tag> |
||||
<description> |
||||
Subtag of <choose> that follows <when> tags |
||||
and runs only if all of the prior conditions evaluated to |
||||
'false' |
||||
</description> |
||||
<name>otherwise</name> |
||||
<tag-class>com.liferay.taglib.core.OtherwiseTag</tag-class> |
||||
<body-content>JSP</body-content> |
||||
</tag> |
||||
|
||||
<tag> |
||||
<description> |
||||
Adds a parameter to a containing 'import' tag's URL. |
||||
</description> |
||||
<name>param</name> |
||||
<tag-class>org.apache.taglibs.standard.tag.rt.core.ParamTag</tag-class> |
||||
<body-content>JSP</body-content> |
||||
<attribute> |
||||
<description> |
||||
Name of the query string parameter. |
||||
</description> |
||||
<name>name</name> |
||||
<required>true</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Value of the parameter. |
||||
</description> |
||||
<name>value</name> |
||||
<required>false</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
</attribute> |
||||
</tag> |
||||
|
||||
<tag> |
||||
<description> |
||||
Redirects to a new URL. |
||||
</description> |
||||
<name>redirect</name> |
||||
<tag-class>org.apache.taglibs.standard.tag.rt.core.RedirectTag</tag-class> |
||||
<body-content>JSP</body-content> |
||||
<attribute> |
||||
<description> |
||||
The URL of the resource to redirect to. |
||||
</description> |
||||
<name>url</name> |
||||
<required>false</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Name of the context when redirecting to a relative URL |
||||
resource that belongs to a foreign context. |
||||
</description> |
||||
<name>context</name> |
||||
<required>false</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
</attribute> |
||||
</tag> |
||||
|
||||
<tag> |
||||
<description> |
||||
Removes a scoped variable (from a particular scope, if specified). |
||||
</description> |
||||
<name>remove</name> |
||||
<tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class> |
||||
<body-content>empty</body-content> |
||||
<attribute> |
||||
<description> |
||||
Name of the scoped variable to be removed. |
||||
</description> |
||||
<name>var</name> |
||||
<required>true</required> |
||||
<rtexprvalue>false</rtexprvalue> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Scope for var. |
||||
</description> |
||||
<name>scope</name> |
||||
<required>false</required> |
||||
<rtexprvalue>false</rtexprvalue> |
||||
</attribute> |
||||
</tag> |
||||
|
||||
<tag> |
||||
<description> |
||||
Sets the result of an expression evaluation in a 'scope' |
||||
</description> |
||||
<name>set</name> |
||||
<tag-class>org.apache.taglibs.standard.tag.rt.core.SetTag</tag-class> |
||||
<body-content>JSP</body-content> |
||||
<attribute> |
||||
<description> |
||||
Name of the exported scoped variable to hold the value |
||||
specified in the action. The type of the scoped variable is |
||||
whatever type the value expression evaluates to. |
||||
</description> |
||||
<name>var</name> |
||||
<required>false</required> |
||||
<rtexprvalue>false</rtexprvalue> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Expression to be evaluated. |
||||
</description> |
||||
<name>value</name> |
||||
<required>false</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
<deferred-value> |
||||
<type>java.lang.Object</type> |
||||
</deferred-value> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Target object whose property will be set. Must evaluate to |
||||
a JavaBeans object with setter property property, or to a |
||||
java.util.Map object. |
||||
</description> |
||||
<name>target</name> |
||||
<required>false</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Name of the property to be set in the target object. |
||||
</description> |
||||
<name>property</name> |
||||
<required>false</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Scope for var. |
||||
</description> |
||||
<name>scope</name> |
||||
<required>false</required> |
||||
<rtexprvalue>false</rtexprvalue> |
||||
</attribute> |
||||
</tag> |
||||
|
||||
<tag> |
||||
<description> |
||||
Creates a URL with optional query parameters. |
||||
</description> |
||||
<name>url</name> |
||||
<tag-class>org.apache.taglibs.standard.tag.rt.core.UrlTag</tag-class> |
||||
<body-content>JSP</body-content> |
||||
<attribute> |
||||
<description> |
||||
Name of the exported scoped variable for the |
||||
processed url. The type of the scoped variable is |
||||
String. |
||||
</description> |
||||
<name>var</name> |
||||
<required>false</required> |
||||
<rtexprvalue>false</rtexprvalue> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Scope for var. |
||||
</description> |
||||
<name>scope</name> |
||||
<required>false</required> |
||||
<rtexprvalue>false</rtexprvalue> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
URL to be processed. |
||||
</description> |
||||
<name>value</name> |
||||
<required>false</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
</attribute> |
||||
<attribute> |
||||
<description> |
||||
Name of the context when specifying a relative URL |
||||
resource that belongs to a foreign context. |
||||
</description> |
||||
<name>context</name> |
||||
<required>false</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
</attribute> |
||||
</tag> |
||||
|
||||
<tag> |
||||
<description> |
||||
Subtag of <choose> that includes its body if its |
||||
condition evalutes to 'true' |
||||
</description> |
||||
<name>when</name> |
||||
<tag-class>com.liferay.taglib.core.WhenTag</tag-class> |
||||
<body-content>JSP</body-content> |
||||
<attribute> |
||||
<description> |
||||
The test condition that determines whether or not the |
||||
body content should be processed. |
||||
</description> |
||||
<name>test</name> |
||||
<required>true</required> |
||||
<rtexprvalue>true</rtexprvalue> |
||||
<type>boolean</type> |
||||
</attribute> |
||||
</tag> |
||||
|
||||
</taglib> |
@ -1 +1 @@
|
||||
b2c2a2163a9e57f49e684a33bc7d0817 |
||||
5ae48f34ca95a715172797941f9c2717 |
||||
|
@ -0,0 +1 @@
|
||||
{"ide":{"scriptPaths":[]},"plugins":{"aui":{},"liferay":{},"yui":{}},"libs":["ecma5","browser"]} |
File binario non mostrato.
Prima Larghezza: | Altezza: | Dimensione: 23 KiB Dopo Larghezza: | Altezza: | Dimensione: 18 KiB |
Dopo Larghezza: | Altezza: | Dimensione: 14 KiB |
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<classpath> |
||||
<classpathentry kind="src" path="src"/> |
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_80"/> |
||||
<classpathentry kind="lib" path="/home/portos/bin/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/lib/ext/portlet.jar"/> |
||||
<classpathentry kind="lib" path="/home/portos/bin/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/lib/ext/portal-service.jar" sourcepath="/home/portos/sources/liferay-portal-src-6.2-ce-ga6"> |
||||
<attributes> |
||||
<attribute name="javadoc_location" value="file:/home/portos/sources/liferay-javadocs-all/"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry kind="lib" path="/home/portos/bin/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/webapps/ROOT/WEB-INF/lib/util-taglib.jar" sourcepath="/home/portos/sources/liferay-portal-src-6.2-ce-ga6"> |
||||
<attributes> |
||||
<attribute name="javadoc_location" value="file:/home/portos/sources/liferay-javadocs-all/"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry kind="lib" path="/home/portos/bin/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/lib/servlet-api.jar"/> |
||||
<classpathentry kind="output" path="classes"/> |
||||
</classpath> |
@ -0,0 +1 @@
|
||||
/classes/ |
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<projectDescription> |
||||
<name>tref-mapit-shared</name> |
||||
<comment></comment> |
||||
<projects> |
||||
</projects> |
||||
<buildSpec> |
||||
<buildCommand> |
||||
<name>org.eclipse.jdt.core.javabuilder</name> |
||||
<arguments> |
||||
</arguments> |
||||
</buildCommand> |
||||
</buildSpec> |
||||
<natures> |
||||
<nature>org.eclipse.jdt.core.javanature</nature> |
||||
</natures> |
||||
</projectDescription> |
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<projectDescription> |
||||
<name>tref-mapit-shared</name> |
||||
<comment></comment> |
||||
<projects> |
||||
</projects> |
||||
<buildSpec> |
||||
<buildCommand> |
||||
<name>org.eclipse.jdt.core.javabuilder</name> |
||||
<arguments> |
||||
</arguments> |
||||
</buildCommand> |
||||
</buildSpec> |
||||
<natures> |
||||
<nature>org.eclipse.jdt.core.javanature</nature> |
||||
</natures> |
||||
</projectDescription> |
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0"?> |
||||
<!DOCTYPE project> |
||||
|
||||
<project name="tref-mapit-shared" basedir="." default="deploy"> |
||||
<property name="plugin.version" value="1" /> |
||||
<import file="../build-common-shared.xml" /> |
||||
</project> |
@ -0,0 +1,47 @@
|
||||
package it.tref.liferay.mapit.constants; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
public interface Constants extends com.liferay.portal.kernel.util.Constants { |
||||
public static final int MAX_SEARCH_RESULT = 4000; |
||||
public static final String MIN_DECIMAL_INDEX = "000000000"; |
||||
public static final String MIN_INTERO_INDEX = "000"; |
||||
public static final String MAX_LAT_INDEX = "180"; |
||||
public static final String MIN_LAT_INDEX = "000"; |
||||
public static final String ZERO_LAT_INDEX = "090"; |
||||
public static final String MAX_LON_INDEX = "360"; |
||||
public static final String MIN_LON_INDEX = "000"; |
||||
public static final String ZERO_LON_INDEX = "180"; |
||||
public static final BigDecimal MAX_LON = (new BigDecimal(180)).setScale(0); |
||||
public static final BigDecimal MIN_LON = (new BigDecimal(-180)).setScale(0); |
||||
public static final BigDecimal MAX_LAT = (new BigDecimal(90)).setScale(0); |
||||
public static final BigDecimal MIN_LAT = (new BigDecimal(-90)).setScale(0); |
||||
public static final String COORDINATE_SEPARATOR = "."; |
||||
public static final String NULL_VALUE = "-1"; |
||||
public static final String EXPANDO_TABLE_NAME = "CUSTOM_FIELDS"; |
||||
public static final String EXPANDO_COLUMN_NAME_LAT = "MAPIT_LAT"; |
||||
public static final String EXPANDO_COLUMN_NAME_LAT_HIDDEN = "MAPIT_LAT_HIDDEN"; |
||||
public static final String EXPANDO_COLUMN_NAME_LON = "MAPIT_LON"; |
||||
public static final String EXPANDO_COLUMN_NAME_LON_HIDDEN = "MAPIT_LON_HIDDEN"; |
||||
|
||||
public static class MapTypeValue { |
||||
public static final String OPEN_STREET_MAP = "1"; |
||||
public static final String GOOGLE_MAP = "2"; |
||||
public static final String BING_MAP = "3"; |
||||
public static final String BASE_MAP = "4"; |
||||
public static final String BASE_MAP_LABEL = "5"; |
||||
public static final String IMAGE = "6"; |
||||
} |
||||
|
||||
public static class ZoomTypeValue { |
||||
public static final String SIMPLE = "0"; |
||||
public static final String COMPACT = "1"; |
||||
public static final String FULL = "2"; |
||||
} |
||||
|
||||
public static class ZoomType { |
||||
public static final String SIMPLE = "simple"; |
||||
public static final String COMPACT = "compact"; |
||||
public static final String FULL = "full"; |
||||
} |
||||
} |
@ -0,0 +1,6 @@
|
||||
package it.tref.liferay.mapit.constants; |
||||
|
||||
public interface DestinationNames extends com.liferay.portal.kernel.messaging.DestinationNames { |
||||
public static final String ASSET_RESOLVER_PREFIX = "liferay/mapit/assetresolver/"; |
||||
public static final String DESTINATION_RESOLVER = "liferay/mapit/destinationresolver"; |
||||
} |
@ -0,0 +1,28 @@
|
||||
package it.tref.liferay.mapit.constants; |
||||
|
||||
public class PortletConfiguration { |
||||
public static final String CENTER_LAT = "centerlat"; |
||||
public static final String CENTER_LON = "centerlon"; |
||||
public static final String GEO_BROWSER = "geobrowser"; |
||||
public static final String IGNORE_VIEW = "ignoreView"; |
||||
public static final String SAVE_LAST_POSITION = "savelastposition"; |
||||
public static final String SHOW_MAP_CODE = "showmapcode"; |
||||
public static final String HEIGHT = "height"; |
||||
public static final String ZOOM_FACTOR = "zoomfactor"; |
||||
public static final String MAP_TYPE = "maptype"; |
||||
public static final String API_KEY = "apikey"; |
||||
public static final String API_VERSION = "apiversion"; |
||||
public static final String MAP_STYLES = "mapStyles"; |
||||
public static final String CLASS_NAME_IDS = "classNameIds"; |
||||
public static final String PLUGIN_IDS = "pluginIds"; |
||||
public static final String IGNORE_BBOX = "ignoreBbox"; |
||||
public static final String LAYER_SWITCH = "controllayerswitch"; |
||||
public static final String ZOOM_TYPE = "controlzoomtype"; |
||||
public static final String FULL_SCREEN = "controlfullscreen"; |
||||
public static final String NAV_TOOLBAR = "controlnavtoolbar"; |
||||
public static final String MOUSE_POSITION = "controlmouseposition"; |
||||
public static final String SCALE = "controlscale"; |
||||
public static final String HOME = "controlhome"; |
||||
public static final String OVERVIEW_MAP = "controloverviewmap"; |
||||
public static final String NO_POPUP = "popunopopup"; |
||||
} |
@ -0,0 +1,5 @@
|
||||
package it.tref.liferay.mapit.constants; |
||||
|
||||
public interface WebKeys extends com.liferay.portal.kernel.util.WebKeys { |
||||
public static final String PLUGIN_PORTLET_PREFERENCES = "PLUGIN_PORTLET_PREFERENCES"; |
||||
} |
@ -0,0 +1,38 @@
|
||||
package it.tref.liferay.mapit.messaging; |
||||
|
||||
import com.liferay.portal.kernel.messaging.BaseMessageListener; |
||||
import com.liferay.portal.kernel.messaging.Message; |
||||
import com.liferay.portal.kernel.messaging.MessageBusUtil; |
||||
import com.liferay.portal.kernel.util.StringUtil; |
||||
import com.liferay.portal.model.BaseModel; |
||||
import com.liferay.portlet.documentlibrary.model.DLFileEntry; |
||||
import com.liferay.portlet.journal.model.JournalArticle; |
||||
import com.liferay.portlet.wiki.model.WikiPage; |
||||
import it.tref.liferay.mapit.resolver.BaseModelResolver; |
||||
import it.tref.liferay.mapit.resolver.asset.DLFileEntryResolver; |
||||
import it.tref.liferay.mapit.resolver.asset.JournalArticleResolver; |
||||
import it.tref.liferay.mapit.resolver.asset.WikiPageResolver; |
||||
import java.util.Map; |
||||
import java.util.concurrent.ConcurrentHashMap; |
||||
|
||||
public class AssetResolverMessageListener extends BaseMessageListener { |
||||
public AssetResolverMessageListener() { |
||||
_baseModelResolverMap.put(DLFileEntry.class.getName(), new DLFileEntryResolver()); |
||||
_baseModelResolverMap.put(WikiPage.class.getName(), new WikiPageResolver()); |
||||
_baseModelResolverMap.put(JournalArticle.class.getName(), new JournalArticleResolver()); |
||||
} |
||||
|
||||
protected void doReceive(Message message) throws Exception { |
||||
long companyId = message.getLong("companyId"); |
||||
long classPK = message.getLong("entryClassPK"); |
||||
String className = StringUtil.extractLast(message.getDestinationName(), "/"); |
||||
BaseModelResolver<?> baseModelResolver = _baseModelResolverMap.get(className); |
||||
BaseModel<?> baseModel = null; |
||||
if (baseModelResolver != null) |
||||
baseModel = baseModelResolver.getBaseModel(companyId, classPK); |
||||
Message responseMessage = MessageBusUtil.createResponseMessage(message, baseModel); |
||||
MessageBusUtil.sendMessage(message.getResponseDestinationName(), responseMessage); |
||||
} |
||||
|
||||
private static Map<String, BaseModelResolver<?>> _baseModelResolverMap = new ConcurrentHashMap<String, BaseModelResolver<?>>(); |
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Caricamento…
Reference in new issue