Class UserNotificationWrapper
- java.lang.Object
-
- org.silverpeas.web.notificationuser.control.UserNotificationWrapper
-
- All Implemented Interfaces:
UserNotification
public class UserNotificationWrapper extends Object implements UserNotification
A wrapper of aUserNotification
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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NotificationMetaData
getNotificationMetaData()
Gets the metadata about the notification to send so that all the properties required to send the notification can be set.void
send()
Sends this notification at the specified addresses declared within the metadata of this notification.void
send(BuiltInNotifAddress notificationAddress)
Sends this notification to the specified builtin user notification address.UserNotificationWrapper
setAsManual(boolean yesOrFalse)
Sets this notification as manual or not.UserNotificationWrapper
setAttachmentLinksFor(String contributionId)
Sets a link for all the attachments of the specified contribution.UserNotificationWrapper
setContent(String content)
Sets a content to this notification.UserNotificationWrapper
setRecipientGroups(Collection<String> groupIds)
Sets one or more recipients to this notification.UserNotificationWrapper
setRecipientUsers(Collection<String> userIds)
Sets one or more recipients to this notification.UserNotificationWrapper
setSender(User sender)
Sets the sender of this notification.UserNotificationWrapper
setTitle(String title)
Sets a title to this notification.
-
-
-
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.
-
getNotificationMetaData
public NotificationMetaData getNotificationMetaData()
Description copied from interface:UserNotification
Gets the metadata about the notification to send so that all the properties required to send the notification can be set.- Specified by:
getNotificationMetaData
in interfaceUserNotification
- Returns:
- the notification metadata.
-
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 interfaceUserNotification
-
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 interfaceUserNotification
- Parameters:
notificationAddress
- the type of the media to vehicle the notification.
-
-