diff --git a/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java b/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java index 98b97f8..cbfc68a 100644 --- a/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java +++ b/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java @@ -163,7 +163,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen * @throws InternalErrorException */ @Override - public boolean notifyAddedItem(String userIdToNotify, WorkspaceItem item) throws InternalErrorException { + public boolean notifyAddedItem(String userIdToNotify, WorkspaceItem item, WorkspaceFolder sharedFolder) throws InternalErrorException { Notification not = new Notification( UUID.randomUUID().toString(), NotificationType.WP_ITEM_NEW, @@ -171,7 +171,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen item.getId(), //the new Date(), "?oid="+item.getId()+"&parentoid="+item.getParent().getId(), - "added "+ item.getName() +" to your workspace shared folder "+ item.getParent().getName(), + "added "+ item.getName() +" to your workspace shared folder "+ sharedFolder.getName(), false, aslSession.getUsername(), aslSession.getUserFullName(), @@ -184,7 +184,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen * @throws InternalErrorException */ @Override - public boolean notifyRemovedItem(String userIdToNotify, WorkspaceItem item) throws InternalErrorException { + public boolean notifyRemovedItem(String userIdToNotify, WorkspaceItem item, WorkspaceFolder sharedFolder) throws InternalErrorException { Notification not = new Notification( UUID.randomUUID().toString(), NotificationType.WP_ITEM_DELETE, @@ -192,7 +192,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen item.getId(), //the new Date(), "?oid="+item.getId()+"&parentoid="+item.getParent().getId(), - "removed "+ item.getName() +" from your workspace shared folder "+ item.getParent().getName(), + "removed "+ item.getName() +" from your workspace shared folder "+ sharedFolder.getName(), false, aslSession.getUsername(), aslSession.getUserFullName(), diff --git a/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java b/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java index f9f6af0..573bb62 100644 --- a/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java +++ b/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java @@ -40,16 +40,18 @@ public interface NotificationsManager { * use to notify a user he got a workspace item new in some of his workspace shared folder * @param userIdToNotify the user you want to notify * @param newItem the new shared {@link WorkspaceItem} + * @param sharedFolder the shared folder {@link WorkspaceFolder} * @return true if the notification is correctly delivered, false otherwise */ - boolean notifyAddedItem(String userIdToNotify, WorkspaceItem item) throws Exception; + boolean notifyAddedItem(String userIdToNotify, WorkspaceItem item, WorkspaceFolder sharedFolder) throws Exception; /** * use to notify a user he got a workspace item deleted from one of his workspace shared folder * @param userIdToNotify the user you want to notify * @param removedItem the removed {@link WorkspaceItem} + * @param sharedFolder the shared folder {@link WorkspaceFolder} * @return true if the notification is correctly delivered, false otherwise */ - boolean notifyRemovedItem(String userIdToNotify, WorkspaceItem item) throws Exception; + boolean notifyRemovedItem(String userIdToNotify, WorkspaceItem item, WorkspaceFolder sharedFolder) throws Exception; /** * use to notify a user he got a workspace item updated from one of his workspace shared folder * @param userIdToNotify the user you want to notify