org.gcube.applicationsupportlayer.social
Class ApplicationNotificationsManager

java.lang.Object
  extended by org.gcube.applicationsupportlayer.social.SocialPortalBridge
      extended by org.gcube.applicationsupportlayer.social.ApplicationNotificationsManager
All Implemented Interfaces:
NotificationsManager

public class ApplicationNotificationsManager
extends SocialPortalBridge
implements NotificationsManager

Author:
Massimiliano Assante, ISTI-CNR use to notify users from within your application

Field Summary
 
Fields inherited from class org.gcube.applicationsupportlayer.social.SocialPortalBridge
applicationProfile, aslSession
 
Constructor Summary
ApplicationNotificationsManager(org.gcube.application.framework.core.session.ASLSession session)
          Use this constructor if you do not need notifications to point back to your applications
ApplicationNotificationsManager(org.gcube.application.framework.core.session.ASLSession session, String portletClassName)
          Use this constructor if you do need notifications to point back to your applications, make sure you create your application profile on the infrastructure.
 
Method Summary
 boolean notifyAddedItem(String userIdToNotify, org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceItem item, org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder sharedFolder)
          use to notify a user he got a workspace item new in some of his workspace shared folder
 boolean notifyCommentOnFavorite(String userIdToNotify, String feedid, String commentText)
          use to notify a user that someone commented on one of his favorite posts
 boolean notifyCommentReply(String userIdToNotify, String feedid, String commentText, String feedOwnerFullName)
          use to notify a user that commented on a post (Not his) that someone commented too
 boolean notifyDocumentWorkflowFirstStepRequest(String userIdToNotify, String documentWorkflowId, String documentName, String assignedRole)
          use to notify a document workflow user that a new Document Workflow was created and he is involved in the first step and he is requested to do a task
 boolean notifyDocumentWorkflowStepForwardComplete(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
 boolean notifyDocumentWorkflowTaskRequest(String userIdToNotify, String documentWorkflowId, String documentName, String assignedRoleName)
          use to notify a document workflow user (user that in the same document workflow) that he is requested to do a task
 boolean notifyDocumentWorkflowUpdate(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
 boolean notifyDocumentWorkflowUserForward(String userIdToNotify, String documentWorkflowId, String documentName, String fromStepName, String toStepName)
          use to notify a document workflow owner that a user performed a forward action to another step a document worflow he created
 boolean notifyDocumentWorkflowView(String userIdToNotify, String documentWorkflowId, String documentName)
          use to notify a document workflow owner that someone has viewed a document involved in a worflow he created
 boolean notifyFolderAddedUser(String userIdToNotify, org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder sharedFolder, String newAddedUserId)
          use to notify a user that a new user was added in on of his workspace shared folder
 boolean notifyFolderAddedUsers(String userIdToNotify, org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder sharedFolder, List<String> newAddedUserIds)
          use to notify a user that a new user was added in on of his workspace shared folder
 boolean notifyFolderRemovedUser(String userIdToNotify, org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder sharedFolder)
          use to notify a user that an existing user was removed from one of his workspace shared folder
 boolean notifyFolderRenaming(String userIdToNotify, String previousName, String newName, String renamedFolderId)
          use to notify a user he got a workspace folder renamed
 boolean notifyFolderSharing(String userIdToNotify, org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder sharedFolder)
          use to notify a user he got a workspace folder shared
 boolean notifyItemRenaming(String userIdToNotify, String previousName, org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceItem renamedItem)
          use to notify a user he got a workspace item renamed
 boolean notifyJobStatus(String userIdToNotify, org.gcube.portal.databook.shared.ApplicationProfile executingJobApId, org.gcube.portal.databook.shared.RunningJob job)
          use to notify a user he got one of his job finished
 boolean notifyLikedFeed(String userIdToNotify, String feedid, String feedText)
          use to notify a user he got one of his post liked
 boolean notifyMessageReceived(String userIdToNotify, String subject)
          
 boolean notifyOwnCommentReply(String userIdToNotify, String feedid, String feedText)
          use to notify a user that someone commented on his post
 boolean notifyRemovedItem(String userIdToNotify, org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceItem item, org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder sharedFolder)
          use to notify a user he got a workspace item deleted from one of his workspace shared folder
 boolean notifyUpdatedItem(String userIdToNotify, org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceItem item, org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder sharedFolder)
          use to notify a user he got a workspace item updated from one of his workspace shared folder
 boolean notifyUserTag(String userIdToNotify, String feedid, String feedText)
          use to notify a user that he was mentioned (tagged) on a post
 
Methods inherited from class org.gcube.applicationsupportlayer.social.SocialPortalBridge
escapeHtml, getApplicationProfile, getScopeByOrganizationId, getStoreInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationNotificationsManager

public ApplicationNotificationsManager(org.gcube.application.framework.core.session.ASLSession session)
Use this constructor if you do not need notifications to point back to your applications

Parameters:
aslSession - the ASLSession instance

ApplicationNotificationsManager

public ApplicationNotificationsManager(org.gcube.application.framework.core.session.ASLSession session,
                                       String portletClassName)
Use this constructor if you do need notifications to point back to your applications, make sure you create your application profile on the infrastructure.

Parameters:
aslSession - the ASLSession instance
portletClassName - your portlet class name will be used ad unique identifier for your applicationProfile
See Also:
http://gcube.wiki.gcube-system.org/gcube/index.php/Social_Networking_Library#Create_Your_Application_Profile
Method Detail

notifyFolderSharing

public boolean notifyFolderSharing(String userIdToNotify,
                                   org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder sharedFolder)
                            throws org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException
use to notify a user he got a workspace folder shared

Specified by:
notifyFolderSharing in interface NotificationsManager
Parameters:
userIdToNotify - the user you want to notify
sharedFolder - the shared WorkspaceFolder
Returns:
true if the notification is correctly delivered, false otherwise
Throws:
org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException

notifyFolderRenaming

public boolean notifyFolderRenaming(String userIdToNotify,
                                    String previousName,
                                    String newName,
                                    String renamedFolderId)
                             throws org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException
use to notify a user he got a workspace folder renamed

Specified by:
notifyFolderRenaming in interface NotificationsManager
Parameters:
userIdToNotify - the user you want to notify
previousName - the previous name of the folder
newName - the new name of the folder
renamedFolderId - the folderId
Returns:
true if the notification is correctly delivered, false otherwise
Throws:
org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException

notifyFolderAddedUser

public boolean notifyFolderAddedUser(String userIdToNotify,
                                     org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder sharedFolder,
                                     String newAddedUserId)
                              throws org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException,
                                     org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException,
                                     org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault,
                                     org.gcube.vomanagement.usermanagement.exception.UserManagementPortalException
use to notify a user that a new user was added in on of his workspace shared folder

Specified by:
notifyFolderAddedUser in interface NotificationsManager
Parameters:
userIdToNotify - the user you want to notify
sharedFolder - the shared WorkspaceFolder
newAddedUserId - the new user that was added
Returns:
true if the notification is correctly delivered, false otherwise
Throws:
org.gcube.vomanagement.usermanagement.exception.UserManagementPortalException
org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault
org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException
org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException

notifyFolderAddedUsers

public boolean notifyFolderAddedUsers(String userIdToNotify,
                                      org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder sharedFolder,
                                      List<String> newAddedUserIds)
                               throws org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException,
                                      org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException,
                                      org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault,
                                      org.gcube.vomanagement.usermanagement.exception.UserManagementPortalException
use to notify a user that a new user was added in on of his workspace shared folder

Specified by:
notifyFolderAddedUsers in interface NotificationsManager
Parameters:
userIdToNotify - the user you want to notify
sharedFolder - the shared WorkspaceFolder
newAddedUserIds - List of new users that were added
Returns:
true if the notification is correctly delivered, false otherwise
Throws:
org.gcube.vomanagement.usermanagement.exception.UserManagementPortalException
org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault
org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException
org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException

notifyFolderRemovedUser

public boolean notifyFolderRemovedUser(String userIdToNotify,
                                       org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder sharedFolder)
                                throws org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException,
                                       org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException,
                                       org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault,
                                       org.gcube.vomanagement.usermanagement.exception.UserManagementPortalException
use to notify a user that an existing user was removed from one of his workspace shared folder

Specified by:
notifyFolderRemovedUser in interface NotificationsManager
Parameters:
userIdToNotify - the user you want to notify
sharedFolder - the shared WorkspaceFolder
Returns:
true if the notification is correctly delivered, false otherwise
Throws:
org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException
org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException
org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault
org.gcube.vomanagement.usermanagement.exception.UserManagementPortalException

notifyAddedItem

public boolean notifyAddedItem(String userIdToNotify,
                               org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceItem item,
                               org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder sharedFolder)
                        throws org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException
use to notify a user he got a workspace item new in some of his workspace shared folder

Specified by:
notifyAddedItem in interface NotificationsManager
Parameters:
userIdToNotify - the user you want to notify
sharedFolder - the shared folder WorkspaceFolder
Returns:
true if the notification is correctly delivered, false otherwise
Throws:
org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException

notifyRemovedItem

public boolean notifyRemovedItem(String userIdToNotify,
                                 org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceItem item,
                                 org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder sharedFolder)
                          throws org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException
use to notify a user he got a workspace item deleted from one of his workspace shared folder

Specified by:
notifyRemovedItem in interface NotificationsManager
Parameters:
userIdToNotify - the user you want to notify
sharedFolder - the shared folder WorkspaceFolder
Returns:
true if the notification is correctly delivered, false otherwise
Throws:
org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException

notifyUpdatedItem

public boolean notifyUpdatedItem(String userIdToNotify,
                                 org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceItem item,
                                 org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder sharedFolder)
                          throws org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException
use to notify a user he got a workspace item updated from one of his workspace shared folder

Specified by:
notifyUpdatedItem in interface NotificationsManager
Parameters:
userIdToNotify - the user you want to notify
sharedFolder - the shared folder WorkspaceFolder
Returns:
true if the notification is correctly delivered, false otherwise
Throws:
org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException

notifyItemRenaming

public boolean notifyItemRenaming(String userIdToNotify,
                                  String previousName,
                                  org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceItem renamedItem)
                           throws org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException
use to notify a user he got a workspace item renamed

Specified by:
notifyItemRenaming in interface NotificationsManager
Parameters:
userIdToNotify - the user you want to notify
previousName - the previous name of the folder
renamedItem - the renamed WorkspaceItem
Returns:
true if the notification is correctly delivered, false otherwise
Throws:
org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException

notifyMessageReceived

public boolean notifyMessageReceived(String userIdToNotify,
                                     String subject)

Specified by:
notifyMessageReceived in interface NotificationsManager
Parameters:
userIdToNotify - the user you want to notify
subject - the subject of the message sent
Returns:
true if the notification is correctly delivered, false otherwise

notifyOwnCommentReply

public boolean notifyOwnCommentReply(String userIdToNotify,
                                     String feedid,
                                     String feedText)
use to notify a user that someone commented on his post

Specified by:
notifyOwnCommentReply in interface NotificationsManager
Parameters:
userIdToNotify - the user you want to notify
feedid - the liked feedid
feedText - the liked feed text or a portion of it
Returns:
true if the notification is correctly delivered, false otherwise

notifyCommentReply

public boolean notifyCommentReply(String userIdToNotify,
                                  String feedid,
                                  String commentText,
                                  String feedOwnerFullName)
use to notify a user that commented on a post (Not his) that someone commented too

Specified by:
notifyCommentReply in interface NotificationsManager
Parameters:
userIdToNotify - the user you want to notify
feedid - the liked feedid
commentText - the liked feed text or a portion of it
feedOwnerFullName - the full name of the user who created this post
Returns:
true if the notification is correctly delivered, false otherwise

notifyCommentOnFavorite

public boolean notifyCommentOnFavorite(String userIdToNotify,
                                       String feedid,
                                       String commentText)
use to notify a user that someone commented on one of his favorite posts

Specified by:
notifyCommentOnFavorite in interface NotificationsManager
Parameters:
userIdToNotify - the user you want to notify
feedid - the liked feedid
commentText - the commentText
Returns:
true if the notification is correctly delivered, false otherwise

notifyUserTag

public boolean notifyUserTag(String userIdToNotify,
                             String feedid,
                             String feedText)
use to notify a user that he was mentioned (tagged) on a post

Specified by:
notifyUserTag in interface NotificationsManager
Parameters:
userIdToNotify - the user you want to notify
feedid - the liked feedid
Returns:
true if the notification is correctly delivered, false otherwise

notifyLikedFeed

public boolean notifyLikedFeed(String userIdToNotify,
                               String feedid,
                               String feedText)
use to notify a user he got one of his post liked

Specified by:
notifyLikedFeed in interface NotificationsManager
Parameters:
userIdToNotify - the user you want to notify
feedid - the liked feedid
feedText - the liked feed text or a portion of it
Returns:
true if the notification is correctly delivered, false otherwise

notifyJobStatus

public boolean notifyJobStatus(String userIdToNotify,
                               org.gcube.portal.databook.shared.ApplicationProfile executingJobApId,
                               org.gcube.portal.databook.shared.RunningJob job)
use to notify a user he got one of his job finished

Specified by:
notifyJobStatus in interface NotificationsManager
Parameters:
userIdToNotify - the user you want to notify
Returns:
true if the notification is correctly delivered, false otherwise

notifyDocumentWorkflowView

public boolean notifyDocumentWorkflowView(String userIdToNotify,
                                          String documentWorkflowId,
                                          String documentName)
use to notify a document workflow owner that someone has viewed a document involved in a worflow he created

Specified by:
notifyDocumentWorkflowView in interface NotificationsManager
Parameters:
userIdToNotify - the user you want to notify
documentName - the document title
Returns:
true if the notification is correctly delivered, false otherwise

notifyDocumentWorkflowUpdate

public boolean notifyDocumentWorkflowUpdate(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

Specified by:
notifyDocumentWorkflowUpdate in interface NotificationsManager
Parameters:
userIdToNotify - the user you want to notify
documentName - the document title
Returns:
true if the notification is correctly delivered, false otherwise

notifyDocumentWorkflowTaskRequest

public boolean notifyDocumentWorkflowTaskRequest(String userIdToNotify,
                                                 String documentWorkflowId,
                                                 String documentName,
                                                 String assignedRoleName)
use to notify a document workflow user (user that in the same document workflow) that he is requested to do a task

Specified by:
notifyDocumentWorkflowTaskRequest in interface NotificationsManager
Parameters:
userIdToNotify - the user you want to notify
documentName - the document title
Returns:
true if the notification is correctly delivered, false otherwise

notifyDocumentWorkflowUserForward

public boolean notifyDocumentWorkflowUserForward(String userIdToNotify,
                                                 String documentWorkflowId,
                                                 String documentName,
                                                 String fromStepName,
                                                 String toStepName)
use to notify a document workflow owner that a user performed a forward action to another step a document worflow he created

Specified by:
notifyDocumentWorkflowUserForward in interface NotificationsManager
Parameters:
userIdToNotify - the owner of this document workflow
fromStepName - the name of the step from which the user performed the forward
toStepName - the name of the step to which the user performed the forward
Returns:
true if the notification is correctly delivered, false otherwise

notifyDocumentWorkflowStepForwardComplete

public boolean notifyDocumentWorkflowStepForwardComplete(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

Specified by:
notifyDocumentWorkflowStepForwardComplete in interface NotificationsManager
Parameters:
userIdToNotify - the owner of this document workflow
fromStepName - the name of the step from which the user performed the forward
toStepName - the name of the step to which the user performed the forward
Returns:
true if the notification is correctly delivered, false otherwise

notifyDocumentWorkflowFirstStepRequest

public boolean notifyDocumentWorkflowFirstStepRequest(String userIdToNotify,
                                                      String documentWorkflowId,
                                                      String documentName,
                                                      String assignedRole)
use to notify a document workflow user that a new Document Workflow was created and he is involved in the first step and he is requested to do a task

Specified by:
notifyDocumentWorkflowFirstStepRequest in interface NotificationsManager
Parameters:
userIdToNotify - the user you want to notify
documentName - the document title
Returns:
true if the notification is correctly delivered, false otherwise


Copyright © 2013. All Rights Reserved.