added new method for shared calendar notification
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@78987 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
54c6262bf3
commit
bc56343b1c
|
@ -13,4 +13,7 @@
|
|||
<Changeset component="org.gcube.applicationsupportlayer.aslsocial.0-4-1" date="2013-06-14">
|
||||
<Change>Modified delete item notifications. Distinguished the move from the delete in a shared folder</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.applicationsupportlayer.aslsocial.0-5-0" date="2013-07-08">
|
||||
<Change>Added support for Calendar Notifications</Change>
|
||||
</Changeset>
|
||||
</ReleaseNotes>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.gcube.applicationsupportlayer.social;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
@ -576,4 +577,37 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
|||
|
||||
return saveNotification(not);
|
||||
}
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean notifyNewCalendarEvent(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("added the following event in the <b>").append(aslSession.getGroupName()).append("</b> shared calendar: <br />") // has done something
|
||||
.append("<br /><b>Summary:</b> ").append(eventTitle).append("<br />")
|
||||
.append("<br /><b>Time:</b> ").append(spf.format(startDate)).append(endDateToDisplay).append("<br />")
|
||||
.append("<br /><b>Category:</b> ").append(eventType);
|
||||
|
||||
Notification not = new Notification(
|
||||
UUID.randomUUID().toString(),
|
||||
NotificationType.CALENDAR_ADDED_EVENT,
|
||||
userIdToNotify, //user no notify
|
||||
"", //
|
||||
new Date(),
|
||||
getApplicationUrl(),
|
||||
notificationText.toString(),
|
||||
false,
|
||||
aslSession.getUsername(),
|
||||
aslSession.getUserFullName(),
|
||||
aslSession.getUserAvatarId());
|
||||
|
||||
return saveNotification(not);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.gcube.applicationsupportlayer.social;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portal.databook.shared.ApplicationProfile;
|
||||
|
@ -105,6 +106,16 @@ public interface NotificationsManager {
|
|||
* @return true if the notification is correctly delivered, false otherwise
|
||||
*/
|
||||
boolean notifyMessageReceived(String userIdToNotify, String subject);
|
||||
/**
|
||||
*
|
||||
* @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 notifyNewCalendarEvent(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