com.stratelia.silverpeas.notificationManager
Class NotificationMetaData

java.lang.Object
  extended by com.stratelia.silverpeas.notificationManager.NotificationMetaData
All Implemented Interfaces:
Serializable

public class NotificationMetaData
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
static String AFTER_MESSAGE_FOOTER_TAG
           
static String BEFORE_MESSAGE_FOOTER_TAG
           
protected  NotificationManager notificationManager
           
 
Constructor Summary
NotificationMetaData()
          Default Constructor
NotificationMetaData(int messageType, String title, Map<String,SilverpeasTemplate> templates, String fileName)
           
NotificationMetaData(int messageType, String title, String content)
          Most common used constructor
 
Method Summary
 void addExternalRecipient(ExternalRecipient externalRecipient)
           
 void addExtraMessage(String message, String language)
           
 void addGroupRecipient(GroupRecipient group)
          Add a group recipient to group recipients
 void addGroupRecipients(Collection<GroupRecipient> groups)
          Add group recipients to group recipients
 void addLanguage(String language, String title, String content)
           
 void addUserRecipient(UserRecipient user)
          Add a user recipient to user recipients.
 void addUserRecipients(Collection<UserRecipient> users)
          Add a user recipient to user recipients.
 void addUserRecipients(UserRecipient[] users)
          Add a user recipient to user recipients.
 void addUserRecipientsToExclude(Collection<UserRecipient> users)
          Add a user recipient to user recipients to exclude
 void addUserRecipientsToExclude(UserRecipient[] users)
          Add a user recipient to user recipients to exclude
 void addUserRecipientToExclude(UserRecipient user)
          Add a user recipient to user recipients to exclude
protected  boolean displayGroup(String groupId)
           
 NotificationMetaData displayReceiversInFooter()
          Calling this method to authorize the display of the users and groups that will received the same notification in the footer of the notification message.
 NotifAction getAction()
           
 Set<UserRecipient> getAllUserRecipients()
          Gets the complete list of users that will receive the notification, so it takes into account users of groups.
 Set<UserRecipient> getAllUserRecipients(boolean updateInternalUserRecipientsToExclude)
          Gets the complete list of users that will receive the notification, so it takes into account users of groups.
 String getComponentId()
           
 String getContent()
          Get message content
 String getContent(String language)
           
 Date getDate()
          Get message date
 Collection<ExternalRecipient> getExternalRecipients()
           
 String getFileName()
           
 Collection<GroupRecipient> getGroupRecipients()
          Get message group recipients
 Set<String> getLanguages()
           
 String getLink()
          Get message link
 String getLinkLabel()
          Get message linkLabel
 String getLinkLabel(String language)
           
 int getMessageType()
          Get message type
 NotificationResourceData getNotificationResourceData()
           
 NotificationResourceData getNotificationResourceData(String lang)
           
 String getOriginalExtraMessage()
           
 String getSender()
          Get message sender
 String getSessionId()
          Get message session Id
 String getSource()
          Get message source
 SilverpeasTemplate getTemplateMessageFooter(String language)
           
 Map<String,SilverpeasTemplate> getTemplates()
           
 String getTitle()
          Get message title
 String getTitle(String language)
           
 Collection<UserRecipient> getUserRecipients()
          Get message user recipients
 Collection<UserRecipient> getUserRecipientsToExclude()
          Get message user recipients to exclude
 boolean isAnswerAllowed()
          Get answer allowed
 boolean isManualUserOne()
          Indicates if the current NotificationMetaData concerns a manual notification between a sender user and several user/group receivers.
 boolean isSendByAUser()
          Indicates if the notification is sent by a Silverpeas user or by a batch treatment.
 boolean isSendImmediately()
           
 NotificationMetaData manualUserNotification()
          Sets that the current NotificationMetaData instance concerns a manual notification between a sender user and several user/group receivers.
 void setAction(NotifAction action)
           
 void setAnswerAllowed(boolean answerAllowed)
          Set answer allowed
 void setComponentId(String componentId)
           
 void setContent(String content)
          Set message content
 void setContent(String content, String language)
           
 void setDate(Date date)
          Set message date
 void setExternalRecipients(Collection<ExternalRecipient> externalRecipients)
           
 void setFileName(String fileName)
           
 void setGroupRecipients(Collection<GroupRecipient> groups)
          Set message group recipients
 void setLink(Link link)
          Set link
 void setLink(Link link, String language)
          Set link
 void setLink(String link)
          Set message link
 void setMessageType(int messageType)
          Set message type
 void setNotificationResourceData(NotificationResourceData notificationResourceData)
           
 void setNotificationResourceData(String lang, NotificationResourceData notificationResourceData)
           
 void setOriginalExtraMessage(String originalExtraMessage)
           
 void setSender(String sender)
          Set message sender
 void setSendImmediately(boolean sendImmediately)
           
 void setSessionId(String sessionId)
          Set message session Id
 void setSource(String source)
          Set message source
 void setTitle(String title)
          Set message title
 void setTitle(String title, String language)
           
 void setUserRecipients(Collection<UserRecipient> users)
          Set message user recipients
 void setUserRecipientsToExclude(Collection<UserRecipient> users)
          Set message user recipients to exclude
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEFORE_MESSAGE_FOOTER_TAG

