From 6fef972adc74d1f77ea36196ee511c96d6610faa Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Tue, 30 May 2023 14:01:35 +0200 Subject: [PATCH] Fixed #25201 --- CHANGELOG.md | 1 + .../geoportaldatamapper/Geoportal_JSON_Mapper.java | 4 +++- src/test/java/Geoportal_DataMapper_Tests.java | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7f1a12..8af47b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,4 +6,5 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [v1.0.0] +- Fixed #25201 - First release diff --git a/src/main/java/org/gcube/application/geoportaldatamapper/Geoportal_JSON_Mapper.java b/src/main/java/org/gcube/application/geoportaldatamapper/Geoportal_JSON_Mapper.java index 2a93c55..81bef7c 100644 --- a/src/main/java/org/gcube/application/geoportaldatamapper/Geoportal_JSON_Mapper.java +++ b/src/main/java/org/gcube/application/geoportaldatamapper/Geoportal_JSON_Mapper.java @@ -523,6 +523,7 @@ public class Geoportal_JSON_Mapper { LOG.debug("data to string: " + data.toString()); List fileSetPaths = gcubeProfileDV.getFilePaths(); + LOG.debug("gcubeProfileDV "+gcubeProfileDV.getGcubeName() + " fileSetPaths: "+fileSetPaths); String filesetPath = JSON_$_POINTER; if (fileSetPaths != null && fileSetPaths.size() > 0) { //Reading the first fieldName that defines the name of the "fileset" field @@ -530,6 +531,7 @@ public class Geoportal_JSON_Mapper { filesetPath +="."+firstOne.getFieldName(); } + LOG.debug("filesetPath is: "+filesetPath); // Splitting the General Document in bson.Document according to list of // GcubeProfiles @@ -550,7 +552,7 @@ public class Geoportal_JSON_Mapper { String jsonString = dataArray.get(i).toString(); LOG.debug("the array " + i + " JSON to string: " + jsonString); Document sectionDoc = Document.parse(jsonString); - boolean isAccessibleSection = isAccessibleSectionAccordingToPolicy(sectionDoc, sectionJSONPath, + boolean isAccessibleSection = isAccessibleSectionAccordingToPolicy(sectionDoc, filesetPath, username); if (isAccessibleSection) { listBSONDocument.add(sectionDoc); diff --git a/src/test/java/Geoportal_DataMapper_Tests.java b/src/test/java/Geoportal_DataMapper_Tests.java index 908c844..a390d49 100644 --- a/src/test/java/Geoportal_DataMapper_Tests.java +++ b/src/test/java/Geoportal_DataMapper_Tests.java @@ -41,8 +41,10 @@ public class Geoportal_DataMapper_Tests { //private static String PROFILE_ID = "concessioni-estere"; private static String PROFILE_ID = "profiledConcessioni"; - private static String PROJECT_ID = "6442653ac6a0422d9e9042e0"; //63d011c4dcac4551b9a6b930 //6442653ac6a0422d9e9042e0 //6399de3ca0a4545420373251 + private static String PROJECT_ID = "6475a6a2a827c6201915917d"; //63d011c4dcac4551b9a6b930 //6442653ac6a0422d9e9042e0 //6399de3ca0a4545420373251 + //IMPORTANT!!!! #NB SET USERNAME = null to test PUBLIC ACCESS + private static String USERNAME = "francesco.mangiacrapa"; /**