notifications all done hopefully

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@68617 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-01-31 15:58:54 +00:00
parent 655745e344
commit 2e619a7f9a
2 changed files with 33 additions and 28 deletions

View File

@ -393,8 +393,8 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
documentWorkflowId, //the workflowid
new Date(),
getApplicationUrl()+"?oid="+documentWorkflowId,
"has performed the last needed forward on a Document Workflow titled: " + escapeHtml(documentName) + " in . " + aslSession.getGroupName() + "." +
"Step \"" + fromStepName + "\" is now complete. The next step is \"" + toStepName +"\". On " + aslSession.getGroupName() + " Virtual Research Environment. ",
"has performed the last needed forward on a Document Workflow titled: " + escapeHtml(documentName) + ". " +
"Step \"" + fromStepName + "\" is now complete. The next step is \"" + toStepName +"\". In " + aslSession.getGroupName(),
false,
aslSession.getUsername(),
aslSession.getUserFullName(),
@ -408,7 +408,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
@Override
public boolean notifyDocumentWorkflowFirstStepRequest(String userIdToNotify, String documentWorkflowId, String documentName, String assignedRole) {
String notificationText = "involved you in the Document Workflow titled: " + escapeHtml(documentName) + ". " +
"You are requested to perform a task. Your role is: " + assignedRole+".";
"You are requested to perform a task. Your role is: " + assignedRole+"";
Notification not = new Notification(
UUID.randomUUID().toString(),
NotificationType.DOCUMENT_WORKFLOW_FIRST_STEP_REQUEST_INVOLVMENT,

View File

@ -36,6 +36,9 @@ public class EmailPlugin {
String sender = notification2Save.getSenderFullName();
if (notification2Save.getType() == NotificationType.DOCUMENT_WORKFLOW_STEP_REQUEST_TASK)
sender = "";
String portalHost = portalURL.replaceAll("https://", "");
portalHost = portalHost.replaceAll("http://", "");
StringBuilder body = new StringBuilder();
@ -43,11 +46,13 @@ public class EmailPlugin {
.append("<p>").append(sender).append(" ").append(removedMarkup) // has done something
.append(getActionLink(notification2Save, portalURL)).append("</p>") //Goto
.append("<br />")
.append("<p><div style=\"color:#999999; font-size:11px; font-family:'lucida grande',tahoma,verdana,arial,sans-serif; padding-top:30px;\">")
.append("<p><div style=\"color:#999999; font-size:11px; font-family:'lucida grande',tahoma,verdana,arial,sans-serif; padding-top:20px;\">")
.append("This message was sent to <a href=\"mailto:")
.append(email).append("\" style=\"color:#3B5998;text-decoration:none\" target=\"_blank\">").append(email).append("</a> by ")
.append(portalURL).append(".")
.append("If you don't want to receive these emails in the future, please <a href=\"")
.append(email)
.append("\" style=\"color:#3B5998;text-decoration:none\" target=\"_blank\">").append(email).append("</a> by ")
.append("<a href=\"").append(portalURL).append("\" style=\"color:#3B5998;text-decoration:none\" target=\"_blank\">").append(portalHost)
.append("</a>. ")
.append(" If you don't want to receive these emails in the future, please <a href=\"")
.append(portalURL).append("/group/data-e-infrastructure-gateway/notifications\" style=\"color:#3b5998;text-decoration:none\" target=\"_blank\">unsubscribe</a>.")
.append("</div></p>")
.append("<p><div style=\"color:#999999; font-size:10px; font-family:'lucida grande',tahoma,verdana,arial,sans-serif; padding-top:15px;\">")
@ -170,67 +175,67 @@ public class EmailPlugin {
switch (notification2Save.getType()) {
case LIKE:
actionLink.append("\">").append("See the Post").append("</a>");
actionLink.append("\">.").append(" See the Post").append("</a>");
break;
case COMMENT:
actionLink.append("\">").append("See the Post").append("</a>");
actionLink.append("\">.").append(" See the Post").append("</a>");
break;
case MESSAGE:
actionLink.append("\">").append("Go to Message").append("</a>");
actionLink.append("\">.").append(" Go to Message").append("</a>");
break;
case WP_FOLDER_ADDEDUSER:
actionLink.append("\">").append("Go to Folder").append("</a>");
actionLink.append("\">.").append(" Go to Folder").append("</a>");
break;
case WP_FOLDER_REMOVEDUSER:
actionLink.append("\">").append("Go to Folder").append("</a>");
actionLink.append("\">.").append(" Go to Folder").append("</a>");
break;
case WP_FOLDER_SHARE:
actionLink.append("\">").append("Go to Folder").append("</a>");
actionLink.append("\">.").append(" Go to Folder").append("</a>");
break;
case WP_ITEM_NEW:
actionLink.append("\">").append("Go to Folder").append("</a>");
actionLink.append("\">.").append(" Go to Folder").append("</a>");
break;
case WP_ITEM_DELETE:
actionLink.append("\">").append("Go to Folder").append("</a>");
actionLink.append("\">.").append(" Go to Folder").append("</a>");
break;
case WP_ITEM_UPDATED:
actionLink.append("\">").append("Go to Folder").append("</a>");
actionLink.append("\">.").append(" Go to Folder").append("</a>");
break;
case OWN_COMMENT:
actionLink.append("\">").append("See the Post").append("</a>");
actionLink.append("\">.").append(" See the Post").append("</a>");
break;
case REQUEST_CONNECTION:
actionLink.append("\">").append("Go to Contacts Center").append("</a>");
actionLink.append("\">.").append(" Go to Contacts Center").append("</a>");
break;
case JOB_COMPLETED_NOK:
actionLink.append("\">").append("Go to Application").append("</a>");
actionLink.append("\">.").append(" Go to Application").append("</a>");
break;
case JOB_COMPLETED_OK:
actionLink.append("\">").append("Go to Application").append("</a>");
actionLink.append("\">.").append(" Go to Application").append("</a>");
break;
case DOCUMENT_WORKFLOW_EDIT:
actionLink.append("\">").append("Go to Document Workflow Manager").append("</a>");
actionLink.append("\">.").append(" Go to Document Workflow Manager").append("</a>");
break;
case DOCUMENT_WORKFLOW_VIEW:
actionLink.append("\">").append("Go to Document Workflow Manager").append("</a>");
actionLink.append("\">.").append(" Go to Document Workflow Manager").append("</a>");
break;
case DOCUMENT_WORKFLOW_STEP_REQUEST_TASK:
actionLink.append("\">").append("Go to Your Document Workflows").append("</a>");
actionLink.append("\">.").append(" Go to Your Document Workflows").append("</a>");
break;
case DOCUMENT_WORKFLOW_FIRST_STEP_REQUEST_INVOLVMENT:
actionLink.append("\">").append("Go to Your Document Workflows").append("</a>");
actionLink.append("\">.").append(" Go to Your Document Workflows").append("</a>");
break;
case DOCUMENT_WORKFLOW_USER_FORWARD_TO_OWNER:
actionLink.append("\">").append("Go to Document Workflow Manager").append("</a>");
actionLink.append("\">.").append(" Go to Document Workflow Manager").append("</a>");
break;
case DOCUMENT_WORKFLOW_STEP_FORWARD_PEER:
actionLink.append("\">").append("Go to Document Workflow Manager").append("</a>");
actionLink.append("\">.").append(" Go to Document Workflow Manager").append("</a>");
break;
case DOCUMENT_WORKFLOW_FORWARD_STEP_COMPLETED_OWNER:
actionLink.append("\">").append("Go to Document Workflow Manager").append("</a>");
actionLink.append("\">.").append(" Go to Document Workflow Manager").append("</a>");
break;
default:
actionLink.append("\">").append("").append("</a>");
actionLink.append("\">.").append("").append("</a>");
break;
}