added support for deleted events

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@79116 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-07-12 15:06:34 +00:00
parent 2fcfd01353
commit 5ec4e35237
2 changed files with 44 additions and 0 deletions

View File

@ -644,4 +644,38 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
return saveNotification(not);
}
/**
* {@inheritDoc}
*/
@Override
public boolean notifyDeletedCalendarEvent(String userIdToNotify, String eventTitle, String eventType, Date startDate, Date endingDate) {
SimpleDateFormat spf = new SimpleDateFormat("EEE dd MMMMM, yyyy");
String endDateToDisplay="";
if (endingDate != null) {
endDateToDisplay = " to " + spf.format(endingDate);
}
StringBuilder notificationText = new StringBuilder();
notificationText.append("deleted the following event in the <b>").append(aslSession.getGroupName()).append("</b> shared calendar: ") // has done something
.append("<strong>").append(eventTitle).append("</strong><br />")
.append("<br /><strong> Was planned:</strong> ").append(spf.format(startDate)).append(endDateToDisplay).append("<br />")
.append("<br /><strong> Category: </strong> ").append(eventType);
Notification not = new Notification(
UUID.randomUUID().toString(),
NotificationType.CALENDAR_DELETED_EVENT,
userIdToNotify, //user no notify
"", //
new Date(),
getApplicationUrl(),
notificationText.toString(),
false,
aslSession.getUsername(),
aslSession.getUserFullName(),
aslSession.getUserAvatarId());
return saveNotification(not);
}
}

View File

@ -126,6 +126,16 @@ public interface NotificationsManager {
* @return true if the notification is correctly delivered, false otherwise
*/
boolean notifyEditedCalendarEvent(String userIdToNotify, String eventTitle, String eventType, Date startDate, Date endingDate);
/**
*
* @param userIdToNotify the user you want to notify
* @param eventTitle the title of the event
* @param eventType the type of the event
* @param startDate staring date
* @param endingDate ending date
* @return true if the notification is correctly delivered, false otherwise
*/
boolean notifyDeletedCalendarEvent(String userIdToNotify, String eventTitle, String eventType, Date startDate, Date endingDate);
/**
* use to notify a user that someone commented on his post
*