modified delete item notifications. Distinguished the move from the delete in a shared folder

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@77068 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-06-14 13:24:42 +00:00
parent bfed3b1fe3
commit 297e6380ef
3 changed files with 33 additions and 3 deletions

View File

@ -10,7 +10,7 @@
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslsocial</artifactId>
<version>0.4.0-SNAPSHOT</version>
<version>0.4.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Social Portal ASL Extension</name>
<description>

View File

@ -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(),

View File

@ -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