added 2 new notifications: renamed folder and renamed item

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@71698 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-03-25 13:38:14 +00:00
parent 2ff8f3ad0c
commit ebcec99164
2 changed files with 32 additions and 3 deletions

View File

@ -26,7 +26,6 @@ import org.gcube.vomanagement.usermanagement.model.UserModel;
/**
*
* @author Massimiliano Assante, ISTI-CNR
* @version 0.1 Dec 2012
*
* use to notify users from within your application
*/
@ -119,7 +118,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
public boolean notifyFolderRenaming(String userIdToNotify, String previousName, String newName, String renamedFolderId) throws InternalErrorException {
Notification not = new Notification(
UUID.randomUUID().toString(),
NotificationType.WP_FOLDER_SHARE,
NotificationType.WP_FOLDER_RENAMED,
userIdToNotify, //user no notify
renamedFolderId, //the
new Date(),
@ -274,6 +273,27 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
return saveNotification(not);
}
/**
* {@inheritDoc}
* @throws InternalErrorException
*/
@Override
public boolean notifyItemRenaming(String userIdToNotify, String previousName, WorkspaceItem renamedItem) throws InternalErrorException {
Notification not = new Notification(
UUID.randomUUID().toString(),
NotificationType.WP_ITEM_RENAMED,
userIdToNotify, //user no notify
renamedItem.getId(), //the
new Date(),
"?oid="+renamedItem.getId(),
"renamed " + previousName +" as " + renamedItem.getName() +" in your shared folder " + renamedItem.getParent().getName(),
false,
aslSession.getUsername(),
aslSession.getUserFullName(),
aslSession.getUserAvatarId());
return saveNotification(not);
}
/**
* {@inheritDoc}
*/
@ -487,5 +507,5 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
aslSession.getUserAvatarId());
return saveNotification(not);
}
}
}

View File

@ -80,6 +80,15 @@ public interface NotificationsManager {
* @return true if the notification is correctly delivered, false otherwise
*/
boolean notifyUpdatedItem(String userIdToNotify, WorkspaceItem item, WorkspaceFolder sharedFolder) throws Exception;
/**
* use to notify a user he got a workspace item renamed
*
* @param userIdToNotify the user you want to notify
* @param previousName the previous name of the folder
* @param renamedItem the renamed {@link WorkspaceItem}
* @return true if the notification is correctly delivered, false otherwise
*/
boolean notifyItemRenaming(String userIdToNotify, String previousName, WorkspaceItem renamedItem) throws Exception;
/**
*
* @param userIdToNotify the user you want to notify