From be78834fe2c088067349a3ed3327a880ee4a3db4 Mon Sep 17 00:00:00 2001 From: "massimiliano.assante" Date: Tue, 29 Jan 2013 15:24:44 +0000 Subject: [PATCH] added new notification Types git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@68503 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../ApplicationNotificationsManager.java | 42 +++++++++++++++++++ .../social/NotificationsManager.java | 39 +++++++++-------- 2 files changed, 63 insertions(+), 18 deletions(-) diff --git a/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java b/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java index acd013b..21d501d 100644 --- a/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java +++ b/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java @@ -336,4 +336,46 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen return saveNotification(not); } + /** + * {@inheritDoc} + */ + @Override + public boolean notifyDocumentWorkflowUserForward(String userIdToNotify, String documentWorkflowId, String documentName, String fromStepName, String toStepName){ + Notification not = new Notification( + UUID.randomUUID().toString(), + NotificationType.DOCUMENT_WORKFLOW_USER_FORWARD_TO_OWNER, + userIdToNotify, //user no notify + documentWorkflowId, //the workflowid + new Date(), + getApplicationUrl()+"?oid="+documentWorkflowId, + "has forwarded a document workflow you created (" + escapeHtml(documentName) + ") " + + "from step " + fromStepName + " towards step " + toStepName +". On " + aslSession.getGroupName() + " Virtual Research Environment. ", + false, + aslSession.getUsername(), + aslSession.getUserFullName(), + aslSession.getUserAvatarId()); + + return saveNotification(not); + } + /** + * {@inheritDoc} + */ + @Override + public boolean notifyDocumentWorkflowStepForwardComplete(String userIdToNotify, String documentWorkflowId, String documentName, String fromStepName, String toStepName) { + Notification not = new Notification( + UUID.randomUUID().toString(), + NotificationType.DOCUMENT_WORKFLOW_FORWARD_STEP_COMPLETED_OWNER, + userIdToNotify, //user no notify + documentWorkflowId, //the workflowid + new Date(), + getApplicationUrl()+"?oid="+documentWorkflowId, + "has performed the last needed forward a document workflow you created (" + escapeHtml(documentName) + "). " + + "Consequently, this Document Workflow moved from step " + fromStepName + " to step " + toStepName +". On " + aslSession.getGroupName() + " Virtual Research Environment. ", + false, + aslSession.getUsername(), + aslSession.getUserFullName(), + aslSession.getUserAvatarId()); + + return 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 84b2e2d..3708d49 100644 --- a/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java +++ b/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java @@ -126,22 +126,25 @@ public interface NotificationsManager { * @return true if the notification is correctly delivered, false otherwise */ boolean notifyDocumentWorkflowTaskRequest(String userIdToNotify, String documentWorkflowId, String documentName, String assignedRole); - // - // 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, - + /** + * use to notify a document workflow owner that a user performed a forward action to another step a document worflow he created + * @param userIdToNotify the owner of this document workflow + * @param documentWorkflowId + * @param documentName + * @param fromStepName the name of the step from which the user performed the forward + * @param toStepName the name of the step to which the user performed the forward + * @return true if the notification is correctly delivered, false otherwise + */ + boolean notifyDocumentWorkflowUserForward(String userIdToNotify, String documentWorkflowId, String documentName, String fromStepName, String toStepName); + /** + * use to notify a document workflow owner that someone forwarded and the workflow moved to another step a document worflow he created + * @param userIdToNotify the owner of this document workflow + * @param documentWorkflowId + * @param documentName + * @param fromStepName the name of the step from which the user performed the forward + * @param toStepName the name of the step to which the user performed the forward + * @return true if the notification is correctly delivered, false otherwise + */ + boolean notifyDocumentWorkflowStepForwardComplete(String userIdToNotify, String documentWorkflowId, String documentName, String fromStepName, String toStepName); + }