From 806ba670d24ef6096a782ed74ee57422b342b966 Mon Sep 17 00:00:00 2001 From: "massimiliano.assante" Date: Mon, 28 Jan 2013 00:12:51 +0000 Subject: [PATCH] added the document workflow edit and view notifications git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@68414 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../ApplicationNotificationsManager.java | 42 +++++++++++++++++++ .../social/NotificationsManager.java | 39 ++++++++++++++++- 2 files changed, 79 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java b/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java index 7791d4c..703c1ad 100644 --- a/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java +++ b/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java @@ -244,11 +244,53 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen aslSession.getUserAvatarId()); return getStoreInstance().saveNotification(not); } + /** + * {@inheritDoc} + */ @Override public boolean notifyJobStatus(String userIdToNotify, ApplicationProfile executingJobApId, RunningJob job) { //TODO: missing implementation return false; } + /** + * {@inheritDoc} + */ + @Override + public boolean notifyDocumentWorkflowView(String userIdToNotify, String documentWorkflowId, String documentName) { + Notification not = new Notification( + UUID.randomUUID().toString(), + NotificationType.DOCUMENT_WORKFLOW_VIEW, + userIdToNotify, //user no notify + documentWorkflowId, //the workflowid + new Date(), + "?oid="+documentWorkflowId, + "has viewed the document workflow with name: " + escapeHtml(documentName), + false, + aslSession.getUsername(), + aslSession.getUserFullName(), + aslSession.getUserAvatarId()); + return getStoreInstance().saveNotification(not); + } + /** + * {@inheritDoc} + */ + @Override + public boolean notifyDocumentWorkflowUpdate(String userIdToNotify, String documentWorkflowId, String documentName) { + Notification not = new Notification( + UUID.randomUUID().toString(), + NotificationType.DOCUMENT_WORKFLOW_EDIT, + userIdToNotify, //user no notify + documentWorkflowId, //the workflowid + new Date(), + "?oid="+documentWorkflowId, + "has edited the document workflow with name: " + escapeHtml(documentName), + false, + aslSession.getUsername(), + aslSession.getUserFullName(), + aslSession.getUserAvatarId()); + return getStoreInstance().saveNotification(not); + } + diff --git a/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java b/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java index 8cc4533..4b84335 100644 --- a/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java +++ b/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java @@ -1,8 +1,6 @@ package org.gcube.applicationsupportlayer.social; import org.gcube.portal.databook.shared.ApplicationProfile; -import org.gcube.portal.databook.shared.Comment; -import org.gcube.portal.databook.shared.Feed; import org.gcube.portal.databook.shared.RunningJob; import org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder; import org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceItem; @@ -101,5 +99,42 @@ public interface NotificationsManager { * @return true if the notification is correctly delivered, false otherwise */ boolean notifyJobStatus(String userIdToNotify, ApplicationProfile executingJobApId, RunningJob job); + /** + * use to notify a document workflow owner that someone + * has viewed a document involved in a worflow he created + * @param userIdToNotify the user you want to notify + * @param documentName the document title + * @param documentid the id of the document workflow + * @param documentName the documentName + * @return + */ + boolean notifyDocumentWorkflowView(String userIdToNotify, String documentWorkflowId, String documentName); + /** + * use to notify a document workflow owner that someone + * has updated a document involved in a worflow he created + * @param userIdToNotify the user you want to notify + * @param documentName the document title + * @param documentid the id of the document workflow + * @param documentName the documentName + * @return + */ + boolean notifyDocumentWorkflowUpdate(String userIdToNotify, String documentWorkflowId, String documentName); +// +// DOCUMENT_WORKFLOW_VIEW, +// /** +// * use to notify a document workflow owner that someone +// * has forwarded to another step a document worflow he created +// */ +// DOCUMENT_WORKFLOW_STEP_FORWARD_OWNER, +// /** +// * use to notify a document workflow peer (user that in the same step has your same role) +// * that someone has forwarded to another step a document worflow he was involved into +// */ +// DOCUMENT_WORKFLOW_STEP_FORWARD_PEER, +// /** +// * use to notify a document workflow user (user that in the same document workflow) +// * that forwarded to a step where he is requested to do a task +// */ +// DOCUMENT_WORKFLOW_STEP_REQUEST_TASK, }