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:
Massimiliano Assante 2013-07-12 13:38:06 +00:00
parent fcd81603ea
commit 2f7aff64bb
2 changed files with 5465 additions and 7 deletions

File diff suppressed because it is too large Load Diff

View File

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