public static final String BEFORE_MESSAGE_FOOTER_TAG
See Also:
Constant Field Values

AFTER_MESSAGE_FOOTER_TAG

public static final String AFTER_MESSAGE_FOOTER_TAG
See Also:
Constant Field Values

notificationManager

protected NotificationManager notificationManager
Constructor Detail

NotificationMetaData

public NotificationMetaData()
Default Constructor


NotificationMetaData

public NotificationMetaData(int messageType,
                            String title,
                            String content)
Most common used constructor

Parameters:
messageType - message type (NORMAL, URGENT, ...)
title - message title (=subject)
content - message content (=body)

NotificationMetaData

public NotificationMetaData(int messageType,
                            String title,
                            Map<String,SilverpeasTemplate> templates,
                            String fileName)
Method Detail

addLanguage

public final void addLanguage(String language,
                              String title,
                              String content)

getLanguages

public Set<String> getLanguages()

getTemplates

public Map<String,SilverpeasTemplate> getTemplates()

setMessageType

public void setMessageType(int messageType)
Set message type

Parameters:
messageType - the message type to be set

getMessageType

public int getMessageType()
Get message type

Returns:
the message type

setDate

public void setDate(Date date)
Set message date

Parameters:
date - the message date to be set

getDate

public Date getDate()
Get message date

Returns:
the message date

setTitle

public void setTitle(String title)
Set message title

Parameters:
title - the title to be set

setTitle

public void setTitle(String title,
                     String language)

getTitle

public String getTitle()
Get message title

Returns:
the message title

getTitle

public String getTitle(String language)

setContent

public void setContent(String content)
Set message content

Parameters:
content - the content to be set

setContent

public void setContent(String content,
                       String language)

getContent

public String getContent()
Get message content

Returns:
the message content

getContent

public String getContent(String language)

setSource

public void setSource(String source)
Set message source

Parameters:
source - the source to be set

getSource

public String getSource()
Get message source

Returns:
the message source

setSender

public void setSender(String sender)
Set message sender

Parameters:
sender - the sender to be set

setAnswerAllowed

public void setAnswerAllowed(boolean answerAllowed)
Set answer allowed

Parameters:
answerAllowed - if answer allowed

getSender

public String getSender()
Get message sender

Returns:
the message sender

isAnswerAllowed

public boolean isAnswerAllowed()
Get answer allowed

Returns:
if answer is allowed

setLink

public void setLink(String link)
Set message link

Parameters:
link - the link to be set

getLink

public String getLink()
Get message link

Returns:
the message link

setLink

public void setLink(Link link)
Set link

Parameters:
link - the link to be set

setLink

public void setLink(Link link,
                    String language)
Set link

Parameters:
link - the link to be set
language - the language of the linkLabel

getLinkLabel

public String getLinkLabel()
Get message linkLabel

Returns:
the message linkLabel

getLinkLabel

public String getLinkLabel(String language)

setSessionId

public void setSessionId(String sessionId)
Set message session Id

Parameters:
sessionId - the session Id to be set

getSessionId

public String getSessionId()
Get message session Id

Returns:
the message session Id

setUserRecipients

public void setUserRecipients(Collection<UserRecipient> users)
Set message user recipients

Parameters:
users - the user ids that must receive this message

getUserRecipients

public Collection<UserRecipient> getUserRecipients()
Get message user recipients

Returns:
the message user recipients

addUserRecipient

public void addUserRecipient(UserRecipient user)
Add a user recipient to user recipients. User that has not an activated state is not taken into account.

Parameters:
user - recipient that must be added

addUserRecipients

public void addUserRecipients(UserRecipient[] users)
Add a user recipient to user recipients. User that has not an activated state is not taken into account.

Parameters:
users - users to be added

addUserRecipients

public void addUserRecipients(Collection<UserRecipient> users)
Add a user recipient to user recipients. User that has not an activated state is not taken into account.

Parameters:
users - users to be added

setUserRecipientsToExclude

public void setUserRecipientsToExclude(Collection<UserRecipient> users)
Set message user recipients to exclude

Parameters:
users - the user ids that must not receive this message

getUserRecipientsToExclude

public Collection<UserRecipient> getUserRecipientsToExclude()
Get message user recipients to exclude

Returns:
the message user recipients

addUserRecipientToExclude

public void addUserRecipientToExclude(UserRecipient user)
Add a user recipient to user recipients to exclude

Parameters:
user - recipient that must not be notified

addUserRecipientsToExclude

public void addUserRecipientsToExclude(UserRecipient[] users)
Add a user recipient to user recipients to exclude

Parameters:
users - recipient that must not be notified

addUserRecipientsToExclude

public void addUserRecipientsToExclude(Collection<UserRecipient> users)
Add a user recipient to user recipients to exclude

Parameters:
users - recipient that must not be notified

getExternalRecipients

public Collection<ExternalRecipient> getExternalRecipients()
Returns:
the externalAddress

setExternalRecipients

public void setExternalRecipients(Collection<ExternalRecipient> externalRecipients)
Parameters:
externalRecipients - the externalAddress to set

addExternalRecipient

public void addExternalRecipient(ExternalRecipient externalRecipient)
Parameters:
externalRecipient - the externalRecipient to add

setGroupRecipients

public void setGroupRecipients(Collection<GroupRecipient> groups)
Set message group recipients

Parameters:
groups - the groups that must receive this message

getGroupRecipients

public Collection<GroupRecipient> getGroupRecipients()
Get message group recipients

Returns:
the message group recipients

addGroupRecipient

public void addGroupRecipient(GroupRecipient group)
Add a group recipient to group recipients

Parameters:
group - group that must be added

addGroupRecipients

public void addGroupRecipients(Collection<GroupRecipient> groups)
Add group recipients to group recipients

Parameters:
groups -

getComponentId

public String getComponentId()

setComponentId

public void setComponentId(String componentId)

addExtraMessage

public void addExtraMessage(String message,
                            String language)

getOriginalExtraMessage

public String getOriginalExtraMessage()

setOriginalExtraMessage

public void setOriginalExtraMessage(String originalExtraMessage)

getFileName

public String getFileName()

setFileName

public void setFileName(String fileName)

isSendImmediately

public boolean isSendImmediately()

setSendImmediately

public void setSendImmediately(boolean sendImmediately)

getAction

public NotifAction getAction()

setAction

public void setAction(NotifAction action)

setNotificationResourceData

public void setNotificationResourceData(NotificationResourceData notificationResourceData)

setNotificationResourceData

public void setNotificationResourceData(String lang,
                                        NotificationResourceData notificationResourceData)

getNotificationResourceData

public NotificationResourceData getNotificationResourceData()

getNotificationResourceData

public NotificationResourceData getNotificationResourceData(String lang)

isSendByAUser

public boolean isSendByAUser()
Indicates if the notification is sent by a Silverpeas user or by a batch treatment.

Returns:
true if the notification is sent by a Silverpeas user, false otherwise.

getTemplateMessageFooter

public SilverpeasTemplate getTemplateMessageFooter(String language)

getAllUserRecipients

public Set<UserRecipient> getAllUserRecipients()
                                        throws NotificationManagerException
Gets the complete list of users that will receive the notification, so it takes into account users of groups.
If the sender is identified, it is removed from the result.
No internal data of the current NotificationMetaData is updated.

Returns:
the complete list of users that will receive the notification.
Throws:
NotificationManagerException

getAllUserRecipients

public Set<UserRecipient> getAllUserRecipients(boolean updateInternalUserRecipientsToExclude)
                                        throws NotificationManagerException
Gets the complete list of users that will receive the notification, so it takes into account users of groups.
If the sender is identified (as a user), it is removed from the result.

Parameters:
updateInternalUserRecipientsToExclude - if true, the internal container of user recipients to exclude will be updated. This container is provided by getUserRecipientsToExclude(). If false, nothing is done.
Returns:
the complete list of users that will receive the notification.
Throws:
NotificationManagerException

displayGroup

protected boolean displayGroup(String groupId)

displayReceiversInFooter

public NotificationMetaData displayReceiversInFooter()
Calling this method to authorize the display of the users and groups that will received the same notification in the footer of the notification message.

Returns:
the current NotificationMetaData instance.

manualUserNotification

public NotificationMetaData manualUserNotification()
Sets that the current NotificationMetaData instance concerns a manual notification between a sender user and several user/group receivers.

Returns:
the current NotificationMetaData instance.

isManualUserOne

public boolean isManualUserOne()
Indicates if the current NotificationMetaData concerns a manual notification between a sender user and several user/group receivers.
Warning : the sender information is not verified.

Returns:
true if the current NotificationMetaData concerns a manual one, false otherwise.


Copyright © 2016 Silverpeas. All Rights Reserved.