Class UserNotificationWrapper

  • All Implemented Interfaces:
    UserNotification

    public class UserNotificationWrapper
    extends Object
    implements UserNotification
    A wrapper of a UserNotification object with additional methods to customize the user notification that was built and returned by a given Silverpeas component instance. The customization is provided by the sender of such a notification and they consist mainly by setting a title other than the provided one or by setting an additional message.
    Author:
    mmoquillon
    • Method Detail

      • setTitle

        public UserNotificationWrapper setTitle​(String title)
        Sets a title to this notification.
        Parameters:
        title - the title to set.
        Returns:
        itself.
      • setContent

        public UserNotificationWrapper setContent​(String content)
        Sets a content to this notification.
        Parameters:
        content - the content to set.
        Returns:
        itself.
      • setAttachmentLinksFor

        public UserNotificationWrapper setAttachmentLinksFor​(String contributionId)
        Sets a link for all the attachments of the specified contribution.
        Parameters:
        contributionId - the unique identifier of the contribution in the component instance from which this notification was built.
        Returns:
        itself.
      • setSender

        public UserNotificationWrapper setSender​(User sender)
        Sets the sender of this notification.
        Parameters:
        sender - the sender to set.
        Returns:
        itself.
      • setRecipientUsers

        public UserNotificationWrapper setRecipientUsers​(Collection<String> userIds)
        Sets one or more recipients to this notification.
        Parameters:
        userIds - a collection of user's unique identifiers.
        Returns:
        itself.
      • setRecipientGroups

        public UserNotificationWrapper setRecipientGroups​(Collection<String> groupIds)
        Sets one or more recipients to this notification.
        Parameters:
        groupIds - a collection of group's unique identifiers.
        Returns:
        itself.
      • setAsManual

        public UserNotificationWrapper setAsManual​(boolean yesOrFalse)
        Sets this notification as manual or not.
        Parameters:
        yesOrFalse - either true for a manual notification or false otherwise.
        Returns:
        itself.
      • send

        public void send()
        Description copied from interface: UserNotification
        Sends this notification at the specified addresses declared within the metadata of this notification.
        Specified by:
        send in interface UserNotification
      • send

        public void send​(BuiltInNotifAddress notificationAddress)
        Description copied from interface: UserNotification
        Sends this notification to the specified builtin user notification address.
        Specified by:
        send in interface UserNotification
        Parameters:
        notificationAddress - the type of the media to vehicle the notification.