Enforced deleteProject method

This commit is contained in:
Francesco Mangiacrapa 2024-05-10 12:25:20 +02:00
parent 89ddb6bc5f
commit acaf4eb37c
3 changed files with 124 additions and 9 deletions

View File

@ -1,5 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -146,7 +157,18 @@
<wb-module deploy-name="geoportal-data-entry-app-3.3.0-SNAPSHOT">
@ -293,7 +315,18 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -440,7 +473,18 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -587,7 +631,18 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
@ -686,7 +741,21 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="geoportal-client-1.2.2-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-client/geoportal-client">
<dependency-type>uses</dependency-type>
</dependent-module>
@ -833,7 +902,18 @@
<property name="context-root" value="geoportal-data-entry-app"/>
@ -980,7 +1060,18 @@
<property name="java-output-path" value="/geoportal-data-entry-app/target/geoportal-data-entry-app-2.0.0-SNAPSHOT/WEB-INF/classes"/>
@ -1127,7 +1218,18 @@
</wb-module>

View File

@ -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

View File

@ -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);