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:
parent
a10cb1073f
commit
1a6b289d0c
|
@ -47,6 +47,20 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
public ApplicationNotificationsManager(ASLSession session, String portletClassName) {
|
public ApplicationNotificationsManager(ASLSession session, String portletClassName) {
|
||||||
super(session, 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}
|
* {@inheritDoc}
|
||||||
* @throws InternalErrorException
|
* @throws InternalErrorException
|
||||||
|
@ -66,7 +80,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
aslSession.getUserFullName(),
|
aslSession.getUserFullName(),
|
||||||
aslSession.getUserAvatarId());
|
aslSession.getUserAvatarId());
|
||||||
|
|
||||||
return getStoreInstance().saveNotification(not);
|
return saveNotification(not);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -91,7 +105,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
aslSession.getUserFullName(),
|
aslSession.getUserFullName(),
|
||||||
aslSession.getUserAvatarId());
|
aslSession.getUserAvatarId());
|
||||||
|
|
||||||
return getStoreInstance().saveNotification(not);
|
return saveNotification(not);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -113,7 +127,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
aslSession.getUserFullName(),
|
aslSession.getUserFullName(),
|
||||||
aslSession.getUserAvatarId());
|
aslSession.getUserAvatarId());
|
||||||
|
|
||||||
return getStoreInstance().saveNotification(not);
|
return saveNotification(not);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -134,7 +148,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
aslSession.getUserFullName(),
|
aslSession.getUserFullName(),
|
||||||
aslSession.getUserAvatarId());
|
aslSession.getUserAvatarId());
|
||||||
|
|
||||||
return getStoreInstance().saveNotification(not);
|
return saveNotification(not);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -155,7 +169,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
aslSession.getUserFullName(),
|
aslSession.getUserFullName(),
|
||||||
aslSession.getUserAvatarId());
|
aslSession.getUserAvatarId());
|
||||||
|
|
||||||
return getStoreInstance().saveNotification(not);
|
return saveNotification(not);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -176,7 +190,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
aslSession.getUserFullName(),
|
aslSession.getUserFullName(),
|
||||||
aslSession.getUserAvatarId());
|
aslSession.getUserAvatarId());
|
||||||
|
|
||||||
return getStoreInstance().saveNotification(not);
|
return saveNotification(not);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -196,7 +210,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
aslSession.getUserFullName(),
|
aslSession.getUserFullName(),
|
||||||
aslSession.getUserAvatarId());
|
aslSession.getUserAvatarId());
|
||||||
|
|
||||||
return getStoreInstance().saveNotification(not);
|
return saveNotification(not);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -215,7 +229,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
aslSession.getUsername(),
|
aslSession.getUsername(),
|
||||||
aslSession.getUserFullName(),
|
aslSession.getUserFullName(),
|
||||||
aslSession.getUserAvatarId());
|
aslSession.getUserAvatarId());
|
||||||
return getStoreInstance().saveNotification(not);
|
return saveNotification(not);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -242,7 +256,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
aslSession.getUsername(),
|
aslSession.getUsername(),
|
||||||
aslSession.getUserFullName(),
|
aslSession.getUserFullName(),
|
||||||
aslSession.getUserAvatarId());
|
aslSession.getUserAvatarId());
|
||||||
return getStoreInstance().saveNotification(not);
|
return saveNotification(not);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -269,7 +283,7 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
aslSession.getUsername(),
|
aslSession.getUsername(),
|
||||||
aslSession.getUserFullName(),
|
aslSession.getUserFullName(),
|
||||||
aslSession.getUserAvatarId());
|
aslSession.getUserAvatarId());
|
||||||
return getStoreInstance().saveNotification(not);
|
return saveNotification(not);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -288,8 +302,11 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
aslSession.getUsername(),
|
aslSession.getUsername(),
|
||||||
aslSession.getUserFullName(),
|
aslSession.getUserFullName(),
|
||||||
aslSession.getUserAvatarId());
|
aslSession.getUserAvatarId());
|
||||||
return getStoreInstance().saveNotification(not);
|
return saveNotification(not);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean notifyDocumentWorkflowTaskRequest(String userIdToNotify, String documentWorkflowId, String documentName, String assignedRoleName) {
|
public boolean notifyDocumentWorkflowTaskRequest(String userIdToNotify, String documentWorkflowId, String documentName, String assignedRoleName) {
|
||||||
Notification not = new Notification(
|
Notification not = new Notification(
|
||||||
|
@ -299,16 +316,18 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
|
||||||
documentWorkflowId, //the workflowid
|
documentWorkflowId, //the workflowid
|
||||||
new Date(),
|
new Date(),
|
||||||
"?oid="+documentWorkflowId,
|
"?oid="+documentWorkflowId,
|
||||||
"has involved you on the document workflow with name: " + escapeHtml(documentName) + " " +
|
"has involved you in a Document Workflow (" + escapeHtml(documentName) + ") " +
|
||||||
"and has assigned you the following role: " + assignedRoleName +". The VRE used was " + aslSession.getGroupName(),
|
"and has assigned you the role: " + assignedRoleName +". The VRE used was " + aslSession.getGroupName(),
|
||||||
false,
|
false,
|
||||||
aslSession.getUsername(),
|
aslSession.getUsername(),
|
||||||
aslSession.getUserFullName(),
|
aslSession.getUserFullName(),
|
||||||
aslSession.getUserAvatarId());
|
aslSession.getUserAvatarId());
|
||||||
return getStoreInstance().saveNotification(not);
|
|
||||||
|
return saveNotification(not);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue