diff --git a/CHANGELOG.md b/CHANGELOG.md index 8826142..3cb0e0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,12 @@ +## 5.3.0 (07-06-2024) + +### Bugfix: 1 +- [#32033](https://parermine.regione.emilia-romagna.it/issues/32033) Aggiornamento metadati: gestire errore dovuto all'aggiornamento errato del TipoConservazione + +### Novità: 1 +- [#32653](https://parermine.regione.emilia-romagna.it/issues/32653) Gestione invocazione microservice di verifica firma + ## 5.2.0 (06-05-2024) ### Bugfix: 3 diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index a3c669d..3114735 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,10 +1,7 @@ -## 5.2.0 (06-05-2024) +## 5.3.0 (07-06-2024) -### Bugfix: 3 -- [#32027](https://parermine.regione.emilia-romagna.it/issues/32027) Aggiornamento metadati: errore 666 se si tenta di aggiornare i Dati Specifici dei componenti -- [#31821](https://parermine.regione.emilia-romagna.it/issues/31821) Correzione gestione data scadenza in caso di "certificato scaduto" (verifica firma eidas) -- [#31285](https://parermine.regione.emilia-romagna.it/issues/31285) Correzione messaggio di errore di aggiornamento metadati +### Bugfix: 1 +- [#32033](https://parermine.regione.emilia-romagna.it/issues/32033) Aggiornamento metadati: gestire errore dovuto all'aggiornamento errato del TipoConservazione -### Novità: 2 -- [#31672](https://parermine.regione.emilia-romagna.it/issues/31672) Introduzione TAG "temporany" su bucket staging (con lifecycle) -- [#29276](https://parermine.regione.emilia-romagna.it/issues/29276) Salvataggio diretto su OS di Aggiornamento metadati UD +### Novità: 1 +- [#32653](https://parermine.regione.emilia-romagna.it/issues/32653) Gestione invocazione microservice di verifica firma diff --git a/pdfdocs/CHANGELOG.pdf b/pdfdocs/CHANGELOG.pdf new file mode 100644 index 0000000..9639d90 Binary files /dev/null and b/pdfdocs/CHANGELOG.pdf differ diff --git a/pdfdocs/JBoss7_configurazione_generale.pdf b/pdfdocs/JBoss7_configurazione_generale.pdf new file mode 100644 index 0000000..3e41f25 Binary files /dev/null and b/pdfdocs/JBoss7_configurazione_generale.pdf differ diff --git a/pdfdocs/JBoss7_configurazione_sacerws.pdf b/pdfdocs/JBoss7_configurazione_sacerws.pdf new file mode 100644 index 0000000..df35fb0 Binary files /dev/null and b/pdfdocs/JBoss7_configurazione_sacerws.pdf differ diff --git a/pdfdocs/RELEASE-NOTES.pdf b/pdfdocs/RELEASE-NOTES.pdf new file mode 100644 index 0000000..d026624 Binary files /dev/null and b/pdfdocs/RELEASE-NOTES.pdf differ diff --git a/pom.xml b/pom.xml index 225a91e..1c3ece6 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 sacerws - 5.2.1-SNAPSHOT + 5.3.1-SNAPSHOT pom sacerws Progetto SACERWS @@ -55,7 +55,7 @@ ${project.version} war - + ${project.groupId} sacerws-jpa ${project.version} diff --git a/sacerws-ear/pom.xml b/sacerws-ear/pom.xml index f43a091..9945f71 100644 --- a/sacerws-ear/pom.xml +++ b/sacerws-ear/pom.xml @@ -4,7 +4,7 @@ sacerws it.eng.parer - 5.2.1-SNAPSHOT + 5.3.1-SNAPSHOT sacerws-ear diff --git a/sacerws-ejb/pom.xml b/sacerws-ejb/pom.xml index 2eda84d..2aa4e81 100644 --- a/sacerws-ejb/pom.xml +++ b/sacerws-ejb/pom.xml @@ -3,7 +3,7 @@ sacerws it.eng.parer - 5.2.1-SNAPSHOT + 5.3.1-SNAPSHOT sacerws-ejb diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/CryptoInvoker.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/CryptoInvoker.java similarity index 97% rename from sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/CryptoInvoker.java rename to sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/CryptoInvoker.java index 08a9f81..d458ead 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/CryptoInvoker.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/CryptoInvoker.java @@ -15,7 +15,7 @@ * If not, see . */ -package it.eng.parer.firma.crypto.verifica; +package it.eng.parer.firma.ejb; import java.io.File; import java.net.URI; @@ -52,12 +52,11 @@ import it.eng.parer.crypto.model.verifica.input.CryptoProfiloVerifica; import it.eng.parer.crypto.model.verifica.input.TipologiaDataRiferimento; import it.eng.parer.entity.constraint.DecServizioVerificaCompDoc.CdServizioVerificaCompDoc; -import it.eng.parer.firma.crypto.helper.CryptoRestConfiguratorHelper; -import it.eng.parer.firma.ejb.IVerificaFirmaInvoker; import it.eng.parer.firma.exception.VerificaFirmaConnectionException; import it.eng.parer.firma.exception.VerificaFirmaGenericInvokeException; import it.eng.parer.firma.exception.VerificaFirmaWrapperGenericException; import it.eng.parer.firma.exception.VerificaFirmaWrapperResNotFoundException; +import it.eng.parer.firma.helper.CryptoRestConfiguratorHelper; import it.eng.parer.firma.strategy.CryptoWrapperResultStrategy; import it.eng.parer.firma.util.CryptoErrorHandler; import it.eng.parer.firma.xml.VerificaFirmaWrapper; @@ -233,12 +232,14 @@ public VerificaFirmaWrapper verificaAndWrapIt(ComponenteVers componenteVers, final boolean hasFirmeDetached = sottoComponentiFirma != null && !sottoComponentiFirma.isEmpty(); CryptoAroCompDoc output; - if (isComponenteSuObjectStorage(componenteVers)) { + if (isComponenteSuObjectStorage(componenteVers) && !restInvoker.isEnableMultipartRequest().booleanValue()) { + LOG.debug("Invocazione verifica firma CRYPTO (application/json)"); CryptoDataToValidateDataUri data = buildDataUri(componenteVers, sottoComponentiFirma, sottoComponentiMarca); output = verificaCrypto(data, metadata); } else { + LOG.debug("Invocazione verifica firma CRYPTO (multipart/form-data)"); // File firme detached (o null) List sottoComponentiMarcaFile = compilaFileDetached(sottoComponentiMarca); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/EidasInvoker.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/EidasInvoker.java index 1c56f24..0bbb075 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/EidasInvoker.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/EidasInvoker.java @@ -48,11 +48,11 @@ import it.eng.parer.eidas.model.EidasWSReportsDTOTree; import it.eng.parer.eidas.model.EidasValidationResponse; import it.eng.parer.entity.constraint.DecServizioVerificaCompDoc.CdServizioVerificaCompDoc; -import it.eng.parer.firma.crypto.helper.EidasRestConfiguratorHelper; import it.eng.parer.firma.exception.VerificaFirmaConnectionException; import it.eng.parer.firma.exception.VerificaFirmaGenericInvokeException; import it.eng.parer.firma.exception.VerificaFirmaWrapperGenericException; import it.eng.parer.firma.exception.VerificaFirmaWrapperResNotFoundException; +import it.eng.parer.firma.helper.EidasRestConfiguratorHelper; import it.eng.parer.firma.strategy.EidasWrapperResultStrategy; import it.eng.parer.firma.util.EidasErrorHandler; import it.eng.parer.firma.util.EidasUtils; @@ -212,10 +212,12 @@ public VerificaFirmaWrapper verificaAndWrapIt(ComponenteVers componenteVers, sottoComponentiFirma, controlliAbilitati, dataDiRiferimento, uuid); // file from o.s. - if (isComponenteSuObjectStorage(componenteVers)) { + if (isComponenteSuObjectStorage(componenteVers) && !restInvoker.isEnableMultipartRequest().booleanValue()) { + LOG.debug("Invocazione verifica firma EIDAS (application/json)"); // call esito = verificaEidasJson(dto); } else { + LOG.debug("Invocazione verifica firma EIDAS (multipart/form-data)"); // file from multipart final boolean hasFirmeDetached = sottoComponentiFirma != null && !sottoComponentiFirma.isEmpty(); File signed = null; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/FirmeFormatiVers.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/FirmeFormatiVers.java index f68c0ae..9e10f2c 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/FirmeFormatiVers.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/FirmeFormatiVers.java @@ -40,14 +40,14 @@ import it.eng.parer.entity.DecFormatoFileDoc; import it.eng.parer.entity.DecFormatoFileStandard; import it.eng.parer.entity.OrgStrut; -import it.eng.parer.firma.crypto.verifica.VerFormatiEnums; -import it.eng.parer.firma.crypto.verifica.VerFormatiEnums.EsitoControlloFormato; -import it.eng.parer.firma.crypto.verifica.VerFormatiEnums.FormatiStandardFirme; -import it.eng.parer.firma.crypto.verifica.VerFormatiEnums.IdoneitaFormato; import it.eng.parer.firma.dto.CompDocMock; import it.eng.parer.firma.dto.input.InvokeVerificaInput; import it.eng.parer.firma.dto.input.InvokeVerificaRule; import it.eng.parer.firma.exception.VerificaFirmaException; +import it.eng.parer.firma.util.VerificaFormatiEnums; +import it.eng.parer.firma.util.VerificaFormatiEnums.EsitoControlloFormato; +import it.eng.parer.firma.util.VerificaFormatiEnums.FormatiStandardFirme; +import it.eng.parer.firma.util.VerificaFormatiEnums.IdoneitaFormato; import it.eng.parer.firma.xml.VFAdditionalInfoBustaType; import it.eng.parer.firma.xml.VFFirmaCompType; import it.eng.parer.firma.xml.VFMarcaCompType; @@ -391,18 +391,20 @@ private void extractFormatInfo(ComponenteVers componenteVers, long idTipoUd, Ver if (formatoStd == null) { formatoRapprBuilder.put(busta.getPgBusta().intValue(), - VerFormatiEnums.SEPARATORE_FORMATI + VerFormatiEnums.FORMATO_SCONOSCIUTO); - builderMessaggio.put(busta.getPgBusta().intValue(), VerFormatiEnums.SEPARATORE_FORMATI + nomeFormato); + VerificaFormatiEnums.SEPARATORE_FORMATI + VerificaFormatiEnums.FORMATO_SCONOSCIUTO); + builderMessaggio.put(busta.getPgBusta().intValue(), + VerificaFormatiEnums.SEPARATORE_FORMATI + nomeFormato); } else if (!formatoStd.getNmFormatoFileStandard().equals(FormatiStandardFirme.XML.name()) && !formatoStd.getNmFormatoFileStandard().equals(FormatiStandardFirme.PDF.name())) { // sono esclusi i formati XML e PDF altrimenti avrei XML.XML o PDF.PDF formatoRapprBuilder.put(busta.getPgBusta().intValue(), - VerFormatiEnums.SEPARATORE_FORMATI + formatoStd.getNmFormatoFileStandard()); - builderMessaggio.put(busta.getPgBusta().intValue(), VerFormatiEnums.SEPARATORE_FORMATI + nomeFormato); + VerificaFormatiEnums.SEPARATORE_FORMATI + formatoStd.getNmFormatoFileStandard()); + builderMessaggio.put(busta.getPgBusta().intValue(), + VerificaFormatiEnums.SEPARATORE_FORMATI + nomeFormato); } else if (formatoStd.getNmFormatoFileStandard().equals(FormatiStandardFirme.XML.name())) { - tikaMime = VerFormatiEnums.XML_MIME; + tikaMime = VerificaFormatiEnums.XML_MIME; } else if (formatoStd.getNmFormatoFileStandard().equals(FormatiStandardFirme.PDF.name())) { - tikaMime = VerFormatiEnums.PDF_MIME; + tikaMime = VerificaFormatiEnums.PDF_MIME; } } // Eventuale normalizzazione mime type xml @@ -466,7 +468,7 @@ private void extractFormatInfo(ComponenteVers componenteVers, long idTipoUd, Ver // formatoStd può essere null se e solo se il mime tika non è censito tra i // formati standard if (formatoStd == null) { - formatoRapprBuilder.put(0, VerFormatiEnums.FORMATO_SCONOSCIUTO); + formatoRapprBuilder.put(0, VerificaFormatiEnums.FORMATO_SCONOSCIUTO); } else { formatoRapprBuilder.put(0, formatoStd.getNmFormatoFileStandard()); mock.setIdDecFormatoFileStandard(new BigDecimal(formatoStd.getIdFormatoFileStandard())); @@ -505,8 +507,8 @@ private void extractFormatInfo(ComponenteVers componenteVers, long idTipoUd, Ver formatoRappr.append(formatoStd.getNmFormatoFileStandard()); listaFormatiMimeTypeTika.append(formatoStd.getNmFormatoFileStandard()); } else { - formatoRapprEsteso.append(VerFormatiEnums.FORMATO_SCONOSCIUTO); - formatoRappr.append(VerFormatiEnums.FORMATO_SCONOSCIUTO); + formatoRapprEsteso.append(VerificaFormatiEnums.FORMATO_SCONOSCIUTO); + formatoRappr.append(VerificaFormatiEnums.FORMATO_SCONOSCIUTO); listaFormatiMimeTypeTika.append(builderMessaggio.get(1)); } } else { @@ -514,8 +516,8 @@ private void extractFormatInfo(ComponenteVers componenteVers, long idTipoUd, Ver // versata come componente, caso di formato di firma non conforme] // MEV#18660 mock.setIdDecFormatoFileStandard(null); - formatoRapprBuilder.put(0, VerFormatiEnums.FORMATO_SCONOSCIUTO); - builderMessaggio.put(0, VerFormatiEnums.FORMATO_SCONOSCIUTO); + formatoRapprBuilder.put(0, VerificaFormatiEnums.FORMATO_SCONOSCIUTO); + builderMessaggio.put(0, VerificaFormatiEnums.FORMATO_SCONOSCIUTO); String nthFormat = formatoRapprBuilder.get(0); formatoRappr.append(nthFormat); formatoRapprEsteso.append(nthFormat); @@ -570,10 +572,10 @@ private void extractFormatInfo(ComponenteVers componenteVers, long idTipoUd, Ver mock.setTiEsitoContrFormatoFile(EsitoControlloFormato.NEGATIVO.name()); StringBuilder esitoNegativo = new StringBuilder(); esitoNegativo.append("Il formato di rappresentazione"); - if (formatoRappr.indexOf(VerFormatiEnums.FORMATO_SCONOSCIUTO) > -1) { + if (formatoRappr.indexOf(VerificaFormatiEnums.FORMATO_SCONOSCIUTO) > -1) { esitoNegativo.append(" è sconosciuto"); if (!formatoRappr.toString().equalsIgnoreCase(listaFormatiMimeTypeTika.toString()) - && !VerFormatiEnums.OCTET_STREAM_MIME.equalsIgnoreCase(tikaMime)) { + && !VerificaFormatiEnums.OCTET_STREAM_MIME.equalsIgnoreCase(tikaMime)) { esitoNegativo.append(", può corrispondere a "); esitoNegativo.append(listaFormatiMimeTypeTika); } @@ -581,7 +583,7 @@ private void extractFormatInfo(ComponenteVers componenteVers, long idTipoUd, Ver esitoNegativo.append(" calcolato è "); esitoNegativo.append(formatoRappr); if (!formatoRappr.toString().equalsIgnoreCase(listaFormatiMimeTypeTika.toString()) - && !VerFormatiEnums.OCTET_STREAM_MIME.equalsIgnoreCase(tikaMime)) { + && !VerificaFormatiEnums.OCTET_STREAM_MIME.equalsIgnoreCase(tikaMime)) { esitoNegativo.append(", corrisponde a "); esitoNegativo.append(listaFormatiMimeTypeTika); } @@ -759,7 +761,7 @@ private boolean testFormati(String formatoRappr, String formatoVers) throws Veri private String buildMessage(List res) { if (res.isEmpty()) { - return VerFormatiEnums.FORMATO_SCONOSCIUTO; + return VerificaFormatiEnums.FORMATO_SCONOSCIUTO; } if (res.size() == 1) { return res.get(0).getNmFormatoFileStandard(); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/VerificaFirmaWrapperManager.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/VerificaFirmaWrapperManager.java index 782270b..8851b2d 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/VerificaFirmaWrapperManager.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/ejb/VerificaFirmaWrapperManager.java @@ -33,7 +33,6 @@ import it.eng.parer.entity.FirCertifOcsp; import it.eng.parer.entity.FirCrl; import it.eng.parer.entity.FirOcsp; -import it.eng.parer.firma.crypto.verifica.CryptoInvoker; import it.eng.parer.firma.dto.input.InvokeVerificaInput; import it.eng.parer.firma.dto.input.InvokeVerificaRule; import it.eng.parer.firma.exception.VerificaFirmaConnectionException; diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/helper/CryptoRestConfiguratorHelper.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/helper/CryptoRestConfiguratorHelper.java similarity index 94% rename from sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/helper/CryptoRestConfiguratorHelper.java rename to sacerws-ejb/src/main/java/it/eng/parer/firma/helper/CryptoRestConfiguratorHelper.java index c93e9ea..90155ba 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/helper/CryptoRestConfiguratorHelper.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/helper/CryptoRestConfiguratorHelper.java @@ -15,7 +15,7 @@ * If not, see . */ -package it.eng.parer.firma.crypto.helper; +package it.eng.parer.firma.helper; import java.util.LinkedList; import java.util.List; @@ -63,6 +63,8 @@ public class CryptoRestConfiguratorHelper implements RestConfiguratorHelper { private static final String PARAMETRO_NON_TROVATO = "Parametro {} non trovato. Utilizzo il valore predefinito."; + public static final String FL_CRYPTO_ENABLE_REQUEST_MULTIPART_FORMDATA = "FL_CRYPTO_ENABLE_REQUEST_MULTIPART_FORMDATA"; + private static final String ENDPOINT_SEPARATOR = "\\|"; @EJB @@ -141,6 +143,10 @@ public Boolean isCompositePolicyOptimisticParam() { return getBooleanParameter(CRYPTO_COMPOSITE_POLICY_OPTIMISTIC); } + public Boolean isEnableMultipartRequest() { + return getBooleanParameter(FL_CRYPTO_ENABLE_REQUEST_MULTIPART_FORMDATA); + } + /** * Lista degli endpoint per i servizi REST. Tendenzialmente questa verrà trattata come una lista circolare. * diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/helper/EidasRestConfiguratorHelper.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/helper/EidasRestConfiguratorHelper.java similarity index 94% rename from sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/helper/EidasRestConfiguratorHelper.java rename to sacerws-ejb/src/main/java/it/eng/parer/firma/helper/EidasRestConfiguratorHelper.java index 0b97b63..e99fe6f 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/helper/EidasRestConfiguratorHelper.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/helper/EidasRestConfiguratorHelper.java @@ -15,7 +15,7 @@ * If not, see . */ -package it.eng.parer.firma.crypto.helper; +package it.eng.parer.firma.helper; import it.eng.parer.exception.ParamApplicNotFoundException; import it.eng.parer.retry.RestConfiguratorHelper; @@ -60,6 +60,8 @@ public class EidasRestConfiguratorHelper implements RestConfiguratorHelper { private static final String EIDAS_COMPOSITE_POLICY_OPTIMISTIC = "EIDAS_COMPOSITE_POLICY_OPTIMISTIC"; + public static final String FL_EIDAS_ENABLE_REQUEST_MULTIPART_FORMDATA = "FL_EIDAS_ENABLE_REQUEST_MULTIPART_FORMDATA"; + private static final String PARAMETRO_NON_TROVATO = "Parametro {} non trovato. Utilizzo il valore predefinito."; private static final String ENDPOINT_SEPARATOR = "\\|"; @@ -142,6 +144,10 @@ public Boolean isCompositePolicyOptimisticParam() { return getBooleanParameter(EIDAS_COMPOSITE_POLICY_OPTIMISTIC); } + public Boolean isEnableMultipartRequest() { + return getBooleanParameter(FL_EIDAS_ENABLE_REQUEST_MULTIPART_FORMDATA); + } + /** * Lista degli endpoint per i servizi REST. Tendenzialmente questa verrà trattata come una lista circolare. * diff --git a/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/VerFormatiEnums.java b/sacerws-ejb/src/main/java/it/eng/parer/firma/util/VerificaFormatiEnums.java similarity index 96% rename from sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/VerFormatiEnums.java rename to sacerws-ejb/src/main/java/it/eng/parer/firma/util/VerificaFormatiEnums.java index edcd897..ec3159e 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/firma/crypto/verifica/VerFormatiEnums.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/firma/util/VerificaFormatiEnums.java @@ -19,13 +19,13 @@ * To change this template, choose Tools | Templates * and open the template in the editor. */ -package it.eng.parer.firma.crypto.verifica; +package it.eng.parer.firma.util; /** * * @author Quaranta_M */ -public class VerFormatiEnums { +public class VerificaFormatiEnums { public enum FormatiStandardFirme { diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdBasePrsr.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdBasePrsr.java index fb57e15..aa2ad78 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdBasePrsr.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdBasePrsr.java @@ -28,96 +28,38 @@ public abstract class UpdBasePrsr { - protected IRispostaUpdVersWS rispostaWs; - - protected void setEsitoControlloErr(String ctrlws, String codErr, String dsErr) { + protected void setEsitoControlloErr(String ctrlws, String codErr, String dsErr, IRispostaUpdVersWS rispostaWs) { // è un errore grave ... rispostaWs.setSeverity(SeverityEnum.ERROR); // esito generale - rispostaWs.setEsitoWsError(ControlliWSBundle.getControllo(ctrlws), // TODO: il - // controllo - // che è - // fallito - // (verificare - // se - // esplicitarlo - // direttamente - // e non - // inserirlo - // come - // parte - // della - // risposta) - codErr, dsErr); + rispostaWs.setEsitoWsError(ControlliWSBundle.getControllo(ctrlws), codErr, dsErr); } - protected void setEsitoControlloErrBundle(String ctrlws, String codErr) { + protected void setEsitoControlloErrBundle(String ctrlws, String codErr, IRispostaUpdVersWS rispostaWs) { // è un errore grave ... rispostaWs.setSeverity(SeverityEnum.ERROR); // esito generale - rispostaWs.setEsitoWsErrBundle(ControlliWSBundle.getControllo(ctrlws), // TODO: il - // controllo - // che è - // fallito - // (verificare - // se - // esplicitarlo - // direttamente - // e non - // inserirlo - // come - // parte - // della - // risposta) - codErr); + rispostaWs.setEsitoWsErrBundle(ControlliWSBundle.getControllo(ctrlws), codErr); } - protected void setEsitoControlloWarn(String ctrlws, String codErr, String dsErr) { + protected void setEsitoControlloWarn(String ctrlws, String codErr, String dsErr, IRispostaUpdVersWS rispostaWs) { // warning (solo se severity diverso da ERROR) if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { rispostaWs.setSeverity(SeverityEnum.WARNING); // esito generale - rispostaWs.setEsitoWsWarning(ControlliWSBundle.getControllo(ctrlws), // TODO: il - // controllo - // che è - // fallito - // (verificare - // se - // esplicitarlo - // direttamente - // e non - // inserirlo - // come - // parte - // della - // risposta) - codErr, dsErr); + rispostaWs.setEsitoWsWarning(ControlliWSBundle.getControllo(ctrlws), codErr, dsErr); } } - protected void setEsitoControlloWarnBundle(String ctrlws, String codErr) { + protected void setEsitoControlloWarnBundle(String ctrlws, String codErr, IRispostaUpdVersWS rispostaWs) { // warning (solo se severity diverso da ERROR) if (rispostaWs.getSeverity() != SeverityEnum.ERROR) { rispostaWs.setSeverity(SeverityEnum.WARNING); // esito generale - rispostaWs.setEsitoWsWarnBundle(ControlliWSBundle.getControllo(ctrlws), // TODO: il - // controllo - // che è - // fallito - // (verificare - // se - // esplicitarlo - // direttamente - // e non - // inserirlo - // come - // parte - // della - // risposta) - codErr); + rispostaWs.setEsitoWsWarnBundle(ControlliWSBundle.getControllo(ctrlws), codErr); } } diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdCollegamentiPrsr.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdCollegamentiPrsr.java index 5f534cf..92be23f 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdCollegamentiPrsr.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdCollegamentiPrsr.java @@ -170,7 +170,7 @@ public boolean eseguiControlli(UpdVersamentoExt versamento, IRispostaUpdVersWS r // allora è un errore di database.. this.setEsitoControlloErr(ControlliWSBundle.CTRL_GENERIC_ERROR, rispostaControlli.getCodErr(), - rispostaControlli.getDsErr()); + rispostaControlli.getDsErr(), rispostaWs); // esco dal ciclo break; @@ -203,7 +203,7 @@ public boolean eseguiControlli(UpdVersamentoExt versamento, IRispostaUpdVersWS r && rispostaControlli.getCodErr().equals(MessaggiWSBundle.ERR_666)) { // è un errore di database.. this.setEsitoControlloErr(ControlliWSBundle.CTRL_GENERIC_ERROR, - rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); + rispostaControlli.getCodErr(), rispostaControlli.getDsErr(), rispostaWs); // esco dal ciclo break; @@ -236,7 +236,7 @@ public boolean eseguiControlli(UpdVersamentoExt versamento, IRispostaUpdVersWS r && rispostaControlli.getCodErr().equals(MessaggiWSBundle.ERR_666)) { // è un errore di database.. this.setEsitoControlloErr(ControlliWSBundle.CTRL_GENERIC_ERROR, - rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); + rispostaControlli.getCodErr(), rispostaControlli.getDsErr(), rispostaWs); break; } else { @@ -279,7 +279,6 @@ public boolean eseguiControlli(UpdVersamentoExt versamento, IRispostaUpdVersWS r rispostaWs.getSeverity(), TipiEsitoErrore.NEGATIVO, tmpCsChiaveColl, rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); collegamentoHasErr = true; - continue; } else { // registro esito positivo su controllo // aggiunta su controlli su collegamento @@ -317,7 +316,7 @@ public boolean eseguiControlli(UpdVersamentoExt versamento, IRispostaUpdVersWS r // valutazione dell'esito // se ho riscontrato un errore ... - this.evaluateControlliOnCollegamenti(collegamentoHasErr, tmpForzaColl, versamento); + this.evaluateControlliOnCollegamenti(collegamentoHasErr, tmpForzaColl, versamento, rispostaWs); // build on esisto (collegamenti normalizzati) /* aggiunta questa condizione qualora non fossero presenti collegamenti (casistica della cancellazione) */ @@ -329,13 +328,14 @@ public boolean eseguiControlli(UpdVersamentoExt versamento, IRispostaUpdVersWS r } private void evaluateControlliOnCollegamenti(boolean collegamentoHasErr, boolean tmpForzaColl, - UpdVersamentoExt versamento) { + UpdVersamentoExt versamento, IRispostaUpdVersWS rispostaWs) { StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); if (collegamentoHasErr) { // ...ma esiste la forzatura sui controlli lo trasformo in WARNING if (tmpForzaColl) { // esito generale - this.setEsitoControlloWarnBundle(ControlliWSBundle.CTRL_UD_COLLEGAMENTI, MessaggiWSBundle.UD_016_003); + this.setEsitoControlloWarnBundle(ControlliWSBundle.CTRL_UD_COLLEGAMENTI, MessaggiWSBundle.UD_016_003, + rispostaWs); // aggiunta su warnings versamento.addControlloOnWarningsBundle( @@ -349,7 +349,8 @@ private void evaluateControlliOnCollegamenti(boolean collegamentoHasErr, boolean } else { // esito generale - this.setEsitoControlloErrBundle(ControlliWSBundle.CTRL_UD_COLLEGAMENTI, MessaggiWSBundle.UD_016_003); + this.setEsitoControlloErrBundle(ControlliWSBundle.CTRL_UD_COLLEGAMENTI, MessaggiWSBundle.UD_016_003, + rispostaWs); // aggiunta su controlli documento (ultimo errore registrato) versamento.addEsitoControlloOnControlliUnitaDocumentariaBundle( ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_UD_COLLEGAMENTI), diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdDocumentiPrsr.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdDocumentiPrsr.java index 7c59a0a..7e5e8a8 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdDocumentiPrsr.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdDocumentiPrsr.java @@ -319,6 +319,7 @@ public boolean eseguiControlli(UpdVersamentoExt versamento, IRispostaUpdVersWS r init(versamento, myEsito); boolean prosegui = true; + AvanzamentoWs myAvanzamentoWs = rispostaWs.getAvanzamento(); StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); @@ -339,7 +340,7 @@ public boolean eseguiControlli(UpdVersamentoExt versamento, IRispostaUpdVersWS r // verifico abilitazione al tipo documento if (prosegui) { - prosegui = this.verificaAbilitazioneTipoDocumento(documento, versamento); + prosegui = this.verificaAbilitazioneTipoDocumento(documento, versamento, rispostaWs); } // verifico la corrispondenza dei DATI SPECIFICI del Documento @@ -367,19 +368,20 @@ public boolean eseguiControlli(UpdVersamentoExt versamento, IRispostaUpdVersWS r /* * Valutazione esito "complessivo" dei controlli su componenti */ - this.evaluteControlliOnComponente(strutturaUpdVers.getDocumentiAttesi(), versamento); + this.evaluteControlliOnComponente(strutturaUpdVers.getDocumentiAttesi(), versamento, rispostaWs); /* * Valutazione esito "complessivo" dei controlli su documenti eseguiti */ - this.evaluteControlliOnDocumento(strutturaUpdVers.getDocumentiAttesi(), versamento); + this.evaluteControlliOnDocumento(strutturaUpdVers.getDocumentiAttesi(), versamento, rispostaWs); myAvanzamentoWs.resetFase().setFase("verifica semantica documenti - fine").logAvanzamento(); return prosegui;// TODO: verificare se ha senso .. } - private void evaluteControlliOnDocumento(List documenti, UpdVersamentoExt versamento) { + private void evaluteControlliOnDocumento(List documenti, UpdVersamentoExt versamento, + IRispostaUpdVersWS rispostaWs) { // 0. merge di tutti i controlli fatti sui componenti dei documenti per singolo // documento // (principale, annessi, allegati, annotazioni ...) @@ -411,7 +413,8 @@ private void evaluteControlliOnDocumento(List documenti, UpdVe if (versamento.anyMatchEsitoControlli(controlliGlobal, VoceDiErrore.TipiEsitoErrore.NEGATIVO)) { // esito generale - this.setEsitoControlloErrBundle(ControlliWSBundle.CTRL_UD_DOCUMENTI, MessaggiWSBundle.UD_016_001); + super.setEsitoControlloErrBundle(ControlliWSBundle.CTRL_UD_DOCUMENTI, MessaggiWSBundle.UD_016_001, + rispostaWs); // aggiunta su controlli ud versamento.addEsitoControlloOnControlliUnitaDocumentariaBundle( @@ -421,7 +424,8 @@ private void evaluteControlliOnDocumento(List documenti, UpdVe VoceDiErrore.TipiEsitoErrore.WARNING)) { // esito generale - this.setEsitoControlloWarnBundle(ControlliWSBundle.CTRL_UD_DOCUMENTI, MessaggiWSBundle.UD_016_001); + super.setEsitoControlloWarnBundle(ControlliWSBundle.CTRL_UD_DOCUMENTI, MessaggiWSBundle.UD_016_001, + rispostaWs); // aggiunta su warnings versamento.addControlloOnWarningsBundle(ControlliWSBundle.getControllo(ControlliWSBundle.CTRL_UD_DOCUMENTI), @@ -445,7 +449,8 @@ private void evaluteControlliOnDocumento(List documenti, UpdVe } } - private void evaluteControlliOnComponente(List documenti, UpdVersamentoExt versamento) { + private void evaluteControlliOnComponente(List documenti, UpdVersamentoExt versamento, + IRispostaUpdVersWS rispostaWs) { // 0. merge di tutti i controlli fatti sui componenti dei documenti per singolo documento // (principale, annessi, allegati, annotazioni ...) // per ogni documento @@ -477,7 +482,8 @@ private void evaluteControlliOnComponente(List documenti, UpdV if (versamento.anyMatchEsitoControlli(controlliGlobal, VoceDiErrore.TipiEsitoErrore.NEGATIVO)) { // esito generale - this.setEsitoControlloErrBundle(ControlliWSBundle.CTRL_UD_COMPONENTI, MessaggiWSBundle.UD_016_002); + super.setEsitoControlloErrBundle(ControlliWSBundle.CTRL_UD_COMPONENTI, MessaggiWSBundle.UD_016_002, + rispostaWs); // aggiunta su controlli ud versamento.addEsitoControlloOnControlliUnitaDocumentariaBundle( @@ -487,7 +493,8 @@ private void evaluteControlliOnComponente(List documenti, UpdV VoceDiErrore.TipiEsitoErrore.WARNING)) { // esito generale - this.setEsitoControlloWarnBundle(ControlliWSBundle.CTRL_UD_COMPONENTI, MessaggiWSBundle.UD_016_002); + super.setEsitoControlloWarnBundle(ControlliWSBundle.CTRL_UD_COMPONENTI, MessaggiWSBundle.UD_016_002, + rispostaWs); // aggiunta su warnings versamento.addControlloOnWarningsBundle( @@ -777,7 +784,8 @@ private boolean verificaTipoDocumento(UpdDocumentoVers documento, UpdVersamentoE return !hasDocError; } - private boolean verificaAbilitazioneTipoDocumento(UpdDocumentoVers documento, UpdVersamentoExt versamento) { + private boolean verificaAbilitazioneTipoDocumento(UpdDocumentoVers documento, UpdVersamentoExt versamento, + IRispostaUpdVersWS rispostaWs) { StrutturaUpdVers strutturaUpdVers = versamento.getStrutturaUpdVers(); boolean hasDocError = false; String cdCtrl = ControlliWSBundle.CTRL_DOC_ABILITAZIONEUTENTETIPO; @@ -848,7 +856,7 @@ private boolean verificaAbilitazioneTipoDocumento(UpdDocumentoVers documento, Up } // esito generale in caso di errore if (hasDocError) { - this.setEsitoControlloErr(cdCtrl, rispostaControlli.getCodErr(), rispostaControlli.getDsErr()); + super.setEsitoControlloErr(cdCtrl, rispostaControlli.getCodErr(), rispostaControlli.getDsErr(), rispostaWs); } else { // set id abilitazione documento.setIdAbilTipoDocumentoDB(rispostaControlli.getrLong()); diff --git a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdVersamentoBasePrsr.java b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdVersamentoBasePrsr.java index 7515730..71d7657 100644 --- a/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdVersamentoBasePrsr.java +++ b/sacerws-ejb/src/main/java/it/eng/parer/ws/versamentoUpd/ejb/prs/UpdVersamentoBasePrsr.java @@ -127,7 +127,7 @@ protected boolean controllaUnivocitaDocIDs(UpdVersamentoExt versamento, Risposta // ALLEGATI if (strutturaUpdVers.isCorrAllegatiDichiarati() != null) { - if (!strutturaUpdVers.isCorrAllegatiDichiarati().booleanValue()) { + if (!strutturaUpdVers.isCorrAllegatiDichiarati()) { rispostaWs.setSeverity(SeverityEnum.ERROR); // esito generale @@ -148,7 +148,7 @@ protected boolean controllaUnivocitaDocIDs(UpdVersamentoExt versamento, Risposta // ANNESSI if (strutturaUpdVers.isCorrAnnessiDichiarati() != null) { - if (!strutturaUpdVers.isCorrAnnessiDichiarati().booleanValue()) { + if (!strutturaUpdVers.isCorrAnnessiDichiarati()) { rispostaWs.setSeverity(SeverityEnum.ERROR); // esito generale @@ -168,7 +168,7 @@ protected boolean controllaUnivocitaDocIDs(UpdVersamentoExt versamento, Risposta } // ANNOTAZIONI if (strutturaUpdVers.isCorrAnnotazioniDichiarati() != null) { - if (!strutturaUpdVers.isCorrAnnotazioniDichiarati().booleanValue()) { + if (!strutturaUpdVers.isCorrAnnotazioniDichiarati()) { rispostaWs.setSeverity(SeverityEnum.ERROR); // esito generale diff --git a/sacerws-ejb/src/test/java/it/eng/parer/firma/crypto/helper/CryptoRestConfiguratorHelperTest.java b/sacerws-ejb/src/test/java/it/eng/parer/firma/crypto/helper/CryptoRestConfiguratorHelperTest.java index 076baaf..405e9bd 100644 --- a/sacerws-ejb/src/test/java/it/eng/parer/firma/crypto/helper/CryptoRestConfiguratorHelperTest.java +++ b/sacerws-ejb/src/test/java/it/eng/parer/firma/crypto/helper/CryptoRestConfiguratorHelperTest.java @@ -34,6 +34,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import it.eng.parer.firma.helper.CryptoRestConfiguratorHelper; + @RunWith(Arquillian.class) public class CryptoRestConfiguratorHelperTest { diff --git a/sacerws-ejb/src/test/java/it/eng/parer/firma/crypto/helper/EidasRestConfiguratorHelperTest.java b/sacerws-ejb/src/test/java/it/eng/parer/firma/crypto/helper/EidasRestConfiguratorHelperTest.java index 1f3ad3f..fc3f67d 100644 --- a/sacerws-ejb/src/test/java/it/eng/parer/firma/crypto/helper/EidasRestConfiguratorHelperTest.java +++ b/sacerws-ejb/src/test/java/it/eng/parer/firma/crypto/helper/EidasRestConfiguratorHelperTest.java @@ -34,6 +34,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import it.eng.parer.firma.helper.EidasRestConfiguratorHelper; + @RunWith(Arquillian.class) public class EidasRestConfiguratorHelperTest { diff --git a/sacerws-jpa/pom.xml b/sacerws-jpa/pom.xml index 2b39d13..3b80514 100644 --- a/sacerws-jpa/pom.xml +++ b/sacerws-jpa/pom.xml @@ -3,7 +3,7 @@ it.eng.parer sacerws - 5.2.1-SNAPSHOT + 5.3.1-SNAPSHOT sacerws-jpa sacerws-jpa diff --git a/sacerws-web/pom.xml b/sacerws-web/pom.xml index dd220b7..0817394 100644 --- a/sacerws-web/pom.xml +++ b/sacerws-web/pom.xml @@ -4,7 +4,7 @@ sacerws it.eng.parer - 5.2.1-SNAPSHOT + 5.3.1-SNAPSHOT sacerws-web