added support for edited events
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@79115 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
db7b98657d
commit
2fcfd01353
|
@ -610,4 +610,38 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
|||
|
||||
return saveNotification(not);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean notifyEditedCalendarEvent(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("edited 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> Time:</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_UPDATED_EVENT,
|
||||
userIdToNotify, //user no notify
|
||||
"", //
|
||||
new Date(),
|
||||
getApplicationUrl(),
|
||||
notificationText.toString(),
|
||||
false,
|
||||
aslSession.getUsername(),
|
||||
aslSession.getUserFullName(),
|
||||
aslSession.getUserAvatarId());
|
||||
|
||||
return saveNotification(not);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -116,6 +116,16 @@ public interface NotificationsManager {
|
|||
* @return true if the notification is correctly delivered, false otherwise
|
||||
*/
|
||||
boolean notifyNewCalendarEvent(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 notifyEditedCalendarEvent(String userIdToNotify, String eventTitle, String eventType, Date startDate, Date endingDate);
|
||||
/**
|
||||
* use to notify a user that someone commented on his post
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue