Class ApplicationNotificationsManager

    • Constructor Detail

      • ApplicationNotificationsManager

        public ApplicationNotificationsManager​(SocialNetworkingSite site,
                                               String scope,
                                               SocialNetworkingUser currUser)

        Use this constructor if you do not need notifications to point back to your applications

        Parameters:
        scope - the current scope
        currUser - an instance of SocialNetworkingUser filled with the required user data
        site - an instance of SocialNetworkingSite filled with the required data
      • ApplicationNotificationsManager

        public ApplicationNotificationsManager​(org.gcube.vomanagement.usermanagement.UserManager userManager,
                                               SocialNetworkingSite site,
                                               String scope,
                                               SocialNetworkingUser currUser)

        Use this constructor if your artifact is not deployed on the portal and do not need notifications to point back to your applications

        Parameters:
        userManager - a remote implementation of UserManager,see LiferayWSUserManager
        site - an instance of SocialNetworkingSite filled with the required data
        scope - the current scope
        currUser - an instance of SocialNetworkingUser filled with the required user data
      • ApplicationNotificationsManager

        public ApplicationNotificationsManager​(SocialNetworkingSite site,
                                               String scope,
                                               SocialNetworkingUser currUser,
                                               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:
        scope - the current scope
        currUser - an instance of SocialNetworkingUser filled with the required user data
        site - an instance of SocialNetworkingSite filled with the required data
        portletClassName - your portlet class name will be used ad unique identifier for your applicationProfile
      • ApplicationNotificationsManager

        public ApplicationNotificationsManager​(org.gcube.vomanagement.usermanagement.UserManager userManager,
                                               SocialNetworkingSite site,
                                               String scope,
                                               SocialNetworkingUser currUser,
                                               String portletClassName)

        Use this constructor if your artifact is not deployed on the portal and you do need notifications to point back to your applications, make sure you create your application profile on the infrastructure.

        Parameters:
        userManager - a remote implementation of UserManager,see LiferayWSUserManager
        scope - the current scope
        currUser - an instance of SocialNetworkingUser filled with the required user data
        site - an instance of SocialNetworkingSite filled with the required data
        portletClassName - your portlet class name will be used ad unique identifier for your applicationProfile
    • Method Detail

      • notifyFolderSharing

        public boolean notifyFolderSharing​(String userIdToNotify,
                                           SocialSharedFolder sharedFolder)
        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 SocialSharedFolder instance
        Returns:
        true if the notification is correctly delivered, false otherwise
        Throws:
        InternalErrorException
      • notifyFolderUnsharing

        public boolean notifyFolderUnsharing​(String userIdToNotify,
                                             String unsharedFolderId,
                                             String unsharedFolderName)
                                      throws Exception
        use to notify a user he got a workspace folder shared
        Specified by:
        notifyFolderUnsharing in interface NotificationsManager
        Parameters:
        userIdToNotify - the user you want to notify
        unsharedFolderId - the unshared folder id
        unsharedFolderName - the unshared folder name
        Returns:
        true if the notification is correctly delivered, false otherwise
        Throws:
        Exception
      • notifyFolderRenaming

        public boolean notifyFolderRenaming​(String userIdToNotify,
                                            String previousName,
                                            String newName,
                                            String renamedFolderId)
        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:
        InternalErrorException
      • notifyFolderAddedUser

        @Deprecated
        public boolean notifyFolderAddedUser​(String userIdToNotify,
                                             SocialSharedFolder sharedFolder,
                                             String newAddedUserId)
                                      throws org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException,
                                             org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault,
                                             org.gcube.vomanagement.usermanagement.exception.UserManagementPortalException
        Deprecated.
        Specified by:
        notifyFolderAddedUser in interface NotificationsManager
        Throws:
        org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException
        org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault
        org.gcube.vomanagement.usermanagement.exception.UserManagementPortalException
      • notifyFolderAddedUser

        public boolean notifyFolderAddedUser​(String userIdToNotify,
                                             SocialSharedFolder sharedFolder,
                                             String newAddedUserId,
                                             org.gcube.vomanagement.usermanagement.UserManager um)
                                      throws 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 SocialSharedFolder instance
        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
      • notifyFolderAddedUsers

        @Deprecated
        public boolean notifyFolderAddedUsers​(String userIdToNotify,
                                              SocialSharedFolder sharedFolder,
                                              List<String> newAddedUserIds)
                                       throws org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException,
                                              org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault,
                                              org.gcube.vomanagement.usermanagement.exception.UserManagementPortalException
        Deprecated.
        Specified by:
        notifyFolderAddedUsers in interface NotificationsManager
        Throws:
        org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException
        org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault
        org.gcube.vomanagement.usermanagement.exception.UserManagementPortalException
      • notifyFolderAddedUsers

        public boolean notifyFolderAddedUsers​(String userIdToNotify,
                                              SocialSharedFolder sharedFolder,
                                              List<String> newAddedUserIds,
                                              org.gcube.vomanagement.usermanagement.UserManager um)
                                       throws 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 SocialSharedFolder instance
        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
      • notifyFolderRemovedUser

        public boolean notifyFolderRemovedUser​(String userIdToNotify,
                                               SocialSharedFolder sharedFolder)
                                        throws 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 SocialSharedFolder
        Returns:
        true if the notification is correctly delivered, false otherwise
        Throws:
        org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException
        org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault
        org.gcube.vomanagement.usermanagement.exception.UserManagementPortalException
      • notifyAddedItem

        public boolean notifyAddedItem​(String userIdToNotify,
                                       SocialFileItem item,
                                       SocialSharedFolder sharedFolder)
        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 SocialSharedFolder instance
        Returns:
        true if the notification is correctly delivered, false otherwise
        Throws:
        InternalErrorException
      • notifyMovedItem

        public boolean notifyMovedItem​(String userIdToNotify,
                                       SocialFileItem item,
                                       SocialSharedFolder sharedFolder)
        use to notify a user he got a workspace item deleted from one of his workspace shared folder
        Specified by:
        notifyMovedItem in interface NotificationsManager
        Parameters:
        userIdToNotify - the user you want to notify
        sharedFolder - the shared folder SocialSharedFolder
        Returns:
        true if the notification is correctly delivered, false otherwise
        Throws:
        InternalErrorException
      • notifyRemovedItem

        public boolean notifyRemovedItem​(String userIdToNotify,
                                         String itemName,
                                         SocialSharedFolder sharedFolder)
        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 SocialSharedFolder
        Returns:
        true if the notification is correctly delivered, false otherwise
        Throws:
        InternalErrorException
      • notifyUpdatedItem

        public boolean notifyUpdatedItem​(String userIdToNotify,
                                         SocialFileItem item,
                                         SocialSharedFolder sharedFolder)
        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 SocialSharedFolder
        Returns:
        true if the notification is correctly delivered, false otherwise
        Throws:
        InternalErrorException
      • notifyMessageReceived

        public boolean notifyMessageReceived​(String userIdToNotify,
                                             String messageId,
                                             String subject,
                                             String messageText,
                                             String... otherRecipientsFullNames)
        Specified by:
        notifyMessageReceived in interface NotificationsManager
        Parameters:
        userIdToNotify - the user you want to notify
        messageId - the unique identifier of the message
        subject - the subject of the message sent
        messageText - the text of the message (text/plain)
        otherRecipientsFullNames - the Full Names of the other recipients. if any
        Returns:
        true if the notification is correctly delivered, false otherwise
      • notifyPost

        public boolean notifyPost​(String userIdToNotify,
                                  String postId,
                                  String postText,
                                  String... hashtags)
        use to notify a user that someone created this post
        Specified by:
        notifyPost in interface NotificationsManager
        Parameters:
        userIdToNotify - the user you want to notify
        postId - the liked postid
        postText - the liked post text or a portion of it
        Returns:
        true if the notification is correctly delivered, false otherwise
      • notifyPost

        public boolean notifyPost​(String userIdToNotify,
                                  String postId,
                                  String postText,
                                  Set<String> mentionedVREGroups,
                                  Set<String> hashtags)
        Description copied from interface: NotificationsManager
        use to notify a user that someone created this post
        Specified by:
        notifyPost in interface NotificationsManager
        Parameters:
        userIdToNotify - the user you want to notify
        postId - the liked postid
        postText - the liked post text or a portion of it
        mentionedVREGroups - the names of the mentioned vre's groups, if any
        hashtags - the set of hashtags in the post, if any
        Returns:
        true if the notification is correctly delivered, false otherwise
      • notifyOwnCommentReply

        public boolean notifyOwnCommentReply​(String userIdToNotify,
                                             String postId,
                                             String postText,
                                             String commentKey)
        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
        postId - the liked postid
        postText - the liked post text or a portion of it
        commentKey - when sending email, stop the shown discussion at that comment
        Returns:
        true if the notification is correctly delivered, false otherwise
      • notifyCommentReply

        public boolean notifyCommentReply​(String userIdToNotify,
                                          String postId,
                                          String commentText,
                                          String feedOwnerFullName,
                                          String feedOwnerId,
                                          String commentKey)
        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
        postId - the liked postid
        commentText - the liked post text or a portion of it
        feedOwnerFullName - the full name of the user who created the post
        feedOwnerId - the username of the user who created the post
        commentKey - when sending email, stop the shown discussion at that comment
        Returns:
        true if the notification is correctly delivered, false otherwise
      • notifyCommentOnFavorite

        public boolean notifyCommentOnFavorite​(String userIdToNotify,
                                               String postId,
                                               String commentText,
                                               String commentKey)
        Specified by:
        notifyCommentOnFavorite in interface NotificationsManager
        Parameters:
        userIdToNotify - the user you want to notify
        postId - the liked postid
        commentText - the commentText
        commentKey - when sending email, stop the shown discussion at that comment
        Returns:
        true if the notification is correctly delivered, false otherwise
      • notifyCommentOnLike

        public boolean notifyCommentOnLike​(String userIdToNotify,
                                           String postId,
                                           String commentText,
                                           String commentKey)
        Specified by:
        notifyCommentOnLike in interface NotificationsManager
        Parameters:
        userIdToNotify - the user you want to notify
        postId - the liked postid
        commentText - the commentText
        commentKey - when sending email, stop the shown discussion at that comment
        Returns:
        true if the notification is correctly delivered, false otherwise
      • notifyUserTag

        public boolean notifyUserTag​(String userIdToNotify,
                                     String postId,
                                     String postText,
                                     String commentKey)
        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
        postId - the liked postid
        commentKey - when sending email, stop the shown discussion at that comment
        Returns:
        true if the notification is correctly delivered, false otherwise
      • notifyLikedFeed

        @Deprecated
        public boolean notifyLikedFeed​(String userIdToNotify,
                                       String postId,
                                       String postText)
        Deprecated.
        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
        postId - the liked postid
        postText - the liked post text or a portion of it
        Returns:
        true if the notification is correctly delivered, false otherwise
      • notifyLikedPost

        public boolean notifyLikedPost​(String userIdToNotify,
                                       String postId,
                                       String postText)
        use to notify a user he got one of his post liked
        Specified by:
        notifyLikedPost in interface NotificationsManager
        Parameters:
        userIdToNotify - the user you want to notify
        postId - the liked postid
        postText - the liked post 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.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
      • notifyCatalogueEvent

        public boolean notifyCatalogueEvent​(org.gcube.portal.databook.shared.NotificationType type,
                                            String userIdToNotify,
                                            String itemId,
                                            String notifyText,
                                            URL url)
                                     throws Exception
        Description copied from interface: NotificationsManager
        use to notify a catalogue moderators someone submitted an item for consideration
        Specified by:
        notifyCatalogueEvent in interface NotificationsManager
        Parameters:
        type - the notification type
        userIdToNotify - the user you want to notify
        itemId - the item unique identifier
        notifyText - the text of the notification
        Returns:
        true if the notification is correctly delivered, false otherwise
        Throws:
        Exception