diff --git a/pom.xml b/pom.xml index 0ab4ff1..5b08023 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.gcube.applicationsupportlayer aslsocial - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT jar Social Portal ASL Extension diff --git a/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java b/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java index df870f3..3108bd4 100644 --- a/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java +++ b/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java @@ -241,7 +241,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen * @throws InternalErrorException */ @Override - public boolean notifyRemovedItem(String userIdToNotify, WorkspaceItem item, WorkspaceFolder sharedFolder) throws InternalErrorException { + public boolean notifyMovedItem(String userIdToNotify, WorkspaceItem item, WorkspaceFolder sharedFolder) throws InternalErrorException { Notification not = new Notification( UUID.randomUUID().toString(), NotificationType.WP_ITEM_DELETE, @@ -262,6 +262,27 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen * @throws InternalErrorException */ @Override + public boolean notifyRemovedItem(String userIdToNotify, String itemName, WorkspaceFolder sharedFolder) throws InternalErrorException { + Notification not = new Notification( + UUID.randomUUID().toString(), + NotificationType.WP_ITEM_DELETE, + userIdToNotify, //user no notify + sharedFolder.getId(), //the + new Date(), + getApplicationUrl()+"?itemid="+sharedFolder.getId(), + "deleted item "+ itemName +" from your workspace shared folder "+ sharedFolder.getName(), + false, + aslSession.getUsername(), + aslSession.getUserFullName(), + aslSession.getUserAvatarId()); + + return saveNotification(not); + } + /** + * {@inheritDoc} + * @throws InternalErrorException + */ + @Override public boolean notifyUpdatedItem(String userIdToNotify, WorkspaceItem item, WorkspaceFolder sharedFolder) throws InternalErrorException { Notification not = new Notification( UUID.randomUUID().toString(), diff --git a/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java b/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java index af2be56..5f72ebd 100644 --- a/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java +++ b/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java @@ -71,7 +71,16 @@ public interface NotificationsManager { * @param sharedFolder the shared folder {@link WorkspaceFolder} * @return true if the notification is correctly delivered, false otherwise */ - boolean notifyRemovedItem(String userIdToNotify, WorkspaceItem item, WorkspaceFolder sharedFolder) throws Exception; + boolean notifyMovedItem(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, String 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