added logs for result of notification

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@68442 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-01-28 22:30:54 +00:00
parent a10cb1073f
commit 1a6b289d0c
1 changed files with 34 additions and 15 deletions

View File

@ -47,6 +47,20 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
public ApplicationNotificationsManager(ASLSession session, String portletClassName) {
super(session, portletClassName);
}
/**
* actually save the notification to the store
* @param notification2Save the notification instance to save
* @return true if the notification was sent ok
*/
private boolean saveNotification(Notification notification2Save) {
_log.trace("Trying to send notification to: " + notification2Save.getUserid() + " Type: " + notification2Save.getType());
boolean result = getStoreInstance().saveNotification(notification2Save);
if (result)
_log.trace("Notification Saved Successfully! ");
else
_log.error("While trying to save Notification");
return result;
}
/**
* {@inheritDoc}
* @throws InternalErrorException
@ -66,7 +80,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
aslSession.getUserFullName(),
aslSession.getUserAvatarId());
return getStoreInstance().saveNotification(not);
return saveNotification(not);
}
/**
* {@inheritDoc}
@ -91,7 +105,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
aslSession.getUserFullName(),
aslSession.getUserAvatarId());
return getStoreInstance().saveNotification(not);
return saveNotification(not);
}
/**
* {@inheritDoc}
@ -113,7 +127,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
aslSession.getUserFullName(),
aslSession.getUserAvatarId());
return getStoreInstance().saveNotification(not);
return saveNotification(not);
}
/**
* {@inheritDoc}
@ -134,7 +148,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
aslSession.getUserFullName(),
aslSession.getUserAvatarId());
return getStoreInstance().saveNotification(not);
return saveNotification(not);
}
/**
* {@inheritDoc}
@ -155,7 +169,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
aslSession.getUserFullName(),
aslSession.getUserAvatarId());
return getStoreInstance().saveNotification(not);
return saveNotification(not);
}
/**
* {@inheritDoc}
@ -176,7 +190,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
aslSession.getUserFullName(),
aslSession.getUserAvatarId());
return getStoreInstance().saveNotification(not);
return saveNotification(not);
}
/**
* {@inheritDoc}
@ -196,7 +210,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
aslSession.getUserFullName(),
aslSession.getUserAvatarId());
return getStoreInstance().saveNotification(not);
return saveNotification(not);
}
/**
* {@inheritDoc}
@ -215,7 +229,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
aslSession.getUsername(),
aslSession.getUserFullName(),
aslSession.getUserAvatarId());
return getStoreInstance().saveNotification(not);
return saveNotification(not);
}
/**
* {@inheritDoc}
@ -242,7 +256,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
aslSession.getUsername(),
aslSession.getUserFullName(),
aslSession.getUserAvatarId());
return getStoreInstance().saveNotification(not);
return saveNotification(not);
}
/**
* {@inheritDoc}
@ -269,7 +283,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
aslSession.getUsername(),
aslSession.getUserFullName(),
aslSession.getUserAvatarId());
return getStoreInstance().saveNotification(not);
return saveNotification(not);
}
/**
* {@inheritDoc}
@ -288,8 +302,11 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
aslSession.getUsername(),
aslSession.getUserFullName(),
aslSession.getUserAvatarId());
return getStoreInstance().saveNotification(not);
return saveNotification(not);
}
/**
* {@inheritDoc}
*/
@Override
public boolean notifyDocumentWorkflowTaskRequest(String userIdToNotify, String documentWorkflowId, String documentName, String assignedRoleName) {
Notification not = new Notification(
@ -299,16 +316,18 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
documentWorkflowId, //the workflowid
new Date(),
"?oid="+documentWorkflowId,
"has involved you on the document workflow with name: " + escapeHtml(documentName) + " " +
"and has assigned you the following role: " + assignedRoleName +". The VRE used was " + aslSession.getGroupName(),
"has involved you in a Document Workflow (" + escapeHtml(documentName) + ") " +
"and has assigned you the role: " + assignedRoleName +". The VRE used was " + aslSession.getGroupName(),
false,
aslSession.getUsername(),
aslSession.getUserFullName(),
aslSession.getUserAvatarId());
return getStoreInstance().saveNotification(not);
return saveNotification(not);
}
}