From 75618683c3cb2d264e3d0d408b5db4d87831d134 Mon Sep 17 00:00:00 2001 From: "massimiliano.assante" Date: Wed, 20 Mar 2013 14:45:06 +0000 Subject: [PATCH] added renamedFolder Notification git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@71606 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../ApplicationNotificationsManager.java | 21 +++++++++++++++++++ .../social/NotificationsManager.java | 11 ++++++++++ 2 files changed, 32 insertions(+) diff --git a/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java b/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java index ba6f97b..d3bae15 100644 --- a/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java +++ b/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java @@ -111,6 +111,27 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen return saveNotification(not); } + /** + * {@inheritDoc} + * @throws InternalErrorException + */ + @Override + public boolean notifyFolderRenaming(String userIdToNotify, String previousName, String newName, String renamedFolderId) throws InternalErrorException { + Notification not = new Notification( + UUID.randomUUID().toString(), + NotificationType.WP_FOLDER_SHARE, + userIdToNotify, //user no notify + renamedFolderId, //the + new Date(), + "?oid="+renamedFolderId, + "renamed your shared folder "+ previousName +" as " + newName, + false, + aslSession.getUsername(), + aslSession.getUserFullName(), + aslSession.getUserAvatarId()); + + return saveNotification(not); + } /** * {@inheritDoc} * @throws UserManagementPortalException diff --git a/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java b/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java index fa65d13..bc70c4b 100644 --- a/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java +++ b/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java @@ -18,6 +18,17 @@ public interface NotificationsManager { * @return true if the notification is correctly delivered, false otherwise */ boolean notifyFolderSharing(String userIdToNotify, WorkspaceFolder sharedFolder) throws Exception; + /** + * use to notify a user he got a workspace folder renamed + * + * @param userIdToNotify the user you want to notify + * @param previousName the previous name of the folder + * @param newName the new name of the folder + * @param renamedFolderId the folderId + * @return true if the notification is correctly delivered, false otherwise + */ + boolean notifyFolderRenaming(String userIdToNotify, String previousName, String newName, String renamedFolderId) throws Exception; + /** /** * use to notify a user that a new user was added in on of his workspace shared folder *