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 aUserNotificationobject 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 NotificationMetaDatagetNotificationMetaData()Gets the metadata about the notification to send so that all the properties required to send the notification can be set.voidsend()Sends this notification at the specified addresses declared within the metadata of this notification.voidsend(BuiltInNotifAddress notificationAddress)Sends this notification to the specified builtin user notification address.UserNotificationWrappersetAsManual(boolean yesOrFalse)Sets this notification as manual or not.UserNotificationWrappersetAttachmentLinksFor(String contributionId)Sets a link for all the attachments of the specified contribution.UserNotificationWrappersetContent(String content)Sets a content to this notification.UserNotificationWrappersetRecipientGroups(Collection<String> groupIds)Sets one or more recipients to this notification.UserNotificationWrappersetRecipientUsers(Collection<String> userIds)Sets one or more recipients to this notification.UserNotificationWrappersetSender(User sender)Sets the sender of this notification.UserNotificationWrappersetTitle(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:UserNotificationGets the metadata about the notification to send so that all the properties required to send the notification can be set.- Specified by:
getNotificationMetaDatain interfaceUserNotification- Returns:
- the notification metadata.
-
send
public void send()
Description copied from interface:UserNotificationSends this notification at the specified addresses declared within the metadata of this notification.- Specified by:
sendin interfaceUserNotification
-
send
public void send(BuiltInNotifAddress notificationAddress)
Description copied from interface:UserNotificationSends this notification to the specified builtin user notification address.- Specified by:
sendin interfaceUserNotification- Parameters:
notificationAddress- the type of the media to vehicle the notification.
-
-