From b96ddb541019df9a70c469417bc7148d92639343 Mon Sep 17 00:00:00 2001 From: Salvatore La Manna Date: Wed, 9 Dec 2020 10:28:19 +0100 Subject: [PATCH] Correzioni moduli --- jasper/Modello_autorizzazione.jrxml | 2 +- jasper/Modello_diniego.jrxml | 2 +- jasper/Modello_non_competenza.jrxml | 2 +- jasper/Modello_preavviso.jrxml | 2 +- .../portos/firma/servlet/FirmaServlet.java | 310 +++++++++--------- .../portos/firma/util/FirmaGetUtil.java | 7 +- .../docroot/html/firma/init.jsp | 15 +- .../docroot/WEB-INF/src/service.properties | 4 +- .../view_panel_pagamenti_spese.jsp | 1 - 9 files changed, 175 insertions(+), 170 deletions(-) delete mode 100644 liferay-plugins-sdk-6.2/view_panel_pagamenti_spese.jsp diff --git a/jasper/Modello_autorizzazione.jrxml b/jasper/Modello_autorizzazione.jrxml index d76de27d..6fb78b68 100644 --- a/jasper/Modello_autorizzazione.jrxml +++ b/jasper/Modello_autorizzazione.jrxml @@ -390,7 +390,7 @@ L’eventuale ricorso gerarchico, debitamente sottoscritto e regolarizzato in bo - + diff --git a/jasper/Modello_diniego.jrxml b/jasper/Modello_diniego.jrxml index fb094bb0..a6198c61 100644 --- a/jasper/Modello_diniego.jrxml +++ b/jasper/Modello_diniego.jrxml @@ -383,7 +383,7 @@ L’eventuale ricorso gerarchico, debitamente sottoscritto e regolarizzato in bo - + diff --git a/jasper/Modello_non_competenza.jrxml b/jasper/Modello_non_competenza.jrxml index 24e8456d..f7ac934e 100644 --- a/jasper/Modello_non_competenza.jrxml +++ b/jasper/Modello_non_competenza.jrxml @@ -370,7 +370,7 @@ esaminata la documentazione allegata all’istanza;]]> - + diff --git a/jasper/Modello_preavviso.jrxml b/jasper/Modello_preavviso.jrxml index 42be7023..d2f2405c 100644 --- a/jasper/Modello_preavviso.jrxml +++ b/jasper/Modello_preavviso.jrxml @@ -326,7 +326,7 @@ Trascorso infruttuosamente tale termine si procederà all’emissione di provved - + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/servlet/FirmaServlet.java b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/servlet/FirmaServlet.java index 65058fa5..c15a2ff0 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/servlet/FirmaServlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/servlet/FirmaServlet.java @@ -33,156 +33,162 @@ import javax.servlet.http.HttpServletResponse; public class FirmaServlet extends HttpServlet { - private static final long serialVersionUID = 1L; - - private static final String GET_CONFIGURATION = "get-configuration"; // get - private static final String GET_FILE_LIST = "get-file-list"; // post - private static final String GET_FILE = "get-file"; // post - private static final String GET_TYPE = "get-type"; // get - private static final String GET_TYPE_VERBALE = "get-type-verbale"; // get - private static final String LOGIN = "login"; // get - private static final String OPEN_PRATICA = "open-pratica"; // post - private static final String RIFIUTA = "rifiuta"; // post - private static final String SET_FILE = "set-file"; // post - private static final String VERSION = "version"; // get - private static final String GET_STILE = "get-stile"; // get - - private static final Log _log = LogFactoryUtil.getLog(FirmaServlet.class); - - /** - * @see HttpServlet#HttpServlet() - */ - public FirmaServlet() { - - super(); - } - - /** - * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) - */ - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - String pathInfo = request.getPathInfo().substring(1); - String[] pathArray = StringUtil.split(pathInfo, "/"); - FirmaGetUtil firmaGetUtil = new FirmaGetUtil(); - String metodo = pathArray[0]; - Risposta risposta = new Risposta<>(); - - switch (metodo) { - case GET_CONFIGURATION: - risposta = firmaGetUtil.getConfiguration(); - break; - - case GET_TYPE: - risposta = firmaGetUtil.getType(); - break; - - case GET_TYPE_VERBALE: - risposta = firmaGetUtil.getTypeVerbale(); - break; - - case LOGIN: - if (pathArray.length == 2) { - String codiceFiscale = pathArray[1]; - risposta = firmaGetUtil.loginCodiceFiscale(codiceFiscale); - } - if (pathArray.length == 3) { - String nome = pathArray[1]; - String cognome = pathArray[2]; - risposta = firmaGetUtil.loginNomeCognome(nome, cognome); - } - break; - - case VERSION: - risposta = firmaGetUtil.version(); - break; - - case GET_STILE: - risposta = firmaGetUtil.getStile(); - break; - - } - JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer(); - jsonSerializer.exclude("*.class"); - String jsonResponse = jsonSerializer.serializeDeep(risposta); - - response.setContentType("application/json; charset=UTF-8"); - ServletResponseUtil.write(response, jsonResponse); - - } - - /** - * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) - */ - @Override - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - String pathInfo = request.getPathInfo().substring(1); - String[] pathArray = StringUtil.split(pathInfo, "/"); - - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - StreamUtil.transfer(request.getInputStream(), outputStream); - String token = new String(outputStream.toByteArray(), StandardCharsets.UTF_8); - - FirmaPostUtil firmaPostUtil = new FirmaPostUtil(); - String metodo = pathArray[0]; - Risposta risposta = new Risposta<>(); - - switch (metodo) { - case GET_FILE: - if (pathArray.length == 3) { - String tipo = pathArray[1]; - String id = pathArray[2]; - risposta = firmaPostUtil.getFile(token, tipo, id); - } - break; - - case GET_FILE_LIST: - risposta = firmaPostUtil.getFileList(token); - break; - - case OPEN_PRATICA: - if (pathArray.length == 2) { - String idFile = pathArray[1]; - risposta = firmaPostUtil.openPratica(token, idFile); - } - break; - - case RIFIUTA: - if (pathArray.length == 5) { - String idFile = pathArray[1]; - String messaggio = pathArray[2]; - String cambiaFase = pathArray[3]; - String assegna = pathArray[4]; - risposta = firmaPostUtil.rifiuta(token, idFile, messaggio, cambiaFase, assegna); - } - break; - - case SET_FILE: - if (pathArray.length == 3) { - String tipo = pathArray[1]; - String idFile = pathArray[2]; - JSONDeserializer> jsonDeserializer = JSONFactoryUtil.createJSONDeserializer(); - Map map = jsonDeserializer.deserialize(token); - - ServiceContext serviceContext = null; - try { - serviceContext = ServiceContextFactory.getInstance(request); - } catch (PortalException | SystemException e) { - _log.error(e.getMessage()); - } - - risposta = firmaPostUtil.setFile(map.get("token"), map.get("file"), tipo, idFile, serviceContext); - } - break; - } - - JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer(); - jsonSerializer.exclude("*.class"); - String jsonResponse = jsonSerializer.serialize(risposta); - - response.setContentType("application/json; charset=UTF-8"); - ServletResponseUtil.write(response, jsonResponse); - } + private static final long serialVersionUID = 1L; + + private static final String GET_CONFIGURATION = "get-configuration"; // get + private static final String GET_FILE_LIST = "get-file-list"; // post + private static final String GET_FILE = "get-file"; // post + private static final String GET_TYPE = "get-type"; // get + private static final String GET_TYPE_VERBALE = "get-type-verbale"; // get + private static final String LOGIN = "login"; // get + private static final String OPEN_PRATICA = "open-pratica"; // post + private static final String RIFIUTA = "rifiuta"; // post + private static final String SET_FILE = "set-file"; // post + private static final String VERSION = "version"; // get + private static final String GET_STILE = "get-stile"; // get + + private static final Log _log = LogFactoryUtil.getLog(FirmaServlet.class); + + /** + * @see HttpServlet#HttpServlet() + */ + public FirmaServlet() { + + super(); + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse + * response) + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, + IOException { + + String pathInfo = request.getPathInfo().substring(1); + String[] pathArray = StringUtil.split(pathInfo, "/"); + FirmaGetUtil firmaGetUtil = new FirmaGetUtil(); + String metodo = pathArray[0]; + Risposta risposta = new Risposta<>(); + + switch (metodo) { + case GET_CONFIGURATION: + risposta = firmaGetUtil.getConfiguration(); + break; + + case GET_TYPE: + risposta = firmaGetUtil.getType(); + break; + + case GET_TYPE_VERBALE: + risposta = firmaGetUtil.getTypeVerbale(); + break; + + case LOGIN: + if (pathArray.length == 2) { + String codiceFiscale = pathArray[1]; + risposta = firmaGetUtil.loginCodiceFiscale(codiceFiscale); + } + if (pathArray.length == 3) { + String nome = pathArray[1]; + String cognome = pathArray[2]; + risposta = firmaGetUtil.loginNomeCognome(nome, cognome); + } + break; + + case VERSION: + risposta = firmaGetUtil.version(); + break; + + case GET_STILE: + risposta = firmaGetUtil.getStile(); + break; + + } + JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer(); + jsonSerializer.exclude("*.class"); + String jsonResponse = jsonSerializer.serializeDeep(risposta); + + response.setContentType("application/json; charset=UTF-8"); + ServletResponseUtil.write(response, jsonResponse); + + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse + * response) + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, + IOException { + + String pathInfo = request.getPathInfo().substring(1); + String[] pathArray = StringUtil.split(pathInfo, "/"); + + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + StreamUtil.transfer(request.getInputStream(), outputStream); + String token = new String(outputStream.toByteArray(), StandardCharsets.UTF_8); + + FirmaPostUtil firmaPostUtil = new FirmaPostUtil(); + String metodo = pathArray[0]; + Risposta risposta = new Risposta<>(); + + switch (metodo) { + case GET_FILE: + if (pathArray.length == 3) { + String tipo = pathArray[1]; + String id = pathArray[2]; + risposta = firmaPostUtil.getFile(token, tipo, id); + } + break; + + case GET_FILE_LIST: + risposta = firmaPostUtil.getFileList(token); + break; + + case OPEN_PRATICA: + if (pathArray.length == 2) { + String idFile = pathArray[1]; + risposta = firmaPostUtil.openPratica(token, idFile); + } + break; + + case RIFIUTA: + if (pathArray.length == 5) { + String idFile = pathArray[1]; + String messaggio = pathArray[2]; + String cambiaFase = pathArray[3]; + String assegna = pathArray[4]; + risposta = firmaPostUtil.rifiuta(token, idFile, messaggio, cambiaFase, assegna); + } + break; + + case SET_FILE: + if (pathArray.length == 3) { + String tipo = pathArray[1]; + String idFile = pathArray[2]; + JSONDeserializer> jsonDeserializer = JSONFactoryUtil + .createJSONDeserializer(); + Map map = jsonDeserializer.deserialize(token); + + ServiceContext serviceContext = null; + try { + serviceContext = ServiceContextFactory.getInstance(request); + } catch (PortalException | SystemException e) { + _log.error(e.getMessage()); + } + + risposta = firmaPostUtil.setFile(map.get("token"), map.get("file"), tipo, idFile, + serviceContext); + } + break; + } + + JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer(); + jsonSerializer.exclude("*.class"); + String jsonResponse = jsonSerializer.serialize(risposta); + + response.setContentType("application/json; charset=UTF-8"); + ServletResponseUtil.write(response, jsonResponse); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaGetUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaGetUtil.java index 508798d9..2d36d18d 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaGetUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaGetUtil.java @@ -150,12 +150,11 @@ public class FirmaGetUtil { if (codiceFiscale.equals(codiceFiscaleTest)) { String tokenTest = jxPortletPreferences.getValue("tokenTest", StringPool.BLANK); risposta.setObj(tokenTest); - risposta.setRisposta(RispostaCostanti.OK); } else { // TODO da migliorare per sicurezza e poi modificare a giro risposta.setObj(codiceFiscale); - risposta.setRisposta(RispostaCostanti.OK); } + risposta.setRisposta(RispostaCostanti.OK); return risposta; } @@ -178,7 +177,9 @@ public class FirmaGetUtil { javax.portlet.PortletPreferences jxPortletPreferences = FirmaUtil.getPortletPreferences(); String versione = jxPortletPreferences.getValue("versione", StringPool.BLANK); Risposta risposta = new Risposta<>(); - if (!Validator.isBlank(versione)) { + if (Validator.isBlank(versione)) { + risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); + } else { risposta.setObj(versione); risposta.setRisposta(RispostaCostanti.OK); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/html/firma/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/html/firma/init.jsp index 45045e6f..9186e043 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/html/firma/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/html/firma/init.jsp @@ -1,8 +1,7 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@taglib uri="http://liferay.com/tld/aui" prefix="aui"%> <%@taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet"%> -<%@taglib uri="http://liferay.com/tld/security" - prefix="liferay-security"%> +<%@taglib uri="http://liferay.com/tld/security" prefix="liferay-security"%> <%@taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme"%> <%@taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui"%> <%@taglib uri="http://liferay.com/tld/util" prefix="liferay-util"%> @@ -24,10 +23,10 @@ <% - String listaFileTest = portletPreferences.getValue("listaFileTest", StringPool.BLANK); - String codiceFiscaleTest = portletPreferences.getValue("codiceFiscaleTest", StringPool.BLANK); - String tokenTest = portletPreferences.getValue("tokenTest", StringPool.BLANK); - String nomeTest = portletPreferences.getValue("nomeTest", StringPool.BLANK); - String cognomeTest = portletPreferences.getValue("cognomeTest", StringPool.BLANK); - String versione = portletPreferences.getValue("versione", StringPool.BLANK); + String listaFileTest = portletPreferences.getValue("listaFileTest", StringPool.BLANK); + String codiceFiscaleTest = portletPreferences.getValue("codiceFiscaleTest", StringPool.BLANK); + String tokenTest = portletPreferences.getValue("tokenTest", StringPool.BLANK); + String nomeTest = portletPreferences.getValue("nomeTest", StringPool.BLANK); + String cognomeTest = portletPreferences.getValue("cognomeTest", StringPool.BLANK); + String versione = portletPreferences.getValue("versione", StringPool.BLANK); %> \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/service.properties index d743bad0..5dcc4a5d 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/service.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/service.properties @@ -13,8 +13,8 @@ ## build.namespace=portos_Mail - build.number=81 - build.date=1606914570374 + build.number=82 + build.date=1607506075611 build.auto.upgrade=true ## diff --git a/liferay-plugins-sdk-6.2/view_panel_pagamenti_spese.jsp b/liferay-plugins-sdk-6.2/view_panel_pagamenti_spese.jsp deleted file mode 100644 index 93abbe53..00000000 --- a/liferay-plugins-sdk-6.2/view_panel_pagamenti_spese.jsp +++ /dev/null @@ -1 +0,0 @@ -<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>