From 680dc4f3785eae9541f3b130e691466b51e8eba1 Mon Sep 17 00:00:00 2001
From: lhameury <43-lhameury@users.noreply.gitlab.libriciel.fr>
Date: Mon, 19 Aug 2024 11:53:16 +0200
Subject: [PATCH] Fix "Node Ref does not exists" issue on isOfType method, from
 "Assert" calls Prepare 4.7.20

---
 CHANGELOG.md                                              | 6 ++++++
 iparapheur-amp/pom.xml                                    | 8 ++++----
 iparapheur-core/pom.xml                                   | 6 +++---
 .../atolcd/parapheur/repo/impl/ParapheurServiceImpl.java  | 5 ++++-
 .../module/parapheur/core/parapheur-version.properties    | 2 +-
 iparapheur-mobile-webscripts/pom.xml                      | 4 ++--
 iparapheur-rules/pom.xml                                  | 4 ++--
 pom.xml                                                   | 2 +-
 8 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4f3bfc4..c7d7ef1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,12 @@ Toutes les modifications apportées au projet seront documentées dans ce fichie
 Le format est basé sur le modèle [Keep a Changelog](http://keepachangelog.com/)
 et adhère aux principes du [Semantic Versioning](http://semver.org/).
 
+## [4.7.20] - 24-08-19
+
+### Corrections
+
+- Une vérification au niveau des dossiers déclenchait des erreurs non attendues
+
 ## [4.7.19] - 24-08-06
 
 ### Corrections
diff --git a/iparapheur-amp/pom.xml b/iparapheur-amp/pom.xml
index 209a898..45ab6b2 100644
--- a/iparapheur-amp/pom.xml
+++ b/iparapheur-amp/pom.xml
@@ -6,13 +6,13 @@
     <parent>
         <groupId>org.adullact.iparapheur</groupId>
         <artifactId>iparapheur</artifactId>
-        <version>4.7.19</version>
+        <version>4.7.20</version>
     </parent>
     <groupId>org.adullact.iparapheur</groupId>
     <artifactId>iparapheur-amp</artifactId>
     <description>Parapheur electronique</description>
     <packaging>war</packaging>
-    <version>4.7.19-for-Alf3.4.c</version>
+    <version>4.7.20-for-Alf3.4.c</version>
     <name>i-Parapheur AMP packaging</name>
     <url>http://maven.apache.org</url>
     <properties>
@@ -65,13 +65,13 @@
         <dependency>
             <groupId>org.adullact.iparapheur</groupId>
             <artifactId>iparapheur-core</artifactId>
-            <version>4.7.19</version>
+            <version>4.7.20</version>
         </dependency>
 
         <dependency>
             <groupId>org.adullact.iparapheur</groupId>
             <artifactId>iparapheur-mobile-webscripts</artifactId>
-            <version>4.7.19</version>
+            <version>4.7.20</version>
         </dependency>
 
         <dependency>
diff --git a/iparapheur-core/pom.xml b/iparapheur-core/pom.xml
index a87ed9c..514f7a2 100644
--- a/iparapheur-core/pom.xml
+++ b/iparapheur-core/pom.xml
@@ -5,14 +5,14 @@
 	<parent>
 		<groupId>org.adullact.iparapheur</groupId>
 		<artifactId>iparapheur</artifactId>
-		<version>4.7.19</version>
+		<version>4.7.20</version>
 	</parent>
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>org.adullact.iparapheur</groupId>
 	<artifactId>iparapheur-core</artifactId>
 	<packaging>jar</packaging>
 	<name>iparapheur core module</name>
-	<version>4.7.19</version>
+	<version>4.7.20</version>
 	<description>Parapheur electronique</description>
 	<!-- General Info -->
 	<url>https://adullact.net/projects/paraphelec/</url>
@@ -294,7 +294,7 @@
 		<dependency>
 			<groupId>org.adullact.iparapheur</groupId>
 			<artifactId>iparapheur-rules</artifactId>
-			<version>4.7.19</version>
+			<version>4.7.20</version>
 			<!-- exclusions>
 			 <exclusion>
 			 <artifactId>asm</artifactId>
diff --git a/iparapheur-core/src/main/java/com/atolcd/parapheur/repo/impl/ParapheurServiceImpl.java b/iparapheur-core/src/main/java/com/atolcd/parapheur/repo/impl/ParapheurServiceImpl.java
index 8b5b3bc..2e81719 100755
--- a/iparapheur-core/src/main/java/com/atolcd/parapheur/repo/impl/ParapheurServiceImpl.java
+++ b/iparapheur-core/src/main/java/com/atolcd/parapheur/repo/impl/ParapheurServiceImpl.java
@@ -7162,8 +7162,11 @@ public final class ParapheurServiceImpl implements ParapheurService, Initializin
     private boolean isOfType(NodeRef nodeRef, QName type) {
         Assert.notNull(nodeRef, "Node Ref is mandatory");
         Assert.notNull(this.nodeService, "NodeService is mandatory");
-        Assert.isTrue(this.nodeService.exists(nodeRef), "Node Ref must exist in the repository");
         Assert.notNull(type, "Type is mandatory");
+        if(!this.nodeService.exists(nodeRef)) {
+            logger.warn("Node Ref does not exists - " + nodeRef.getId());
+            return false;
+        }
 
         // find it's type so we can see if it's a node we are interested in
         QName type2 = this.nodeService.getType(nodeRef);
diff --git a/iparapheur-core/src/main/resources/alfresco/module/parapheur/core/parapheur-version.properties b/iparapheur-core/src/main/resources/alfresco/module/parapheur/core/parapheur-version.properties
index b07c1a6..a8626d3 100755
--- a/iparapheur-core/src/main/resources/alfresco/module/parapheur/core/parapheur-version.properties
+++ b/iparapheur-core/src/main/resources/alfresco/module/parapheur/core/parapheur-version.properties
@@ -1,2 +1,2 @@
-ph_version=4.7.19
+ph_version=4.7.20
 ph_build=20240611
diff --git a/iparapheur-mobile-webscripts/pom.xml b/iparapheur-mobile-webscripts/pom.xml
index 13c3de9..e43b1d7 100644
--- a/iparapheur-mobile-webscripts/pom.xml
+++ b/iparapheur-mobile-webscripts/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <artifactId>iparapheur</artifactId>
         <groupId>org.adullact.iparapheur</groupId>
-        <version>4.7.19</version>
+        <version>4.7.20</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
@@ -94,7 +94,7 @@
         <dependency>
             <groupId>org.adullact.iparapheur</groupId>
             <artifactId>iparapheur-core</artifactId>
-            <version>4.7.19</version>
+            <version>4.7.20</version>
             <scope>provided</scope>
         </dependency>
 
diff --git a/iparapheur-rules/pom.xml b/iparapheur-rules/pom.xml
index a4a4bcd..6285398 100644
--- a/iparapheur-rules/pom.xml
+++ b/iparapheur-rules/pom.xml
@@ -5,10 +5,10 @@
     <parent>
         <groupId>org.adullact.iparapheur</groupId>
         <artifactId>iparapheur</artifactId>
-        <version>4.7.19</version>
+        <version>4.7.20</version>
     </parent>
     <artifactId>iparapheur-rules</artifactId>
-    <version>4.7.19</version>
+    <version>4.7.20</version>
     <name>iparapheur-rules</name>
     <url>http://maven.apache.org</url>
     <properties>
diff --git a/pom.xml b/pom.xml
index b2d0061..15863ff 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
     <artifactId>iparapheur</artifactId>
     <packaging>pom</packaging>
     <name>iparapheur</name>
-    <version>4.7.19</version>
+    <version>4.7.20</version>
     <description>Parapheur electronique</description>
 
     <url>https://adullact.net/projects/paraphelec/</url>
-- 
GitLab