Class AbstractContributionTemplateUserNotificationBuilder<C extends Contribution>
- java.lang.Object
-
- org.silverpeas.core.notification.user.builder.AbstractUserNotificationBuilder
-
- org.silverpeas.core.notification.user.builder.AbstractResourceUserNotificationBuilder<T>
-
- org.silverpeas.core.notification.user.builder.AbstractTemplateUserNotificationBuilder<C>
-
- org.silverpeas.core.notification.user.builder.AbstractContributionTemplateUserNotificationBuilder<C>
-
- Type Parameters:
C
-
- All Implemented Interfaces:
UserNotificationBuilder
- Direct Known Subclasses:
AbstractCalendarUserNotificationBuilder
,DefaultContributionReminderUserNotification
public abstract class AbstractContributionTemplateUserNotificationBuilder<C extends Contribution> extends AbstractTemplateUserNotificationBuilder<C>
Centralization of common behavior around the contribution implementations.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.silverpeas.core.notification.user.builder.AbstractTemplateUserNotificationBuilder
AbstractTemplateUserNotificationBuilder.NotificationTemporal
-
-
Field Summary
-
Fields inherited from class org.silverpeas.core.notification.user.builder.AbstractTemplateUserNotificationBuilder
CUSTOM_NOTIFICATION_SUBJECT, DEFAULT_NOTIFICATION_SUBJECT
-
-
Constructor Summary
Constructors Constructor Description AbstractContributionTemplateUserNotificationBuilder(C resource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getComponentInstanceId()
Gets the component instance identifier.protected String
getSenderName()
Gets the sender name fromAbstractUserNotificationBuilder.getSender()
method.protected void
performNotificationResource(String language, C contribution, NotificationResourceData notificationResourceData)
Builds the notification resource data container from a given language.protected void
performTemplateData(C localizedContribution, SilverpeasTemplate template)
Performs additional template data.protected void
performTemplateData(String language, C contribution, SilverpeasTemplate template)
-
Methods inherited from class org.silverpeas.core.notification.user.builder.AbstractTemplateUserNotificationBuilder
createNotification, getBundleSubjectKey, getContributionAccessLinkLabelBundleKey, getTemplateFileName, getTemplatePath, getTitle, getTitle, perform, performBuild, performNotificationResource, performNotificationResource
-
Methods inherited from class org.silverpeas.core.notification.user.builder.AbstractResourceUserNotificationBuilder
getResource, getResourceURL, initialize, initializeNotificationResourceData, isGroupCanBeNotified, isSendImmediately, isUserCanBeNotified, performBuild, setResource
-
Methods inherited from class org.silverpeas.core.notification.user.builder.AbstractUserNotificationBuilder
build, getAction, getBundle, getBundle, getContent, getExternalAddressesToNotify, getGroupIdsToNotify, getLocalizationBundlePath, getMessageType, getNotificationMetaData, getSender, getUserIdsToExcludeFromNotifying, getUserIdsToNotify, stop, stopWhenNoUserToNotify
-
-
-
-
Constructor Detail
-
AbstractContributionTemplateUserNotificationBuilder
public AbstractContributionTemplateUserNotificationBuilder(C resource)
-
-
Method Detail
-
performTemplateData
protected final void performTemplateData(String language, C contribution, SilverpeasTemplate template)
- Specified by:
performTemplateData
in classAbstractTemplateUserNotificationBuilder<C extends Contribution>
-
getSenderName
protected String getSenderName()
Gets the sender name fromAbstractUserNotificationBuilder.getSender()
method.This method can be overridden if getting sender name from
AbstractUserNotificationBuilder.getSender()
method is not satisfying.- Returns:
- the sender name as string.
-
performTemplateData
protected void performTemplateData(C localizedContribution, SilverpeasTemplate template)
Performs additional template data.Following attributes have already been set:
contribution
with instance ofLocalizedContribution
contributionName
from the contribution titlesenderName
fromgetSenderName()
method
- Parameters:
localizedContribution
- the localized contribution.template
- the current localized template.
-
performNotificationResource
protected final void performNotificationResource(String language, C contribution, 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 classAbstractTemplateUserNotificationBuilder<C extends Contribution>
- Parameters:
language
- the language in ISO-639-2contribution
- the resource concerned by the notificationnotificationResourceData
- data about the notification
-
getComponentInstanceId
protected String getComponentInstanceId()
Description copied from class:AbstractUserNotificationBuilder
Gets the component instance identifier.- Specified by:
getComponentInstanceId
in classAbstractUserNotificationBuilder
- Returns:
- the unique identifier of the component instance concerned by the notification to build.
-
-