Package org.silverpeas.core.reminder
Class DefaultContributionReminderUserNotification
- 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<Contribution>
-
- org.silverpeas.core.reminder.DefaultContributionReminderUserNotification
-
- All Implemented Interfaces:
UserNotificationBuilder
,FallbackToCoreTemplatePathBehavior
public class DefaultContributionReminderUserNotification extends AbstractContributionTemplateUserNotificationBuilder<Contribution> implements FallbackToCoreTemplatePathBehavior
- Author:
- silveryocha
-
-
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 Modifier Constructor Description protected
DefaultContributionReminderUserNotification(Reminder reminder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Temporal
computeReminderContributionEnd()
protected Temporal
computeReminderContributionStart()
protected NotifAction
getAction()
Gets the type of action on the resource concerned by the notification if any.protected String
getBundleSubjectKey()
The title is built byAbstractTemplateUserNotificationBuilder.getTitle()
protected User
getReceiver()
protected Temporal
getScheduledDateTimeWithZeroDuration()
protected String
getSender()
Gets the sender (the user identifier usually)protected String
getTemplateFileName()
Gets the fileName of StringTemplateprotected String
getTemplatePath()
Gets the string template pathprotected Collection<String>
getUserIdsToNotify()
A collection of user identifiers.protected ZoneId
getZoneIdForNormalization()
Gets theZoneId
instance which must have to be used in date normalization.protected boolean
isSendImmediately()
Is the notification to build has to be sent immediately?protected Temporal
normalizeTemporal(Temporal temporal)
Normalizes the temporal for user notification according to the result ofgetZoneIdForNormalization()
method.protected void
performTemplateData(Contribution localizedContribution, SilverpeasTemplate template)
Performs additional template data.-
Methods inherited from class org.silverpeas.core.notification.user.builder.AbstractContributionTemplateUserNotificationBuilder
getComponentInstanceId, getSenderName, performNotificationResource, performTemplateData
-
Methods inherited from class org.silverpeas.core.notification.user.builder.AbstractTemplateUserNotificationBuilder
createNotification, getContributionAccessLinkLabelBundleKey, getTitle, getTitle, perform, performBuild, performNotificationResource, performNotificationResource
-
Methods inherited from class org.silverpeas.core.notification.user.builder.AbstractResourceUserNotificationBuilder
getResource, getResourceURL, initialize, initializeNotificationResourceData, isGroupCanBeNotified, isUserCanBeNotified, performBuild, setResource
-
Methods inherited from class org.silverpeas.core.notification.user.builder.AbstractUserNotificationBuilder
build, getBundle, getBundle, getContent, getExternalAddressesToNotify, getGroupIdsToNotify, getLocalizationBundlePath, getMessageType, getNotificationMetaData, getUserIdsToExcludeFromNotifying, stop, stopWhenNoUserToNotify
-
-
-
-
Constructor Detail
-
DefaultContributionReminderUserNotification
protected DefaultContributionReminderUserNotification(Reminder reminder)
-
-
Method Detail
-
computeReminderContributionStart
protected Temporal computeReminderContributionStart()
-
computeReminderContributionEnd
protected Temporal computeReminderContributionEnd()
-
getScheduledDateTimeWithZeroDuration
protected Temporal getScheduledDateTimeWithZeroDuration()
-
getZoneIdForNormalization
protected ZoneId getZoneIdForNormalization()
Gets theZoneId
instance which must have to be used in date normalization.- Returns:
- a
ZoneId
instance.
-
normalizeTemporal
protected Temporal normalizeTemporal(Temporal temporal)
Normalizes the temporal for user notification according to the result ofgetZoneIdForNormalization()
method.- Parameters:
temporal
- a temporal.- Returns:
- a
LocalDate
orZonedDateTime
.
-
getReceiver
protected User getReceiver()
-
getBundleSubjectKey
protected String getBundleSubjectKey()
The title is built byAbstractTemplateUserNotificationBuilder.getTitle()
- Overrides:
getBundleSubjectKey
in classAbstractTemplateUserNotificationBuilder<Contribution>
- Returns:
- null value.
-
performTemplateData
protected void performTemplateData(Contribution localizedContribution, SilverpeasTemplate template)
Description copied from class:AbstractContributionTemplateUserNotificationBuilder
Performs additional template data.Following attributes have already been set:
contribution
with instance ofLocalizedContribution
contributionName
from the contribution titlesenderName
fromAbstractContributionTemplateUserNotificationBuilder.getSenderName()
method
- Overrides:
performTemplateData
in classAbstractContributionTemplateUserNotificationBuilder<Contribution>
- Parameters:
localizedContribution
- the localized contribution.template
- the current localized template.
-
getTemplateFileName
protected String getTemplateFileName()
Description copied from class:AbstractTemplateUserNotificationBuilder
Gets the fileName of StringTemplate- Specified by:
getTemplateFileName
in classAbstractTemplateUserNotificationBuilder<Contribution>
- Returns:
- the StringTemplate filename
-
getTemplatePath
protected String getTemplatePath()
Description copied from class:AbstractTemplateUserNotificationBuilder
Gets the string template path- Specified by:
getTemplatePath
in classAbstractTemplateUserNotificationBuilder<Contribution>
- Returns:
- the StringTemplate file path
-
getAction
protected NotifAction getAction()
Description copied from class:AbstractUserNotificationBuilder
Gets the type of action on the resource concerned by the notification if any.- Specified by:
getAction
in classAbstractUserNotificationBuilder
- Returns:
- a value of the
NotifAction
enumeration.
-
getSender
protected String getSender()
Description copied from class:AbstractUserNotificationBuilder
Gets the sender (the user identifier usually)- Specified by:
getSender
in classAbstractUserNotificationBuilder
- Returns:
- the unique identifier of the sender.
-
getUserIdsToNotify
protected Collection<String> getUserIdsToNotify()
Description copied from class:AbstractUserNotificationBuilder
A collection of user identifiers. All the users in this collection will be notified. This method requires to be implemented.- Specified by:
getUserIdsToNotify
in classAbstractUserNotificationBuilder
- Returns:
-
isSendImmediately
protected boolean isSendImmediately()
Description copied from class:AbstractUserNotificationBuilder
Is the notification to build has to be sent immediately? If no, then its sending will be delayed according to the preferences of the users.- Overrides:
isSendImmediately
in classAbstractResourceUserNotificationBuilder<Contribution>
- Returns:
- true if the notification to build has to be sent immediately.
-
-