Class PublicationDateReminderUserNotification
- 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<PersistentResourceDateReminder>
-
- org.silverpeas.core.contribution.publication.datereminder.PublicationDateReminderUserNotification
-
- All Implemented Interfaces:
UserNotificationBuilder
,FallbackToCoreTemplatePathBehavior
public class PublicationDateReminderUserNotification extends AbstractTemplateUserNotificationBuilder<PersistentResourceDateReminder> implements FallbackToCoreTemplatePathBehavior
Set parameters for user notifications sended automatically for date reminder.- Author:
- Cécile Bonin
-
-
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected NotifAction
getAction()
Gets the type of action on the resource concerned by the notification if any.protected String
getBundleSubjectKey()
The name of the property in the bundle returned by theAbstractUserNotificationBuilder.getBundle()
method and that specifies a custom subject for the notifications built by this builder.protected String
getComponentInstanceId()
Gets the component instance identifier.protected String
getContributionAccessLinkLabelBundleKey()
Gets the string bundle key for contribution access linkprotected String
getLocalizationBundlePath()
Gets the path of the localization bundle to load.protected String
getResourceURL(PersistentResourceDateReminder resource)
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 boolean
isSendImmediately()
Is the notification to build has to be sent immediately?protected void
performNotificationResource(String language, PersistentResourceDateReminder resource, NotificationResourceData notificationResourceData)
Builds the notification resource data container from a given language.protected void
performTemplateData(String language, PersistentResourceDateReminder resource, SilverpeasTemplate template)
-
Methods inherited from class org.silverpeas.core.notification.user.builder.AbstractTemplateUserNotificationBuilder
createNotification, getTitle, getTitle, perform, performBuild, performNotificationResource, performNotificationResource
-
Methods inherited from class org.silverpeas.core.notification.user.builder.AbstractResourceUserNotificationBuilder
getResource, initialize, initializeNotificationResourceData, isGroupCanBeNotified, isUserCanBeNotified, performBuild, setResource
-
Methods inherited from class org.silverpeas.core.notification.user.builder.AbstractUserNotificationBuilder
build, getBundle, getBundle, getContent, getExternalAddressesToNotify, getGroupIdsToNotify, getMessageType, getNotificationMetaData, getUserIdsToExcludeFromNotifying, stop, stopWhenNoUserToNotify
-
-
-
-
Method Detail
-
getBundleSubjectKey
protected String getBundleSubjectKey()
Description copied from class:AbstractTemplateUserNotificationBuilder
The name of the property in the bundle returned by theAbstractUserNotificationBuilder.getBundle()
method and that specifies a custom subject for the notifications built by this builder. By Default the custom subject is defined by the propertycustom.st.notification.subject
in the bundle returned by theAbstractUserNotificationBuilder.getBundle()
method. So this method doesn't require to be overridden unless to give a different property name; for example, in case there is a different subject for several kinds of notifications in a given Silverpeas component (and hence several notification builders).- Overrides:
getBundleSubjectKey
in classAbstractTemplateUserNotificationBuilder<PersistentResourceDateReminder>
- Returns:
- the name of the property in the
AbstractUserNotificationBuilder.getBundle()
bundle that specifies the subject to use in the notifications built by this builder.
-
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:
-
performTemplateData
protected void performTemplateData(String language, PersistentResourceDateReminder resource, SilverpeasTemplate template)
- Specified by:
performTemplateData
in classAbstractTemplateUserNotificationBuilder<PersistentResourceDateReminder>
-
performNotificationResource
protected void performNotificationResource(String language, PersistentResourceDateReminder 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 classAbstractTemplateUserNotificationBuilder<PersistentResourceDateReminder>
- Parameters:
language
- the language in ISO-639-2resource
- the resource concerned by the notificationnotificationResourceData
- data about the notification
-
getResourceURL
protected String getResourceURL(PersistentResourceDateReminder resource)
- Overrides:
getResourceURL
in classAbstractResourceUserNotificationBuilder<PersistentResourceDateReminder>
-
getTemplatePath
protected String getTemplatePath()
Description copied from class:AbstractTemplateUserNotificationBuilder
Gets the string template path- Specified by:
getTemplatePath
in classAbstractTemplateUserNotificationBuilder<PersistentResourceDateReminder>
- Returns:
- the StringTemplate file path
-
getTemplateFileName
protected String getTemplateFileName()
Description copied from class:AbstractTemplateUserNotificationBuilder
Gets the fileName of StringTemplate- Specified by:
getTemplateFileName
in classAbstractTemplateUserNotificationBuilder<PersistentResourceDateReminder>
- Returns:
- the StringTemplate filename
-
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.
-
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.
-
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.
-
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<PersistentResourceDateReminder>
- Returns:
- true if the notification to build has to be sent immediately.
-
getLocalizationBundlePath
protected String getLocalizationBundlePath()
Description copied from class:AbstractUserNotificationBuilder
Gets the path of the localization bundle to load. By default, returns the general translations. For more specific localized text to use in the notification, override this method.- Overrides:
getLocalizationBundlePath
in classAbstractUserNotificationBuilder
- Returns:
- the path of the localization bundle.
-
getContributionAccessLinkLabelBundleKey
protected String getContributionAccessLinkLabelBundleKey()
Description copied from class:AbstractTemplateUserNotificationBuilder
Gets the string bundle key for contribution access link- Overrides:
getContributionAccessLinkLabelBundleKey
in classAbstractTemplateUserNotificationBuilder<PersistentResourceDateReminder>
- Returns:
- the string bundle key.
-
-