diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ebaf0d..f09ae50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ +## 6.15.0 (19-08-2024) + +### Novità: 1 +- [#33050](https://parermine.regione.emilia-romagna.it/issues/33050) Aggiornamento librerie obsolete 2024 + ## 6.14.1 (13-08-2024) ### Bugfix: 1 @@ -12,7 +17,7 @@ ## 5.14.0 (30-04-2024) ### Novità: 1 -- [#29991](https://parermine.regione.emilia-romagna.it/issues/29991) Aggiornamento a Java 11 +- [#31873](https://parermine.regione.emilia-romagna.it/issues/31873) Allineamento alla versione 4.14.0 ## 5.13.0 (20-12-2023) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index e1548e7..5f19208 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,4 +1,4 @@ -## 6.14.1 (13-08-2024) +## 6.15.0 (19-08-2024) -### Bugfix: 1 -- [#33323](https://parermine.regione.emilia-romagna.it/issues/33323) Fix configurazione dipendenze Java 11 +### Novità: 1 +- [#33050](https://parermine.regione.emilia-romagna.it/issues/33050) Aggiornamento librerie obsolete 2024 diff --git a/pom.xml b/pom.xml index c428735..c727ea0 100644 --- a/pom.xml +++ b/pom.xml @@ -1,37 +1,29 @@ 4.0.0 spagofat - 6.14.2-SNAPSHOT + 6.15.0 pom Spagolite Framework utilizzato dalle applicazioni web, si tratta di uno strato software comune contenente anche le dipendenze di terze parti ed ereditato come bom. + https://nexus.ente.regione.emr.it/repository/parer-site/spago/${project.version}/ + + + site + dav:https://nexus.ente.regione.emr.it/repository/parer-site/spago/${project.version} + + it.eng.parer parer-pom - 6.3.1 + 6.4.0 - scm:git:https://github.com/RegioneER/parer-framework-spagolite.git - HEAD + scm:git:git@gitlab.ente.regione.emr.it:parer/framework-spagolite.git + spagofat-6.15.0 - - - - github - https://maven.pkg.github.com/RegioneER/parer-framework-spagolite - - - - - - github - https://maven.pkg.github.com/RegioneER/parer-framework-parerpom - - - UTF-8 @@ -42,20 +34,24 @@ 6.0.22.Final-redhat-00002 5.6.14.Final-redhat-00001 2.1.4 - 21.1.1 + 24.0.5 1.4.01 5.1.1 - 3.6.4 - 1.13.2 + 3.7.1 + 1.13.3 3.3.8 1.8.7 4.0.13 6.4.0 11.5.0 - 2.7.0 + 2.8.0 0.0.5 + 1.9.4 + 2.3 + 1.2.0 + 5.10.3 @@ -262,6 +258,11 @@ + + org.apache.velocity + velocity-engine-core + ${velocity-engine-core.version} + org.slf4j slf4j-api @@ -287,11 +288,6 @@ commons-logging ${commons-logging.version} - - commons-beanutils - commons-beanutils - ${commons-beanutils.version} - commons-io commons-io @@ -301,25 +297,35 @@ org.apache.httpcomponents httpclient ${httpclient.version} - - - - + + + + org.apache.santuario + xmlsec + ${xmlsec.version} + + + + javax.xml.bind jaxb-api ${jaxb.version} - compile - + javax.xml.ws jaxws-api ${jaxws-api.version} - compile - - + + + com.sun.activation + javax.activation + ${javax.activation.version} + + + javax.servlet javax.servlet-api @@ -356,7 +362,11 @@ commons-net ${commons-net.version} - + + commons-beanutils + commons-beanutils + ${commons-beanutils.version} + org.hibernate @@ -423,10 +433,12 @@ + xml-apis xml-apis ${xml-apis.version} + provided joda-time @@ -495,11 +507,11 @@ highlightjs ${highlightjs.version} - - org.webjars.bowergithub.wcoder - highlightjs-line-numbers.js + + org.webjars.npm + highlightjs-line-numbers.js ${highlightjs-line-numbers.js.version} - + org.webjars font-awesome @@ -520,6 +532,18 @@ + + + + + org.owasp + dependency-check-maven + + src/site/owasp/suppress.xml + + + + org.apache.maven.plugins diff --git a/pom.xml.github b/pom.xml.github new file mode 100644 index 0000000..c428735 --- /dev/null +++ b/pom.xml.github @@ -0,0 +1,553 @@ + + 4.0.0 + spagofat + 6.14.2-SNAPSHOT + pom + Spagolite + Framework utilizzato dalle applicazioni web, si tratta di uno strato software comune contenente anche le dipendenze di terze parti ed ereditato come bom. + + + + it.eng.parer + parer-pom + 6.3.1 + + + + scm:git:https://github.com/RegioneER/parer-framework-spagolite.git + HEAD + + + + + github + https://maven.pkg.github.com/RegioneER/parer-framework-spagolite + + + + + + github + https://maven.pkg.github.com/RegioneER/parer-framework-parerpom + + + + + UTF-8 + + true + ${project.version} + + 5.3.20.Final-redhat-00001 + 6.0.22.Final-redhat-00002 + 5.6.14.Final-redhat-00001 + 2.1.4 + 21.1.1 + 1.4.01 + 5.1.1 + + 3.6.4 + 1.13.2 + 3.3.8 + 1.8.7 + 4.0.13 + 6.4.0 + 11.5.0 + 2.7.0 + + 0.0.5 + + + + + + + it.eng.parer + spagofat-core + ${project.version} + + + it.eng.parer + spagofat-middle + ${project.version} + + + it.eng.parer + spagofat-webresources + ${project.version} + war + runtime + + + it.eng.parer + spagofat-paginator-ejb + ${project.version} + ejb + + + + it.eng.parer + spagofat-paginator-gf + ${project.version} + + + + + it.eng.parer + spagofat-si-client + ${project.version} + + + it.eng.parer + spagofat-si-server + ${project.version} + runtime + war + + + it.eng.parer + spagofat-si-server + ${project.version} + classes + + + it.eng.parer + spagofat-si-util + ${project.version} + + + + + it.eng.parer + spagofat-sl-jpa + ${project.version} + + + it.eng.parer + spagofat-sl-slg + ${project.version} + + + it.eng.parer + spagofat-sl-ejb + ejb + ${project.version} + + + it.eng.parer + spagofat-sl-web + war + ${project.version} + + + it.eng.parer + spagofat-sl-web + classes + ${project.version} + + + + + it.eng.parer + spagofat-timer-wrapper-common + ${project.version} + + + it.eng.parer + spagofat-timer-wrapper-ejb + ejb + ${project.version} + + + + + + org.springframework + spring-context + ${spring.version} + + + org.springframework + spring-web + ${spring.version} + + + org.springframework + spring-webmvc + ${spring.version} + + + org.springframework + spring-tx + ${spring.version} + + + org.springframework + spring-core + ${spring.version} + + + org.springframework + spring-test + ${spring.version} + + + org.springframework + spring-context-support + ${spring.version} + + + org.springframework + spring-aop + ${spring.version} + + + org.springframework + spring-jdbc + ${spring.version} + + + org.springframework + spring-orm + ${spring.version} + + + org.springframework.security + spring-security-web + ${spring.security.version} + + + org.springframework.security + spring-security-core + ${spring.security.version} + + + org.springframework.security + spring-security-config + ${spring.security.version} + + + org.springframework.security.extensions + spring-security-saml2-core + ${spring.security.saml.version} + + + xalan + xalan + + + xercesImpl + xerces + + + xml-resolver + xml-resolver + + + org.bouncycastle + bcprov-jdk15on + + + org.bouncycastle + bcprov-ext-jdk15on + + + org.bouncycastle + bcpkix-jdk15on + + + commons-lang + commons-lang + + + + + + org.slf4j + slf4j-api + ${slf4j.version} + + + org.slf4j + log4j-over-slf4j + ${slf4j.version} + + + org.slf4j + jcl-over-slf4j + ${slf4j.version} + + + org.slf4j + slf4j-log4j12 + ${slf4j.version} + + + commons-logging + commons-logging + ${commons-logging.version} + + + commons-beanutils + commons-beanutils + ${commons-beanutils.version} + + + commons-io + commons-io + ${commons-io.version} + + + org.apache.httpcomponents + httpclient + ${httpclient.version} + + + + + + javax.xml.bind + jaxb-api + ${jaxb.version} + compile + + + + javax.xml.ws + jaxws-api + ${jaxws-api.version} + compile + + + + + javax.servlet + javax.servlet-api + ${javax.servlet-api.version} + + + + + org.jboss.spec + jboss-jakartaee-8.0 + pom + ${jboss-jakartaee-8.0.version} + + + org.jboss.bom + jboss-eap-jakartaee8-with-tools + ${jboss-eap-jakartaee8-with-tools.version} + pom + import + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + commons-fileupload + commons-fileupload + ${commons-fileupload.version} + + + commons-net + commons-net + ${commons-net.version} + + + + + org.hibernate + hibernate-core + ${hibernate-core-version} + provided + + + org.hibernate + hibernate-entitymanager + ${hibernate-core-version} + provided + + + org.hibernate.validator + hibernate-validator + provided + ${hibernate-validator-version} + + + org.hibernate + hibernate-jpamodelgen + ${hibernate-jpamodelgen-version} + provided + + + + + org.codehaus.jettison + jettison + ${jettison.version} + + + stax + stax-api + + + + + org.dom4j + dom4j + ${dom4j.version} + provided + + + xml-apis + xml-apis + + + + + org.apache.poi + poi + ${poi.version} + + + org.apache.xmlbeans + xmlbeans + ${xmlbeans.version} + + + stax + stax-api + + + + + xml-apis + xml-apis + ${xml-apis.version} + + + joda-time + joda-time + ${joda-time.version} + + + org.apache.commons + commons-collections4 + ${commons-collections4.version} + + + commons-codec + commons-codec + ${commons-codec.version} + + + + org.apache.commons + commons-text + ${commons-text.version} + + + + org.owasp.esapi + esapi + ${owasp.version} + + + + + junit + junit + ${junit.version} + test + + + + + org.webjars + jquery + ${jquery.version} + + + org.webjars + jquery-ui + ${jquery-ui.version} + + + org.webjars + jstree + ${jstree.version} + + + org.webjars.bower + chosen + ${chosen.version} + + + org.webjars + select2 + ${select2.version} + + + org.webjars + highlightjs + ${highlightjs.version} + + + org.webjars.bowergithub.wcoder + highlightjs-line-numbers.js + ${highlightjs-line-numbers.js.version} + + + org.webjars + font-awesome + ${font-awesome.version} + + + org.webjars.npm + highlightjs-badgejs + ${highlightjs-badgejs.version} + + + + org.keycloak + keycloak-servlet-filter-adapter + ${keycloak-filter.version} + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + it.eng.spagoLite.spagoLite.*:it.eng.spagoLite.xmlbean.*:it.eng.integriam.* + + + + + + spagolite-core + spagolite-middle + spagolite-webresources + spagolite-paginator-gf + spagolite-paginator-ejb + + spagolite-si-server + spagolite-si-client + spagolite-si-util + + spagolite-sl-jpa + spagolite-sl-slg + spagolite-sl-ejb + spagolite-sl-web + + spagolite-timer-wrapper-common + spagolite-timer-wrapper-ejb + + diff --git a/spagolite-core/pom.xml b/spagolite-core/pom.xml index 80be779..1a5db6c 100644 --- a/spagolite-core/pom.xml +++ b/spagolite-core/pom.xml @@ -8,7 +8,7 @@ it.eng.parer spagofat - 6.14.2-SNAPSHOT + 6.15.0 diff --git a/spagolite-core/src/main/java/it/eng/spagoCore/base/Constants.java b/spagolite-core/src/main/java/it/eng/spagoCore/base/Constants.java index 4b1dfc0..20c3069 100644 --- a/spagolite-core/src/main/java/it/eng/spagoCore/base/Constants.java +++ b/spagolite-core/src/main/java/it/eng/spagoCore/base/Constants.java @@ -23,8 +23,8 @@ /* * DATE CONTRIBUTOR/DEVELOPER NOTE -* 13-12-2004 Butano Cambiato il valore della costante Spago -* +* 13-12-2004 Butano Cambiato il valore della costante Spago +* **/ public class Constants { public static final String NOME_MODULO = "Spago"; diff --git a/spagolite-core/src/main/java/it/eng/spagoCore/configuration/ConfigServlet.java b/spagolite-core/src/main/java/it/eng/spagoCore/configuration/ConfigServlet.java index b325001..59082d7 100644 --- a/spagolite-core/src/main/java/it/eng/spagoCore/configuration/ConfigServlet.java +++ b/spagolite-core/src/main/java/it/eng/spagoCore/configuration/ConfigServlet.java @@ -144,7 +144,7 @@ public void init(ServletConfig config) throws ServletException { * contesto dell'applicazione senza "/" per esempio saceriam * @param configName * nome della proprietà  supportata dallla Servlet - * + * * @return valore della configurazione. */ private String getValue(ServletConfig config, String applicationPrefix, String configName, String defaultValue) { @@ -186,14 +186,14 @@ private String getValue(ServletConfig config, String applicationPrefix, String c /** * Carica, internamente all'applicazione in fase di deploy, la risorsa esterna. Per l'applicazione la risorsa sarà, * a tutti gli effetti, interna. - * + * * @param externalResource * percorso della risorsa esterna all'applicazione. * @param destinationPath * percorso relativo della risorsa all'interno dell'applicazione * @param defaultRelativePath * percorso della risorsa predefinita - * + * * @return percorso relativo dalle risorsa */ private String getRelativePathFromExternalResource(String externalResource, String destinationPath, @@ -217,13 +217,13 @@ private String getRelativePathFromExternalResource(String externalResource, Stri *
    *
  • file://
  • http(s):// *
- * + * * Esempio di chiamata: *
    *
  • loadResource("file:///opt/jboss/logo1_snap.png", "/img/logo1.png")
  • *
  • loadResource("https:///my.beautiful.css/overlay.css", "/css/overlay.css")
  • *
