diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_desc_edificio.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_desc_edificio.jsp
index 61c658f1..7e71f9df 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_desc_edificio.jsp
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_desc_edificio.jsp
@@ -1,3 +1,4 @@
+<%@page import="com.liferay.portal.kernel.util.HtmlUtil"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.bean.BeanPropertiesUtil"%>
<%@ include file="/html/fascicolo/init.jsp" %>
@@ -214,7 +215,7 @@
<%= LanguageUtil.get(pageContext, "dcc-strutture-ele-misto-altro") %>
- <%=BeanPropertiesUtil.getString(dettPratica, "dccStruttureEleAltroDescrizione") %>
+ <%= HtmlUtil.escape(BeanPropertiesUtil.getString(dettPratica, "dccStruttureEleAltroDescrizione")) %>
@@ -247,7 +248,7 @@
<%= LanguageUtil.get(pageContext, "dcc-orizzontamenti-altro") %>
- <%=BeanPropertiesUtil.getString(dettPratica, "dccOrizzontamentiAltroDescrizione") %>
+ <%= HtmlUtil.escape(BeanPropertiesUtil.getString(dettPratica, "dccOrizzontamentiAltroDescrizione")) %>
@@ -317,7 +318,7 @@
<%= LanguageUtil.get(pageContext, "dcc-elem-non-strut-altro") %>
- <%=BeanPropertiesUtil.getString(dettPratica, "dccElemNonStrutAltroDescrizione") %>
+ <%= HtmlUtil.escape(BeanPropertiesUtil.getString(dettPratica, "dccElemNonStrutAltroDescrizione")) %>
@@ -362,7 +363,7 @@
<%= LanguageUtil.get(pageContext, "dcc-opere-di-rinforzo-altro") %>
- <%=BeanPropertiesUtil.getString(dettPratica, "dccOpereDiRinforzoAltroDescrizione") %>
+ <%= HtmlUtil.escape(BeanPropertiesUtil.getString(dettPratica, "dccOpereDiRinforzoAltroDescrizione")) %>
@@ -450,7 +451,7 @@
<%= LanguageUtil.get(pageContext, "de-inf-altro") %>
- <%=BeanPropertiesUtil.getString(dettPratica, "deInfAltroDesc") %>
+ <%= HtmlUtil.escape(BeanPropertiesUtil.getString(dettPratica, "deInfAltroDesc")) %>
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_dettagli_principali.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_dettagli_principali.jsp
index 2414f27f..92bb9bc2 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_dettagli_principali.jsp
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_dettagli_principali.jsp
@@ -1,3 +1,4 @@
+<%@page import="com.liferay.portal.kernel.util.HtmlUtil"%>
<%@page import="it.mwg.sismica.bo.shared.util.Generics"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.bean.BeanPropertiesUtil"%>
@@ -98,7 +99,7 @@ String hide10 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q10) |
<%= LanguageUtil.get(pageContext, "interv-fin-pub") %>
- <%=BeanPropertiesUtil.getString(dettPratica, "intervFinPubDesc") %>
+ <%= HtmlUtil.escape(BeanPropertiesUtil.getString(dettPratica, "intervFinPubDesc")) %>
@@ -185,7 +186,7 @@ String hide10 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q10) |
- <%= dettPratica.getDescLongIntervento() %>
+ <%= HtmlUtil.escape(dettPratica.getDescLongIntervento()) %>
@@ -380,7 +381,7 @@ String hide10 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q10) |
<%=LanguageUtil.get(pageContext, "tc-altri-interventi") %>
- : <%= dettPratica.getTcAltriInterventiDesc() %>
+ : <%= HtmlUtil.escape(dettPratica.getTcAltriInterventiDesc()) %>
@@ -448,7 +449,7 @@ String hide10 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q10) |
<%= LanguageUtil.get(pageContext, "tc-altro") %>
- <%= BeanPropertiesUtil.getString(dettPratica, "tcAltroDescrizione") %>
+ <%= HtmlUtil.escape(BeanPropertiesUtil.getString(dettPratica, "tcAltroDescrizione")) %>
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_riepilogo.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_riepilogo.jsp
index 463758ab..60edb7f9 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_riepilogo.jsp
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_riepilogo.jsp
@@ -1,3 +1,4 @@
+<%@page import="com.liferay.portal.kernel.util.HtmlUtil"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.bean.BeanPropertiesUtil"%>
<%@page import="com.liferay.portal.model.User"%>
@@ -128,7 +129,7 @@ String hide10 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q10) |
- <%= BeanPropertiesUtil.getString(dettPratica, "descLongIntervento") %>
+ <%= HtmlUtil.escape(BeanPropertiesUtil.getString(dettPratica, "descLongIntervento")) %>
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/view_dettagli_collaudo.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/view_dettagli_collaudo.jsp
index 2ff9fc7c..5f51a51d 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/view_dettagli_collaudo.jsp
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/view_dettagli_collaudo.jsp
@@ -1,3 +1,4 @@
+<%@page import="com.liferay.portal.kernel.util.HtmlUtil"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%>
<%@page import="com.liferay.portal.kernel.bean.BeanPropertiesUtil"%>
@@ -73,7 +74,7 @@
<%= LanguageUtil.get(pageContext, "col-desc-interv") %>
- <%=BeanPropertiesUtil.getString(dettPratica, "descLongIntervento") %>
+ <%= HtmlUtil.escape(BeanPropertiesUtil.getString(dettPratica, "descLongIntervento")) %>
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/view_dettagli_fine-lavori.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/view_dettagli_fine-lavori.jsp
index 03d43ff0..f3377602 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/view_dettagli_fine-lavori.jsp
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/view_dettagli_fine-lavori.jsp
@@ -1,3 +1,4 @@
+<%@page import="com.liferay.portal.kernel.util.HtmlUtil"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%>
<%@page import="com.liferay.portal.kernel.bean.BeanPropertiesUtil"%>
@@ -74,7 +75,7 @@
<%= LanguageUtil.get(pageContext, "fl-desc-interv") %>
- <%=BeanPropertiesUtil.getString(dettPratica, "descLongIntervento") %>
+ <%= HtmlUtil.escape(BeanPropertiesUtil.getString(dettPratica, "descLongIntervento")) %>
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/view.jsp
index 1291bdf3..4c7b358b 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/view.jsp
+++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/view.jsp
@@ -330,7 +330,7 @@ String keywords = StringPool.BLANK;
<%= LanguageUtil.get(pageContext, "label_procedura_" + intPratica.getTipoProcedura()) + ") "
+ LanguageUtil.get(pageContext, "tipo_procedura_" + intPratica.getTipoProcedura()) %>
- <%= lastDettPratica == null ? StringPool.BLANK : lastDettPratica.getDescLongIntervento() %>
+ <%= lastDettPratica == null ? StringPool.BLANK : HtmlUtil.escape(lastDettPratica.getDescLongIntervento()) %>
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/mwg/sismica/fe/servlet/Instrumentation.java b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/mwg/sismica/fe/servlet/Instrumentation.java
new file mode 100644
index 00000000..957ad4bc
--- /dev/null
+++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/mwg/sismica/fe/servlet/Instrumentation.java
@@ -0,0 +1,94 @@
+package it.mwg.sismica.fe.servlet;
+
+import it.tref.liferay.portos.bo.service.AvvisoLocalServiceUtil;
+
+import java.io.IOException;
+import java.lang.management.ManagementFactory;
+import java.util.Date;
+import java.util.Iterator;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.liferay.portal.kernel.exception.SystemException;
+import com.liferay.portal.kernel.json.JSONFactoryUtil;
+import com.liferay.portal.kernel.json.JSONObject;
+import com.liferay.portal.kernel.servlet.ServletResponseUtil;
+import com.liferay.portal.kernel.util.ContentTypes;
+import com.liferay.portal.kernel.util.ParamUtil;
+import com.liferay.portal.kernel.util.StringPool;
+import com.liferay.portal.util.PortalUtil;
+
+public class Instrumentation extends HttpServlet {
+
+ private static final long serialVersionUID = 5542429846030601941L;
+
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+
+ process(request, response);
+ }
+
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
+ IOException {
+
+ process(request, response);
+ }
+
+ private void process(HttpServletRequest request, HttpServletResponse response) throws IOException {
+
+ switch (request.getPathInfo()) {
+ case "/status":
+ status(response, ParamUtil.getString(request, "fmt", StringPool.BLANK).toLowerCase());
+ break;
+ default:
+ response.sendError(HttpServletResponse.SC_NOT_FOUND);
+ }
+ }
+
+ private void status(HttpServletResponse response, String mode) throws IOException {
+
+ JSONObject json = JSONFactoryUtil.createJSONObject();
+ long time = new Date().getTime() / 1000;
+ Runtime runtime = Runtime.getRuntime();
+ json.put("status", "OK");
+ json.put("cpus", runtime.availableProcessors());
+ json.put("freeMemory", runtime.freeMemory());
+ json.put("maxMemory", runtime.maxMemory());
+ json.put("totalMemory", runtime.totalMemory());
+ json.put("threads", ManagementFactory.getThreadMXBean().getThreadCount());
+ json.put("time", time);
+ json.put("uptime", time - PortalUtil.getUptime().getTime() / 1000);
+ try {
+ AvvisoLocalServiceUtil.countAvvisiInvioSignal();
+ } catch (SystemException e) {
+ json.put("status", "KO");
+ }
+ switch (mode) {
+ case FMT_JSON:
+ response.setContentType(ContentTypes.APPLICATION_JSON);
+ ServletResponseUtil.write(response, json.toString());
+ break;
+ case FMT_TEXT:
+ response.setContentType(ContentTypes.TEXT_PLAIN);
+ StringBuilder sb = new StringBuilder();
+ Iterator keys = json.keys();
+ while (keys.hasNext()) {
+ String key = keys.next();
+ String value = json.getString(key);
+ sb.append('X').append(key.toUpperCase()).append('=').append(value).append('\n');
+ }
+ ServletResponseUtil.write(response, sb.toString());
+ break;
+ default:
+ response.setContentType(ContentTypes.TEXT_PLAIN);
+ ServletResponseUtil.write(response, json.getString("status"));
+ }
+ }
+
+ private static final String FMT_JSON = "json";
+ private static final String FMT_TEXT = "text";
+}
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/mwg/sismica/fe/servlet/SorgentiServlet.java b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/mwg/sismica/fe/servlet/SorgentiServlet.java
deleted file mode 100644
index 3c6b170d..00000000
--- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/mwg/sismica/fe/servlet/SorgentiServlet.java
+++ /dev/null
@@ -1,220 +0,0 @@
-package it.mwg.sismica.fe.servlet;
-
-import it.tref.liferay.portos.bo.shared.util.Constants;
-import it.tref.liferay.portos.mailmanager.shared.messaging.util.DestinationNames;
-import it.tref.liferay.portos.mailmanager.shared.util.MailManagerConstants;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.text.SimpleDateFormat;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Comparator;
-import java.util.Date;
-
-import javax.mail.internet.AddressException;
-import javax.mail.internet.InternetAddress;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.FilenameUtils;
-
-import com.liferay.portal.kernel.exception.PortalException;
-import com.liferay.portal.kernel.exception.SystemException;
-import com.liferay.portal.kernel.mail.MailMessage;
-import com.liferay.portal.kernel.messaging.Message;
-import com.liferay.portal.kernel.messaging.MessageBusUtil;
-import com.liferay.portal.kernel.servlet.HttpHeaders;
-import com.liferay.portal.kernel.util.CharPool;
-import com.liferay.portal.kernel.util.ContentTypes;
-import com.liferay.portal.kernel.util.DigesterUtil;
-import com.liferay.portal.kernel.util.ParamUtil;
-import com.liferay.portal.kernel.util.PropsUtil;
-import com.liferay.portal.kernel.util.StringPool;
-import com.liferay.portal.kernel.util.StringUtil;
-import com.liferay.portal.kernel.util.Validator;
-import com.liferay.portal.model.Company;
-import com.liferay.portal.model.Role;
-import com.liferay.portal.model.RoleConstants;
-import com.liferay.portal.model.User;
-import com.liferay.portal.service.RoleLocalServiceUtil;
-import com.liferay.portal.service.ServiceContext;
-import com.liferay.portal.service.ServiceContextFactory;
-import com.liferay.portal.service.UserLocalServiceUtil;
-import com.liferay.portal.util.PortalUtil;
-
-public class SorgentiServlet extends HttpServlet {
- private static final long serialVersionUID = 5549374841236285035L;
-
- private static final int VALIDITA = 3;
- private static final String FOLDER = "condivisi";
- private static final String URI = "/portos-fe-portlet/sorgenti-paesaggistica/";
-
- @Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-
- String pathInfo = request.getPathInfo();
- if (Validator.isNull(pathInfo) || pathInfo.equals(StringPool.FORWARD_SLASH)) {
- request.getRequestDispatcher("/html/sorgenti/form.jsp").forward(request, response);
- } else {
- String[] parti = StringUtil.split(pathInfo, CharPool.FORWARD_SLASH);
- if (parti.length == 4) {
- registra(request, "Scaricamento - " + parti[1] + StringPool.FORWARD_SLASH + parti[2]
- + StringPool.FORWARD_SLASH + parti[3]);
- String path = parti[1];
- File file = new File(PropsUtil.get("liferay.home") + File.separator + FOLDER + File.separator
- + parti[3]);
- if (file.exists() && !file.isDirectory() && pathValido(request, path)) {
- String contentType = probeContentType(file);
- response.setContentType(contentType);
- response.setContentLength((int) file.length());
- response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + file.getName()
- + StringPool.QUOTE);
- FileUtils.copyFile(file, response.getOutputStream());
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, request.getRequestURI());
- }
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, request.getRequestURI());
- }
- }
- }
-
- @Override
- protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
- IOException {
-
- String pathInfo = request.getPathInfo();
- if (Validator.isNotNull(pathInfo) && pathInfo.equals("/richiedi")) {
- try {
- if (inviaMail(request, response)) {
- request.getRequestDispatcher("/html/sorgenti/invio_ok.jsp").forward(request, response);
- } else {
- request.getRequestDispatcher("/html/sorgenti/invio_ko.jsp").forward(request, response);
- }
- } catch (AddressException | PortalException | SystemException e) {
- request.getRequestDispatcher("/html/sorgenti/invio_ko.jsp").forward(request, response);
- e.printStackTrace();
- }
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, request.getRequestURI());
- }
- }
-
- private static boolean pathValido(HttpServletRequest request, String path) {
-
- Calendar calendar = Calendar.getInstance();
- calendar.setTime(new Date());
- for (int i = 0; i <= VALIDITA; i++) {
- if (path.equals(getLink(request, calendar.getTime()))) {
- return true;
- }
- calendar.add(Calendar.DAY_OF_MONTH, -1);
- }
- return false;
- }
-
- private static String getSeed(HttpServletRequest request) {
-
- String seed = null;
- try {
- Company company = PortalUtil.getCompany(request);
- seed = (String) company.getExpandoBridge().getAttribute(Constants.COMPANY_CUSTOM_FIELD_LINK_SEED, false);
- } catch (PortalException | SystemException e) {
- }
- return seed;
- }
-
- private static boolean inviaMail(HttpServletRequest request, HttpServletResponse response) throws AddressException,
- PortalException, SystemException, IOException {
-
- Date date = new Date();
- Calendar calendar = Calendar.getInstance();
- calendar.setTime(date);
- calendar.add(Calendar.DAY_OF_MONTH, VALIDITA);
- String nome = ParamUtil.getString(request, "nome");
- String cognome = ParamUtil.getString(request, "cognome");
- String email = ParamUtil.getString(request, "email");
- String link = getLink(request, date);
- String digest = digest(request, email);
- String scadenza = new SimpleDateFormat("dd/MM/yyyy").format(calendar.getTime());
- String testo = "Gentile " + nome + StringPool.SPACE + cognome
- + ".
Puoi scaricare i sorgenti di Paesaggistica Sicilia da qui:
";
- File[] lista = new File(PropsUtil.get("liferay.home") + File.separator + FOLDER).listFiles();
- Arrays.sort(lista, new Comparator() {
- @Override
- public int compare(File f1, File f2) {
- return f1.getName().compareTo(f2.getName());
- }
- });
- for (File file : lista) {
- testo += "" + file.getName() + ".
";
- }
- if (lista.length > 1) {
- testo += "
I link saranno validi";
- } else {
- testo += "
Il link sarà valido";
- }
- testo += " fino a tutto il giorno " + scadenza
- + ".
È possibile in ogni momento richiedere un nuovo link da questa pagina.";
- InternetAddress from = new InternetAddress("noreply-Sismica@lavoripubblici.sicilia.it", true);
- InternetAddress[] to = { new InternetAddress(email, true) };
- MailMessage mail = new MailMessage(from, "Sorgenti del portale Sismica Sicilia", testo, true);
- mail.setTo(to);
- ServiceContext serviceContext = ServiceContextFactory.getInstance(request);
- Role role = RoleLocalServiceUtil.getRole(serviceContext.getCompanyId(), RoleConstants.ADMINISTRATOR);
- User user = UserLocalServiceUtil.getRoleUsers(role.getRoleId(), 0, 1).get(0);
- serviceContext.setUserId(user.getUserId());
- Message message = new Message();
- message.put("serviceContext", serviceContext);
- message.put("mode", MailManagerConstants.MESSAGING_SEND_MODE_ASYNC);
- message.setPayload(mail);
- MessageBusUtil.sendMessage(DestinationNames.SEND_MAIL, message);
- registra(request, "Richiesta - nome: " + nome + ", cognome: " + cognome + ", email: " + email + ", cartella: "
- + link + StringPool.FORWARD_SLASH + digest);
- return true;
- }
-
- private static String getLink(HttpServletRequest request, Date date) {
-
- return digest(request, new SimpleDateFormat("dd/MM/yyyy").format(date));
- }
-
- private static String digest(HttpServletRequest request, String text) {
-
- return DigesterUtil.digestHex("md5", getSeed(request) + text);
- }
-
- private static void registra(HttpServletRequest request, String text) throws IOException {
-
- FileWriter writer = new FileWriter(PropsUtil.get("liferay.home") + "/logs/sorgenti.log", true);
- writer.write(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date()) + " [" + request.getRemoteAddr()
- + "] " + text + StringPool.NEW_LINE);
- writer.close();
- }
-
- // La macchina di produzione non ha il supporto per mime, aggiriamo per i casi che ci interessano
- private static String probeContentType(File file) {
-
- try {
- String extension = FilenameUtils.getExtension(file.getName()).toLowerCase();
- switch (extension) {
- case "pdf":
- return ContentTypes.APPLICATION_PDF;
- case "zip":
- return ContentTypes.APPLICATION_ZIP;
- default:
- return Files.probeContentType(file.toPath());
- }
- } catch (IOException e) {
- return ContentTypes.APPLICATION_OCTET_STREAM;
- }
- }
-}
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/AllegatiPraticaPortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/AllegatiPraticaPortlet.java
index 02e39c84..d730e560 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/AllegatiPraticaPortlet.java
+++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/AllegatiPraticaPortlet.java
@@ -2,6 +2,7 @@ package it.tref.liferay.portos.fe.portlet;
import it.mwg.sismica.bo.shared.util.DocumentiPraticaUtil;
import it.tref.liferay.portos.bo.model.DocPratica;
+import it.tref.liferay.portos.bo.service.ConfigurazioneLocalServiceUtil;
import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.DocPraticaServiceUtil;
import it.tref.liferay.portos.bo.shared.bean.FirmeBean;
@@ -230,12 +231,12 @@ public class AllegatiPraticaPortlet extends MVCPortlet {
String id = resourceRequest.getResourceID();
try {
- if ("downloadAllDocPratica".equals(id) || "downloadAllDocPraticas".equals(id)) {
+ if ("downloadAllDocPratica".equals(id)) {
long intPraticaId = ParamUtil.getLong(resourceRequest, "intPraticaId");
long classPk = ParamUtil.getLong(resourceRequest, "classPk");
String comingFrom = ParamUtil.getString(resourceRequest, "comingFrom");
String type = ParamUtil.getString(resourceRequest, "type");
- List docs = new ArrayList<>();
+ List docs;
if (Validator.isNull(comingFrom)) {
docs = DocPraticaLocalServiceUtil.findByClassPk(classPk);
} else if ("page_in_allegati".equals(comingFrom) || "page_va_allegati".equals(comingFrom)) {
@@ -243,7 +244,7 @@ public class AllegatiPraticaPortlet extends MVCPortlet {
docs = DocPraticaLocalServiceUtil.findByIntPratica_ClassPkEqual_Tipologie(intPraticaId, classPk,
tipologieAllegati);
} else {
- List tipologieAllegati = new ArrayList();
+ List tipologieAllegati;
if ("page_geologica".equals(comingFrom) || "ag".equals(type)) {
tipologieAllegati = DocumentiPraticaUtil.getDocGeologo();
} else if ("page_allegati".equals(comingFrom) || "ad".equals(type)) {
@@ -252,9 +253,10 @@ public class AllegatiPraticaPortlet extends MVCPortlet {
tipologieAllegati = DocumentiPraticaUtil.getDocFineLavori();
} else if ("page_collaudo".equals(comingFrom)) {
tipologieAllegati = DocumentiPraticaUtil.getDocCollaudo();
+ } else {
+ tipologieAllegati = new ArrayList();
}
- docs = DocPraticaLocalServiceUtil.findByIntPratica_ClassPk_Tipologie(intPraticaId, classPk,
- tipologieAllegati);
+ docs = DocPraticaLocalServiceUtil.findByIntPratica_Tipologie(intPraticaId, tipologieAllegati);
}
ZipWriter zipWriter = ZipWriterFactoryUtil.getZipWriter();
for (DocPratica doc : docs) {
@@ -269,6 +271,9 @@ public class AllegatiPraticaPortlet extends MVCPortlet {
String s = new String(fileEntry.getTitle().getBytes(StandardCharsets.UTF_8));
byte[] b = s.getBytes(StandardCharsets.ISO_8859_1);
String name = new String(b, StandardCharsets.ISO_8859_1);
+ if (doc.isRimosso()) {
+ name = "rimossi_" + doc.getClassPk() + '/' + name;
+ }
zipWriter.addEntry(name, inputStream);
} finally {
if (inputStream != null) {
@@ -279,10 +284,15 @@ public class AllegatiPraticaPortlet extends MVCPortlet {
resourceResponse.reset();
File file = zipWriter.getFile();
byte[] data = Files.readAllBytes(file.toPath());
+ file.delete();
resourceResponse.setContentType(ContentTypes.APPLICATION_ZIP);
- resourceResponse.addProperty(HttpHeaders.CACHE_CONTROL, "max-age=3600, must-revalidate");
+ if (ConfigurazioneLocalServiceUtil.isProduction()) {
+ resourceResponse.addProperty(HttpHeaders.CACHE_CONTROL, "max-age=3600, must-revalidate");
+ } else {
+ resourceResponse.addProperty(HttpHeaders.CACHE_CONTROL, "no-store");
+ }
resourceResponse.addProperty(HttpHeaders.CONTENT_DISPOSITION,
- "attachment; filename=\"" + file.getName() + StringPool.QUOTE);
+ "attachment; filename=\"" + file.getName() + '"');
resourceResponse.setContentLength(data.length);
resourceResponse.getPortletOutputStream().write(data);
resourceResponse.getPortletOutputStream().flush();
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java
index 34daf6c1..e449381f 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java
+++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java
@@ -1321,11 +1321,11 @@ public class FascicoloFePortlet extends MVCPortlet {
// ADT: BUG FE ID=30 - CALCOLO IMPORTO, controllo non effettuato se spese esente
boolean esenteSpeseIstruttoria = DettPraticaLocalServiceUtil.getDettPratica(dettPraticaId)
.isNormEsenteSpese();
- if (esenteSpeseIstruttoria || (totale != 0)) {
+ if (esenteSpeseIstruttoria || (totale != 0) || aggiorna) {
DettPraticaServiceUtil.pagaInvia(dettPraticaId, request, response);
} else {
_log.error("pagaInvia - Riscontrato errore di congruenza pagamenti per dettPraticaId = "
- + dettPraticaId);
+ + dettPraticaId + ", totale = " + totale);
throw new PortalException("Compilare sezione Spese Istruttoria");
}
} else {
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/web.xml b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/web.xml
index 4c63ef09..fe6c9ee4 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/web.xml
+++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/web.xml
@@ -2,11 +2,11 @@
- SorgentiServlet
- it.mwg.sismica.fe.servlet.SorgentiServlet
+ Instrumentation
+ it.mwg.sismica.fe.servlet.Instrumentation
- SorgentiServlet
- /sorgenti-paesaggistica/*
+ Instrumentation
+ /instrumentation/*
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view_accordion.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view_accordion.jsp
index 40f4e231..0205fc59 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view_accordion.jsp
+++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view_accordion.jsp
@@ -1,3 +1,4 @@
+<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.dao.orm.QueryUtil"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
@@ -50,13 +51,13 @@ if ("allegati_geologici".equals(tipoAllegati)) {
tipologiaAllegati = DocumentiPraticaUtil.getDocCollaudo();
type = "acl";
} else {
- tipologiaAllegati = DocumentiPraticaUtil.getDocDomanda();
+ tipologiaAllegati = new ArrayList(DocumentiPraticaUtil.getDocDomanda());
//BUG BO ID=9 (ANNULLA ISTANZA)
tipologiaAllegati.add(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_ANNULLAMENTO_FASCICOLO);
type = "ad";
}
%>
-
+
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/fascicolo_action.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/fascicolo_action.jsp
index e3c85b4e..3eed818c 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/fascicolo_action.jsp
+++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/fascicolo_action.jsp
@@ -41,7 +41,8 @@ String randomId = StringUtil.randomId() + StringPool.UNDERLINE + intPratica.getI
+ && intPratica.getStatus() != WorkflowConstants.STATUS_INCOMPLETE && !intPratica.getSospesa()
+ && IntPraticaLocalServiceUtil.getTipiProcedure().containsKey(intPratica.getTipoProcedura()) %>">
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_dettagli_principali.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_dettagli_principali.jsp
index fa8de951..cbce2ff8 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_dettagli_principali.jsp
+++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_dettagli_principali.jsp
@@ -1,6 +1,6 @@
+<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.service.DiocesiLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.Diocesi"%>
-<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants"%>
<%@page import="it.tref.liferay.portos.bo.service.ConfigurazioneLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%>
@@ -56,6 +56,8 @@ String hide10 = intPratica.getTipoProcedura().equalsIgnoreCase(Constants.PROCEDU
|| intPratica.getTipoProcedura().equalsIgnoreCase(Constants.PROCEDURA_P10) ? "hideSection" : "";
boolean showDiocesi = intPratica.getTipoProcedura().equalsIgnoreCase(Constants.PROCEDURA_Q1) ||
intPratica.getTipoProcedura().equalsIgnoreCase(Constants.PROCEDURA_Q2);
+String originMappe = ConfigurazioneLocalServiceUtil.isProduction() ?
+ PortalUtil.getPortalURL(request) : "https://paesaggistica.sicilia.it";
%>
@@ -288,42 +290,45 @@ 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 = [];
- var lat = '';
- var lng = '';
- var name = '';
- for (key in data) {
- var el = null;
- switch (key) {
- case 'latitudine':
- lat = data[key];
- break;
- case 'longitudine':
- lng = data[key];
- break;
- case 'paesaggioLocale':
- case 'livelloDiTutela':
- case 'vincoli':
- data[key] = duplicati(data[key]);
- // Fall through
- default:
- el = document.getElementById('input_' + key);
+ if (event.origin == '<%= originMappe %>') {
+ try {
+ var data = JSON.parse(event.data);
+ } catch (e) {
+ return;
}
- if (null !== el) {
- el.value = data[key];
- trasferiti.push(key);
+ var lat = '';
+ var lng = '';
+ for (key in data) {
+ var name = '';
+ switch (key) {
+ case 'latitudine':
+ lat = data[key];
+ break;
+ case 'longitudine':
+ lng = data[key];
+ break;
+ case 'paesaggioLocale':
+ name = 'input_contestoPaesaggistico';
+ data[key] = duplicati(data[key]);
+ break;
+ case 'livelloDiTutela':
+ case 'vincoli':
+ data[key] = duplicati(data[key]);
+ // Fall through
+ default:
+ name = 'input_' + key;
+ }
+ if (name !== '') {
+ var el = document.getElementById('' + name);
+ if (null !== el) {
+ el.value = data[key];
+ }
+ }
+ }
+ if (lat.length > 0 && lng.length > 0) {
+ var el = document.getElementById('localizzazioneGeografica');
+ el.value = lat + '|' + lng + '|8';
}
- }
- var el = document.getElementById('localizzazioneGeografica');
- el.value = lat + '|' + lng + '|8';
- trasferiti.push('localizzazioneGeografica');
- if (trasferiti.length > 0) {
- console.log('Trasferiti correttamente: ' + trasferiti.join(', '));
}
}
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_columns_generic.jspf b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_columns_generic.jspf
index 54c284b6..51a4f351 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_columns_generic.jspf
+++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_columns_generic.jspf
@@ -307,7 +307,7 @@ if (lastDettPratica == null) {
<%= LanguageUtil.get(pageContext, "label_procedura_" + intPratica.getTipoProcedura()) + ") " + LanguageUtil.get(pageContext, "tipo_procedura_" + intPratica.getTipoProcedura()) %>
- <%= lastDettPratica.getDescLongIntervento() %>
+ <%= HtmlUtil.escape(lastDettPratica.getDescLongIntervento()) %>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.bean.BeanPropertiesUtil"%>
<%@page import="com.liferay.portal.kernel.servlet.ServletContextPool"%>
@@ -190,7 +191,7 @@ String hide10 = (intPratica.getTipoProcedura().equalsIgnoreCase(Constants.PROCED
- <%= BeanPropertiesUtil.getString(dettPratica, "descLongIntervento") %>
+ <%= HtmlUtil.escape(BeanPropertiesUtil.getString(dettPratica, "descLongIntervento")) %>
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_riepilogo.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_riepilogo.jsp
index 2d0eb227..d47a67c8 100644
--- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_riepilogo.jsp
+++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_riepilogo.jsp
@@ -1,3 +1,4 @@
+<%@page import="com.liferay.portal.kernel.util.HtmlUtil"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.bean.BeanPropertiesUtil"%>
<%@page import="com.liferay.portal.kernel.servlet.ServletContextPool"%>
@@ -197,7 +198,7 @@ String hide10 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q10)
- <%= BeanPropertiesUtil.getString(dettPratica, "descLongIntervento") %>
+ <%= HtmlUtil.escape(BeanPropertiesUtil.getString(dettPratica, "descLongIntervento")) %>
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/sorgenti/footer.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/sorgenti/footer.jsp
deleted file mode 100644
index f26d9923..00000000
--- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/sorgenti/footer.jsp
+++ /dev/null
@@ -1,6 +0,0 @@
-<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
-
-
-
-