diff --git a/src/main/java/org/gcube/gcat/moderation/thread/ModerationThread.java b/src/main/java/org/gcube/gcat/moderation/thread/ModerationThread.java index 1f2d046..2abb26a 100644 --- a/src/main/java/org/gcube/gcat/moderation/thread/ModerationThread.java +++ b/src/main/java/org/gcube/gcat/moderation/thread/ModerationThread.java @@ -163,8 +163,8 @@ public abstract class ModerationThread { postUserMessage(cmItemStatus, userMessage); } - public void postItemDeleted(CMItemStatus cmItemStatus) throws Exception { - this.cmItemStatus = cmItemStatus; + public void postItemDeleted() throws Exception { + this.cmItemStatus = null; String fullName = ckanUser.getNameSurname(); String message = String.format( "@**%s** deleted the item with name '%s' (id='%s')", diff --git a/src/main/java/org/gcube/gcat/moderation/thread/social/notifications/SocialNotificationModerationThread.java b/src/main/java/org/gcube/gcat/moderation/thread/social/notifications/SocialNotificationModerationThread.java index abe9de3..e25feb8 100644 --- a/src/main/java/org/gcube/gcat/moderation/thread/social/notifications/SocialNotificationModerationThread.java +++ b/src/main/java/org/gcube/gcat/moderation/thread/social/notifications/SocialNotificationModerationThread.java @@ -162,9 +162,9 @@ public class SocialNotificationModerationThread extends ModerationThread { } @Override - public void postItemDeleted(CMItemStatus cmItemStatus) throws Exception { + public void postItemDeleted() throws Exception { this.create = false; - this.cmItemStatus = cmItemStatus; + this.cmItemStatus = null; this.catalogueEventType = CatalogueEventType.ITEM_REMOVED; notifyItemDeleted(); } @@ -218,7 +218,7 @@ public class SocialNotificationModerationThread extends ModerationThread { catalogueEvent.setType(catalogueEventType); catalogueEvent.setNotifyText(messageString); catalogueEvent.setItemId(getSubject()); - if(cmItemStatus == CMItemStatus.APPROVED) { + if(cmItemStatus!=null && cmItemStatus == CMItemStatus.APPROVED) { catalogueEvent.setItemURL(new URL(itemURL)); }else { catalogueEvent.setItemURL(new URL(getModerationURL())); diff --git a/src/main/java/org/gcube/gcat/persistence/ckan/CKANPackage.java b/src/main/java/org/gcube/gcat/persistence/ckan/CKANPackage.java index 85f46f9..5d2649d 100644 --- a/src/main/java/org/gcube/gcat/persistence/ckan/CKANPackage.java +++ b/src/main/java/org/gcube/gcat/persistence/ckan/CKANPackage.java @@ -1467,9 +1467,8 @@ public class CKANPackage extends CKAN implements Moderated { private void postItemDeleted() { try { if(isModerationEnabled()) { - CMItemStatus cmItemStatus = getCMItemStatus(); moderationThread.setItemCoordinates(itemID, name, itemTitle, itemURL); - moderationThread.postItemDeleted(cmItemStatus); + moderationThread.postItemDeleted(); } } catch(WebApplicationException e) { throw e;