enhanced to read portal sender email from portal property file, removed periods at the end of notification emails.
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@117206 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
86fa0951cc
commit
aa32741422
|
@ -94,7 +94,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return the url of the application if exists in the profile
|
* return the url of the application if exists in the profile
|
||||||
* @return .
|
* @return .
|
||||||
|
@ -201,7 +201,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
|
|
||||||
return saveNotification(not);
|
return saveNotification(not);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
* @throws InternalErrorException
|
* @throws InternalErrorException
|
||||||
|
@ -310,22 +310,22 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
public boolean notifyAddedItem(String userIdToNotify, WorkspaceItem item, WorkspaceSharedFolder sharedFolder) throws InternalErrorException {
|
public boolean notifyAddedItem(String userIdToNotify, WorkspaceItem item, WorkspaceSharedFolder sharedFolder) throws InternalErrorException {
|
||||||
String notifyText = sharedFolder.isVreFolder() ?
|
String notifyText = sharedFolder.isVreFolder() ?
|
||||||
"added "+ item.getName() +" to the workspace group folder " + sharedFolder.getDisplayName() :
|
"added "+ item.getName() +" to the workspace group folder " + sharedFolder.getDisplayName() :
|
||||||
"added "+ item.getName() +" to your workspace shared folder "+ item.getPath().substring(0,item.getPath().lastIndexOf('/'));
|
"added "+ item.getName() +" to your workspace shared folder "+ item.getPath().substring(0,item.getPath().lastIndexOf('/'));
|
||||||
|
|
||||||
Notification not = new Notification(
|
|
||||||
UUID.randomUUID().toString(),
|
|
||||||
NotificationType.WP_ITEM_NEW,
|
|
||||||
userIdToNotify, //user no notify
|
|
||||||
item.getId(), //the
|
|
||||||
new Date(),
|
|
||||||
getApplicationUrl()+"?itemid="+item.getParent().getId(),
|
|
||||||
notifyText,
|
|
||||||
false,
|
|
||||||
aslSession.getUsername(),
|
|
||||||
aslSession.getUserFullName(),
|
|
||||||
aslSession.getUserAvatarId());
|
|
||||||
|
|
||||||
return saveNotification(not);
|
Notification not = new Notification(
|
||||||
|
UUID.randomUUID().toString(),
|
||||||
|
NotificationType.WP_ITEM_NEW,
|
||||||
|
userIdToNotify, //user no notify
|
||||||
|
item.getId(), //the
|
||||||
|
new Date(),
|
||||||
|
getApplicationUrl()+"?itemid="+item.getParent().getId(),
|
||||||
|
notifyText,
|
||||||
|
false,
|
||||||
|
aslSession.getUsername(),
|
||||||
|
aslSession.getUserFullName(),
|
||||||
|
aslSession.getUserAvatarId());
|
||||||
|
|
||||||
|
return saveNotification(not);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -335,7 +335,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
public boolean notifyMovedItem(String userIdToNotify, WorkspaceItem item, WorkspaceSharedFolder sharedFolder) throws InternalErrorException {
|
public boolean notifyMovedItem(String userIdToNotify, WorkspaceItem item, WorkspaceSharedFolder sharedFolder) throws InternalErrorException {
|
||||||
String notifyText = sharedFolder.isVreFolder() ? "removed item "+ item.getName() +" from the workspace group folder " + sharedFolder.getDisplayName():
|
String notifyText = sharedFolder.isVreFolder() ? "removed item "+ item.getName() +" from the workspace group folder " + sharedFolder.getDisplayName():
|
||||||
"removed item "+ item.getName() +" from your workspace shared folder \""+ sharedFolder.getName()+"\"";
|
"removed item "+ item.getName() +" from your workspace shared folder \""+ sharedFolder.getName()+"\"";
|
||||||
|
|
||||||
Notification not = new Notification(
|
Notification not = new Notification(
|
||||||
UUID.randomUUID().toString(),
|
UUID.randomUUID().toString(),
|
||||||
NotificationType.WP_ITEM_DELETE,
|
NotificationType.WP_ITEM_DELETE,
|
||||||
|
@ -480,11 +480,13 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
feedid, //the post
|
feedid, //the post
|
||||||
new Date(),
|
new Date(),
|
||||||
"/group/data-e-infrastructure-gateway?oid="+feedid,
|
"/group/data-e-infrastructure-gateway?oid="+feedid,
|
||||||
"commented on your post: " + escapeHtml(feedText),
|
"commented on your post: "
|
||||||
false,
|
+ "<div style=\"margin-top: 10px; margin-bottom: 10px; margin-left: 50px; padding-left: 15px; border-left: 3px solid #ccc; font-style: italic;\">\""
|
||||||
aslSession.getUsername(),
|
+ escapeHtml(feedText) +"\"</div>",
|
||||||
aslSession.getUserFullName(),
|
false,
|
||||||
aslSession.getUserAvatarId());
|
aslSession.getUsername(),
|
||||||
|
aslSession.getUserFullName(),
|
||||||
|
aslSession.getUserAvatarId());
|
||||||
return saveNotification(not);
|
return saveNotification(not);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -493,22 +495,26 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
@Override
|
@Override
|
||||||
public boolean notifyCommentReply(String userIdToNotify, String feedid, String commentText, String feedOwnerFullName, String feedOwnerId) {
|
public boolean notifyCommentReply(String userIdToNotify, String feedid, String commentText, String feedOwnerFullName, String feedOwnerId) {
|
||||||
String notificationText = (aslSession.getUsername().compareTo(feedOwnerId) == 0) ?
|
String notificationText = (aslSession.getUsername().compareTo(feedOwnerId) == 0) ?
|
||||||
"also commented on his post: " + escapeHtml(commentText)
|
"also commented on his post: "
|
||||||
|
+ "<div style=\"margin-top: 10px; margin-bottom: 10px; margin-left: 50px; padding-left: 15px; border-left: 3px solid #ccc; font-style: italic;\">\""
|
||||||
|
+ escapeHtml(commentText) +"\"</div>"
|
||||||
:
|
:
|
||||||
"also commented on " + feedOwnerFullName + "'s post: " + escapeHtml(commentText);
|
"also commented on " + feedOwnerFullName + "'s post: "
|
||||||
Notification not = new Notification(
|
+ "<div style=\"margin-top: 10px; margin-bottom: 10px; margin-left: 50px; padding-left: 15px; border-left: 3px solid #ccc; font-style: italic;\">\""
|
||||||
UUID.randomUUID().toString(),
|
+ escapeHtml(commentText) +"\"</div>";
|
||||||
NotificationType.COMMENT,
|
Notification not = new Notification(
|
||||||
userIdToNotify, //user no notify
|
UUID.randomUUID().toString(),
|
||||||
feedid, //the post
|
NotificationType.COMMENT,
|
||||||
new Date(),
|
userIdToNotify, //user no notify
|
||||||
"/group/data-e-infrastructure-gateway?oid="+feedid,
|
feedid, //the post
|
||||||
notificationText,
|
new Date(),
|
||||||
false,
|
"/group/data-e-infrastructure-gateway?oid="+feedid,
|
||||||
aslSession.getUsername(),
|
notificationText,
|
||||||
aslSession.getUserFullName(),
|
false,
|
||||||
aslSession.getUserAvatarId());
|
aslSession.getUsername(),
|
||||||
return saveNotification(not);
|
aslSession.getUserFullName(),
|
||||||
|
aslSession.getUserAvatarId());
|
||||||
|
return saveNotification(not);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -522,11 +528,13 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
feedid, //the post
|
feedid, //the post
|
||||||
new Date(),
|
new Date(),
|
||||||
"/group/data-e-infrastructure-gateway?oid="+feedid,
|
"/group/data-e-infrastructure-gateway?oid="+feedid,
|
||||||
"commented on one of your favorite posts: " + escapeHtml(commentText),
|
"commented on one of your favorite posts: "
|
||||||
false,
|
+ "<div style=\"margin-top: 10px; margin-bottom: 10px; margin-left: 50px; padding-left: 15px; border-left: 3px solid #ccc; font-style: italic;\">\""
|
||||||
aslSession.getUsername(),
|
+ escapeHtml(commentText) +"\"</div>",
|
||||||
aslSession.getUserFullName(),
|
false,
|
||||||
aslSession.getUserAvatarId());
|
aslSession.getUsername(),
|
||||||
|
aslSession.getUserFullName(),
|
||||||
|
aslSession.getUserAvatarId());
|
||||||
return saveNotification(not);
|
return saveNotification(not);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -831,15 +839,15 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
public boolean notifyTDMObjectSharing(String userIdToNotify, NotificationType type, String tdmObjectName, String encodedTabularResourceParams) throws Exception {
|
public boolean notifyTDMObjectSharing(String userIdToNotify, NotificationType type, String tdmObjectName, String encodedTabularResourceParams) throws Exception {
|
||||||
if (! (type == NotificationType.TDM_RULE_SHARE || type == NotificationType.TDM_TEMPLATE_SHARE))
|
if (! (type == NotificationType.TDM_RULE_SHARE || type == NotificationType.TDM_TEMPLATE_SHARE))
|
||||||
throw new IllegalArgumentException("Type must be either TDM_RULE_SHARE or TDM_TEMPLATE_SHARE");
|
throw new IllegalArgumentException("Type must be either TDM_RULE_SHARE or TDM_TEMPLATE_SHARE");
|
||||||
|
|
||||||
String notificationText = "shared the Tabular Data Manager";
|
String notificationText = "shared the Tabular Data Manager";
|
||||||
notificationText += (type == NotificationType.TDM_RULE_SHARE) ? " Rule " : " Template ";
|
notificationText += (type == NotificationType.TDM_RULE_SHARE) ? " Rule " : " Template ";
|
||||||
notificationText += "\"" + tdmObjectName + "\" with you";
|
notificationText += "\"" + tdmObjectName + "\" with you";
|
||||||
|
|
||||||
String url = getApplicationUrl();
|
String url = getApplicationUrl();
|
||||||
if (encodedTabularResourceParams != null && encodedTabularResourceParams.compareTo("") != 0)
|
if (encodedTabularResourceParams != null && encodedTabularResourceParams.compareTo("") != 0)
|
||||||
url += "?"+encodedTabularResourceParams;
|
url += "?"+encodedTabularResourceParams;
|
||||||
|
|
||||||
Notification not = new Notification(
|
Notification not = new Notification(
|
||||||
UUID.randomUUID().toString(),
|
UUID.randomUUID().toString(),
|
||||||
type,
|
type,
|
||||||
|
@ -852,7 +860,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
aslSession.getUsername(),
|
aslSession.getUsername(),
|
||||||
aslSession.getUserFullName(),
|
aslSession.getUserFullName(),
|
||||||
aslSession.getUserAvatarId());
|
aslSession.getUserAvatarId());
|
||||||
|
|
||||||
return saveNotification(not);
|
return saveNotification(not);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue