com.silverpeas.comment.service
Class CommentUserNotification

java.lang.Object
  extended by com.silverpeas.notification.builder.AbstractUserNotificationBuilder
      extended by com.silverpeas.notification.builder.AbstractResourceUserNotificationBuilder<T>
          extended by com.silverpeas.notification.builder.AbstractTemplateUserNotificationBuilder<SilverpeasContent>
              extended by com.silverpeas.comment.service.CommentUserNotification
All Implemented Interfaces:
UserNotificationBuilder

public class CommentUserNotification
extends AbstractTemplateUserNotificationBuilder<SilverpeasContent>

Author:
Yohann Chastagnier

Field Summary
static String DEFAULT_SUBJECT_COMMENT_ADDING
          If no property with the subject of the notification message is defined in a Silverpeas component, then the below default property is taken.
static String NOTIFICATION_COMMENT_ATTRIBUTE
          The name of the attribute in a notification message that refers the comment responsable of the triggering of this service.
static String NOTIFICATION_CONTENT_ATTRIBUTE
          The name of the attribute in a notification message that refers the content commented by the comment responsable of the triggering of this service.
 
Constructor Summary
CommentUserNotification(CommentService commentService, Comment comment, SilverpeasContent commentedContent, String subjectKey, ResourceLocator componentMessages, Set<String> recipients)
           
 
Method Summary
protected  SilverpeasTemplate createTemplate()
          Creates the template bases
protected  NotifAction getAction()
          Gets the type of action on a resource
protected  String getBundleSubjectKey()
           
protected  String getComponentInstanceId()
          Gets the component instance id
protected  String getContributionAccessLinkLabelBundleKey()
          Gets the string bundle key for contribution access link
protected  String getMultilangPropertyFile()
          Gets the resource locator path
protected  String getSender()
          Gets the sender (the user id usually)
protected  String getTemplatePath()
          Gets the string template path
protected  String getTitle()
           
protected  Collection<String> getUserIdsToNotify()
           
protected  boolean isSendImmediatly()
          Forces the sending immediatly if true
protected  void perform(SilverpeasContent resource)
          Performing notification data from a given language
protected  void performNotificationResource(String language, SilverpeasContent resource, NotificationResourceData notificationResourceData)
          Builds the notification resource data container from a given language.
protected  void performTemplateData(String language, SilverpeasContent resource, SilverpeasTemplate template)
          Performing notification data from a given language
 
Methods inherited from class com.silverpeas.notification.builder.AbstractTemplateUserNotificationBuilder
createNotification, getFileName, performBuild, performNotificationResource, performNotificationResource
 
Methods inherited from class com.silverpeas.notification.builder.AbstractResourceUserNotificationBuilder
getResource, getResourceURL, initialize, initializeNotificationResourceData, performBuild, setResource
 
Methods inherited from class com.silverpeas.notification.builder.AbstractUserNotificationBuilder
build, getBundle, getBundle, getContent, getExternalAddressesToNotify, getGroupIdsToNotify, getMessageType, getNotificationMetaData, getUserIdsToExcludeFromNotifying, performUsersToBeNotified, stop, stopWhenNoUserToNotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SUBJECT_COMMENT_ADDING

public static final String DEFAULT_SUBJECT_COMMENT_ADDING
If no property with the subject of the notification message is defined in a Silverpeas component, then the below default property is taken.

See Also:
Constant Field Values

NOTIFICATION_COMMENT_ATTRIBUTE

public static final String NOTIFICATION_COMMENT_ATTRIBUTE
The name of the attribute in a notification message that refers the comment responsable of the triggering of this service.

See Also:
Constant Field Values

NOTIFICATION_CONTENT_ATTRIBUTE

public static final String NOTIFICATION_CONTENT_ATTRIBUTE
The name of the attribute in a notification message that refers the content commented by the comment responsable of the triggering of this service.

See Also:
Constant Field Values
Constructor Detail

CommentUserNotification

