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
This commit is contained in:
Massimiliano Assante 2013-01-29 15:24:44 +00:00
parent 65dff0aa7b
commit be78834fe2
2 changed files with 63 additions and 18 deletions

View File

@ -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);
}
}

View File

@ -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);
}