open app related for document workflow edit or uptade

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@68452 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-01-29 01:09:00 +00:00
parent de27602d90
commit 65dff0aa7b
1 changed files with 25 additions and 19 deletions

View File

@ -61,6 +61,15 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
_log.error("While trying to save Notification"); _log.error("While trying to save Notification");
return result; return result;
} }
/**
* return the url of the application if exists in the profile
* @return .
*/
private String getApplicationUrl() {
if (applicationProfile != null && applicationProfile.getUrl() != null)
return applicationProfile.getUrl();
else return "";
}
/** /**
* {@inheritDoc} * {@inheritDoc}
* @throws InternalErrorException * @throws InternalErrorException
@ -104,7 +113,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);
} }
/** /**
@ -126,7 +135,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);
} }
/** /**
@ -147,7 +156,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);
} }
/** /**
@ -168,7 +177,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);
} }
/** /**
@ -189,7 +198,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);
} }
/** /**
@ -277,8 +286,8 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
userIdToNotify, //user no notify userIdToNotify, //user no notify
documentWorkflowId, //the workflowid documentWorkflowId, //the workflowid
new Date(), new Date(),
"?oid="+documentWorkflowId, getApplicationUrl()+"?oid="+documentWorkflowId,
"has viewed a document workflow you created (" + escapeHtml(documentName) + ")", "has viewed a document workflow you created (" + escapeHtml(documentName) + ").",
false, false,
aslSession.getUsername(), aslSession.getUsername(),
aslSession.getUserFullName(), aslSession.getUserFullName(),
@ -290,14 +299,15 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
*/ */
@Override @Override
public boolean notifyDocumentWorkflowUpdate(String userIdToNotify, String documentWorkflowId, String documentName) { public boolean notifyDocumentWorkflowUpdate(String userIdToNotify, String documentWorkflowId, String documentName) {
Notification not = new Notification( Notification not = new Notification(
UUID.randomUUID().toString(), UUID.randomUUID().toString(),
NotificationType.DOCUMENT_WORKFLOW_EDIT, NotificationType.DOCUMENT_WORKFLOW_EDIT,
userIdToNotify, //user no notify userIdToNotify, //user no notify
documentWorkflowId, //the workflowid documentWorkflowId, //the workflowid
new Date(), new Date(),
"?oid="+documentWorkflowId, getApplicationUrl()+"?oid="+documentWorkflowId,
"has edited a document workflow you created (" + escapeHtml(documentName) + ")", "has edited a document workflow you created (" + escapeHtml(documentName) + ").",
false, false,
aslSession.getUsername(), aslSession.getUsername(),
aslSession.getUserFullName(), aslSession.getUserFullName(),
@ -315,19 +325,15 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
userIdToNotify, //user no notify userIdToNotify, //user no notify
documentWorkflowId, //the workflowid documentWorkflowId, //the workflowid
new Date(), new Date(),
"?oid="+documentWorkflowId, getApplicationUrl()+"?oid="+documentWorkflowId,
"has involved you in a Document Workflow (" + escapeHtml(documentName) + ") " + "has involved you in a Document Workflow (" + escapeHtml(documentName) + ") " +
"and has assigned you the role: " + assignedRoleName +". On " + aslSession.getGroupName() + " Virtual Research Environment. ", "and has assigned you the role: " + assignedRoleName +". On " + aslSession.getGroupName() + " Virtual Research Environment. ",
false, false,
aslSession.getUsername(), aslSession.getUsername(),
aslSession.getUserFullName(), aslSession.getUserFullName(),
aslSession.getUserAvatarId()); aslSession.getUserAvatarId());
return saveNotification(not); return saveNotification(not);
} }
} }