From acaf4eb37c2fd2282e00f4ab21b888766ceca799 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Fri, 10 May 2024 12:25:20 +0200 Subject: [PATCH] Enforced deleteProject method --- .settings/org.eclipse.wst.common.component | 120 ++++++++++++++++-- CHANGELOG.md | 1 + .../server/GeoportalDataEntryServiceImpl.java | 12 ++ 3 files changed, 124 insertions(+), 9 deletions(-) diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 604e800..5420fc3 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,16 @@ - + + + + + + + + + + + + @@ -146,7 +157,18 @@ - + + + + + + + + + + + + @@ -293,7 +315,18 @@ - + + + + + + + + + + + + @@ -440,7 +473,18 @@ - + + + + + + + + + + + + @@ -587,7 +631,18 @@ - + + + + + + + + + + + + @@ -686,7 +741,21 @@ - + + uses + + + + + + + + + + + + + @@ -833,7 +902,18 @@ - + + + + + + + + + + + + @@ -980,7 +1060,18 @@ - + + + + + + + + + + + + @@ -1127,7 +1218,18 @@ - + + + + + + + + + + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index e239a92..53fd7bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Integrated new Uri-Resolver-Manager [#27160] - Added Get Shareable Link facility [#27120] - Added optional message when performing lifecycle step [#27192] +- Enforced deleteProject method ## [v3.2.2] - 2024-01-11 diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java index 4349754..141e5d7 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java @@ -1010,6 +1010,18 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen SessionUtil.getCurrentContext(getThreadLocalRequest(), true); client.deleteProject(profileID, projectID, true); + + try { + Project deletedP = client.getProjectByID(profileID, projectID); + if(deletedP!=null) { + String error = "The project with id: "+projectID+" still exists"; + LOG.error(error +". Sending exception.."); + throw new Exception(error); + } + }catch (Exception e) { + throw e; + } + // Updating count of Documents in session per profileID Integer totalProjectForProfile = client.getTotalDocument(profileID); SessionUtil.setTotalDocumentForProfileID(getThreadLocalRequest(), profileID, totalProjectForProfile);