public CommentUserNotification(CommentService commentService,
                               Comment comment,
                               SilverpeasContent commentedContent,
                               String subjectKey,
                               ResourceLocator componentMessages,
                               Set<String> recipients)
Method Detail

getBundleSubjectKey

protected String getBundleSubjectKey()
Specified by:
getBundleSubjectKey in class AbstractTemplateUserNotificationBuilder<SilverpeasContent>

getTitle

protected String getTitle()
Overrides:
getTitle in class AbstractTemplateUserNotificationBuilder<SilverpeasContent>

getUserIdsToNotify

protected Collection<String> getUserIdsToNotify()
Specified by:
getUserIdsToNotify in class AbstractUserNotificationBuilder

perform

protected void perform(SilverpeasContent resource)
Description copied from class: AbstractTemplateUserNotificationBuilder
Performing notification data from a given language

Overrides:
perform in class AbstractTemplateUserNotificationBuilder<SilverpeasContent>

performTemplateData

protected void performTemplateData(String language,
                                   SilverpeasContent resource,
                                   SilverpeasTemplate template)
Description copied from class: AbstractTemplateUserNotificationBuilder
Performing notification data from a given language

Specified by:
performTemplateData in class AbstractTemplateUserNotificationBuilder<SilverpeasContent>

performNotificationResource

protected void performNotificationResource(String language,
                                           SilverpeasContent resource,
                                           NotificationResourceData notificationResourceData)
Description copied from class: AbstractTemplateUserNotificationBuilder
Builds the notification resource data container from a given language. Don't forget to fill resourceId, resourceType, resourceName, resourceDescription (optional), resourceLocation (optional). If ResourceLocation is empty , it will be filled by the NotificationManager with the given componentInstanceId of NotificationMetaData

Specified by:
performNotificationResource in class AbstractTemplateUserNotificationBuilder<SilverpeasContent>

createTemplate

protected SilverpeasTemplate createTemplate()
Description copied from class: AbstractTemplateUserNotificationBuilder
Creates the template bases

Overrides:
createTemplate in class AbstractTemplateUserNotificationBuilder<SilverpeasContent>
Returns:

getTemplatePath

protected String getTemplatePath()
Description copied from class: AbstractTemplateUserNotificationBuilder
Gets the string template path

Specified by:
getTemplatePath in class AbstractTemplateUserNotificationBuilder<SilverpeasContent>
Returns:

getAction

protected NotifAction getAction()
Description copied from class: AbstractUserNotificationBuilder
Gets the type of action on a resource

Specified by:
getAction in class AbstractUserNotificationBuilder
Returns:

getComponentInstanceId

protected String getComponentInstanceId()
Description copied from class: AbstractUserNotificationBuilder
Gets the component instance id

Specified by:
getComponentInstanceId in class AbstractUserNotificationBuilder
Returns:

getSender

protected String getSender()
Description copied from class: AbstractUserNotificationBuilder
Gets the sender (the user id usually)

Specified by:
getSender in class AbstractUserNotificationBuilder
Returns:

isSendImmediatly

protected boolean isSendImmediatly()
Description copied from class: AbstractUserNotificationBuilder
Forces the sending immediatly if true

Overrides:
isSendImmediatly in class AbstractResourceUserNotificationBuilder<SilverpeasContent>
Returns:

getMultilangPropertyFile

protected String getMultilangPropertyFile()
Description copied from class: AbstractUserNotificationBuilder
Gets the resource locator path

Overrides:
getMultilangPropertyFile in class AbstractUserNotificationBuilder
Returns:

getContributionAccessLinkLabelBundleKey

protected String getContributionAccessLinkLabelBundleKey()
Description copied from class: AbstractTemplateUserNotificationBuilder
Gets the string bundle key for contribution access link

Overrides:
getContributionAccessLinkLabelBundleKey in class AbstractTemplateUserNotificationBuilder<SilverpeasContent>
Returns:


Copyright © 2016 Silverpeas. All Rights Reserved.