suuport for calendar events completed, testing phase inititated
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portal/social-networking-library@79066 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
fcd81603ea
commit
2f7aff64bb
5445
.gwt/.gwt-log
5445
.gwt/.gwt-log
File diff suppressed because it is too large
Load Diff
|
@ -925,24 +925,28 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
|
|||
}
|
||||
/**
|
||||
* called when you add new notification types where the setting does not exist yet
|
||||
* please note: by default we set only portal notifications
|
||||
*/
|
||||
private List<NotificationChannelType> createNewNotificationType(String userid, NotificationType notificationType) {
|
||||
List<NotificationChannelType> toReturn = new ArrayList<NotificationChannelType>();
|
||||
MutationBatch m = conn.getKeyspace().prepareMutationBatch();
|
||||
String valueToInsert = "";
|
||||
int channelsNo = NotificationChannelType.values().length;
|
||||
for (int i = 0; i < channelsNo; i++) {
|
||||
valueToInsert += NotificationChannelType.values()[i];
|
||||
if (i < channelsNo-1)
|
||||
NotificationChannelType[] wpTypes = { NotificationChannelType.PORTAL };
|
||||
|
||||
for (int i = 0; i < wpTypes.length; i++) {
|
||||
valueToInsert += wpTypes[i];
|
||||
if (i < wpTypes.length-1)
|
||||
valueToInsert += ",";
|
||||
toReturn.add(wpTypes[i]); //add the new added notification type
|
||||
}
|
||||
m.withRow(cf_UserNotificationsPreferences, userid).putColumn(notificationType.toString(), valueToInsert, null);
|
||||
boolean overAllresult = execute(m);
|
||||
if (overAllresult)
|
||||
if (overAllresult) {
|
||||
_log.trace("Set New Notification Setting for " + userid + " OK");
|
||||
|
||||
return toReturn;
|
||||
}
|
||||
return new ArrayList<NotificationChannelType>(); //no notification if sth fails
|
||||
}
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
@ -1455,6 +1459,15 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
|
|||
else if (type.compareTo("CALENDAR_DELETED_EVENT") == 0) {
|
||||
return NotificationType.CALENDAR_DELETED_EVENT;
|
||||
}
|
||||
else if (type.compareTo("CALENDAR_ADDED_EVENT") == 0) {
|
||||
return NotificationType.CALENDAR_ADDED_EVENT;
|
||||
}
|
||||
else if (type.compareTo("CALENDAR_UPDATED_EVENT") == 0) {
|
||||
return NotificationType.CALENDAR_UPDATED_EVENT;
|
||||
}
|
||||
else if (type.compareTo("CALENDAR_DELETED_EVENT") == 0) {
|
||||
return NotificationType.CALENDAR_DELETED_EVENT;
|
||||
}
|
||||
else if (type.compareTo("MESSAGE") == 0) {
|
||||
return NotificationType.MESSAGE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue