Class AbstractReplacementNotificationBuilder
- 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<Replacement>
-
- org.silverpeas.core.workflow.engine.notification.AbstractReplacementNotificationBuilder
-
- All Implemented Interfaces:
UserNotificationBuilder
,FallbackToCoreTemplatePathBehavior
,RemoveSenderRecipientBehavior
- Direct Known Subclasses:
ToIncumbentReplacementNotificationBuilder
,ToSubstituteReplacementNotificationBuilder
public abstract class AbstractReplacementNotificationBuilder extends AbstractTemplateUserNotificationBuilder<Replacement> implements RemoveSenderRecipientBehavior, FallbackToCoreTemplatePathBehavior
A builder of notifications about a replacement between two users in a given workflow instance.- Author:
- mmoquillon
-
-
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
getLocalizationBundlePath()
Gets the path of the localization bundle to load.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 void
performNotificationResource(String language, Replacement resource, NotificationResourceData notificationResourceData)
Builds the notification resource data container from a given language.protected void
performTemplateData(String language, Replacement resource, SilverpeasTemplate template)
-
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, isSendImmediately, isUserCanBeNotified, performBuild, setResource
-
Methods inherited from class org.silverpeas.core.notification.user.builder.AbstractUserNotificationBuilder
build, getBundle, getBundle, getContent, getExternalAddressesToNotify, getGroupIdsToNotify, getMessageType, getNotificationMetaData, getUserIdsToExcludeFromNotifying, getUserIdsToNotify, 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<Replacement>
- Returns:
- the name of the property in the
AbstractUserNotificationBuilder.getBundle()
bundle that specifies the subject to use in the notifications built by this builder.
-
performTemplateData
protected void performTemplateData(String language, Replacement resource, SilverpeasTemplate template)
- Specified by:
performTemplateData
in classAbstractTemplateUserNotificationBuilder<Replacement>
-
performNotificationResource
protected void performNotificationResource(String language, Replacement 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<Replacement>
- Parameters:
language
- the language in ISO-639-2resource
- the resource concerned by the notificationnotificationResourceData
- data about the notification
-
getTemplatePath
protected String getTemplatePath()
Description copied from class:AbstractTemplateUserNotificationBuilder
Gets the string template path- Specified by:
getTemplatePath
in classAbstractTemplateUserNotificationBuilder<Replacement>
- Returns:
- the StringTemplate file path
-
getTemplateFileName
protected String getTemplateFileName()
Description copied from class:AbstractTemplateUserNotificationBuilder
Gets the fileName of StringTemplate- Specified by:
getTemplateFileName
in classAbstractTemplateUserNotificationBuilder<Replacement>
- 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.
-
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.
-
-