- * + * * @param resourceURL * URL della risorsa da caricare * @param destination diff --git a/spagolite-core/src/main/java/it/eng/spagoCore/util/JavaScript.java b/spagolite-core/src/main/java/it/eng/spagoCore/util/JavaScript.java index af11bce..fefe7b3 100644 --- a/spagolite-core/src/main/java/it/eng/spagoCore/util/JavaScript.java +++ b/spagolite-core/src/main/java/it/eng/spagoCore/util/JavaScript.java @@ -38,7 +38,7 @@ private JavaScript() { * * @param input * stringa da manipolare. - * + * * @return Stringa manipolata */ public static String escape(String input) { @@ -58,7 +58,7 @@ public static String escape(String input) { * * @param input * the string to manage. - * + * * @return stringa manipolata */ public static String unescape(String input) { @@ -79,7 +79,7 @@ public static String unescape(String input) { * * @param input * stringa da manipolare. - * + * * @return testo manipolato */ public static String escapeText(String input) { @@ -97,7 +97,7 @@ public static String escapeText(String input) { * parte di stringa da sostituire. * @param replaced * stringa nuova. - * + * * @return stringa modificata */ public static String replace(String toParse, String replacing, String replaced) { diff --git a/spagolite-core/src/main/java/it/eng/spagoCore/util/Oauth2Srvlt.java b/spagolite-core/src/main/java/it/eng/spagoCore/util/Oauth2Srvlt.java index a3fd067..de40bdd 100644 --- a/spagolite-core/src/main/java/it/eng/spagoCore/util/Oauth2Srvlt.java +++ b/spagolite-core/src/main/java/it/eng/spagoCore/util/Oauth2Srvlt.java @@ -56,9 +56,9 @@ public boolean isOauth2Request(HttpServletRequest request) { /** * Get keycloak session from request - * + * * @param req - * + * * @return */ private KeycloakSecurityContext getKeycloakSession(HttpServletRequest req) { diff --git a/spagolite-core/src/main/java/it/eng/spagoCore/util/UriEcondingFilter.java b/spagolite-core/src/main/java/it/eng/spagoCore/util/UriEcondingFilter.java index 3625bc0..ff4a8a2 100644 --- a/spagolite-core/src/main/java/it/eng/spagoCore/util/UriEcondingFilter.java +++ b/spagolite-core/src/main/java/it/eng/spagoCore/util/UriEcondingFilter.java @@ -178,9 +178,9 @@ private boolean checkParam(String name) { * * @param value * valore atteso - * + * * @return array di string verificate - * + * * @throws JsonParseException * @throws IOException */ diff --git a/spagolite-core/src/main/java/it/eng/spagoIFace/session/SessionCoreManager.java b/spagolite-core/src/main/java/it/eng/spagoIFace/session/SessionCoreManager.java index d88951b..35db534 100644 --- a/spagolite-core/src/main/java/it/eng/spagoIFace/session/SessionCoreManager.java +++ b/spagolite-core/src/main/java/it/eng/spagoIFace/session/SessionCoreManager.java @@ -35,7 +35,7 @@ public abstract class SessionCoreManager { * * @param httpSession * sessione http - * + * * @return resituisce l'action corrente */ public static String getCurrentActionUrl(HttpSession httpSession) { @@ -67,7 +67,7 @@ public static String getLastPublisher(HttpSession httpSession) { * nome operazione * @param additionalInfo * informazioni aggiuntive - * + * * @return restituisce l'URL con query parameters */ public static String getOperationUrl(HttpSession httpSession, String operation, String additionalInfo) { diff --git a/spagolite-middle/pom.xml b/spagolite-middle/pom.xml index d087ad7..5d3e403 100644 --- a/spagolite-middle/pom.xml +++ b/spagolite-middle/pom.xml @@ -8,7 +8,7 @@ it.eng.parer spagofat - 6.14.2-SNAPSHOT + 6.15.0 @@ -89,6 +89,14 @@ commons-collections commons-collections + + xml-apis + xml-apis + + + org.springframework + spring-expression +
@@ -120,6 +128,12 @@ org.springframework.security spring-security-web + + + org.springframework + spring-expression + + org.apache.commons diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/actions/RedirectAction.java b/spagolite-middle/src/main/java/it/eng/spagoLite/actions/RedirectAction.java index 5350026..6ceb52a 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/actions/RedirectAction.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/actions/RedirectAction.java @@ -25,11 +25,11 @@ import it.eng.spagoLite.security.IUser; /** - * + * * Action standard per governare il redirect a livello applicativo - * + * * @author Enrico Grillini - * + * */ public class RedirectAction extends BaseController { diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/actions/application/ApplicationBaseProperties.java b/spagolite-middle/src/main/java/it/eng/spagoLite/actions/application/ApplicationBaseProperties.java index 9ea39be..059a74a 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/actions/application/ApplicationBaseProperties.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/actions/application/ApplicationBaseProperties.java @@ -25,7 +25,7 @@ /** * * @author Iacolucci_M - * + * * Oggetto contenente gli attributi di base di ogni applicazione che usa spagolite. Ad esempio serve per poter * far funzionare il motore di richiesta HelpOnline che richiede il nome dell'applicazione e l'utenet e la * password applicativa per comunicare con IAM. diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/actions/application/IApplicationBasePropertiesSevice.java b/spagolite-middle/src/main/java/it/eng/spagoLite/actions/application/IApplicationBasePropertiesSevice.java index 0186894..4c4e4ea 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/actions/application/IApplicationBasePropertiesSevice.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/actions/application/IApplicationBasePropertiesSevice.java @@ -25,7 +25,7 @@ /** * * @author Iacolucci_M - * + * * Interfaccia che ogni applicazione che usa SpagoLite dovrebbe implementare per popolare l'oggetto * ApplicationBaseProperties da qualsiasi fonte, tipicamente un DB */ diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/actions/form/FormAction.java b/spagolite-middle/src/main/java/it/eng/spagoLite/actions/form/FormAction.java index e5b6fc1..8c6056b 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/actions/form/FormAction.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/actions/form/FormAction.java @@ -166,7 +166,7 @@ public void setForm(T form) { * value * @param wizardNavigation * value - * + * * @throws EMFError * eccezione generica */ @@ -319,14 +319,14 @@ public boolean isAuthorized(String destination) { /* * VECCHIO CODICE CHE NON GESTIVA LE FORM DINAMICHE CON UNA SOLA JSP - * + * * public boolean isUserAuthorized(String action) { if (ConfigSingleton.getDisableSecurity()) { return true; } * IUser user = getUser(); if (user != null) { if (getLastPublisher().equals("")) { return true; } - * + * * Pagina p = (Pagina) user.getProfile().getChild(getLastPublisher()); if (p != null && p.getChild(action) != null) * { return true; } else { logger.debug("Utente " + user.getUsername() + * " non autorizzato all'esecuzione dell'azione " + action + " nella pagina " + getLastPublisher()); } } - * + * * return false; } */ public boolean isUserAuthorized(String action) { diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/actions/form/ListAction.java b/spagolite-middle/src/main/java/it/eng/spagoLite/actions/form/ListAction.java index 1535a23..52991c1 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/actions/form/ListAction.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/actions/form/ListAction.java @@ -100,10 +100,10 @@ public void cancelDelete() { /** * Metodo di utility che viene eseguito dopo ogni query di paginazione lazy - * + * * @param list * value - * + * * @throws EMFError * eccezione generica */ @@ -172,7 +172,7 @@ public void listNavigationOnClick(String[] param) throws EMFError { * riga * @param forceReload * reload - * + * * @throws EMFError * eccezione generica */ diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/db/base/BaseTableInterface.java b/spagolite-middle/src/main/java/it/eng/spagoLite/db/base/BaseTableInterface.java index 1b6f0f5..0ca16e1 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/db/base/BaseTableInterface.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/db/base/BaseTableInterface.java @@ -156,7 +156,7 @@ public interface BaseTableInterface extends Iterable * * @param row * value - * + * * @return oggetto generico T aggiunto */ public T add(BaseRowInterface row); @@ -175,7 +175,7 @@ public interface BaseTableInterface extends Iterable * * @param rowIndex * indice relativo della riga - * + * * @return la riga rimossa */ public T remove(int rowIndex); @@ -204,7 +204,7 @@ public interface BaseTableInterface extends Iterable * * @param index * indice riga - * + * * @return riga passata */ public T getRow(int index); @@ -244,7 +244,7 @@ public interface BaseTableInterface extends Iterable * * @param rowIndex * indice assoluto della riga - * + * * @return la riga rimossa */ public T removeFullIdx(int rowIndex); @@ -255,7 +255,7 @@ public interface BaseTableInterface extends Iterable * * @param baseRowInterface * value - * + * * @return la riga aggiunta */ public T addFullIdx(BaseRowInterface baseRowInterface); diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/db/base/row/BaseRow.java b/spagolite-middle/src/main/java/it/eng/spagoLite/db/base/row/BaseRow.java index cf3ba37..1758f9c 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/db/base/row/BaseRow.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/db/base/row/BaseRow.java @@ -45,7 +45,7 @@ public BaseRow() { /** * Crea un nuovo RowBean e lo prepopola - * + * * @param row * value */ diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/db/base/table/AbstractBaseTable.java b/spagolite-middle/src/main/java/it/eng/spagoLite/db/base/table/AbstractBaseTable.java index 9046ace..0a63826 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/db/base/table/AbstractBaseTable.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/db/base/table/AbstractBaseTable.java @@ -178,7 +178,7 @@ public T add() { /* * (non-Javadoc) - * + * * @see it.eng.spagoLite.db.base.BaseTableInterface#add(it.eng.spagoLite.db.base.BaseRowInterface) */ public T add(BaseRowInterface baseRowInterface) { @@ -211,7 +211,7 @@ public void addAll(BaseTableInterface table) { /* * (non-Javadoc) - * + * * @see it.eng.spagoLite.db.base.BaseTableInterface#addFullIdx(it.eng.spagoLite.db.base.BaseRowInterface) */ public T addFullIdx(BaseRowInterface baseRowInterface) { @@ -245,7 +245,7 @@ public T remove() { /* * (non-Javadoc) - * + * * @see it.eng.spagoLite.db.base.BaseTableInterface#remove(int) */ public T remove(int rowIndex) { @@ -265,7 +265,7 @@ public T remove(int rowIndex) { /* * (non-Javadoc) - * + * * @see it.eng.spagoLite.db.base.BaseTableInterface#removeFullIdx(int) */ public T removeFullIdx(int rowIndex) { diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/form/fields/Fields.java b/spagolite-middle/src/main/java/it/eng/spagoLite/form/fields/Fields.java index 7af9e25..6efa60f 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/form/fields/Fields.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/form/fields/Fields.java @@ -76,9 +76,9 @@ public void post(HttpServletRequest servletRequest) { * Http request * @param maxFileSize * Sets the maximum allowed size of a single uploaded file - * + * * @return risultato elaborazione - * + * * @throws FileUploadException * se la dimensione massima del file è stata raggiunta o si è verificato un errore di I/O. * @@ -95,9 +95,9 @@ public String[] postMultipart(HttpServletRequest servletRequest, long maxFileSiz * Folder temporanea su cui avviene il deposito dei file più grandi di 1 MB * @param maxFileSize * Sets the maximum allowed size of a single uploaded file - * + * * @return risultato elaborazione - * + * * @throws FileUploadException * se la dimensione massima del file è stata raggiunta o si è verificato un errore di I/O. * @@ -163,7 +163,7 @@ public String[] postMultipart(HttpServletRequest servletRequest, File tempDirRep * * @param row * oggetto bean - * + * * @throws EMFError * eccezione generica */ @@ -181,7 +181,7 @@ public void copyFromBean(BaseRowInterface row) throws EMFError { * * @param row * oggetto bean - * + * * @throws EMFError * eccezione generica */ @@ -249,12 +249,12 @@ public boolean postAndValidate(HttpServletRequest servletRequest, MessageBox mes /** * Metodo che ritorna un JSONObject popolato con i dati del form e l'aggiunta di un eventuale Message visualizzato * in un popup JavaScript lato client - * + * * @param msg * messaggio - * + * * @return json object - * + * * @throws EMFError * eccezione generica */ @@ -286,12 +286,12 @@ public JSONObject asJSON(Message msg) throws EMFError { /** * Metodo che ritorna un JSONObject popolato con i dati del form e l'aggiunta del nome di una funzione JavaScript da * eseguire lato client - * + * * @param funcName * nome funzione - * + * * @return Json object - * + * * @throws EMFError * eccezione generica */ @@ -309,14 +309,14 @@ public JSONObject asJSON(String funcName) throws EMFError { * Metodo che ritorna un JSONObject popolato con i dati del form e l'aggiunta di un eventuale Message visualizzato * in un popup JavaScript lato client e del nome di una funzione JavaScript da eseguire lato client dopo la * pressione del tasto OK sul messaggio - * + * * @param msg * messaggio * @param funcName * nome funzione - * + * * @return Json object - * + * * @throws EMFError * eccezione generica */ diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/form/fields/IMappableField.java b/spagolite-middle/src/main/java/it/eng/spagoLite/form/fields/IMappableField.java index 78a8f22..c1ba801 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/form/fields/IMappableField.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/form/fields/IMappableField.java @@ -20,7 +20,7 @@ import it.eng.spagoLite.db.decodemap.DecodeMapIF; /** - * + * * @author Arcella_A * */ diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/form/fields/impl/MultiSemaphore.java b/spagolite-middle/src/main/java/it/eng/spagoLite/form/fields/impl/MultiSemaphore.java index 1b04133..d90f6ff 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/form/fields/impl/MultiSemaphore.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/form/fields/impl/MultiSemaphore.java @@ -202,7 +202,7 @@ public void post(HttpServletRequest servletRequest) { /** * @return string del tipo "VRG" con le iniziali dei semafori checkati (Verde Rosso Giallo) - * + * * @throws EMFError * eccezione generica */ diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/form/list/List.java b/spagolite-middle/src/main/java/it/eng/spagoLite/form/list/List.java index 80d2c59..433bedb 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/form/list/List.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/form/list/List.java @@ -136,7 +136,7 @@ public BaseTableInterface getTable() { * * @param inTable * interfaccia table - * + * * @return implementazione dell'interfaccia */ public BaseTableInterface toTable(BaseTableInterface inTable) { @@ -211,7 +211,7 @@ public BaseRowInterface remove() { * * @param rowIndex * numero riga - * + * * @return BaseRowInterface */ public BaseRowInterface remove(int rowIndex) { @@ -389,7 +389,7 @@ public void copyToBean() throws EMFError { * * @param row * oggetto bean - * + * * @throws EMFError * eccezione generica */ diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/form/list/NestedList.java b/spagolite-middle/src/main/java/it/eng/spagoLite/form/list/NestedList.java index 5b62b5e..8e73eb4 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/form/list/NestedList.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/form/list/NestedList.java @@ -97,10 +97,10 @@ public BaseTableInterface getTable() { /** * Restituisce un table bean del tipo passato in input arricchito dalle informazioni del table bean referenziato * dalla lista - * + * * @param inTable * interfaccia table base - * + * * @return implementazione interfaccia */ public BaseTableInterface toTable(BaseTableInterface inTable) { @@ -142,7 +142,7 @@ public void setMasterList(boolean masterList) { /** * Removes current row from the list - * + * * @return BaseRowInterface */ public BaseRowInterface remove() { @@ -155,10 +155,10 @@ public BaseRowInterface remove() { /** * Removes row from the list - * + * * @param rowIndex * numero riga - * + * * @return BaseRowInterface */ public BaseRowInterface remove(int rowIndex) { @@ -288,7 +288,7 @@ public boolean postAndValidate(HttpServletRequest servletRequest, MessageBox mes /** * Compila il row bean con il contenuto della riga corrente - * + * * @throws EMFError * eccezione generica */ @@ -301,10 +301,10 @@ public void copyToBean() throws EMFError { /** * Compila il row bean con il contenuto del form - * + * * @param row * riga oggetto BaseRowInterface - * + * * @throws EMFError * eccezione generica */ diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/form/tab/TabElement.java b/spagolite-middle/src/main/java/it/eng/spagoLite/form/tab/TabElement.java index 4e220b0..3c223d4 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/form/tab/TabElement.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/form/tab/TabElement.java @@ -37,7 +37,7 @@ public TabElement(Component parent, String name, String description) { } /** - * + * * @param parent * riferimento genitore * @param name @@ -96,7 +96,7 @@ public void setIconUrlList(List iconUrlList) { } /** - * + * * @param iconUrls * {@link String} di url separati da spazio */ diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/form/tree/Tree.java b/spagolite-middle/src/main/java/it/eng/spagoLite/form/tree/Tree.java index 10aad12..529d9a2 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/form/tree/Tree.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/form/tree/Tree.java @@ -149,7 +149,7 @@ public void copyToBean() throws EMFError { * * @param row * dto row - * + * * @throws EMFError * eccezione generica */ diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/form/wizard/Wizard.java b/spagolite-middle/src/main/java/it/eng/spagoLite/form/wizard/Wizard.java index da21118..8bee1a8 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/form/wizard/Wizard.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/form/wizard/Wizard.java @@ -169,7 +169,7 @@ public void reset() { /** * Conta solo gli step visibili - * + * * @return conteggio */ public int stepSize() { @@ -187,7 +187,7 @@ public int stepSize() { /** * Conta solo gli step visibili - * + * * @return conteggio */ public int currentStepIndex() { diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/security/auth/Authenticator.java b/spagolite-middle/src/main/java/it/eng/spagoLite/security/auth/Authenticator.java index c1c0556..1d76674 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/security/auth/Authenticator.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/security/auth/Authenticator.java @@ -40,11 +40,11 @@ public User doLogin(HttpSession httpSession) { /** * Metodo per la verifica dell'autorizzazione ad eseguire l'applicazione corrente Metodo reimplementato per * bypassare la verifica. - * - * + * + * * @param utente * dto - * + * * @return true/false se autenticato */ // public boolean isAutorized(User utente){ @@ -60,7 +60,7 @@ public boolean isAutorized(User utente) { /** * Metodo che ritorna il nome dell'applicazione così come è definito in IAM - * + * * @return nome applicazione */ protected abstract String getAppName(); diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/security/auth/SOAPIamLoginHandler.java b/spagolite-middle/src/main/java/it/eng/spagoLite/security/auth/SOAPIamLoginHandler.java index 7f8721a..b8731ea 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/security/auth/SOAPIamLoginHandler.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/security/auth/SOAPIamLoginHandler.java @@ -42,9 +42,9 @@ /** * Handler SOAP specifico per Sacer IAM (Lato SERVER): i controlli sono effettuati su tabelle specifiche, che in IAM * sono diverse dagli altri applicativi Viene effettuato anche il controllo delle autorizzazioni. - * + * * @author Quaranta_M - * + * */ public class SOAPIamLoginHandler implements SOAPHandler { diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/security/auth/SOAPServerLoginHandler.java b/spagolite-middle/src/main/java/it/eng/spagoLite/security/auth/SOAPServerLoginHandler.java index 4b9c146..510b567 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/security/auth/SOAPServerLoginHandler.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/security/auth/SOAPServerLoginHandler.java @@ -44,10 +44,10 @@ /** * Handler SOAP per un WS Server generico: effettua solo il login (autenticazione con user/password) dell'utente. Si * aspetta che i campi user e password siano nell'header come da standard ws security. - * - * + * + * * @author Quaranta_M - * + * */ public class SOAPServerLoginHandler implements SOAPHandler { diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/security/menu/impl/Link.java b/spagolite-middle/src/main/java/it/eng/spagoLite/security/menu/impl/Link.java index eb21d28..af6fc4b 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/security/menu/impl/Link.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/security/menu/impl/Link.java @@ -25,9 +25,9 @@ import org.dom4j.Element; /** - * + * * @author Enrico Grillini - * + * */ public class Link extends MenuEntry { diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/security/menu/impl/Menu.java b/spagolite-middle/src/main/java/it/eng/spagoLite/security/menu/impl/Menu.java index e544e61..b9d8abd 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/security/menu/impl/Menu.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/security/menu/impl/Menu.java @@ -26,9 +26,9 @@ import org.dom4j.Element; /** - * + * * @author Enrico Grillini - * + * */ public class Menu extends MenuEntry implements Iterable { diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/security/profile/ProfileElement.java b/spagolite-middle/src/main/java/it/eng/spagoLite/security/profile/ProfileElement.java index 01e2498..8b8019d 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/security/profile/ProfileElement.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/security/profile/ProfileElement.java @@ -25,11 +25,11 @@ import org.dom4j.Element; /** - * + * * @author Enrico Grillini - * + * * @param - * + * */ public class ProfileElement> extends FrameElement implements Iterable { diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/security/saml/SliteSAMLEntryPoint.java b/spagolite-middle/src/main/java/it/eng/spagoLite/security/saml/SliteSAMLEntryPoint.java index a75c0d0..680ad02 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/security/saml/SliteSAMLEntryPoint.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/security/saml/SliteSAMLEntryPoint.java @@ -31,7 +31,7 @@ /** * * @author S257421 - * + * * Classe con metodo ridefinito per poter intercettato il parametro nostro della request atto a gestire il * purpose di SPID e per metterlo tra gli attributi della request, altrimenti non è più possibile leggerlo in * alcun modo nelle fari successive negli oggetti SPRING SAML perché completamente incapsulati. diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/tag/FooterTag.java b/spagolite-middle/src/main/java/it/eng/spagoLite/tag/FooterTag.java index ad783f4..234355f 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/tag/FooterTag.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/tag/FooterTag.java @@ -91,6 +91,7 @@ private String renderFooterInfo(String contextPath) { } else { footer.append(img3.toString()); } + footer.append(""); return footer.toString(); } diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/tag/HeadTag.java b/spagolite-middle/src/main/java/it/eng/spagoLite/tag/HeadTag.java index 9b81ae2..f48b35d 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/tag/HeadTag.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/tag/HeadTag.java @@ -100,9 +100,9 @@ protected String includeCss(String contextPath) { /* * Highlightjs - * + * *
 block 
- * + * */ css.append(" \n"); @@ -114,7 +114,7 @@ protected String includeCss(String contextPath) { * Custom */ css.append(" \n"); + + "/css/custom/jquery-ui-custom/1.13.3/jquery-ui.min.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\n"); css.append(" \n"); @@ -160,14 +160,14 @@ protected String includeJs(String contextPath) { * Webjars */ js.append(" \n"); + + "/webjars/jquery/3.7.1/jquery.min.js\">\n"); // Static (not updatable to webjar) js.append(" \n"); js.append(" \n"); + + "/webjars/jquery-ui/1.13.3/jquery-ui.min.js\">\n"); // Static (not updatable to webjar) js.append(" \n"); js.append(" \n"); + + "/webjars/highlightjs-line-numbers.js/2.8.0/dist/highlightjs-line-numbers.min.js\">\n"); js.append(" \n"); diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/BaseTag.java b/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/BaseTag.java index 9a8da9b..12d116d 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/BaseTag.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/BaseTag.java @@ -30,11 +30,11 @@ import org.slf4j.LoggerFactory; /** - * + * * Classe base per - * + * * @author Grillini Enrico - * + * */ public abstract class BaseTag extends TagSupport { diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/fields/FileFieldTag.java b/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/fields/FileFieldTag.java index 3158ee4..fd4a72a 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/fields/FileFieldTag.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/fields/FileFieldTag.java @@ -106,7 +106,7 @@ protected void writeStartContainer() throws JspException { /** * Stampa il container - * + * * @throws JspException * eccezione generica */ diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/fields/LblFieldTag.java b/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/fields/LblFieldTag.java index 691b0a9..a375f17 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/fields/LblFieldTag.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/fields/LblFieldTag.java @@ -112,7 +112,7 @@ protected void writeStartContainer() throws JspException { /** * Stampa il container - * + * * @throws JspException * eccezione generica */ diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/list/ListNavBackTag.java b/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/list/ListNavBackTag.java index 5e1f527..eb0893a 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/list/ListNavBackTag.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/list/ListNavBackTag.java @@ -23,7 +23,7 @@ /** * @deprecated Al momento non disegna nulla sulla pagina. - * + * * */ @Deprecated diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/list/NestedListTag.java b/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/list/NestedListTag.java index 7801f25..62feddc 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/list/NestedListTag.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/list/NestedListTag.java @@ -303,7 +303,7 @@ private void drawNestedRow(BaseRowInterface row, List secondaryFields, String /** * Calcola le operazioni disponibili su questa tabella. Utilizzato per generare le colonne necessarie da presentare * su interfaccia - * + * * @param table */ private void calculateOperations(BaseTableInterface table) { diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/wizard/AbstractWizardTag.java b/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/wizard/AbstractWizardTag.java index bbc5ab8..f7a6845 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/wizard/AbstractWizardTag.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/tag/form/wizard/AbstractWizardTag.java @@ -117,9 +117,9 @@ protected void writeNext() throws JspException { * nome step * @param textInnerLink * testo link - * + * * @return link elaborato - * + * * @throws JspException * eccezione generica */ diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/tag/prototype/AbstractLblTag.java b/spagolite-middle/src/main/java/it/eng/spagoLite/tag/prototype/AbstractLblTag.java index 27ad2fc..4a68d34 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/tag/prototype/AbstractLblTag.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/tag/prototype/AbstractLblTag.java @@ -24,9 +24,9 @@ import javax.servlet.jsp.JspException; /** - * + * * @author Enrico Grillini - * + * */ public abstract class AbstractLblTag extends BaseSpagoLiteTag { @@ -121,7 +121,7 @@ public void setLabelPosition(String labelPosition) { /** * Scrive la label - * + * * @throws JspException * eccezione generica */ @@ -140,7 +140,7 @@ protected void writeLabel() throws JspException { /** * Scrive il controllo - * + * * @throws JspException * eccezione generica */ @@ -148,7 +148,7 @@ protected void writeLabel() throws JspException { /** * Stampa il container - * + * * @throws JspException * eccezione generica */ @@ -159,7 +159,7 @@ protected void writeStartContainer() throws JspException { /** * Stampa il container - * + * * @throws JspException * eccezione generica */ diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/util/Casting/Casting.java b/spagolite-middle/src/main/java/it/eng/spagoLite/util/Casting/Casting.java index afd4d06..831269a 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/util/Casting/Casting.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/util/Casting/Casting.java @@ -46,7 +46,7 @@ public class Casting { * * @param date * timestamp in input - * + * * @return formattazione date */ public static String formatDate(Timestamp date) { @@ -58,7 +58,7 @@ public static String formatDate(Timestamp date) { * * @param date * timestamp in input - * + * * @return formattazione date */ public static String formatDateTime(Timestamp date) { @@ -86,7 +86,7 @@ public static String formatBigDecimal(BigDecimal integer) { * * @param strDate * data in formato string - * + * * @return true/false con risultato verifica */ public static boolean checkDate(String strDate) { @@ -103,9 +103,9 @@ public static boolean checkDate(String strDate) { * * @param strDate * data in formato string - * + * * @return Timestamp della data in ingresso - * + * * @throws EMFError * eccezione generica */ @@ -127,9 +127,9 @@ public static Timestamp parseDate(String strDate) throws EMFError { * * @param strInteger * data in formato integer - * + * * @return BigDecimal della data in ingresso - * + * * @throws EMFError * eccezione generica */ @@ -153,9 +153,9 @@ public static BigDecimal parseInteger(String strInteger) throws EMFError { * * @param strDecimal * data in formato string - * + * * @return BigDecimal della data in ingresso - * + * * @throws EMFError * eccezione generica */ @@ -178,9 +178,9 @@ public static BigDecimal parseDecimal(String strDecimal) throws EMFError { * * @param cap * in ingresso - * + * * @return parsing del CAP fornito - * + * * @throws EMFError * eccezione generica */ @@ -200,9 +200,9 @@ public static String parseCAP(String cap) throws EMFError { * * @param email * in ingresso - * + * * @return parsing della mail con espressione regolare - * + * * @throws EMFError * eccezione generica */ @@ -223,9 +223,9 @@ public static String parseEmail(String email) throws EMFError { * * @param codFiscale * in ingresso - * + * * @return del codice fiscale con espressione regolare - * + * * @throws EMFError * eccezione generica */ @@ -245,9 +245,9 @@ public static String parseCodFiscale(String codFiscale) throws EMFError { * * @param piva * in ingresso - * + * * @return della partiva iva con espressione regolare - * + * * @throws EMFError * eccezione generica */ @@ -320,9 +320,9 @@ public static String parsePartitaIva(String piva) throws EMFError { * * @param codice * in ingresso - * + * * @return del codice fiscale con espressione regolare - * + * * @throws EMFError * eccezione generica */ @@ -359,9 +359,9 @@ public static boolean isPartitaIva(String codice) { * * @param telefono * in ingresso - * + * * @return del telefono con espressione regolare - * + * * @throws EMFError * eccezione generica */ @@ -416,9 +416,9 @@ public static final String format(Object value, Type.Enum type, String format) t * oggetto generico * @param type * tipo {@link Enum} - * + * * @return risultato della formattazione - * + * * @throws EMFError * eccezione generica */ @@ -451,7 +451,7 @@ public static final String format(Object value, Type.Enum type) throws EMFError * string in ingresso * @param type * tipo {@link Enum} - * + * * @return true/false con verifica */ public static final boolean check(String value, Type.Enum type) { @@ -483,9 +483,9 @@ public static final boolean check(Set values, Type.Enum type) { * string in ingresso * @param type * tipo {@link Enum} - * + * * @return oggetto parsato - * + * * @throws EMFError * eccezione generica */ diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/util/Format.java b/spagolite-middle/src/main/java/it/eng/spagoLite/util/Format.java index 81af701..67dd561 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/util/Format.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/util/Format.java @@ -109,7 +109,7 @@ public String format() { * * @param string * valore - * + * * @return la stringa formattata */ public static String formatString(String string) { @@ -129,7 +129,7 @@ public static String formatString(String string) { * formato conversione * @param symbols * simbolo decimale - * + * * @return la stringa formattata */ private static String formatNumber(BigDecimal bigDecimal, String format, DecimalFormatSymbols symbols) { @@ -154,7 +154,7 @@ private static String formatNumber(BigDecimal bigDecimal, String format, Decimal * valore * @param format * formato - * + * * @return la stringa formattata */ public static String formatDecimal(BigDecimal bigDecimal, String format) { @@ -166,7 +166,7 @@ public static String formatDecimal(BigDecimal bigDecimal, String format) { * * @param bigDecimal * valore - * + * * @return la stringa formattata */ public static String formatDecimal(BigDecimal bigDecimal) { @@ -178,7 +178,7 @@ public static String formatDecimal(BigDecimal bigDecimal) { * * @param bigDecimal * valore - * + * * @return la stringa formattata */ public static String formatInteger(BigDecimal bigDecimal) { @@ -206,7 +206,7 @@ public static String formatInteger(String bigDecimal) { * valore * @param formato * formato - * + * * @return la stringa formattata */ public static String formatInteger(BigDecimal bigDecimal, String formato) { @@ -222,7 +222,7 @@ public static String formatInteger(BigDecimal bigDecimal, String formato) { * formato * @param currencySymbol * simbolo valuta - * + * * @return la stringa formattata */ public static String formatCurrency(BigDecimal bigDecimal, String format, String currencySymbol) { @@ -244,7 +244,7 @@ public static String formatCurrency(BigDecimal bigDecimal, String format, String * valore * @param currencySymbol * simbolo valuta - * + * * @return la stringa formattata */ public static String formatCurrency(BigDecimal bigDecimal, String currencySymbol) { @@ -254,7 +254,7 @@ public static String formatCurrency(BigDecimal bigDecimal, String currencySymbol /** * @param valore * in inpunt - * + * * @return la stringa formattata */ public static String formatItalianCurrency(String valore) { @@ -282,7 +282,7 @@ public static String formatItalianCurrency(String valore) { * * @param bigDecimal * valore - * + * * @return la stringa formattata */ public static String formatCurrency(BigDecimal bigDecimal) { @@ -296,7 +296,7 @@ public static String formatCurrency(BigDecimal bigDecimal) { * in formato timestamp * @param format * formato di conversione - * + * * @return la data formattata */ public static String formatDate(Timestamp date, String format) { @@ -314,7 +314,7 @@ public static String formatDate(Timestamp date, String format) { * * @param date * timestamp in input - * + * * @return la data formattata */ public static String formatDate(Timestamp date) { @@ -326,7 +326,7 @@ public static String formatDate(Timestamp date) { * * @param date * timestamp in input - * + * * @return la data formattata */ public static String formatDateTime(Timestamp date) { @@ -338,7 +338,7 @@ public static String formatDateTime(Timestamp date) { * * @param date * timestamp in input - * + * * @return la data formattata */ public static String formatTime(Timestamp date) { @@ -350,7 +350,7 @@ public static String formatTime(Timestamp date) { * * @param date * timestamp in input - * + * * @return la data formattata */ public static String formatWeek(Timestamp date) { @@ -362,7 +362,7 @@ public static String formatWeek(Timestamp date) { * * @param date * timestamp in input - * + * * @return la data formattata */ public static String formatMonth(Timestamp date) { @@ -374,7 +374,7 @@ public static String formatMonth(Timestamp date) { * * @param date * timestamp in input - * + * * @return la data formattata */ public static String formatYear(Timestamp date) { diff --git a/spagolite-middle/src/main/java/it/eng/spagoLite/util/Parse.java b/spagolite-middle/src/main/java/it/eng/spagoLite/util/Parse.java index ff9578b..6f14d1b 100644 --- a/spagolite-middle/src/main/java/it/eng/spagoLite/util/Parse.java +++ b/spagolite-middle/src/main/java/it/eng/spagoLite/util/Parse.java @@ -38,7 +38,7 @@ public class Parse { * * @param string * in ingresso - * + * * @return string parsata */ public static String parseString(String string) { @@ -58,9 +58,9 @@ public static String parseString(String string) { * formato * @param symbols * simbolo decimale - * + * * @return la stringa parsata - * + * * @throws ParseException */ private static BigDecimal parseNumber(String value, String format, DecimalFormatSymbols symbols) @@ -88,9 +88,9 @@ private static BigDecimal parseNumber(String value, String format, DecimalFormat * in ingresso * @param format * formato - * + * * @return il numero parsato - * + * * @throws ParseException * eccezione generica */ @@ -103,9 +103,9 @@ public static BigDecimal parseDecimal(String value, String format) throws ParseE * * @param value * in ingresso - * + * * @return il numero parsato - * + * * @throws ParseException * eccezione generica */ @@ -118,9 +118,9 @@ public static BigDecimal parseDecimal(String value) throws ParseException { * * @param value * in ingresso - * + * * @return il numero parsato - * + * * @throws ParseException * eccezione generica */ @@ -137,9 +137,9 @@ public static BigDecimal parseInteger(String value) throws ParseException { * formato * @param currencySymbol * currency - * + * * @return il numero parsato - * + * * @throws ParseException * eccezione generica */ @@ -159,9 +159,9 @@ public static BigDecimal parseCurrency(String value, String format, String curre * in ingresso * @param currencySymbol * currency - * + * * @return il numero parsato - * + * * @throws ParseException * eccezione generica */ @@ -174,9 +174,9 @@ public static BigDecimal parseCurrency(String value, String currencySymbol) thro * * @param value * in ingresso - * + * * @return risultato parsing valuta - * + * * @throws ParseException * eccezione generica */ @@ -195,9 +195,9 @@ public static BigDecimal parseCurrency(String value) throws ParseException { * in ingresso * @param format * formato - * + * * @return la data parsata, null se la data è null o stringa vuota - * + * * @throws ParseException * eccezione generica */ @@ -222,9 +222,9 @@ public static Timestamp parseDate(String date, String format) throws ParseExcept * * @param date * in ingresso - * + * * @return la data parsata, null se la data è null o stringa vuota - * + * * @throws ParseException * eccezione generica */ @@ -237,9 +237,9 @@ public static Timestamp parseDate(String date) throws ParseException { * * @param date * in ingresso - * + * * @return la data parsata, null se la data è null o stringa vuota - * + * * @throws ParseException * eccezione generica */ @@ -252,9 +252,9 @@ public static Timestamp parseDateTime(String date) throws ParseException { * * @param date * in ingresso - * + * * @return la data parsata, null se la data è null o stringa vuota - * + * * @throws ParseException * eccezione generica */ @@ -267,9 +267,9 @@ public static Timestamp parseTime(String date) throws ParseException { * * @param date * in ingresso - * + * * @return la data parsata, null se la data è null o stringa vuota - * + * * @throws ParseException * eccezione generica */ @@ -282,9 +282,9 @@ public static Timestamp parseMonth(String date) throws ParseException { * * @param date * in ingresso - * + * * @return la data parsata, null se la data è null o stringa vuota - * + * * @throws ParseException * eccezione generica */ diff --git a/spagolite-middle/src/main/java/it/eng/util/EncryptionUtil.java b/spagolite-middle/src/main/java/it/eng/util/EncryptionUtil.java index fc0de49..e7690b9 100644 --- a/spagolite-middle/src/main/java/it/eng/util/EncryptionUtil.java +++ b/spagolite-middle/src/main/java/it/eng/util/EncryptionUtil.java @@ -42,7 +42,7 @@ /** * * @author MIacolucci - * + * * Classe di utilità  per la criptazione/decriptazione di stringhe */ public class EncryptionUtil { @@ -78,12 +78,12 @@ public static byte[] aesCrypt(String plainText) { } /** - * + * * @param plainText * Stringa da Criptare con algoritmo AES con profondità  di Bit richiesti * @param bit * 128, 192, 256 bit - * + * * @return byte array contenente l'input cifrato */ public static byte[] aesCrypt(String plainText, Aes bit) { @@ -125,12 +125,12 @@ public static byte[] aesDecrypt(byte[] cipherMessage) { } /** - * + * * @param cipherMessage * byte arrai della stringa cifrata * @param bit * 128, 192, 256 bit - * + * * @return byte array contenente la stringa oroginaria */ public static byte[] aesDecrypt(byte[] cipherMessage, Aes bit) { @@ -196,12 +196,12 @@ private static void generateBase64Aes128_192_256BitKey() { /** * TOrna il vecchio HMAC di una stringa. Usato da sempre in sacer per passare parametri sulla URL - * + * * @param msg * stringa di cui calcolare l'HMAC - * + * * @return L'HMAC della stringa passata. - * + * * @throws EMFError */ public static String getHMAC(String msg) throws EMFError { diff --git a/spagolite-middle/src/main/java/it/eng/util/FileSystemUtil.java b/spagolite-middle/src/main/java/it/eng/util/FileSystemUtil.java index a4d3326..821bdc3 100644 --- a/spagolite-middle/src/main/java/it/eng/util/FileSystemUtil.java +++ b/spagolite-middle/src/main/java/it/eng/util/FileSystemUtil.java @@ -32,7 +32,7 @@ public class FileSystemUtil { * da verificare * @param excludePath * path da escludere - * + * * @return true/false */ public static final boolean isToExclude(File file, String[] excludePath) { @@ -49,7 +49,7 @@ public static final boolean isToExclude(File file, String[] excludePath) { * * @param file * da verificare - * + * * @return true/false */ public static final boolean isToExclude(File file) { @@ -66,7 +66,7 @@ public static final boolean isToExclude(File file) { * filtro da applicare * @param excludePath * path da escludere - * + * */ private static final void getFileList(List list, File file, String filter, String[] excludePath) { if (isToExclude(file, excludePath)) @@ -93,7 +93,7 @@ private static final void getFileList(List list, File file, String filter, Strin * filtro da applicare * @param excludePath * path da escludere - * + * * @return lista file */ public static final List getFileList(String directory, String filter, String[] excludePath) { diff --git a/spagolite-paginator-ejb/pom.xml b/spagolite-paginator-ejb/pom.xml index 3f2002f..084346b 100644 --- a/spagolite-paginator-ejb/pom.xml +++ b/spagolite-paginator-ejb/pom.xml @@ -6,7 +6,7 @@ it.eng.parer spagofat - 6.14.2-SNAPSHOT + 6.15.0 diff --git a/spagolite-paginator-gf/pom.xml b/spagolite-paginator-gf/pom.xml index 0c94937..ebeffcb 100644 --- a/spagolite-paginator-gf/pom.xml +++ b/spagolite-paginator-gf/pom.xml @@ -5,7 +5,7 @@ it.eng.parer spagofat - 6.14.2-SNAPSHOT + 6.15.0 diff --git a/spagolite-paginator-gf/src/main/java/it/eng/paginator/util/CriteriaQueryUtils.java b/spagolite-paginator-gf/src/main/java/it/eng/paginator/util/CriteriaQueryUtils.java index 8b2bcf0..8bf564c 100644 --- a/spagolite-paginator-gf/src/main/java/it/eng/paginator/util/CriteriaQueryUtils.java +++ b/spagolite-paginator-gf/src/main/java/it/eng/paginator/util/CriteriaQueryUtils.java @@ -51,10 +51,10 @@ public abstract class CriteriaQueryUtils { private static volatile int aliasCount = 0; /** - * + * * @param em * @param criteria - * + * * @return */ public static int count(EntityManager em, CriteriaQuery criteria) { @@ -68,9 +68,9 @@ public static int count(EntityManager em, CriteriaQuery criteria) { * Entity Manager * @param criteria * Criteria Query to count results - * + * * @param params - * + * * @return row count */ public static int count(EntityManager em, CriteriaQuery criteria, Set params) { @@ -87,7 +87,7 @@ public static int count(EntityManager em, CriteriaQuery criteria, Set CriteriaQuery countCriteria(EntityManager em, CriteriaQuery criteria) { @@ -110,7 +110,7 @@ public static CriteriaQuery countCriteria(EntityManager em, CriteriaQu * Gets The result alias, if none set a default one and return it * * @param selection - * + * * @return root alias or generated one */ private static synchronized String getOrCreateAlias(Selection selection) { @@ -135,7 +135,7 @@ private static synchronized String getOrCreateAlias(Selection selection) * criteria query * @param clazz * root type - * + * * @return Root of null if none */ @SuppressWarnings("unchecked") @@ -332,7 +332,7 @@ private static Path getOrderByPath(CriteriaQuery cq, String sortColumnName) { } /** - * + * * @param cq * @param sortColumnName * @param sortingRule diff --git a/spagolite-paginator-gf/src/main/java/it/eng/paginator/util/HibernateUtils.java b/spagolite-paginator-gf/src/main/java/it/eng/paginator/util/HibernateUtils.java index 7d8e132..696345d 100644 --- a/spagolite-paginator-gf/src/main/java/it/eng/paginator/util/HibernateUtils.java +++ b/spagolite-paginator-gf/src/main/java/it/eng/paginator/util/HibernateUtils.java @@ -32,18 +32,14 @@ import org.hibernate.proxy.HibernateProxy; import org.hibernate.proxy.LazyInitializer; -/** - * - * @author Manuel Bertuzzi - */ public abstract class HibernateUtils { /** * Converte una collection di BigDecimal in una List Utilizzato per una migrazione ad Hibernate che non * modifichi minimamente la logica attuale La soluzione pulita è chiaramente farsi arrivare direttamente il tipo di * dato corretto. - * + * * @param longCollection - * + * * @return */ public static List bigDecimalListFrom(Collection longCollection) { @@ -63,9 +59,9 @@ public static List bigDecimalListFrom(Collection longCollectio * modifichi minimamente la logica attuale La soluzione pulita è chiaramente farsi arrivare direttamente il tipo di * dato corretto. Si utilizza questo metodo piuttosto che farlo inline col metodo longValue() perché in caso di * valori null darebbe un NullPointerException che prima non sarebbe stato sollevato. - * + * * @param number - * + * * @return */ public static Long longFrom(Number number) { @@ -80,9 +76,9 @@ public static boolean isCollectionOf(final Class c, Collection collection) { * Converte una collection di BigDecimal in una List Utilizzato per una migrazione ad Hibernate che non * modifichi minimamente la logica attuale La soluzione pulita è chiaramente farsi arrivare direttamente il tipo di * dato corretto. - * + * * @param collection - * + * * @return */ public static List longListFrom(Collection collection) { @@ -100,9 +96,9 @@ public static List longListFrom(Collection collectio * non modifichi minimamente la logica attuale La soluzione pulita è chiaramente farsi arrivare direttamente il tipo * di dato corretto. Si utilizza questo metodo piuttosto che farlo inline col metodo BigDecimal.valueOf() perché in * caso di valori null darebbe un NullPointerException che prima non sarebbe stato sollevato. - * + * * @param numero - * + * * @return */ public static BigDecimal bigDecimalFrom(Number numero) { diff --git a/spagolite-si-client/pom.xml b/spagolite-si-client/pom.xml index 0559fde..c215642 100644 --- a/spagolite-si-client/pom.xml +++ b/spagolite-si-client/pom.xml @@ -7,7 +7,7 @@ it.eng.parer spagofat - 6.14.2-SNAPSHOT + 6.15.0 @@ -23,13 +23,12 @@ jaxb-api compile - - javax.activation - activation - 1.1.1 - compile - - + + com.sun.activation + javax.activation + compile + + javax.xml.ws jaxws-api diff --git a/spagolite-si-server/pom.xml b/spagolite-si-server/pom.xml index 8fcf533..ab489e1 100644 --- a/spagolite-si-server/pom.xml +++ b/spagolite-si-server/pom.xml @@ -6,7 +6,7 @@ it.eng.parer spagofat - 6.14.2-SNAPSHOT + 6.15.0 war diff --git a/spagolite-si-util/pom.xml b/spagolite-si-util/pom.xml index 4837b1e..10fdd83 100644 --- a/spagolite-si-util/pom.xml +++ b/spagolite-si-util/pom.xml @@ -14,7 +14,7 @@ it.eng.parer spagofat - 6.14.2-SNAPSHOT + 6.15.0 @@ -53,11 +53,11 @@ javax.xml.ws jaxws-api - + org.junit.jupiter junit-jupiter-api - 5.6.0 + ${junit-jupiter.version} test @@ -69,13 +69,12 @@ org.junit.jupiter junit-jupiter-engine - 5.6.0 + ${junit-jupiter.version} test org.slf4j slf4j-simple - ${slf4j.version} test diff --git a/spagolite-si-util/src/main/java/it/eng/integriam/client/ws/IAMRestClients.java b/spagolite-si-util/src/main/java/it/eng/integriam/client/ws/IAMRestClients.java index 7f87437..09445e4 100644 --- a/spagolite-si-util/src/main/java/it/eng/integriam/client/ws/IAMRestClients.java +++ b/spagolite-si-util/src/main/java/it/eng/integriam/client/ws/IAMRestClients.java @@ -48,7 +48,7 @@ private IAMRestClients() { * tipologia help online * @param nmPaginaWeb. * pagina web per cui cui richiedere l'help online - * + * * @return stringa contenente la serializzazione dell'help online. */ public static String recuperoHelpClient(String serviceURL, long idApplic, String tiHelpOnLine, String nmPaginaWeb) { diff --git a/spagolite-sl-ejb/pom.xml b/spagolite-sl-ejb/pom.xml index 3a135ad..a04edd4 100644 --- a/spagolite-sl-ejb/pom.xml +++ b/spagolite-sl-ejb/pom.xml @@ -7,7 +7,7 @@ it.eng.parer spagofat - 6.14.2-SNAPSHOT + 6.15.0 @@ -24,6 +24,12 @@ it.eng.parer spagofat-sl-slg + + + xml-apis + xml-apis + + it.eng.parer diff --git a/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/common/SacerLogEjbType.java b/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/common/SacerLogEjbType.java index 07d2653..912ed66 100644 --- a/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/common/SacerLogEjbType.java +++ b/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/common/SacerLogEjbType.java @@ -25,7 +25,7 @@ /** * * @author Iacolucci_M - * + * * Questa annotazione serve per indicare che l'ejb che si sta annotando è un ejb del pacchetto SacerLog. Serve * per far funzionare correttamente il paginatore il quale quando trova questa annotazione sull'ejb che sta * paginando fa la lookup dal modulo sacerlog-ejb invece che da "module" come faceva inizialmente. Quando l'ejb diff --git a/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/SacerLogEjb.java b/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/SacerLogEjb.java index 869db84..78e236f 100644 --- a/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/SacerLogEjb.java +++ b/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/SacerLogEjb.java @@ -55,6 +55,8 @@ import it.eng.parer.sacerlog.entity.LogEvento; import it.eng.parer.sacerlog.entity.LogEventoByScript; import it.eng.parer.sacerlog.entity.LogOggettoEvento; +import it.eng.parer.sacerlog.exceptions.SacerLogRuntimeException; +import it.eng.parer.sacerlog.exceptions.SacerLogRuntimeException.SacerLogErrorCategory; import it.eng.parer.sacerlog.util.TransactionLogContext; import it.eng.parer.sacerlog.viewEntity.AplVLogChiaveTiOgg; import it.eng.parer.sacerlog.viewEntity.AplVLogFotoTiEvnOgg; @@ -96,52 +98,6 @@ public TransactionLogContext getNewTransactionLogContext() { return ctx; } - /* - * Metodo principale per il logging che gestisce sia le loggate normali che quelle scaturite da un trigger. - * - * @param isTrigger viene messo a true quando questo metodo viene chiamato da se stesso per eseguire un log da - * trigger. In questo caso non serve passare nmComponente ma basta il nmTipoEvento e nmApplicazione che usa per fare - * una query sulla vista APL_V_LOG_TI_EVN che va solo nella tabella APL_TIPO_EVENTO. Se viene passato false in tutti - * gli altri casi. Con false usa la view APL_V_LOG_TI_EVN_CON_ORIGINE che mette in join e UNION le tabelle delle - * pagine web, azioni pagine e tabelle dei tipi evento. - * - * @param nmTipoEvento viene passato nel caso in cui istrigger = true in quanto serve per estrarre i dati dalla view - * APL_V_LOG_TI_EVN - * - * @param nmApplic contiene il nome dell'applicazione per cui si sta loggando - * - * @param agente contiene un record di LOG_V_LOG_AGENTE che è una view che consente con una UNION e join di estrarre - * i dati dell'utente/agente oppure del componente sw/agente. - * - * @param nmAzione contiene il nome dell'azione da loggare es.: toolbar/insert (campo NM_AZIONE_PAGINA della tabella - * APL_AZIONE_PAGINA) oppure nel caso di un componente software l'azione corrisponde al contenuto del campo - * NM_AZIONE_COMP_SW della tabella APL_AZIONE_COMP_SW come ad esempio: "Inizializza log Sacer_iam" - * - * @param nmTipoOggetto contiene il del tipo oggetto che si sta loggando - * - * @param idOggetto contiene la chiave primaria dell'entità che si sta loggando - * - * @param nmComponente contiene il nome del componente che sta logganto come ad esempio una pagina web (es.: - * /amministrazione/loginUtente) oppure un nome di un componente software come un job che corrisponde al campo - * NM_COMP_SW della tabella APL_COMP_SW - * - * @param tipoRuoloPremisAgenteEvento il ruolo_agente_evento da mettere nella tabella LOG_AGENTE_EVENTO. Se non - * viene valorizzato imposta di default "implementer" - * - * @param tipoRuoloPremisEventoOggetto il ruolo_oggetto_evento da mettere nella tabella LOG_OGGETTO_EVENTO. Se non - * viene valorizzato imposta di default "outcome" - * - * @param momentoAttuale è il timestamp con cui si deve registrare l'evento di log che può essere now() nel caso di - * loggate normale oppure deve esere presa dalla tabella LOG_EVENTO_BY_SCRIPT nel caso in cui si utilizzi uno script - * di aggiornamento ORACLE lanciato esternamente per cui quegli eventi vanno registrati con il loro timestamp - * originario - * - * @param hasToCheckScriptExistance true nei casi di log normale, false nel caso in cui questo metodo venisse - * chiamato da se stesso quando venissero rilevati dei log dalla tabella LOG_EVENTO_BY_SCRIPT - * - * @return LogEvento record LOG_EVENTO con la sua chiave primaria valorizzata - * - */ protected LogEvento log(TransactionLogContext ctx, boolean isTrigger, String nmTipoEvento, String nmApplic, LogVLogAgente agente, String nmAzione, String nmTipoOggetto, BigDecimal idOggetto, String nmComponente, String tipoRuoloPremisAgenteEvento, String tipoRuoloPremisEventoOggetto, Calendar momentoAttuale, @@ -208,7 +164,7 @@ protected LogEvento log(TransactionLogContext ctx, boolean isTrigger, String nmT logEvento.setIdTransazione(ctx.getTransactionId()); // Agenti Evento - ArrayList agentiEvento = new ArrayList(); + ArrayList agentiEvento = new ArrayList<>(); LogAgenteEvento logAgenteEvento = new LogAgenteEvento(); logAgenteEvento.setIdAgente(agente.getIdAgente()); logAgenteEvento.setTiRuoloAgenteEvento(tipoRuoloPremisAgenteEvento); @@ -217,7 +173,7 @@ protected LogEvento log(TransactionLogContext ctx, boolean isTrigger, String nmT logEvento.setLogAgenteEventos(agentiEvento); // Oggetto Evento - ArrayList oggettiEvento = new ArrayList(); + ArrayList oggettiEvento = new ArrayList<>(); LogOggettoEvento logOggettoEvento = new LogOggettoEvento(); logOggettoEvento.setIdOggetto(idOggetto); logOggettoEvento.setIdTipoOggetto(tiOgg.getIdTipoOggetto()); @@ -229,11 +185,11 @@ protected LogEvento log(TransactionLogContext ctx, boolean isTrigger, String nmT logEvento.setLogOggettoEventos(oggettiEvento); // Verifica esistenza chiavi di accesso - ArrayList aChiave = new ArrayList(); + ArrayList aChiave = new ArrayList<>(); if (tiOgg.getIdTipoOggettoPadre() != null) { List lChiavi = sacerLogHelper .getChiaviAccessoByIdTipoOggetto(tiOgg.getIdTipoOggetto()); - if (lChiavi != null && lChiavi.size() > 0) { + if (lChiavi != null && !lChiavi.isEmpty()) { BigDecimal idOggettoFiglio = idOggetto; LogChiaveAccessoEvento logChiave = null; for (AplVLogChiaveTiOgg chiave : lChiavi) { @@ -244,7 +200,7 @@ protected LogEvento log(TransactionLogContext ctx, boolean isTrigger, String nmT logChiave.setDtRegEvento(momentoAttuale); List lChiaviPadre = sacerLogHelper .findAllChiaviAccessoByIdOggetto(chiave.getBlQueryTipoOggetto(), idOggettoFiglio); - if (lChiaviPadre != null && lChiaviPadre.size() > 0) { + if (lChiaviPadre != null && !lChiaviPadre.isEmpty()) { logChiave.setIdOggetto(lChiaviPadre.iterator().next()); aChiave.add(logChiave); } @@ -275,7 +231,7 @@ protected LogEvento log(TransactionLogContext ctx, boolean isTrigger, String nmT // Verifica esistenza ed esecuzione dei trigger List trigList = sacerLogHelper .getTriggersByIdEventoOggetto(evnOgg.getIdTipoEventoOggetto()); - if (trigList != null && trigList.size() > 0) { + if (trigList != null && !trigList.isEmpty()) { // per ogni trigger che trova... for (AplVLogTrigTiEvnOgg trigger : trigList) { if (sacerLogHelper.isThereATrigger(trigger.getBlQueryTipoOggettoTrig(), idFoto)) { @@ -288,9 +244,6 @@ protected LogEvento log(TransactionLogContext ctx, boolean isTrigger, String nmT log.debug("TID [{}] Deve scattare la nuova FOTO TRIGGERATA per l'entita' [{}]", ctx, oggId); // Logga l'oggetto triggerato ricorsivamente - // log(ctx, true, trigger.getNmTipoEventoTrig(), nmApplic, agente, nmAzione, - // trigger.getNmTipoOggettoTrig(), oggId, nmComponente, tipoRuoloPremisAgenteEvento, - // tipoRuoloPremisEventoOggetto, momentoAttuale, true); log(ctx, true, trigger.getNmTipoEventoTrig(), trigger.getNmApplicTrig(), agente, nmAzione, trigger.getNmTipoOggettoTrig(), oggId, nmComponente, tipoRuoloPremisAgenteEvento, tipoRuoloPremisEventoOggetto, momentoAttuale, @@ -318,8 +271,9 @@ protected LogEvento log(TransactionLogContext ctx, boolean isTrigger, String nmT */ public void gestisciLogEventoScript(TransactionLogContext ctx, String nomeApplicazione, String nomeTipoOggetto, BigDecimal idTipoOggetto, BigDecimal idOggetto) { - List l = sacerLogHelper.getLogEventoScriptByTipoOggettoIdLocked(idTipoOggetto, idOggetto); - if (l != null && l.size() > 0) { + List eventoList = sacerLogHelper.getLogEventoScriptByTipoOggettoIdLocked(idTipoOggetto, + idOggetto); + if (eventoList != null && !eventoList.isEmpty()) { /* * Se l'ID di transazione viene fornito dall'esterno usa quello altrimenti ne ricava uno nuovo dalla * sequence su DB. @@ -337,7 +291,7 @@ public void gestisciLogEventoScript(TransactionLogContext ctx, String nomeApplic TransactionLogContext ctxEffettivo; - for (LogEventoByScript logEventoByScript : l) { + for (LogEventoByScript logEventoByScript : eventoList) { LogVLogAgente logAgente = sacerLogHelper.getAgenteByIdAgente(logEventoByScript.getIdAgente()); // 29592 - recupero l'azione da loggare, che può essere riferita ad un componente sw o ad una pagina web BigDecimal idAzione = logEventoByScript.getIdAzionePagina() == null @@ -412,8 +366,8 @@ public LogEvento logInNewTx(TransactionLogContext ctx, String nmApplic, String n */ public List log(TransactionLogContext ctx, String nmApplic, String nmAgente, String nmAzione, String nmTipoOggetto, Set idsOggetto, String nmComponente) { - List l = new ArrayList(); - if (idsOggetto != null && idsOggetto.size() > 0) { + List l = new ArrayList<>(); + if (idsOggetto != null && !idsOggetto.isEmpty()) { /* * Se l'ID di transazione viene fornito dall'esterno usa quello altrimenti ne ricava uno nuovo dalla * sequence su DB. @@ -442,27 +396,27 @@ public List logInNewTx(TransactionLogContext ctx, String nmApplic, St * tipo oggetto ed una lista di ID oggetto da fotografare in futuro. Si utilizza tipicamente quando di vuole una * lista di oggetti da fotografare dopo che sono stati cancellati dal DB. Per fotografarli successivamente si deve * usare la funzione logAfter() a cui verrà passata la lista di oggetti ritornati da questa funzione. - * + * * @param nmApplic contiene il nome dell'applicazione per cui si sta loggando - * + * * @param agente contiene un record di LOG_V_LOG_AGENTE che è una view che consente con una UNION e join di estrarre * i dati dell'utente/agente oppure del componente sw/agente. - * + * * @param nmAzione contiene il nome dell'azione da loggare es.: toolbar/insert - * + * * @param nmTipoOggetto contiene il del tipo oggetto che si sta loggando - * + * * @param idOggetto contiene la chiave primaria dell'entità che si sta loggando - * + * * @param nmComponente contiene il nome del componente che sta logganto come ad esempio una pagina web (es.: * /amministrazione/loginUtente) oppure un nome di un componente software come un job - * + * * @param tipoRuoloPremisAgenteEvento il ruolo_agente_evento da mettere nella tabella LOG_AGENTE_EVENTO. Se non * viene valorizzato imposta di default "implementer" - * + * * @param tipoRuoloPremisEventoOggetto il ruolo_oggetto_evento da mettere nella tabella LOG_OGGETTO_EVENTO. Se non * viene valorizzato imposta di default "outcome" - * + * * @return List Unalista di ObjectsToLogBefore. Un ObjectsToLogBefore contiene il nome del tipo * di oggetto ed una lista di idOggetto. */ @@ -470,18 +424,14 @@ public List logBefore(TransactionLogContext ctx, String nmAp String nmAzione, String nmTipoOggetto, BigDecimal idOggetto, String nmComponente) { if (ctx == null) { - throw new RuntimeException(ERR_MSG_ID_TRANSAZIONE_NULLO); + throw SacerLogRuntimeException.builder().category(SacerLogErrorCategory.LOGGER_ERROR) + .message(ERR_MSG_ID_TRANSAZIONE_NULLO).build(); } // LogVLogAgente agente = sacerLogHelper.getAgenteByNomeAgente(nmAgente); List listaOggettiDaLoggare = null; // verifica se il logging e' abilitato sulla tabella dei parametri dell'applicazione if (sacerLogHelper.isLoggingEnabled() || sacerLogHelper.isLoggingEnabledForThisNomeAzione(nmAzione)) { // Gestione defaults - // tipoRuoloPremisAgenteEvento = tipoRuoloPremisAgenteEvento == null ? - // PremisEnums.TipoAgenteEvento.IMPLEMENTER : tipoRuoloPremisAgenteEvento; - // tipoRuoloPremisEventoOggetto = tipoRuoloPremisEventoOggetto == null ? - // PremisEnums.TipoEventoOggetto.OUTCOME : tipoRuoloPremisEventoOggetto; - AplVLogTiEvnConOrigine tipoConOrigine = sacerLogHelper.getTipoEventoByApplicFinestraAzione(nmApplic, nmComponente, nmAzione); BigDecimal idTipoEvento = tipoConOrigine.getAplVLogTiEvnConOrigineId().getIdTipoEvento(); @@ -496,8 +446,8 @@ public List logBefore(TransactionLogContext ctx, String nmAp */ List trigList = sacerLogHelper .getTriggersBeforeByIdEventoOggetto(evnOgg.getIdTipoEventoOggetto()); - if (trigList != null && trigList.size() > 0) { - listaOggettiDaLoggare = new ArrayList(); + if (trigList != null && !trigList.isEmpty()) { + listaOggettiDaLoggare = new ArrayList<>(); // per ogni trigger che trova... for (AplVLogTrigTiEvnOgg trigger : trigList) { /* @@ -505,9 +455,9 @@ public List logBefore(TransactionLogContext ctx, String nmAp * esempio l'idOggetto potrebbe essere quello del TipoUD e la select degli oggetti estrae per questo * TipoUD tutti i Registri collegati */ - List l = sacerLogHelper.findAllObjectIdFromTrigger(trigger.getBlQueryTipoOggettoSel(), - idOggetto); - if (l != null && l.size() > 0) { + List idsList = sacerLogHelper + .findAllObjectIdFromTrigger(trigger.getBlQueryTipoOggettoSel(), idOggetto); + if (idsList != null && !idsList.isEmpty()) { // ...estrae il tipo oggetto ed il tipo evento degli oggetti i cui ID si estrarranno nella // successiva query... ObjectsToLogBefore obj = new ObjectsToLogBefore(trigger.getNmApplicTrig(), @@ -515,7 +465,7 @@ public List logBefore(TransactionLogContext ctx, String nmAp trigger.getTipoClasseEventoTrig()); listaOggettiDaLoggare.add(obj); log.debug("TID [{}] Deve scattare il trigger per l'entita' [{}]", ctx, obj.getTipoOggetto()); - for (BigDecimal oggId : l) { + for (BigDecimal oggId : idsList) { // Inserisco l'ID dell'oggetto nell'array degli oggetti da fotografare in futuro obj.getIdOggetto().add(oggId); } @@ -538,7 +488,8 @@ public void logAfter(TransactionLogContext ctx, String nmApplic, String nmAgente List listaOggetti, String nmComponente) { if (ctx == null) { - throw new RuntimeException(ERR_MSG_ID_TRANSAZIONE_NULLO); + throw SacerLogRuntimeException.builder().category(SacerLogErrorCategory.LOGGER_ERROR) + .message(ERR_MSG_ID_TRANSAZIONE_NULLO).build(); } if (listaOggetti != null) { LogVLogAgente agente = sacerLogHelper.getAgenteByNomeAgente(nmAgente); @@ -576,7 +527,7 @@ public LogEvento logInNewTransaction(TransactionLogContext ctx, boolean isTrigge * Costruisce la chiave del record prendendo tutti gli elementi della chiave e separandoli con DUE caratteri ~ * (TILDE). Se nell'elemento c'è 'null' allora omette sia il contenuto della chiave che della tilde */ - public static String getChiaveRecordFoto(String xml) { + public String getChiaveRecordFoto(String xml) { if (xml == null) { return null; } @@ -612,65 +563,4 @@ public static String getChiaveRecordFoto(String xml) { return chiave; } - /* - * public List logBefore(String nmApplic, String nmAgente, String nmAzione, String - * nmTipoOggetto, BigDecimal idOggetto, String nmComponente, String tipoRuoloPremisAgenteEvento, String - * tipoRuoloPremisEventoOggetto) { LogVLogAgente agente = sacerLogHelper.getAgenteByNomeAgente(nmAgente); return - * logBefore(nmApplic, agente, nmAzione, nmTipoOggetto, idOggetto, nmComponente, tipoRuoloPremisAgenteEvento, - * tipoRuoloPremisEventoOggetto); } - */ - /* - * public List logBefore(String nmApplic, String nmAgente, String nmAzione, String - * nmTipoOggetto, BigDecimal idOggetto, String nmComponente) { LogVLogAgente agente = - * sacerLogHelper.getAgenteByNomeAgente(nmAgente); return logBefore(nmApplic, agente, nmAzione, nmTipoOggetto, - * idOggetto, nmComponente); } - */ - /* - * Metodo di logging massivo per loggare una serie di idOggetto in un colpo solo senza idTransazione - */ - /* - * public List log(String nmApplic, String nmAgente, String nmAzione, String nmTipoOggetto, - * Set idsOggetto, String nmComponente) { return log(null, nmApplic, nmAgente, nmAzione, nmTipoOggetto, - * idsOggetto, nmComponente); } - */ - /* Multiple logging */ - /* - * public void log(String nmApplic, String nmAgente, String nmAzione, LogOggettoRuolo logOggettoRuolo[], String - * nmComponente, String tipoRuoloPremisAgenteEvento) { if (logOggettoRuolo != null) { for (LogOggettoRuolo or : - * logOggettoRuolo) { log(nmApplic, nmAgente, nmAzione, or.getNmTipoOggetto(), or.getIdOggetto(), nmComponente, - * tipoRuoloPremisAgenteEvento, or.getTiRuoloPremis()); } } } - * - * public void log(String nmApplic, String nmAgente, String nmAzione, LogOggettoRuolo logOggettoRuolo[], String - * nmComponente) { if (logOggettoRuolo != null) { for (LogOggettoRuolo or : logOggettoRuolo) { log(nmApplic, - * nmAgente, nmAzione, or.getNmTipoOggetto(), or.getIdOggetto(), nmComponente, null, or.getTiRuoloPremis()); } } } - * - * public void log(String nmApplic, String nmAgente, String nmAzione, LogOggettoRuolo logOggettoRuolo[]) { if - * (logOggettoRuolo != null) { for (LogOggettoRuolo or : logOggettoRuolo) { log(nmApplic, nmAgente, nmAzione, - * or.getNmTipoOggetto(), or.getIdOggetto(), null, null, or.getTiRuoloPremis()); } } } - */ - /* - * Metodo da utilizzare per le loggate da azioni tipo azione pagina senza idTransazione - */ - /* - * public LogEvento log(String nmApplic, String nmAgente, String nmAzione, String nmTipoOggetto, BigDecimal - * idOggetto, String nmComponente) { return log(null, nmApplic, nmAgente, nmAzione, nmTipoOggetto, idOggetto, - * nmComponente); } - */ - /* - * Metodo da utilizzare per le loggate da azioni tipo azione pagina senza idTransazione - */ - /* - * public LogEvento log(String nmApplic, String nmAgente, String nmAzione, String nmTipoOggetto, BigDecimal - * idOggetto, String nmComponente, String tipoRuoloPremisAgenteEvento, String tipoRuoloPremisEventoOggetto) { return - * log(null, nmApplic, nmAgente, nmAzione, nmTipoOggetto, idOggetto, nmComponente, tipoRuoloPremisAgenteEvento, - * tipoRuoloPremisEventoOggetto); } - */ - /* - * Metodo in overload che passa null al corrispondente metodo precedente - */ - /* - * public void gestisciLogEventoScript(String nomeApplicazione, String nomeTipoOggetto, BigDecimal idTipoOggetto, - * BigDecimal idOggetto) { gestisciLogEventoScript(null, nomeApplicazione, nomeTipoOggetto, idTipoOggetto, - * idOggetto); } - */ } diff --git a/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/SacerLogWebEjb.java b/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/SacerLogWebEjb.java index 7402f06..7dac7da 100644 --- a/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/SacerLogWebEjb.java +++ b/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/SacerLogWebEjb.java @@ -157,11 +157,11 @@ public LogVLisAsserzioniDatiTableBean getAsserzioniDatiByIdOggettoEvento(BigDeci String flg2 = "0"; /* * La logica di apparizione dei link per i valori troppo grandi è la seguente: - * + * * Dalla vista se tipo _valore = 0 allora il valore è < 254 caratteri e quindi è un campo normale. Se tipo * valore = 1 il valore <=4000 caratteri ed è ancora un campo normale. Se tipo valore = 2 il valore > 4000 * caratteri ed un CLOB. - * + * * Se però nel caso in cui nel tipo_valore = 1 è presente una stringa contenente un XML allora il sistema * deve copiare la stringa dal campo caratteri normale a quello contenente il CLOB. Se invece non c'è un xml * allora il valore è considerato ancora un tipo caratteri normale ed appare il primo link. diff --git a/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/common/AppServerInstance.java b/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/common/AppServerInstance.java index 485a905..b99921b 100644 --- a/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/common/AppServerInstance.java +++ b/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/common/AppServerInstance.java @@ -22,9 +22,6 @@ */ package it.eng.parer.sacerlog.ejb.common; -import it.eng.parer.sacerlog.ejb.common.helper.ParamApplicHelper; -import it.eng.parer.sacerlog.ejb.helper.SacerLogHelper; -import it.eng.parer.sacerlog.viewEntity.AplVParamApplic; import java.net.Inet4Address; import java.net.InetAddress; import java.net.NetworkInterface; @@ -32,6 +29,7 @@ import java.util.Enumeration; import java.util.HashMap; import java.util.Map; + import javax.annotation.PostConstruct; import javax.ejb.EJB; import javax.ejb.LocalBean; @@ -39,8 +37,15 @@ import javax.ejb.LockType; import javax.ejb.Singleton; import javax.ejb.Startup; + import org.slf4j.LoggerFactory; +import it.eng.parer.sacerlog.ejb.common.helper.ParamApplicHelper; +import it.eng.parer.sacerlog.ejb.helper.SacerLogHelper; +import it.eng.parer.sacerlog.exceptions.SacerLogRuntimeException; +import it.eng.parer.sacerlog.exceptions.SacerLogRuntimeException.SacerLogErrorCategory; +import it.eng.parer.sacerlog.viewEntity.AplVParamApplic; + /** * * @author Fioravanti_F, Iacolucci_M @@ -63,8 +68,8 @@ protected void initSingleton() { LOG.info("Inizializzazione singleton AppServerInstance..."); InetAddress address = this.getMyHostAddress(); - LOG.info("Indirizzo IP del server: " + address.getHostAddress()); - LOG.info(" Nome del server: " + address.getCanonicalHostName()); + LOG.info("Indirizzo IP del server: {}", address.getHostAddress()); + LOG.info(" Nome del server: {}", address.getCanonicalHostName()); servername = address.getCanonicalHostName(); @@ -73,10 +78,11 @@ protected void initSingleton() { if (instance != null) { servername += "/" + instance; } - LOG.info("Il nome completo dell'istanza in esecuzione è " + servername); + LOG.info("Il nome completo dell'istanza in esecuzione è {}", servername); } catch (UnknownHostException ex) { - LOG.error("Inizializzazione singleton AppServerInstance fallita! ", ex); - throw new RuntimeException(ex); + throw SacerLogRuntimeException.builder().cause(ex) + .message("Inizializzazione singleton AppServerInstance fallita!") + .category(SacerLogErrorCategory.INTERNAL_ERROR).build(); } } @@ -107,12 +113,13 @@ private InetAddress getMyHostAddress() throws UnknownHostException { // probabilmente disconnessa dalla rete // // Scorri su tutte le interfacce di rete - for (Enumeration ifaces = NetworkInterface.getNetworkInterfaces(); ifaces.hasMoreElements();) { + for (Enumeration ifaces = NetworkInterface.getNetworkInterfaces(); ifaces + .hasMoreElements();) { NetworkInterface iface = (NetworkInterface) ifaces.nextElement(); // Scorri su tutti gli indirizzi IP associati ad una scheda di rete - for (Enumeration inetAddrs = iface.getInetAddresses(); inetAddrs.hasMoreElements();) { + for (Enumeration inetAddrs = iface.getInetAddresses(); inetAddrs.hasMoreElements();) { InetAddress inetAddr = (InetAddress) inetAddrs.nextElement(); - LOG.debug("Verifico l'indirizzo " + inetAddr.getHostAddress()); + LOG.debug("Verifico l'indirizzo {}", inetAddr.getHostAddress()); AddressTypes tipo = decodeAddrType(inetAddr); // se è già presente un indirizzo di questo tipo (per esempio se // ci sono più schede di rete fisiche) lo sovrascrivo. Di fatto prendo @@ -125,7 +132,7 @@ private InetAddress getMyHostAddress() throws UnknownHostException { // garantendo la preferenza nella scelta del tipo di indirizzo reso for (AddressTypes at : AddressTypes.values()) { if (map.get(at) != null) { - LOG.info("Ho selezionato l'indirizzo di tipo " + at.name()); + LOG.info("Ho selezionato l'indirizzo di tipo {}", at.name()); return map.get(at); } } @@ -166,7 +173,7 @@ private AddressTypes decodeAddrType(InetAddress inetAddress) { tipo = AddressTypes.NON_SITE_LOCAL_WITHOUT_NAME_IPV6; } } - LOG.debug("è un indirizzo " + tipo.name()); + LOG.debug("è un indirizzo {}", tipo.name()); } else { // non mi interessa se questo indirizzo di loopback ha un nome: // nella maggior parte dei casi si chiama "localhost". @@ -178,15 +185,12 @@ private AddressTypes decodeAddrType(InetAddress inetAddress) { } else { tipo = AddressTypes.LOOPBACK_IPV6; } - LOG.debug("è un indirizzo di loopback di tipo " + tipo.name()); + LOG.debug("è un indirizzo di loopback di tipo {}", tipo.name()); } return tipo; } private boolean isAddressWithHostName(InetAddress inetAddress) { - if (inetAddress.getHostName().equals(inetAddress.getHostAddress())) { - return false; - } - return true; + return inetAddress.getHostName().equals(inetAddress.getHostAddress()); } } diff --git a/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/common/helper/ParamApplicHelper.java b/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/common/helper/ParamApplicHelper.java index 1ea31e1..ae86f46 100644 --- a/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/common/helper/ParamApplicHelper.java +++ b/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/common/helper/ParamApplicHelper.java @@ -22,17 +22,16 @@ */ package it.eng.parer.sacerlog.ejb.common.helper; -import it.eng.parer.sacerlog.common.Constants; -import it.eng.parer.sacerlog.ejb.helper.SacerLogHelper; -import it.eng.parer.sacerlog.viewEntity.AplVParamApplic; import java.util.List; + import javax.ejb.LocalBean; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; + +import it.eng.parer.sacerlog.common.Constants; +import it.eng.parer.sacerlog.viewEntity.AplVParamApplic; /** * @@ -42,26 +41,20 @@ @LocalBean public class ParamApplicHelper { - private static Logger log = LoggerFactory.getLogger(SacerLogHelper.class); - @PersistenceContext private EntityManager entityManager; + @SuppressWarnings("unchecked") protected AplVParamApplic getParamApplicValue(String nmParamApplic) { - try { - Query query = entityManager.createNamedQuery("AplVParamApplic.findByNmParamApplic", AplVParamApplic.class); - query.setParameter("nmParamApplic", nmParamApplic); - // AplVParamApplic p = (AplVParamApplic) query.getSingleResult(); - AplVParamApplic p = null; - List l = query.getResultList(); - if (l != null && l.size() > 0) { - p = l.get(0); - } - return p; - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione del parametro applicativo [{}]", nmParamApplic, ex); - throw ex; + Query query = entityManager.createNamedQuery("AplVParamApplic.findByNmParamApplic", AplVParamApplic.class); + query.setParameter("nmParamApplic", nmParamApplic); + // AplVParamApplic p = (AplVParamApplic) query.getSingleResult(); + AplVParamApplic p = null; + List result = query.getResultList(); + if (result != null && !result.isEmpty()) { + p = result.get(0); } + return p; } public AplVParamApplic getServerNameSystemProperty() { diff --git a/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/helper/ExportImportFotoHelper.java b/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/helper/ExportImportFotoHelper.java index c16e0e2..5851fec 100644 --- a/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/helper/ExportImportFotoHelper.java +++ b/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/helper/ExportImportFotoHelper.java @@ -22,8 +22,6 @@ */ package it.eng.parer.sacerlog.ejb.helper; -import it.eng.parer.sacerlog.common.SacerLogEjbType; -import it.eng.spagoCore.util.JpaUtils; import java.io.IOException; import java.io.Reader; import java.math.BigDecimal; @@ -33,18 +31,23 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -import java.util.HashMap; +import java.util.Map; import java.util.Map.Entry; + import javax.ejb.LocalBean; import javax.ejb.Stateless; import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; -import org.apache.commons.lang3.StringEscapeUtils; -import org.apache.commons.lang3.text.StrSubstitutor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; + +import org.apache.commons.text.StringEscapeUtils; +import org.apache.commons.text.StringSubstitutor; + +import it.eng.parer.sacerlog.common.SacerLogEjbType; +import it.eng.parer.sacerlog.exceptions.SacerLogRuntimeException; +import it.eng.parer.sacerlog.exceptions.SacerLogRuntimeException.SacerLogErrorCategory; +import it.eng.spagoCore.util.JpaUtils; /** * @@ -59,8 +62,6 @@ public class ExportImportFotoHelper { @PersistenceContext private EntityManager entityManager; - private static Logger log = LoggerFactory.getLogger(ExportImportFotoHelper.class); - /* * Dato un idOggetto ed un nome di funzione Oracle (NOME_SCHEMA.NOME_FUNZIONE) restituisce una foto XML dell'entità * a cui fa capo l'idOggetto passato. @@ -69,11 +70,8 @@ public String exportFoto(BigDecimal idOggetto, String functionName) { Clob clob = null; String risultato = null; ResultSet rs = null; - PreparedStatement ps = null; - Connection con = null; - try { - con = JpaUtils.provideConnectionFrom(entityManager); - ps = con.prepareStatement("SELECT " + functionName + "(?) AS FOTO FROM DUAL"); + try (Connection con = JpaUtils.provideConnectionFrom(entityManager); + PreparedStatement ps = con.prepareStatement("SELECT " + functionName + "(?) AS FOTO FROM DUAL")) { ps.setBigDecimal(1, idOggetto); rs = ps.executeQuery(); if (rs != null && rs.next()) { @@ -81,23 +79,10 @@ public String exportFoto(BigDecimal idOggetto, String functionName) { risultato = clob == null ? null : getClobAsString(clob); } } catch (Exception ex) { - log.error("Errore esportazione foto dalla funzione oracle " + functionName + "() per l'oggetto con ID [{}]", - idOggetto, ex); - throw new RuntimeException("Errore esportazione foto dalla funzione oracle " + functionName + "()", ex); - } finally { - try { - if (rs != null) { - rs.close(); - if (ps != null) { - ps.close(); - } - } - if (con != null) { - con.close(); - } - } catch (Exception ex) { - throw new RuntimeException("Errore esportazione foto dalla funzione oracle " + functionName + "()", ex); - } + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore esportazione foto dalla funzione oracle {0}() per l'oggetto con ID {1,number,#}", + functionName, idOggetto) + .build(); } return risultato; } @@ -109,36 +94,16 @@ public String exportFoto(BigDecimal idOggetto, String functionName) { */ public long importFoto(String fotoXml, String procedureName) { long risultato = -1; - CallableStatement cs = null; String istruzione = "{call " + procedureName + "(?,?)}"; - Connection con = null; - try { - con = JpaUtils.provideConnectionFrom(entityManager); - cs = con.prepareCall(istruzione); + try (Connection con = JpaUtils.provideConnectionFrom(entityManager); + CallableStatement cs = con.prepareCall(istruzione);) { cs.registerOutParameter(2, java.sql.Types.NUMERIC); cs.setString(1, fotoXml); cs.executeUpdate(); risultato = cs.getLong(2); } catch (Exception ex) { - log.error("Errore importazione Foto", ex); - throw new RuntimeException("Errore importazione Foto", ex); - } finally { - if (cs != null) { - try { - cs.close(); - } catch (SQLException ex) { - log.debug("Errore importazione Foto", ex); - throw new RuntimeException("Errore importazione Foto", ex); - } - } - if (con != null) { - try { - con.close(); - } catch (SQLException ex) { - log.debug("Errore importazione Foto", ex); - throw new RuntimeException("Errore importazione Foto", ex); - } - } + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore importazione Foto").build(); } return risultato; } @@ -154,23 +119,17 @@ private String getClobAsString(Clob clob) throws SQLException, IOException { return sb.toString(); } - /* - * private Clob getStringAsClob(Connection con, String str) throws SQLException { Clob c = con.createClob(); - * c.setString(1, str); return c; } - */ - /* * Prende in input una stringa contenente la Foto esportata dalla funzione exportFoto() ed una mappa con nella * chiave la variabile da sostituire all'interno dell'XML e la stringa effettiva. */ @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) - public String sostituisciTutto(String stringa, HashMap mappa) { + public String sostituisciTutto(String stringa, Map mappa) { // Fà l'escape dei caratteri NON XML! Su tutta la mappa. for (Entry entry : mappa.entrySet()) { - entry.setValue(StringEscapeUtils.escapeXml(entry.getValue())); + entry.setValue(StringEscapeUtils.escapeXml10(entry.getValue())); } - String str = StrSubstitutor.replace(stringa, mappa, "$#${", "}$#$"); - return str; + return StringSubstitutor.replace(stringa, mappa, "$#${", "}$#$"); } } diff --git a/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/helper/SacerLogHelper.java b/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/helper/SacerLogHelper.java index 3e29d2e..93c763f 100644 --- a/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/helper/SacerLogHelper.java +++ b/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/helper/SacerLogHelper.java @@ -17,27 +17,6 @@ package it.eng.parer.sacerlog.ejb.helper; -import it.eng.parer.sacerlog.common.SacerLogEjbType; -import it.eng.parer.sacerlog.ejb.common.AppServerInstance; -import it.eng.parer.sacerlog.entity.LogEventoByScript; -import it.eng.parer.sacerlog.entity.LogEventoLoginUser; -import it.eng.parer.sacerlog.viewEntity.AplVLogChiaveTiOgg; -import it.eng.parer.sacerlog.viewEntity.AplVLogFotoTiEvnOgg; -import it.eng.parer.sacerlog.viewEntity.AplVLogInit; -import it.eng.parer.sacerlog.viewEntity.AplVLogTiEvn; -import it.eng.parer.sacerlog.viewEntity.AplVLogTiEvnConOrigine; -import it.eng.parer.sacerlog.viewEntity.AplVLogTiOgg; -import it.eng.parer.sacerlog.viewEntity.AplVLogTrigTiEvnOgg; -import it.eng.parer.sacerlog.viewEntity.AplVParamApplic; -import it.eng.parer.sacerlog.viewEntity.LogVLisAsserzioniDati; -import it.eng.parer.sacerlog.viewEntity.LogVLisEventoOggetto; -import it.eng.parer.sacerlog.viewEntity.LogVLogAgente; -import it.eng.parer.sacerlog.viewEntity.LogVRicEventi; -import it.eng.parer.sacerlog.viewEntity.LogVRicEventiOrganiz; -import it.eng.parer.sacerlog.viewEntity.LogVUsrAbilOrganiz; -import it.eng.parer.sacerlog.viewEntity.LogVVisEventoPrincTx; -import it.eng.parer.sacerlog.viewEntity.LogVVisOggetto; -import it.eng.spagoCore.util.JpaUtils; import java.io.IOException; import java.io.Reader; import java.math.BigDecimal; @@ -52,20 +31,55 @@ import java.util.Calendar; import java.util.Date; import java.util.List; -import javax.ejb.*; -import javax.persistence.*; + +import javax.ejb.EJB; +import javax.ejb.LocalBean; +import javax.ejb.Stateless; +import javax.ejb.TransactionAttribute; +import javax.ejb.TransactionAttributeType; +import javax.persistence.EntityManager; +import javax.persistence.LockModeType; +import javax.persistence.NoResultException; +import javax.persistence.PersistenceContext; +import javax.persistence.Query; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Path; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import it.eng.parer.sacerlog.common.SacerLogEjbType; +import it.eng.parer.sacerlog.ejb.common.AppServerInstance; +import it.eng.parer.sacerlog.entity.LogEventoByScript; +import it.eng.parer.sacerlog.entity.LogEventoLoginUser; +import it.eng.parer.sacerlog.exceptions.SacerLogRuntimeException; +import it.eng.parer.sacerlog.exceptions.SacerLogRuntimeException.SacerLogErrorCategory; +import it.eng.parer.sacerlog.viewEntity.AplVLogChiaveTiOgg; +import it.eng.parer.sacerlog.viewEntity.AplVLogFotoTiEvnOgg; +import it.eng.parer.sacerlog.viewEntity.AplVLogInit; +import it.eng.parer.sacerlog.viewEntity.AplVLogTiEvn; +import it.eng.parer.sacerlog.viewEntity.AplVLogTiEvnConOrigine; +import it.eng.parer.sacerlog.viewEntity.AplVLogTiOgg; +import it.eng.parer.sacerlog.viewEntity.AplVLogTrigTiEvnOgg; +import it.eng.parer.sacerlog.viewEntity.AplVParamApplic; +import it.eng.parer.sacerlog.viewEntity.LogVLisAsserzioniDati; +import it.eng.parer.sacerlog.viewEntity.LogVLisEventoOggetto; +import it.eng.parer.sacerlog.viewEntity.LogVLogAgente; +import it.eng.parer.sacerlog.viewEntity.LogVRicEventi; +import it.eng.parer.sacerlog.viewEntity.LogVRicEventiOrganiz; +import it.eng.parer.sacerlog.viewEntity.LogVUsrAbilOrganiz; +import it.eng.parer.sacerlog.viewEntity.LogVVisEventoPrincTx; +import it.eng.parer.sacerlog.viewEntity.LogVVisOggetto; +import it.eng.spagoCore.util.JpaUtils; + /** * * @author Iacolucci_M */ +@SuppressWarnings("unchecked") @Stateless @LocalBean @TransactionAttribute(TransactionAttributeType.REQUIRED) @@ -78,7 +92,6 @@ public class SacerLogHelper { private AppServerInstance appServerInstance; private static final String TRUE = "1"; - private static final String FALSE = "0"; private static Logger log = LoggerFactory.getLogger(SacerLogHelper.class); @@ -87,9 +100,9 @@ public LogVLogAgente getAgenteByNomeAgente(String nomeAgente) { Query query = entityManager.createNamedQuery("LogVLogAgente.getByNomeAgente", LogVLogAgente.class); query.setParameter("nomeAgente", nomeAgente); return (LogVLogAgente) query.getSingleResult(); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione dell'agente [{}]", nomeAgente, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore nell'estrazione dell'agente [{0}]", nomeAgente).build(); } } @@ -98,9 +111,9 @@ public LogVLogAgente getAgenteByIdAgente(BigDecimal idAgente) { Query query = entityManager.createNamedQuery("LogVLogAgente.getByIdAgente", LogVLogAgente.class); query.setParameter("idAgente", idAgente); return (LogVLogAgente) query.getSingleResult(); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione dell'agente con id [{}]", idAgente, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore nell'estrazione dell'agente con id [{0,number,#}]", idAgente).build(); } } @@ -112,10 +125,10 @@ public AplVLogTiEvnConOrigine getAplVLogTiEvnConOrigineByApplicIdAzioneCompSw(St query.setParameter("nmApplic", nomeApplicazione); query.setParameter("idAzionePaginaCompSw", idAzionePaginaCompSw); return (AplVLogTiEvnConOrigine) query.getSingleResult(); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione di AplVLogTiEvnConOrigine con idAzionePaginaCompSw [{}] e applic [{}]", - idAzionePaginaCompSw, nomeApplicazione, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR).message( + "Errore nell'estrazione di AplVLogTiEvnConOrigine con idAzionePaginaCompSw [{0,number,#}] e applic [{1}]", + idAzionePaginaCompSw, nomeApplicazione).build(); } } @@ -125,9 +138,9 @@ public boolean isLoggingEnabled() { query.setParameter("nmParamApplic", "LOG_ATTIVO"); AplVParamApplic p = (AplVParamApplic) query.getSingleResult(); return p.getDsValoreParamApplic().equalsIgnoreCase("true"); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione del parametro applicativo [{}]", "LOG_ATTIVO", ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore nell'estrazione del parametro applicativo [LOG_ATTIVO]").build(); } } @@ -138,9 +151,9 @@ public boolean isLoggingEnabledForThisNomeAzione(String nomeAzione) { AplVParamApplic p = (AplVParamApplic) query.getSingleResult(); return p.getDsValoreParamApplic().equalsIgnoreCase(nomeAzione); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione del parametro applicativo [{}]", "AZIONE_INIZIALIZZAZIONE_LOG", ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore nell'estrazione del parametro applicativo [AZIONE_INIZIALIZZAZIONE_LOG]").build(); } } @@ -149,9 +162,10 @@ public LogVLogAgente getAgenteByNomeCompSoftware(String nmNomeUserCompSw) { Query query = entityManager.createNamedQuery("LogVLogAgente.getByNomeCompSoftware", LogVLogAgente.class); query.setParameter("nmNomeUserCompSw", nmNomeUserCompSw); return (LogVLogAgente) query.getSingleResult(); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione di LogVLogAgente con nmNomeUserCompSw [{}]", nmNomeUserCompSw, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore nell'estrazione di LogVLogAgente con nmNomeUserCompSw [{0}]", nmNomeUserCompSw) + .build(); } } @@ -164,11 +178,10 @@ public AplVLogTiEvnConOrigine getTipoEventoByApplicFinestraAzione(String nmAppli query.setParameter("nmPaginaCompSw", nmPaginaCompSw); query.setParameter("nmAzionePaginaCompSw", nmAzionePaginaCompSw); return (AplVLogTiEvnConOrigine) query.getSingleResult(); - } catch (RuntimeException ex) { - log.error( - "Errore nell'estrazione di AplVLogTiEvnConOrigine con nmApplic [{}] nmPaginaCompSw [{}] nmAzionePaginaCompSw [{}] ", - nmApplic, nmPaginaCompSw, nmAzionePaginaCompSw, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR).message( + "Errore nell'estrazione di AplVLogTiEvnConOrigine con nmApplic [{0}] nmPaginaCompSw [{1}] nmAzionePaginaCompSw [{2}]", + nmApplic, nmPaginaCompSw, nmAzionePaginaCompSw).build(); } } @@ -178,10 +191,11 @@ public AplVLogTiEvn getTipoEventoByApplicTipoEvento(String nmApplic, String nmTi query.setParameter("nmApplic", nmApplic); query.setParameter("nmTipoEvento", nmTipoEvento); return (AplVLogTiEvn) query.getSingleResult(); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione di AplVLogTiEvn con nmApplic [{}] nmTipoEvento [{}]", nmApplic, - nmTipoEvento, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore nell'estrazione di AplVLogTiEvn con nmApplic [{0}] nmTipoEvento [{1}]", nmApplic, + nmTipoEvento) + .build(); } } @@ -191,10 +205,12 @@ public AplVLogTiOgg getTipoOggettoByNome(String nmApplic, String nmTipoOggetto) query.setParameter("nmApplic", nmApplic); query.setParameter("nmTipoOggetto", nmTipoOggetto); return (AplVLogTiOgg) query.getSingleResult(); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione di AplVLogTiOgg con nmApplic [{}] nmTipoOggetto [{}]", nmApplic, - nmTipoOggetto, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore nell'estrazione di AplVLogTiOgg con nmApplic [{0}] nmTipoOggetto [{1}]", nmApplic, + nmTipoOggetto) + .build(); + } } @@ -203,9 +219,10 @@ public AplVLogTiOgg getTipoOggettoById(BigDecimal idTipoOggetto) { Query query = entityManager.createNamedQuery("AplVLogTiOgg.findTipoOggettoById", AplVLogTiOgg.class); query.setParameter("idTipoOggetto", idTipoOggetto); return (AplVLogTiOgg) query.getSingleResult(); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione di AplVLogTiOgg con idTipoOggetto [{}]", idTipoOggetto, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore nell'estrazione di AplVLogTiOgg con idTipoOggetto [{0,number,#}]", idTipoOggetto) + .build(); } } @@ -215,9 +232,11 @@ public List getChiaviAccessoByIdTipoOggetto(BigDecimal idTip AplVLogChiaveTiOgg.class); query.setParameter("idTipoOggetto", idTipoOggetto); return query.getResultList(); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione di AplVLogChiaveTiOgg con idTipoOggetto [{}]", idTipoOggetto, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore nell'estrazione di AplVLogChiaveTiOgg con idTipoOggetto [{0,number,#}]", + idTipoOggetto) + .build(); } } @@ -228,14 +247,13 @@ public AplVLogFotoTiEvnOgg getFotoByEventoOggetto(BigDecimal idTipoEvento, BigDe query.setParameter("idTipoEvento", idTipoEvento); query.setParameter("idTipoOggetto", idTipoOggetto); return (AplVLogFotoTiEvnOgg) query.getSingleResult(); - } catch (NoResultException e) { - log.error("Nessun AplVLogFotoTiEvnOgg trovato con con idTipoEvento [{}] idTipoOggetto [{}]", idTipoEvento, - idTipoOggetto, e); - throw new RuntimeException("Errore di configurazione del sistema di log"); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione di AplVLogFotoTiEvnOgg con idTipoEvento [{}] idTipoOggetto [{}]", - idTipoEvento, idTipoOggetto, ex); - throw ex; + } catch (NoResultException ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore di configurazione del sistema di log").build(); + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR).message( + "Errore nell'estrazione di AplVLogFotoTiEvnOgg con idTipoEvento [{0,number,#}] idTipoOggetto [{1,number,#}]", + idTipoEvento, idTipoOggetto).build(); } } @@ -244,9 +262,11 @@ public List getTriggersByIdEventoOggetto(BigDecimal idEvent Query query = entityManager.createNamedQuery("AplVLogTrigTiEvnOgg.findTrigger", AplVLogTrigTiEvnOgg.class); query.setParameter("idTipoEventoOggetto", idEventoOggetto); return query.getResultList(); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione di AplVLogChiaveTiOgg con idEventoOggetto [{}]", idEventoOggetto, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore nell'estrazione di AplVLogChiaveTiOgg con idEventoOggetto [{0,number,#}]", + idEventoOggetto) + .build(); } } @@ -259,47 +279,34 @@ public List getTriggersBeforeByIdEventoOggetto(BigDecimal i AplVLogTrigTiEvnOgg.class); query.setParameter("idTipoEventoOggetto", idEventoOggetto); return query.getResultList(); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione di AplVLogTrigTiEvnOgg con idEventoOggetto [{}]", idEventoOggetto, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore nell'estrazione di AplVLogTrigTiEvnOgg con idEventoOggetto [{0,number,#}]", + idEventoOggetto) + .build(); } } public String getFotoXml(String query, BigDecimal idOggetto, String nmQueryTipoOggetto) { Clob clob = null; String risultato = null; - ResultSet rs = null; - PreparedStatement ps = null; - Connection con = null; - try { - con = JpaUtils.provideConnectionFrom(entityManager); - ps = con.prepareStatement("SELECT GET_XML_FOTO_AS_CLOB(?,?) AS FOTO FROM DUAL"); + try (Connection con = JpaUtils.provideConnectionFrom(entityManager); + PreparedStatement ps = con.prepareStatement("SELECT GET_XML_FOTO_AS_CLOB(?,?) AS FOTO FROM DUAL")) { ps.setClob(1, getStringAsClob(con, query)); ps.setBigDecimal(2, idOggetto); - rs = ps.executeQuery(); - if (rs != null && rs.next()) { - clob = rs.getClob("FOTO"); - risultato = clob == null ? null : getClobAsString(clob); - } - } catch (Exception ex) { - log.error("Errore lettura foto per la query [{}] per l'oggetto [{}]", nmQueryTipoOggetto, idOggetto, ex); - throw new RuntimeException("Errore lettura foto dalla funzione oracle", ex); - } finally { - try { - if (rs != null) { - rs.close(); - if (ps != null) { - ps.close(); - } - } - if (con != null) { - con.close(); + + try (ResultSet rs = ps.executeQuery();) { + if (rs != null && rs.next()) { + clob = rs.getClob("FOTO"); + risultato = clob == null ? null : getClobAsString(clob); } - } catch (Exception ex) { - throw new RuntimeException("Errore lettura foto dalla funzione oracle", ex); } - + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore lettura foto per la query [{0}] per l'oggetto [{1,number,#}]", nmQueryTipoOggetto, + idOggetto) + .build(); } return risultato; } @@ -307,38 +314,24 @@ public String getFotoXml(String query, BigDecimal idOggetto, String nmQueryTipoO public String getDeltaFotoAsClob(String xml1, String xml2) { Clob clob = null; String risultato = null; - ResultSet rs = null; - PreparedStatement ps = null; - Connection con = null; - try { - con = JpaUtils.provideConnectionFrom(entityManager); - ps = con.prepareStatement("SELECT SACER_LOG.GET_DELTA_FOTO_AS_CLOB(?,?) AS DELTA FROM DUAL"); + + try (Connection con = JpaUtils.provideConnectionFrom(entityManager); PreparedStatement ps = con + .prepareStatement("SELECT SACER_LOG.GET_DELTA_FOTO_AS_CLOB(?,?) AS DELTA FROM DUAL")) { Clob par1 = con.createClob(); Clob par2 = con.createClob(); par1.setString(1, xml1); par2.setString(1, xml2); ps.setClob(1, par1); ps.setClob(2, par2); - rs = ps.executeQuery(); - if (rs != null && rs.next()) { - clob = rs.getClob("DELTA"); - risultato = clob == null ? null : getClobAsString(clob); + + try (ResultSet rs = ps.executeQuery();) { + if (rs != null && rs.next()) { + clob = rs.getClob("DELTA"); + risultato = clob == null ? null : getClobAsString(clob); + } } } catch (Exception ex) { log.error("Errore lettura foto dalla funzione oracle GET_DELTA_FOTO_AS_CLOB()", ex); - } finally { - try { - if (rs != null) { - rs.close(); - if (ps != null) { - ps.close(); - } - } - if (con != null) { - con.close(); - } - } catch (Exception ex) { - } } return risultato; } @@ -346,41 +339,25 @@ public String getDeltaFotoAsClob(String xml1, String xml2) { public String getDeltaFotoAssertAsClob(String xml1, String xml2) { Clob clob = null; String risultato = null; - ResultSet rs = null; - PreparedStatement ps = null; - Connection con = null; - try { - con = JpaUtils.provideConnectionFrom(entityManager); - ps = con.prepareStatement("SELECT SACER_LOG.GET_DELTA_ASSERT_FOR_TEST(?,?) AS DELTA FROM DUAL"); + + try (Connection con = JpaUtils.provideConnectionFrom(entityManager); PreparedStatement ps = con + .prepareStatement("SELECT SACER_LOG.GET_DELTA_ASSERT_FOR_TEST(?,?) AS DELTA FROM DUAL")) { Clob par1 = con.createClob(); Clob par2 = con.createClob(); par1.setString(1, xml1); par2.setString(1, xml2); ps.setClob(1, par1); ps.setClob(2, par2); - rs = ps.executeQuery(); - if (rs != null && rs.next()) { - clob = rs.getClob("DELTA"); - risultato = clob == null ? null : getClobAsString(clob); - } - } catch (Exception ex) { - final String testoErrore = "Errore lettura foto dalla funzione oracle GET_DELTA_ASSERT_FOR_TEST()"; - log.error(testoErrore, ex); - throw new RuntimeException(testoErrore, ex); - } finally { - try { - if (rs != null) { - rs.close(); - if (ps != null) { - ps.close(); - } - } - if (con != null) { - con.close(); - } - } catch (Exception ex) { + try (ResultSet rs = ps.executeQuery();) { + if (rs != null && rs.next()) { + clob = rs.getClob("DELTA"); + risultato = clob == null ? null : getClobAsString(clob); + } } + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore lettura foto dalla funzione oracle GET_DELTA_ASSERT_FOR_TEST()").build(); } return risultato; } @@ -388,35 +365,20 @@ public String getDeltaFotoAssertAsClob(String xml1, String xml2) { public boolean isThereATrigger(String sqlTrigger, BigDecimal idFoto) { boolean risultato = false; String campo = null; - ResultSet rs = null; - PreparedStatement ps = null; - Connection con = null; - try { - con = JpaUtils.provideConnectionFrom(entityManager); - ps = con.prepareStatement(sqlTrigger); + + try (Connection con = JpaUtils.provideConnectionFrom(entityManager); + PreparedStatement ps = con.prepareStatement(sqlTrigger);) { ps.setBigDecimal(1, idFoto); - rs = ps.executeQuery(); - if (rs != null && rs.next()) { - campo = rs.getString("FLAG"); - risultato = campo != null && campo.equals(TRUE); - } - } catch (Exception ex) { - log.error(null, ex); - throw new RuntimeException("Errore verifica esistenza trigger", ex); - } finally { - try { - if (rs != null) { - rs.close(); - if (ps != null) { - ps.close(); - } - } - if (con != null) { - con.close(); + + try (ResultSet rs = ps.executeQuery();) { + if (rs != null && rs.next()) { + campo = rs.getString("FLAG"); + risultato = campo != null && campo.equals(TRUE); } - } catch (Exception ex) { - throw new RuntimeException("Errore verifica esistenza trigger", ex); } + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore verifica esistenza trigger").build(); } return risultato; @@ -428,37 +390,22 @@ public boolean isThereATrigger(String sqlTrigger, BigDecimal idFoto) { */ public List findAllObjectIdFromTrigger(String sqlTriggerAllObjectId, BigDecimal idEntity) { List risultato = null; - ResultSet rs = null; - PreparedStatement ps = null; - Connection con = null; - try { - con = JpaUtils.provideConnectionFrom(entityManager); - ps = con.prepareStatement(sqlTriggerAllObjectId); + + try (Connection con = JpaUtils.provideConnectionFrom(entityManager); + PreparedStatement ps = con.prepareStatement(sqlTriggerAllObjectId);) { ps.setBigDecimal(1, idEntity); - rs = ps.executeQuery(); - if (rs != null) { - risultato = new ArrayList<>(); - while (rs.next()) { - risultato.add(rs.getBigDecimal("ID")); - } - } - } catch (Exception ex) { - log.error(null, ex); - throw new RuntimeException("Errore estrazione ID scatenati dal trigger", ex); - } finally { - try { + + try (ResultSet rs = ps.executeQuery();) { if (rs != null) { - rs.close(); - if (ps != null) { - ps.close(); + risultato = new ArrayList<>(); + while (rs.next()) { + risultato.add(rs.getBigDecimal("ID")); } } - if (con != null) { - con.close(); - } - } catch (Exception ex) { - throw new RuntimeException("Errore estrazione ID scatenati dal trigger", ex); } + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore estrazione ID scatenati dal trigger").build(); } return risultato; } @@ -469,36 +416,21 @@ public List findAllObjectIdFromTrigger(String sqlTriggerAllObjectId, */ public List findAllObjectIdToInitialize(String sqlFindAllObjectId) { List risultato = null; - ResultSet rs = null; - PreparedStatement ps = null; - Connection con = null; - try { - con = JpaUtils.provideConnectionFrom(entityManager); - ps = con.prepareStatement(sqlFindAllObjectId); - rs = ps.executeQuery(); - if (rs != null) { - risultato = new ArrayList(); - while (rs.next()) { - risultato.add(rs.getBigDecimal(1)); - } - } - } catch (Exception ex) { - log.error(null, ex); - throw new RuntimeException("Errore estrazione ID scatenati dalla funzione init log", ex); - } finally { - try { + + try (Connection con = JpaUtils.provideConnectionFrom(entityManager); + PreparedStatement ps = con.prepareStatement(sqlFindAllObjectId);) { + + try (ResultSet rs = ps.executeQuery();) { if (rs != null) { - rs.close(); - if (ps != null) { - ps.close(); + risultato = new ArrayList<>(); + while (rs.next()) { + risultato.add(rs.getBigDecimal(1)); } } - if (con != null) { - con.close(); - } - } catch (Exception ex) { - throw new RuntimeException("Errore estrazione ID scatenati dalla funzione init log", ex); } + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore estrazione ID scatenati dalla funzione init log").build(); } return risultato; } @@ -509,37 +441,22 @@ public List findAllObjectIdToInitialize(String sqlFindAllObjectId) { */ public List findAllChiaviAccessoByIdOggetto(String sqlAllChiaviAccesso, BigDecimal idOggettoFiglio) { List risultato = null; - ResultSet rs = null; - PreparedStatement ps = null; - Connection con = null; - try { - con = JpaUtils.provideConnectionFrom(entityManager); - ps = con.prepareStatement(sqlAllChiaviAccesso); + + try (Connection con = JpaUtils.provideConnectionFrom(entityManager); + PreparedStatement ps = con.prepareStatement(sqlAllChiaviAccesso);) { ps.setBigDecimal(1, idOggettoFiglio); - rs = ps.executeQuery(); - if (rs != null) { - risultato = new ArrayList(); - while (rs.next()) { - risultato.add(rs.getBigDecimal("ID")); - } - } - } catch (Exception ex) { - log.error(null, ex); - throw new RuntimeException("Errore Lettura degli oggetti padre", ex); - } finally { - try { + + try (ResultSet rs = ps.executeQuery();) { if (rs != null) { - rs.close(); - if (ps != null) { - ps.close(); + risultato = new ArrayList<>(); + while (rs.next()) { + risultato.add(rs.getBigDecimal("ID")); } } - if (con != null) { - con.close(); - } - } catch (Exception ex) { - throw new RuntimeException("Errore Lettura degli oggetti padre", ex); } + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore Lettura degli oggetti padre").build(); } return risultato; } @@ -554,16 +471,16 @@ public LogVVisOggetto getDettOggettoByAppTipoOggettoId(String nomeApplicazione, query.setParameter("nmApplic", nomeApplicazione); query.setParameter("nmTipoOggetto", nomeTipoOggetto); query.setParameter("idOggetto", idOggetto); - List l = query.getResultList(); - if (!l.isEmpty()) { - return l.get(0); + List result = query.getResultList(); + if (!result.isEmpty()) { + return result.get(0); } else { return null; } - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione di LogVVisOggetto con nmApplic [{}] nmTipoOggetto [{}] idOggetto [{}]", - nomeApplicazione, nomeTipoOggetto, idOggetto, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR).message( + "Errore nell'estrazione di LogVVisOggetto con nmApplic [{0}] nmTipoOggetto [{1}] idOggetto [{2,number,#}]", + nomeApplicazione, nomeTipoOggetto, idOggetto).build(); } } @@ -579,11 +496,10 @@ public List getEventsByAppTipoOggettoId(String nomeApplica query.setParameter("nmTipoOggetto", nomeTipoOggetto); query.setParameter("idOggetto", idOggetto); return query.getResultList(); - } catch (RuntimeException ex) { - log.error( - "Errore nell'estrazione di LogVLisEventoOggetto con nmApplic [{}] nmTipoOggetto [{}] idOggetto [{}]", - nomeApplicazione, nomeTipoOggetto, idOggetto, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR).message( + "Errore nell'estrazione di LogVLisEventoOggetto con nmApplic [{0}] nmTipoOggetto [{1}] idOggetto [{2,number,#}]", + nomeApplicazione, nomeTipoOggetto, idOggetto).build(); } } @@ -596,9 +512,11 @@ public List getAsserzioniDatiByIdOggettoEvento(BigDecimal LogVLisAsserzioniDati.class); query.setParameter("idOggettoEvento", idOggettoEvento); return query.getResultList(); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione di LogVLisAsserzioniDati con idOggettoEvento [{}]", idOggettoEvento, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore nell'estrazione di LogVLisAsserzioniDati con idOggettoEvento [{0,number,#}]", + idOggettoEvento) + .build(); } } @@ -615,10 +533,10 @@ public List getLogEventoScriptByTipoOggettoIdLocked(BigDecima query.setParameter("idTipoOggetto", idTipoOggetto); query.setParameter("idOggetto", idOggetto); return query.getResultList(); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione di LogEventoByScript con idTipoOggetto [{}] e idOggetto [{}]", - idTipoOggetto, idOggetto, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR).message( + "Errore nell'estrazione di LogEventoByScript con idTipoOggetto [{0,number,#}] e idOggetto [{1,number,#}]", + idTipoOggetto, idOggetto).build(); } } @@ -630,9 +548,9 @@ public List findAplVLogInitByAppName(String nmApplic) { Query query = entityManager.createNamedQuery("AplVLogInit.findByAppName", AplVLogInit.class); query.setParameter("nmApplic", nmApplic); return query.getResultList(); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione di AplVLogInit con nmApplic [{}]", nmApplic, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore nell'estrazione di AplVLogInit con nmApplic [{0}]", nmApplic).build(); } } @@ -658,9 +576,9 @@ public List findAplVLogTiOggByAppName(String nmApplic, String nmTi } query.setParameter("nmApplic", nmApplic); return query.getResultList(); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione di AplVLogTiOgg con nmApplic [{}]", nmApplic, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore nell'estrazione di AplVLogTiOgg con nmApplic [{0}]", nmApplic).build(); } } @@ -671,10 +589,11 @@ public List findUsrVAbilOrganizByApplicAndUser(String nmAppl query.setParameter("nmApplic", nmApplic); query.setParameter("idUserIam", idUserIam); return query.getResultList(); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione di UsrVAbilOrganiz con nmApplic [{}] e idUserIam [{}]", nmApplic, - idUserIam, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore nell'estrazione di UsrVAbilOrganiz con nmApplic [{0}] e idUserIam [{1,number,#}]", + nmApplic, idUserIam) + .build(); } } @@ -696,12 +615,15 @@ public CriteriaQuery findEventiByOrgTipoClasseDates(String nomeApplicazione, Str cq.select(logVRicEventi); cq.orderBy(cb.desc(logVRicEventi.get("dtRegEvento"))); Predicate predicate = cb.equal(logVRicEventi.get("nmApplic"), nomeApplicazione); - if (idOrganizzazione != null) + if (idOrganizzazione != null) { predicate = cb.and(predicate, cb.equal(logVRicEventi.get("idOrganizApplic"), idOrganizzazione)); - if (idTipoOggetto != null) + } + if (idTipoOggetto != null) { predicate = cb.and(predicate, cb.equal(logVRicEventi.get("idTipoOggetto"), idTipoOggetto)); - if (classeEvento != null) + } + if (classeEvento != null) { predicate = cb.and(predicate, cb.equal(logVRicEventi.get("tipoClasseEvento"), classeEvento)); + } Path val = logVRicEventi.get("dtRegEvento"); // Gestisce i casi di data between, solo "data da" e solo "data a" if (dataDa != null && dataA != null) { @@ -718,11 +640,10 @@ public CriteriaQuery findEventiByOrgTipoClasseDates(String nomeApplicazione, Str cq.where(predicate); return cq; - } catch (RuntimeException ex) { - log.error( - "Errore nell'estrazione di LogVRicEventi con nmApplic [{}], idOrganizzazione [{}], idtipoOggetto [{}], classeEvento [{}], dataInizio [{}], dataFine [{}]", - nomeApplicazione, idOrganizzazione, idTipoOggetto, classeEvento, dataDa, dataA, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR).message( + "Errore nell'estrazione di LogVRicEventi con nmApplic [{0}], idOrganizzazione [{1,number,#}], idtipoOggetto [{2,number,#}], classeEvento [{3}], dataInizio [{4,date}], dataFine [{5,date}]", + nomeApplicazione, idOrganizzazione, idTipoOggetto, classeEvento, dataDa, dataA, ex).build(); } } @@ -731,9 +652,10 @@ public List findOggettiByIdEvento(BigDecimal idEvento) { Query query = entityManager.createNamedQuery("LogVRicEventi.findByIdEvento", LogVRicEventi.class); query.setParameter("idEvento", idEvento); return query.getResultList(); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione di LogVRicEventi con idEvento [{}]", idEvento, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore nell'estrazione di LogVRicEventi con idEvento [{0,number,#}]", idEvento, ex) + .build(); } } @@ -745,10 +667,10 @@ public List findEventiByIdTransazioneExcludingIdEvento(BigDecimal query.setParameter("idTransazione", idTransazione); query.setParameter("idEvento", idEvento); return query.getResultList(); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione di LogVRicEventi con idtransazione [{}] e idEvento [{}]", idTransazione, - idEvento, ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR).message( + "Errore nell'estrazione di LogVRicEventi con idtransazione [{0,number,#}] e idEvento [{1,number,#}]", + idTransazione, idEvento, ex).build(); } } @@ -763,8 +685,10 @@ public LogVVisEventoPrincTx findTransazioneById(BigDecimal idTransazione) { } return null; } catch (RuntimeException ex) { - log.error("Errore nell'estrazione di LogVVisEventoPrincTx con idtransazione [{}]", idTransazione, ex); - throw ex; + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore nell'estrazione di LogVVisEventoPrincTx con idtransazione [{0,number,#}]", + idTransazione, ex) + .build(); } } @@ -776,9 +700,9 @@ public List getDistinctLogVLisEventoScriptByNmApplic(String nmApplic) Query query = entityManager.createNamedQuery("LogVLisEventoByScript.findDistinctByNmApplic"); query.setParameter("nmApplic", nmApplic); return query.getResultList(); - } catch (RuntimeException ex) { - log.error("Errore nell'estrazione di LogEventoByScript DISTINCT", ex); - throw ex; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore nell'estrazione di LogEventoByScript DISTINCT", ex).build(); } } @@ -825,9 +749,9 @@ public T findById(Class entityClass, BigDecimal id) { T instance = entityManager.find(entityClass, id); log.debug("Get successful"); return instance; - } catch (RuntimeException re) { - log.error("Get failed", re); - throw re; + } catch (Exception ex) { + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Get failed", ex).build(); } } @@ -837,12 +761,10 @@ public T findById(Class entityClass, BigDecimal id) { */ public long inserisciFoto(long idOggettoEvento, String fotoXml, Calendar momentoAttuale) { long risultato = -1; - CallableStatement cs = null; String istruzione = "{call SACER_LOG.INSERT_FOTO(?,?,?,?)}"; - Connection con = null; - try { - con = JpaUtils.provideConnectionFrom(entityManager); - cs = con.prepareCall(istruzione); + + try (Connection con = JpaUtils.provideConnectionFrom(entityManager); + CallableStatement cs = con.prepareCall(istruzione);) { cs.registerOutParameter(4, java.sql.Types.NUMERIC); cs.setLong(1, idOggettoEvento); cs.setString(2, fotoXml); @@ -850,27 +772,8 @@ public long inserisciFoto(long idOggettoEvento, String fotoXml, Calendar momento cs.executeUpdate(); risultato = cs.getLong(4); } catch (Exception ex) { - log.error("Errore Scrittura Foto", ex); - throw new RuntimeException("Errore Scrittura Foto", ex); - } finally { - - if (cs != null) { - try { - cs.close(); - } catch (SQLException ex) { - log.debug("Errore Scrittura Foto", ex); - throw new RuntimeException("Errore Scrittura Foto", ex); - } - } - if (con != null) { - try { - con.close(); - } catch (SQLException ex) { - log.debug("Errore Scrittura Foto", ex); - throw new RuntimeException("Errore Scrittura Foto", ex); - } - } - + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore Scrittura Foto", ex).build(); } return risultato; } @@ -880,31 +783,17 @@ public long inserisciFoto(long idOggettoEvento, String fotoXml, Calendar momento */ public BigDecimal getNewTransactionId() { BigDecimal risultato = null; - ResultSet rs = null; - PreparedStatement ps = null; - Connection con = null; - try { - con = JpaUtils.provideConnectionFrom(entityManager); - ps = con.prepareStatement("SELECT SACER_LOG.slog_evento_transazione.NEXTVAL AS TRANSACTION_ID FROM DUAL"); - rs = ps.executeQuery(); - if (rs != null && rs.next()) { - risultato = rs.getBigDecimal("TRANSACTION_ID"); + + try (Connection con = JpaUtils.provideConnectionFrom(entityManager); PreparedStatement ps = con + .prepareStatement("SELECT SACER_LOG.slog_evento_transazione.NEXTVAL AS TRANSACTION_ID FROM DUAL");) { + + try (ResultSet rs = ps.executeQuery();) { + if (rs != null && rs.next()) { + risultato = rs.getBigDecimal("TRANSACTION_ID"); + } } } catch (Exception ex) { log.error(null, ex); - } finally { - try { - if (rs != null) { - rs.close(); - if (ps != null) { - ps.close(); - } - } - if (con != null) { - con.close(); - } - } catch (Exception ex) { - } } return risultato; } @@ -914,39 +803,19 @@ public BigDecimal getNewTransactionId() { */ public long scriviDelta(long idOggettoEvento, Calendar momentoAttuale) { long risultato = -1; - CallableStatement cs = null; String istruzione = "{call SACER_LOG.SCRIVI_DELTA(?,?,?)}"; - Connection con = null; - try { - con = JpaUtils.provideConnectionFrom(entityManager); - cs = con.prepareCall(istruzione); + + try (Connection con = JpaUtils.provideConnectionFrom(entityManager); + CallableStatement cs = con.prepareCall(istruzione);) { + cs.registerOutParameter(3, java.sql.Types.NUMERIC); cs.setLong(1, idOggettoEvento); cs.setTimestamp(2, new Timestamp(momentoAttuale.getTime().getTime())); cs.executeUpdate(); risultato = cs.getLong(3); } catch (Exception ex) { - log.error("Errore Scrittura DELTA", ex); - throw new RuntimeException("Errore nella chiamata alla procedura SCRIVI_DELTA", ex); - } finally { - - if (cs != null) { - try { - cs.close(); - } catch (SQLException ex) { - log.error("Errore Scrittura DELTA", ex); - throw new RuntimeException("Errore nella chiamata alla procedura SCRIVI_DELTA", ex); - } - } - - if (con != null) { - try { - con.close(); - } catch (SQLException ex) { - log.error("Errore Scrittura DELTA", ex); - throw new RuntimeException("Errore nella chiamata alla procedura SCRIVI_DELTA", ex); - } - } + throw SacerLogRuntimeException.builder().cause(ex).category(SacerLogErrorCategory.SQL_ERROR) + .message("Errore nella chiamata alla procedura SCRIVI_DELTA", ex).build(); } return risultato; } @@ -971,34 +840,20 @@ private Clob getStringAsClob(Connection con, String str) throws SQLException { public String getXmlFotoByIdEventoOggettoAsString(BigDecimal idOggettoEvento) { Clob clob = null; String risultato = null; - ResultSet rs = null; - PreparedStatement ps = null; - Connection con = null; - try { - con = JpaUtils.provideConnectionFrom(entityManager); - ps = con.prepareStatement("SELECT SACER_LOG.GET_XML_FOTO_BY_ID_AS_CLOB(?) AS FOTO FROM DUAL"); + + try (Connection con = JpaUtils.provideConnectionFrom(entityManager); PreparedStatement ps = con + .prepareStatement("SELECT SACER_LOG.GET_XML_FOTO_BY_ID_AS_CLOB(?) AS FOTO FROM DUAL");) { + ps.setLong(1, idOggettoEvento.longValueExact()); - rs = ps.executeQuery(); - if (rs != null && rs.next()) { - clob = rs.getClob("FOTO"); - risultato = clob == null ? null : getClobAsString(clob); - } - } catch (Exception ex) { - log.error(null, ex); - } finally { - try { - if (rs != null) { - rs.close(); - if (ps != null) { - ps.close(); - } + try (ResultSet rs = ps.executeQuery();) { + if (rs != null && rs.next()) { + clob = rs.getClob("FOTO"); + risultato = clob == null ? null : getClobAsString(clob); } - if (con != null) { - con.close(); - } - } catch (Exception ex) { } + } catch (Exception ex) { + log.error(null, ex); } return risultato; } diff --git a/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/util/PremisEnums.java b/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/util/PremisEnums.java index 084d496..2acbde9 100644 --- a/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/util/PremisEnums.java +++ b/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/ejb/util/PremisEnums.java @@ -33,7 +33,7 @@ public class TipoAgente { /* * public class TipoOrigineAgente { - * + * * public static final String UTENTE = "UTENTE"; public static final String COMPONENTE_SW = "COMPONENTE_SW"; }; */ diff --git a/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/exceptions/SacerLogRuntimeException.java b/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/exceptions/SacerLogRuntimeException.java new file mode 100644 index 0000000..896ba75 --- /dev/null +++ b/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/exceptions/SacerLogRuntimeException.java @@ -0,0 +1,85 @@ +package it.eng.parer.sacerlog.exceptions; + +import java.text.MessageFormat; + +public class SacerLogRuntimeException extends RuntimeException { + + private static final long serialVersionUID = 5497209347748993178L; + + private final SacerLogErrorCategory category; + + public SacerLogRuntimeException(SacerLogExceptionBuilder builder) { + super(builder.message, builder.cause); + this.category = builder.category; + } + + public SacerLogErrorCategory getCategory() { + return category; + } + + public static SacerLogExceptionBuilder builder() { + return new SacerLogExceptionBuilder(); + } + + @Override + public String getMessage() { + return "[" + getCategory().toString() + "]" + " " + super.getMessage(); + } + + public static class SacerLogExceptionBuilder { + + private SacerLogErrorCategory category = SacerLogErrorCategory.INTERNAL_ERROR; + private String message; + private Throwable cause; + + public SacerLogRuntimeException build() { + return new SacerLogRuntimeException(this); + } + + public SacerLogExceptionBuilder category(SacerLogErrorCategory category) { + this.setCategory(category); + return this; + } + + public SacerLogErrorCategory getCategory() { + return category; + } + + public void setCategory(SacerLogErrorCategory category) { + this.category = category; + } + + public SacerLogExceptionBuilder message(String messageToFormat, Object... args) { + this.setMessage(MessageFormat.format(messageToFormat, args)); + return this; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public SacerLogExceptionBuilder cause(Throwable cause) { + this.setCause(cause); + return this; + } + + public Throwable getCause() { + return cause; + } + + public void setCause(Throwable cause) { + this.cause = cause; + } + + } + + public enum SacerLogErrorCategory { + + INTERNAL_ERROR, LOGGER_ERROR, SQL_ERROR + } + +} diff --git a/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/job/SacerLogJob.java b/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/job/SacerLogJob.java index b2533fe..10c0f4d 100644 --- a/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/job/SacerLogJob.java +++ b/spagolite-sl-ejb/src/main/java/it/eng/parer/sacerlog/job/SacerLogJob.java @@ -139,13 +139,13 @@ public void execute(AplVLogInit rec, BigDecimal id, String nomeEffettivoJob) thr /* * Metodo invocato dal timer di gestione degli allineamenti delle loggate inserite mediante script esterni * all'applicazione. - * + * * Apre un cursore che estrae con una DISTINCT dalla VIEW LOG_V_LIS_EVENTO_BY_SCRIPT ( legge dalla tabella: * LOG_EVENTO_BY_SCRIPT) tutte le coppie di valori ID_TIPO_OGGETTO e ID_OGGETTO (+ nome tipo oggetto). Per ogni * record estratto effettua una SELECT FOR UPDATE della coppia di valori estratti loccando tutti i records estratti * in modo pessimistico in modo tale da bloccare un'altra eventuale select dello stesso tipo che dovesse essere * fatta sugli stessi oggetti dal motore di logging. - * + * */ public void allineamentoLogByScript(String nomeApplicazione) throws Exception { Date dataInizio = new Date(); @@ -206,7 +206,7 @@ public void allineaOggettiEstrattiDaScriptInNuovaTransazione(BigDecimal idTipoOg * logger.info("[{}]>>> ATTESA SIMULATA 30sec NEL THREAD DI ALLINEAMENTO...[{}]-[{}]-[{}] ", new * Date(),nmApplic, nmTipoOggetto,idOggetto); try { Thread.currentThread().sleep(1000*30); } catch (Exception * ex) { - * + * * } logger.info("[{}]>>> USCITO DALL'ATTESA SIMULATA 30sec NEL THREAD DI ALLINEAMENTO..[{}]-[{}]-[{}] ", new * Date(),nmApplic, nmTipoOggetto,idOggetto); */ diff --git a/spagolite-sl-jpa/pom.xml b/spagolite-sl-jpa/pom.xml index 3dac654..f9acb0d 100644 --- a/spagolite-sl-jpa/pom.xml +++ b/spagolite-sl-jpa/pom.xml @@ -7,7 +7,7 @@ it.eng.parer spagofat - 6.14.2-SNAPSHOT + 6.15.0 diff --git a/spagolite-sl-jpa/src/main/java/it/eng/parer/sacerlog/entity/LogEventoByScript.java b/spagolite-sl-jpa/src/main/java/it/eng/parer/sacerlog/entity/LogEventoByScript.java index f2546b4..acc04d1 100644 --- a/spagolite-sl-jpa/src/main/java/it/eng/parer/sacerlog/entity/LogEventoByScript.java +++ b/spagolite-sl-jpa/src/main/java/it/eng/parer/sacerlog/entity/LogEventoByScript.java @@ -42,7 +42,7 @@ @NamedQuery(name = "LogEventoByScript.deleteAll", query = "DELETE FROM LogEventoByScript") /* * , - * + * * @NamedQuery(name = "LogEventoByScript.findDistinctLogEventoScriptByIdApplic", query = * "SELECT DISTINCT l.idTipoOggetto, l.idOggetto FROM LogEventoByScript l WHERE l.idApplic = :idApplic") */ diff --git a/spagolite-sl-slg/pom.xml b/spagolite-sl-slg/pom.xml index dd65867..340917a 100644 --- a/spagolite-sl-slg/pom.xml +++ b/spagolite-sl-slg/pom.xml @@ -7,7 +7,7 @@ it.eng.parer spagofat - 6.14.2-SNAPSHOT + 6.15.0 diff --git a/spagolite-sl-web/pom.xml b/spagolite-sl-web/pom.xml index 4d00655..15952a1 100644 --- a/spagolite-sl-web/pom.xml +++ b/spagolite-sl-web/pom.xml @@ -7,15 +7,15 @@ it.eng.parer spagofat - 6.14.2-SNAPSHOT + 6.15.0 - + org.jboss.spec jboss-jakartaee-8.0 - pom - provided - + pom + provided + it.eng.parer spagofat-sl-jpa diff --git a/spagolite-sl-web/src/main/java/it/eng/parer/sacerlog/web/validator/TypeValidator.java b/spagolite-sl-web/src/main/java/it/eng/parer/sacerlog/web/validator/TypeValidator.java index 235795a..68ae08e 100644 --- a/spagolite-sl-web/src/main/java/it/eng/parer/sacerlog/web/validator/TypeValidator.java +++ b/spagolite-sl-web/src/main/java/it/eng/parer/sacerlog/web/validator/TypeValidator.java @@ -39,7 +39,7 @@ public MessageBox getMessageBox() { /** * Metodo di validazione delle date e degli orari inseriti nei filtri di ricerca - * + * * @param data_da * data da * @param ore_da @@ -56,9 +56,9 @@ public MessageBox getMessageBox() { * descrizione campo data da * @param nm_data_a * descrizione campo data a - * + * * @return dateValidate, un array di Date contenente le date da - a validate - * + * * @throws EMFError * eccezione generica */ @@ -189,7 +189,7 @@ public void isOrganizzazioneObbligatoria(String nmApplic, String nomeCampo, Stri /** * Metodo di validazione delle date inserite nei filtri di ricerca e in fase di inserimento dati - * + * * @param data_da * data da * @param data_a @@ -198,7 +198,7 @@ public void isOrganizzazioneObbligatoria(String nmApplic, String nomeCampo, Stri * descrizione campo data da * @param nm_data_a * descrizione campo data a - * + * * @throws EMFError * eccezione generica */ diff --git a/spagolite-timer-wrapper-common/pom.xml b/spagolite-timer-wrapper-common/pom.xml index 006a96b..e0aabb6 100644 --- a/spagolite-timer-wrapper-common/pom.xml +++ b/spagolite-timer-wrapper-common/pom.xml @@ -4,7 +4,7 @@ it.eng.parer spagofat - 6.14.2-SNAPSHOT + 6.15.0 spagofat-timer-wrapper-common Spagolite Timer wrapper - common diff --git a/spagolite-timer-wrapper-common/src/main/java/it/eng/parer/jboss/timer/common/JbossJobTimer.java b/spagolite-timer-wrapper-common/src/main/java/it/eng/parer/jboss/timer/common/JbossJobTimer.java index bdddd12..5bb0aac 100644 --- a/spagolite-timer-wrapper-common/src/main/java/it/eng/parer/jboss/timer/common/JbossJobTimer.java +++ b/spagolite-timer-wrapper-common/src/main/java/it/eng/parer/jboss/timer/common/JbossJobTimer.java @@ -32,7 +32,7 @@ public interface JbossJobTimer { * Restituisce la data del prossimo timeout. * * @return data della prossima elaborazione - * + * * @param applicationName * nome dell'applicazione. Necessario per SacerLog */ @@ -76,7 +76,7 @@ public interface JbossJobTimer { * * @param timer * firma standard del metodo di timeout - * + * * @throws java.lang.Exception * eccezione generica */ diff --git a/spagolite-timer-wrapper-common/src/main/java/it/eng/parer/jboss/timer/common/entity/JobDefinition.java b/spagolite-timer-wrapper-common/src/main/java/it/eng/parer/jboss/timer/common/entity/JobDefinition.java index d34e8de..77c6396 100644 --- a/spagolite-timer-wrapper-common/src/main/java/it/eng/parer/jboss/timer/common/entity/JobDefinition.java +++ b/spagolite-timer-wrapper-common/src/main/java/it/eng/parer/jboss/timer/common/entity/JobDefinition.java @@ -27,7 +27,7 @@ /** * Implementazione di una parte dell'entity necessaria a mappare la tabella dei job. I metodi rispettano (parzialmente) * il contratto definito da {@link JobTable} - * + * * @author Snidero_L */ @MappedSuperclass diff --git a/spagolite-timer-wrapper-ejb/pom.xml b/spagolite-timer-wrapper-ejb/pom.xml index 25bb88d..d2bcbb2 100644 --- a/spagolite-timer-wrapper-ejb/pom.xml +++ b/spagolite-timer-wrapper-ejb/pom.xml @@ -4,7 +4,7 @@ it.eng.parer spagofat - 6.14.2-SNAPSHOT + 6.15.0 spagofat-timer-wrapper-ejb Spagolite Timer wrapper - ejb diff --git a/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/helper/JbossTimerHelper.java b/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/helper/JbossTimerHelper.java index 87a31f6..046a41b 100644 --- a/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/helper/JbossTimerHelper.java +++ b/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/helper/JbossTimerHelper.java @@ -46,7 +46,7 @@ public interface JbossTimerHelper { * nome del job (solitamente una costante) * @param nodeName * nome del nodo. - * + * * @throws TimerNotFoundException * nel caso in cui il job non esista */ @@ -66,9 +66,9 @@ public interface JbossTimerHelper { * * @param jobName * nome del job - * + * * @return entity della tabella che memorizza lo stato dei job - * + * * @throws TimerNotFoundException * nel caso in cui il job non esista */ @@ -87,7 +87,7 @@ public interface JbossTimerHelper { * * @param nodeName * nome del nodo - * + * * @return lista di job */ List getJobs(String nodeName); @@ -97,9 +97,9 @@ public interface JbossTimerHelper { * * @param jobName * nome del job - * + * * @return true se il timer lo ha impostato. false altrimenti - * + * * @throws TimerNotFoundException * nel caso in cui il job non esista */ @@ -110,7 +110,7 @@ public interface JbossTimerHelper { * * @param jobName * nome del job - * + * * @throws TimerNotFoundException * nel caso in cui il job non esista */ @@ -124,7 +124,7 @@ public interface JbossTimerHelper { * nome del job * @param newDate * nuova data - * + * * @throws TimerNotFoundException * nel caso in cui il job non esista */ @@ -135,7 +135,7 @@ public interface JbossTimerHelper { * * @param jobName * nome del job - * + * * @throws TimerNotFoundException * nel caso in cui il job non esista */ @@ -146,7 +146,7 @@ public interface JbossTimerHelper { * * @param jobName * nome del job - * + * * @throws TimerNotFoundException * nel caso in cui il job non esista */ @@ -160,7 +160,7 @@ public interface JbossTimerHelper { * nome del job * @param newDate * nuova data - * + * * @throws TimerNotFoundException * nel caso in cui il job non esista */ @@ -171,7 +171,7 @@ public interface JbossTimerHelper { * * @param jobName * nome del job - * + * * @throws TimerNotFoundException * nel caso in cui il job non esista */ @@ -183,9 +183,9 @@ public interface JbossTimerHelper { * * @param jobName * nome del job - * + * * @return istanza del timer - * + * * @throws TimerNotFoundException * nel caso in cui il job non esista */ @@ -198,7 +198,7 @@ public interface JbossTimerHelper { * nome del job * @param stato * nuovo stato - * + * * @throws TimerNotFoundException * nel caso in cui il job non esista */ @@ -209,9 +209,9 @@ public interface JbossTimerHelper { * * @param jobName * nome del job - * + * * @return data di prossima attivazione oppure null - * + * * @throws TimerNotFoundException * nel caso in cui il job non esista */ @@ -229,9 +229,9 @@ public interface JbossTimerHelper { * * @param jobName * nome del job - * + * * @return l'oggetto cronschedule - * + * * @throws TimerNotFoundException * nel caso in cui il job non esista */ diff --git a/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/interceptor/JbossTimerNodeInterceptor.java b/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/interceptor/JbossTimerNodeInterceptor.java index b65b1bb..03ae259 100644 --- a/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/interceptor/JbossTimerNodeInterceptor.java +++ b/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/interceptor/JbossTimerNodeInterceptor.java @@ -46,9 +46,9 @@ public class JbossTimerNodeInterceptor { * * @param inv * invocation context - * + * * @return di solito i metodi intercettati sono void - * + * * @throws Exception * eccezione del metodo intercettato */ diff --git a/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/interceptor/JbossTimerResetStatusInterceptor.java b/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/interceptor/JbossTimerResetStatusInterceptor.java index 3fe46b1..8886ecf 100644 --- a/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/interceptor/JbossTimerResetStatusInterceptor.java +++ b/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/interceptor/JbossTimerResetStatusInterceptor.java @@ -46,9 +46,9 @@ public class JbossTimerResetStatusInterceptor { * * @param inv * invocation context - * + * * @return di solito i metodi intercettati sono void - * + * * @throws Exception * eccezione del metodo intercettato */ diff --git a/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/interceptor/JbossTimerStartInterceptor.java b/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/interceptor/JbossTimerStartInterceptor.java index bf4dff2..388814b 100644 --- a/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/interceptor/JbossTimerStartInterceptor.java +++ b/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/interceptor/JbossTimerStartInterceptor.java @@ -48,9 +48,9 @@ public class JbossTimerStartInterceptor { * * @param inv * invocation context del metodo doJob - * + * * @return di solito i metodi intercettati sono void - * + * * @throws Exception * eccezione del metodo intercettato */ diff --git a/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/interceptor/JbossTimerTimeoutInterceptor.java b/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/interceptor/JbossTimerTimeoutInterceptor.java index c52d76b..d7eef1e 100644 --- a/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/interceptor/JbossTimerTimeoutInterceptor.java +++ b/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/interceptor/JbossTimerTimeoutInterceptor.java @@ -50,9 +50,9 @@ public class JbossTimerTimeoutInterceptor { * * @param inv * invocation context del metodo doJob - * + * * @return di solito i metodi intercettati sono void - * + * * @throws Exception * eccezione del metodo intercettato */ diff --git a/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/service/JbossTimerEjb.java b/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/service/JbossTimerEjb.java index 98daa4c..1363784 100644 --- a/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/service/JbossTimerEjb.java +++ b/spagolite-timer-wrapper-ejb/src/main/java/it/eng/parer/jboss/timer/service/JbossTimerEjb.java @@ -152,7 +152,7 @@ public void esecuzioneSingola(String jobName, String nodeName) { * * @param jobName * nome del job - * + * * @return null o la data della prossima attivazioen del job */ public Date getDataProssimaAttivazione(String jobName) { @@ -183,7 +183,7 @@ public Date getDataProssimaAttivazione(String jobName) { * * @param jobName * nome del job - * + * * @return true se la risposta è sì, false altrimenti */ public boolean isDataProssimaAttivazioneAccurata(String jobName) { @@ -250,7 +250,7 @@ public List getJobs() { * * @param nodoAssegnato * definito su banca dati - * + * * @return lista di job */ public List getJobs(String nodoAssegnato) { @@ -268,7 +268,7 @@ public List getJobs(String nodoAssegnato) { * * @param jobName * nome del job - * + * * @return istanza del timer */ public JbossJobTimer getTimer(String jobName) { @@ -296,7 +296,7 @@ public String getApplicationName() { * * @param jobName * nome del job - * + * * @return entity oppure null */ public JobTable getJob(String jobName) { diff --git a/spagolite-webresources/pom.xml b/spagolite-webresources/pom.xml index 2f2dcca..de7538f 100644 --- a/spagolite-webresources/pom.xml +++ b/spagolite-webresources/pom.xml @@ -1,130 +1,133 @@ - 4.0.0 - spagofat-webresources - Spagolite web resources - war - - it.eng.parer - spagofat - 6.14.2-SNAPSHOT - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - extract-tld-from-middle - generate-resources - - unpack-dependencies - - - ${basedir}/target/tld/ - ${project.groupId} - spagofat-middle - - META-INF/sl.tld, - META-INF/slf.tld, - META-INF/slp.tld - - - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - copy-tld-to-web - prepare-package - - copy-resources - - - ${basedir}/target/spagofat-webresources-${project.version}/WEB-INF/tld/ - - - ${basedir}/target/tld/META-INF/ - - sl.tld - slf.tld - slp.tld - - - - - - - - - - maven-war-plugin - - - WEB-INF/web_fragment.xml, - WEB-INF/SpringServlet-servlet-TEMPLATE.xml - - - - - - - - it.eng.parer - spagofat-middle - provided - - - it.eng.parer - spagofat-core - provided - - - org.apache.commons - commons-collections4 - + 4.0.0 + spagofat-webresources + Spagolite web resources + war + + it.eng.parer + spagofat + 6.15.0 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + extract-tld-from-middle + generate-resources + + unpack-dependencies + + + ${basedir}/target/tld/ + ${project.groupId} + spagofat-middle + + META-INF/sl.tld, + META-INF/slf.tld, + META-INF/slp.tld + + + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + copy-tld-to-web + prepare-package + + copy-resources + + + + ${basedir}/target/spagofat-webresources-${project.version}/WEB-INF/tld/ + + + ${basedir}/target/tld/META-INF/ + + sl.tld + slf.tld + slp.tld + + + + + + + + + + maven-war-plugin + + + WEB-INF/web_fragment.xml, + WEB-INF/SpringServlet-servlet-TEMPLATE.xml + + + + + + + + it.eng.parer + spagofat-middle + provided + + + it.eng.parer + spagofat-core + provided + + + org.apache.commons + commons-collections4 + - - - org.webjars - jquery - - - org.webjars - jquery-ui - - - org.webjars - jstree - - - org.webjars.bower - chosen - - - org.webjars - select2 - - - org.webjars - highlightjs - - - org.webjars.bowergithub.wcoder - highlightjs-line-numbers.js - - - org.webjars - font-awesome - - - org.webjars.npm - highlightjs-badgejs - - + + + org.webjars + jquery + + + org.webjars + jquery-ui + + + org.webjars + jstree + + + org.webjars.bower + chosen + + + org.webjars + select2 + + + org.webjars + highlightjs + + + org.webjars.npm + highlightjs-line-numbers.js + + + org.webjars + font-awesome + + + org.webjars.npm + highlightjs-badgejs + + diff --git a/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/images/ui-icons_444444_256x240.png b/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/images/ui-icons_444444_256x240.png similarity index 100% rename from spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/images/ui-icons_444444_256x240.png rename to spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/images/ui-icons_444444_256x240.png diff --git a/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/images/ui-icons_555555_256x240.png b/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/images/ui-icons_555555_256x240.png similarity index 100% rename from spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/images/ui-icons_555555_256x240.png rename to spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/images/ui-icons_555555_256x240.png diff --git a/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/images/ui-icons_777620_256x240.png b/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/images/ui-icons_777620_256x240.png similarity index 100% rename from spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/images/ui-icons_777620_256x240.png rename to spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/images/ui-icons_777620_256x240.png diff --git a/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/images/ui-icons_777777_256x240.png b/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/images/ui-icons_777777_256x240.png similarity index 100% rename from spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/images/ui-icons_777777_256x240.png rename to spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/images/ui-icons_777777_256x240.png diff --git a/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/images/ui-icons_cc0000_256x240.png b/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/images/ui-icons_cc0000_256x240.png similarity index 100% rename from spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/images/ui-icons_cc0000_256x240.png rename to spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/images/ui-icons_cc0000_256x240.png diff --git a/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/images/ui-icons_ffffff_256x240.png b/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/images/ui-icons_ffffff_256x240.png similarity index 100% rename from spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/images/ui-icons_ffffff_256x240.png rename to spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/images/ui-icons_ffffff_256x240.png diff --git a/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/jquery-ui.css b/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/jquery-ui.css similarity index 99% rename from spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/jquery-ui.css rename to spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/jquery-ui.css index 3371a80..c77486b 100644 --- a/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/jquery-ui.css +++ b/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/jquery-ui.css @@ -1,4 +1,4 @@ -/*! jQuery UI - v1.13.2 (custom) - 2022-09-27 +/*! jQuery UI - v1.13.3 (custom) - 2024-08-08 * http://jqueryui.com * Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css * To view and modify this theme, visit http://jqueryui.com/themeroller/?bgShadowXPos=&bgOverlayXPos=&bgErrorXPos=&bgHighlightXPos=&bgContentXPos=&bgHeaderXPos=&bgActiveXPos=&bgHoverXPos=&bgDefaultXPos=&bgShadowYPos=&bgOverlayYPos=&bgErrorYPos=&bgHighlightYPos=&bgContentYPos=&bgHeaderYPos=&bgActiveYPos=&bgHoverYPos=&bgDefaultYPos=&bgShadowRepeat=&bgOverlayRepeat=&bgErrorRepeat=&bgHighlightRepeat=&bgContentRepeat=&bgHeaderRepeat=&bgActiveRepeat=&bgHoverRepeat=&bgDefaultRepeat=&iconsHover=url(%22images%2Fui-icons_555555_256x240.png%22)&iconsHighlight=url(%22images%2Fui-icons_777620_256x240.png%22)&iconsHeader=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsError=url(%22images%2Fui-icons_cc0000_256x240.png%22)&iconsDefault=url(%22images%2Fui-icons_777777_256x240.png%22)&iconsContent=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsActive=url(%22images%2Fui-icons_ffffff_256x240.png%22)&bgImgUrlShadow=&bgImgUrlOverlay=&bgImgUrlHover=&bgImgUrlHighlight=&bgImgUrlHeader=&bgImgUrlError=&bgImgUrlDefault=&bgImgUrlContent=&bgImgUrlActive=&opacityFilterShadow=Alpha(Opacity%3D30)&opacityFilterOverlay=Alpha(Opacity%3D30)&opacityShadowPerc=30&opacityOverlayPerc=30&iconColorHover=%23555555&iconColorHighlight=%23777620&iconColorHeader=%23444444&iconColorError=%23cc0000&iconColorDefault=%23777777&iconColorContent=%23444444&iconColorActive=%23ffffff&bgImgOpacityShadow=0&bgImgOpacityOverlay=0&bgImgOpacityError=95&bgImgOpacityHighlight=55&bgImgOpacityContent=75&bgImgOpacityHeader=75&bgImgOpacityActive=65&bgImgOpacityHover=75&bgImgOpacityDefault=75&bgTextureShadow=flat&bgTextureOverlay=flat&bgTextureError=flat&bgTextureHighlight=flat&bgTextureContent=flat&bgTextureHeader=flat&bgTextureActive=flat&bgTextureHover=flat&bgTextureDefault=flat&cornerRadius=3px&fwDefault=normal&ffDefault=Arial%2CHelvetica%2Csans-serif&fsDefault=1em&cornerRadiusShadow=8px&thicknessShadow=5px&offsetLeftShadow=0px&offsetTopShadow=0px&opacityShadow=.3&bgColorShadow=%23666666&opacityOverlay=.3&bgColorOverlay=%23aaaaaa&fcError=%235f3f3f&borderColorError=%23f1a899&bgColorError=%23fddfdf&fcHighlight=%23777620&borderColorHighlight=%23dad55e&bgColorHighlight=%23fffa90&fcContent=%23333333&borderColorContent=%23dddddd&bgColorContent=%23ffffff&fcHeader=%23333333&borderColorHeader=%23dddddd&bgColorHeader=%23e9e9e9&fcActive=%23ffffff&borderColorActive=%23003eff&bgColorActive=%23007fff&fcHover=%232b2b2b&borderColorHover=%23cccccc&bgColorHover=%23ededed&fcDefault=%23454545&borderColorDefault=%23c5c5c5&bgColorDefault=%23f6f6f6 diff --git a/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/jquery-ui.min.css b/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/jquery-ui.min.css similarity index 99% rename from spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/jquery-ui.min.css rename to spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/jquery-ui.min.css index 1772bfc..11864b9 100644 --- a/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/jquery-ui.min.css +++ b/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/jquery-ui.min.css @@ -1,4 +1,4 @@ -/*! jQuery UI - v1.13.2 (custom) - 2022-09-27 +/*! jQuery UI - v1.13.3 (custom) - 2024-08-08 * http://jqueryui.com * Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css * To view and modify this theme, visit http://jqueryui.com/themeroller/?bgShadowXPos=&bgOverlayXPos=&bgErrorXPos=&bgHighlightXPos=&bgContentXPos=&bgHeaderXPos=&bgActiveXPos=&bgHoverXPos=&bgDefaultXPos=&bgShadowYPos=&bgOverlayYPos=&bgErrorYPos=&bgHighlightYPos=&bgContentYPos=&bgHeaderYPos=&bgActiveYPos=&bgHoverYPos=&bgDefaultYPos=&bgShadowRepeat=&bgOverlayRepeat=&bgErrorRepeat=&bgHighlightRepeat=&bgContentRepeat=&bgHeaderRepeat=&bgActiveRepeat=&bgHoverRepeat=&bgDefaultRepeat=&iconsHover=url(%22images%2Fui-icons_555555_256x240.png%22)&iconsHighlight=url(%22images%2Fui-icons_777620_256x240.png%22)&iconsHeader=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsError=url(%22images%2Fui-icons_cc0000_256x240.png%22)&iconsDefault=url(%22images%2Fui-icons_777777_256x240.png%22)&iconsContent=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsActive=url(%22images%2Fui-icons_ffffff_256x240.png%22)&bgImgUrlShadow=&bgImgUrlOverlay=&bgImgUrlHover=&bgImgUrlHighlight=&bgImgUrlHeader=&bgImgUrlError=&bgImgUrlDefault=&bgImgUrlContent=&bgImgUrlActive=&opacityFilterShadow=Alpha(Opacity%3D30)&opacityFilterOverlay=Alpha(Opacity%3D30)&opacityShadowPerc=30&opacityOverlayPerc=30&iconColorHover=%23555555&iconColorHighlight=%23777620&iconColorHeader=%23444444&iconColorError=%23cc0000&iconColorDefault=%23777777&iconColorContent=%23444444&iconColorActive=%23ffffff&bgImgOpacityShadow=0&bgImgOpacityOverlay=0&bgImgOpacityError=95&bgImgOpacityHighlight=55&bgImgOpacityContent=75&bgImgOpacityHeader=75&bgImgOpacityActive=65&bgImgOpacityHover=75&bgImgOpacityDefault=75&bgTextureShadow=flat&bgTextureOverlay=flat&bgTextureError=flat&bgTextureHighlight=flat&bgTextureContent=flat&bgTextureHeader=flat&bgTextureActive=flat&bgTextureHover=flat&bgTextureDefault=flat&cornerRadius=3px&fwDefault=normal&ffDefault=Arial%2CHelvetica%2Csans-serif&fsDefault=1em&cornerRadiusShadow=8px&thicknessShadow=5px&offsetLeftShadow=0px&offsetTopShadow=0px&opacityShadow=.3&bgColorShadow=%23666666&opacityOverlay=.3&bgColorOverlay=%23aaaaaa&fcError=%235f3f3f&borderColorError=%23f1a899&bgColorError=%23fddfdf&fcHighlight=%23777620&borderColorHighlight=%23dad55e&bgColorHighlight=%23fffa90&fcContent=%23333333&borderColorContent=%23dddddd&bgColorContent=%23ffffff&fcHeader=%23333333&borderColorHeader=%23dddddd&bgColorHeader=%23e9e9e9&fcActive=%23ffffff&borderColorActive=%23003eff&bgColorActive=%23007fff&fcHover=%232b2b2b&borderColorHover=%23cccccc&bgColorHover=%23ededed&fcDefault=%23454545&borderColorDefault=%23c5c5c5&bgColorDefault=%23f6f6f6 diff --git a/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/jquery-ui.structure.css b/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/jquery-ui.structure.css similarity index 99% rename from spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/jquery-ui.structure.css rename to spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/jquery-ui.structure.css index b2cf338..0a3591f 100644 --- a/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/jquery-ui.structure.css +++ b/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/jquery-ui.structure.css @@ -1,5 +1,5 @@ /*! - * jQuery UI CSS Framework 1.13.2 (custom) + * jQuery UI CSS Framework 1.13.3 (custom) * http://jqueryui.com * * Copyright jQuery Foundation and other contributors diff --git a/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/jquery-ui.structure.min.css b/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/jquery-ui.structure.min.css similarity index 99% rename from spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/jquery-ui.structure.min.css rename to spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/jquery-ui.structure.min.css index 692b447..e58e997 100644 --- a/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/jquery-ui.structure.min.css +++ b/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/jquery-ui.structure.min.css @@ -1,5 +1,5 @@ /*! - * jQuery UI CSS Framework 1.13.2 (custom) + * jQuery UI CSS Framework 1.13.3 (custom) * http://jqueryui.com * * Copyright jQuery Foundation and other contributors diff --git a/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/jquery-ui.theme.css b/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/jquery-ui.theme.css similarity index 99% rename from spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/jquery-ui.theme.css rename to spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/jquery-ui.theme.css index ebd2978..d87414a 100644 --- a/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/jquery-ui.theme.css +++ b/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/jquery-ui.theme.css @@ -1,5 +1,5 @@ /*! - * jQuery UI CSS Framework 1.13.2 (custom) + * jQuery UI CSS Framework 1.13.3 (custom) * http://jqueryui.com * * Copyright jQuery Foundation and other contributors diff --git a/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/jquery-ui.theme.min.css b/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/jquery-ui.theme.min.css similarity index 99% rename from spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/jquery-ui.theme.min.css rename to spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/jquery-ui.theme.min.css index 308edd5..b0d81df 100644 --- a/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.2/jquery-ui.theme.min.css +++ b/spagolite-webresources/src/main/webapp/css/custom/jquery-ui-custom/1.13.3/jquery-ui.theme.min.css @@ -1,4 +1,4 @@ -/*! jQuery UI CSS Framework 1.13.2 (custom) +/*! jQuery UI CSS Framework 1.13.3 (custom) * http://jqueryui.com * Copyright jQuery Foundation and other contributors; Licensed MIT */ diff --git a/src/site/owasp/suppress.xml b/src/site/owasp/suppress.xml new file mode 100644 index 0000000..f5fe35c --- /dev/null +++ b/src/site/owasp/suppress.xml @@ -0,0 +1,17 @@ + + + + + ^pkg:maven/org\.springframework/spring-web@.*$ + CVE-2016-1000027 + + + + ^pkg:maven/org\.springframework\.security/spring-security-crypto@.*$ + CVE-2020-5408 + + \ No newline at end of file diff --git a/src/site/site.xml b/src/site/site.xml index 900cbd2..8068942 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -25,7 +25,7 @@ org.apache.maven.skins maven-fluido-skin - 1.9 + 1.11.0 @@ -33,7 +33,7 @@ - + @@ -42,4 +42,4 @@ - \ No newline at end of file +