Class AbstractInvitationUserNotification
- 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<Invitation>
-
- org.silverpeas.core.socialnetwork.invitation.AbstractInvitationUserNotification
-
- All Implemented Interfaces:
UserNotificationBuilder
- Direct Known Subclasses:
AcceptationUserNotification
,NewInvitationUserNotification
public abstract class AbstractInvitationUserNotification extends AbstractTemplateUserNotificationBuilder<Invitation>
- Author:
- Nicolas Eysseric.
-
-
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 AbstractInvitationUserNotification(Invitation invitation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 String
getTitle(String language)
The title is the value of the property defined bygetBundleSubjectKey()
in the localization bundle referred byAbstractUserNotificationBuilder.getBundle()
.protected Collection<String>
getUserIdsToNotify()
A collection of user identifiers.protected boolean
isSendImmediately()
Is the notification to build has to be sent immediately?-
Methods inherited from class org.silverpeas.core.notification.user.builder.AbstractTemplateUserNotificationBuilder
createNotification, getContributionAccessLinkLabelBundleKey, getTitle, perform, performBuild, performNotificationResource, performNotificationResource, performNotificationResource, performTemplateData
-
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, getAction, getBundle, getBundle, getContent, getExternalAddressesToNotify, getGroupIdsToNotify, getMessageType, getNotificationMetaData, getUserIdsToExcludeFromNotifying, stop, stopWhenNoUserToNotify
-
-
-
-
Constructor Detail
-
AbstractInvitationUserNotification
public AbstractInvitationUserNotification(Invitation invitation)
-
-
Method Detail
-
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.
-
getTemplatePath
protected String getTemplatePath()
Description copied from class:AbstractTemplateUserNotificationBuilder
Gets the string template path- Specified by:
getTemplatePath
in classAbstractTemplateUserNotificationBuilder<Invitation>
- Returns:
- the StringTemplate file path
-
getTemplateFileName
protected String getTemplateFileName()
Description copied from class:AbstractTemplateUserNotificationBuilder
Gets the fileName of StringTemplate- Specified by:
getTemplateFileName
in classAbstractTemplateUserNotificationBuilder<Invitation>
- Returns:
- the StringTemplate filename
-
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.
-
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<Invitation>
- Returns:
- the name of the property in the
AbstractUserNotificationBuilder.getBundle()
bundle that specifies the subject to use in the notifications built by this builder.
-
getTitle
protected String getTitle(String language)
The title is the value of the property defined bygetBundleSubjectKey()
in the localization bundle referred byAbstractUserNotificationBuilder.getBundle()
. If no such property exists, then the title is the first name of the notification sender.- Overrides:
getTitle
in classAbstractTemplateUserNotificationBuilder<Invitation>
- Parameters:
language
- the ISO-631 code of a language.- Returns:
- the subject of the notification as defined in the localisation bundle returned by
the
AbstractUserNotificationBuilder.getBundle()
method. - See Also:
AbstractTemplateUserNotificationBuilder.getTitle()
-
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.
-
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<Invitation>
- Returns:
- true if the notification to build has to be sent immediately.
-
-