com.silverpeas.notification.builder
Class AbstractTemplateUserNotificationBuilder<T>

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<T>
Type Parameters:
T - the type of resource concerned by the notification.
All Implemented Interfaces:
UserNotificationBuilder
Direct Known Subclasses:
AgendaUserNotification, CommentUserNotification, FileSharingUserNotification, PublicationDateReminderUserNotification

public abstract class AbstractTemplateUserNotificationBuilder<T>
extends AbstractResourceUserNotificationBuilder<T>

Author:
Yohann Chastagnier

Constructor Summary
AbstractTemplateUserNotificationBuilder(T resource)
          Default constructor
AbstractTemplateUserNotificationBuilder(T resource, String fileName)
          Default constructor
AbstractTemplateUserNotificationBuilder(T resource, String title, String fileName)
          Default constructor
 
Method Summary
protected  UserNotification createNotification()
          Create the user notification container
protected  SilverpeasTemplate createTemplate()
          Creates the template bases
protected abstract  String getBundleSubjectKey()
           
protected  String getContributionAccessLinkLabelBundleKey()
          Gets the string bundle key for contribution access link
protected  String getFileName()
          Gets the fileName of StringTemplate
protected abstract  String getTemplatePath()
          Gets the string template path
protected  String getTitle()
           
protected  void perform(T resource)
          Performing notification data from a given language
protected  void performBuild(T resource)
          Builds the notification data container
protected abstract  void performNotificationResource(String language, T resource, NotificationResourceData notificationResourceData)
          Builds the notification resource data container from a given language.
protected  void performNotificationResource(T resource)
          Handling notification resource data (Used by delayed notifications for example)
protected  void performNotificationResource(T resource, NotificationResourceData notificationResourceData)
          Builds the notification resource data container.
protected abstract  void performTemplateData(String language, T resource, SilverpeasTemplate template)
          Performing notification data from a given language
 
Methods inherited from class com.silverpeas.notification.builder.AbstractResourceUserNotificationBuilder
getResource, getResourceURL, initialize, initializeNotificationResourceData, isSendImmediatly, performBuild, setResource
 
Methods inherited from class com.silverpeas.notification.builder.AbstractUserNotificationBuilder
build, getAction, getBundle, getBundle, getComponentInstanceId, getContent, getExternalAddressesToNotify, getGroupIdsToNotify, getMessageType, getMultilangPropertyFile, getNotificationMetaData, getSender, getUserIdsToExcludeFromNotifying, getUserIdsToNotify, performUsersToBeNotified, stop, stopWhenNoUserToNotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTemplateUserNotificationBuilder

public AbstractTemplateUserNotificationBuilder(T resource)
Default constructor

Parameters:
resource -

AbstractTemplateUserNotificationBuilder

public AbstractTemplateUserNotificationBuilder(T resource,
                                               String fileName)
Default constructor

Parameters:
resource -
fileName -

AbstractTemplateUserNotificationBuilder

public AbstractTemplateUserNotificationBuilder(T resource,
                                               String title,
                                               String fileName)
Default constructor

Parameters:
resource -
title -
fileName -
Method Detail

getBundleSubjectKey

protected abstract String getBundleSubjectKey()

getTitle

protected String getTitle()
Overrides:
getTitle in class AbstractUserNotificationBuilder

getFileName

protected String getFileName()
Gets the fileName of StringTemplate

Returns:

createNotification

protected UserNotification createNotification()
Description copied from class: AbstractUserNotificationBuilder
Create the user notification container

Overrides:
createNotification in class AbstractUserNotificationBuilder
Returns:

performBuild

protected final void performBuild(T resource)
Description copied from class: AbstractResourceUserNotificationBuilder
Builds the notification data container

Specified by:
performBuild in class AbstractResourceUserNotificationBuilder<T>

performNotificationResource

protected final void performNotificationResource(T resource)
Description copied from class: AbstractResourceUserNotificationBuilder
Handling notification resource data (Used by delayed notifications for example)

Overrides:
performNotificationResource in class AbstractResourceUserNotificationBuilder<T>

performNotificationResource

protected final void performNotificationResource(T resource,
                                                 NotificationResourceData notificationResourceData)
Description copied from class: AbstractResourceUserNotificationBuilder
Builds the notification resource data container. 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 AbstractResourceUserNotificationBuilder<T>

createTemplate

protected SilverpeasTemplate createTemplate()
Creates the template bases

Returns:

perform

protected void perform(T resource)
Performing notification data from a given language

Parameters:
resource -

performTemplateData

protected abstract void performTemplateData(String language,
                                            T resource,
                                            SilverpeasTemplate template)
Performing notification data from a given language

Parameters:
language -
resource -
template -

performNotificationResource

protected abstract void performNotificationResource(String language,
                                                    T resource,
                                                    NotificationResourceData notificationResourceData)
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

Parameters:
language -
resource -
notificationResourceData -

getTemplatePath

protected abstract String getTemplatePath()
Gets the string template path

Returns:

getContributionAccessLinkLabelBundleKey

protected String getContributionAccessLinkLabelBundleKey()
Gets the string bundle key for contribution access link

Returns:


Copyright © 2016 Silverpeas. All Rights Reserved.