set for workspace notification emails to off by default

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portal/social-networking-library@76854 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-06-07 10:28:09 +00:00
parent f4ffa05f81
commit 7c05ce61bc
3 changed files with 3283 additions and 6 deletions

File diff suppressed because it is too large Load Diff

View File

@ -936,7 +936,7 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
}
m.withRow(cf_UserNotificationsPreferences, userid).putColumn(nType.toString(), valueToInsert, null);
}
boolean overAllresult = execute(m);
if (overAllresult)
_log.trace("Set Notification Map for " + userid + " OK");
@ -965,7 +965,14 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
HashMap<NotificationType, NotificationChannelType[]> toCreate = new HashMap<NotificationType, NotificationChannelType[]>();
for (int i = 0; i < NotificationType.values().length; i++) {
toCreate.put(NotificationType.values()[i], NotificationChannelType.values()); //create a map with all notification enabled
//TODO: Potential bug in NotificationType for workspace are refactored
//create a map with all notification enabled except for workflow notifications (They start with WP_) it was the only quick way
if (NotificationType.values()[i].toString().startsWith("WP_")) {
NotificationChannelType[] wpTypes = { NotificationChannelType.PORTAL };
toCreate.put(NotificationType.values()[i], wpTypes);
}
else
toCreate.put(NotificationType.values()[i], NotificationChannelType.values());
}
setUserNotificationPreferences(userid, toCreate); //commit the map
@ -981,8 +988,8 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
if (channels[i].compareTo("") != 0)
toAdd[i] = (getChannelType(channels[i]));
}
toReturn.put(getNotificationType(column.getName()), toAdd);
toReturn.put(getNotificationType(column.getName()), toAdd);
}
}
return toReturn;
@ -1515,7 +1522,7 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
_log.info("LikesNo update OK to: " + newCount);
return true;
}
}

View File

@ -1,12 +1,15 @@
package org.gcube.portal.databook.shared;
/**
* @author Massimiliano Assante ISTI-CNR
*
* @version 1.0 January 2012
* TODO: Buggy if NotificationType for WP_* are refactored see DBCassandraAstyanaxImpl#getUserNotificationPreferences(String userid)
* introduced due to urgent matters
*/
public enum NotificationType {
/**
* use to notify a user he got a workspace folder shared
*/