Class AgendaUserNotification
- 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<JournalHeader>
-
- org.silverpeas.core.web.tools.agenda.notification.AgendaUserNotification
-
- All Implemented Interfaces:
UserNotificationBuilder
public class AgendaUserNotification extends AbstractTemplateUserNotificationBuilder<JournalHeader>
User notification from "My Diary" application.- Author:
- Yohann Chastagnier
-
-
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 AgendaUserNotification(UserDetail sender, JournalHeader resource, String attend)
Notification from attendeeAgendaUserNotification(NotifAction action, UserDetail sender, JournalHeader resource)
Notification from delegator
-
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(JournalHeader resource)
protected String
getSender()
Gets the sender (the user identifier usually)protected SilverpeasCalendar
getSilverpeasCalendar()
protected String
getTemplateFileName()
Gets the fileName of StringTemplateprotected String
getTemplatePath()
Gets the string template pathprotected Collection<String>
getUserIdsToNotify()
A collection of user identifiers.protected void
initialize()
Performs common initializations from a given resourceprotected boolean
isSendImmediately()
Is the notification to build has to be sent immediately?protected void
performNotificationResource(String language, JournalHeader resource, NotificationResourceData notificationResourceData)
Builds the notification resource data container from a given language.protected void
performTemplateData(String language, JournalHeader 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, 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
-
-
-
-
Constructor Detail
-
AgendaUserNotification
public AgendaUserNotification(NotifAction action, UserDetail sender, JournalHeader resource)
Notification from delegator- Parameters:
action
-sender
-resource
-
-
AgendaUserNotification
public AgendaUserNotification(UserDetail sender, JournalHeader resource, String attend)
Notification from attendee- Parameters:
sender
-resource
-attend
-
-
-
Method Detail
-
initialize
protected void initialize()
Description copied from class:AbstractResourceUserNotificationBuilder
Performs common initializations from a given resource- Overrides:
initialize
in classAbstractResourceUserNotificationBuilder<JournalHeader>
-
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<JournalHeader>
- Returns:
- the name of the property in the
AbstractUserNotificationBuilder.getBundle()
bundle that specifies the subject to use in the notifications built by this builder.
-
getTemplateFileName
protected String getTemplateFileName()
Description copied from class:AbstractTemplateUserNotificationBuilder
Gets the fileName of StringTemplate- Specified by:
getTemplateFileName
in classAbstractTemplateUserNotificationBuilder<JournalHeader>
- Returns:
- the StringTemplate filename
-
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, JournalHeader resource, SilverpeasTemplate template)
- Specified by:
performTemplateData
in classAbstractTemplateUserNotificationBuilder<JournalHeader>
-
performNotificationResource
protected void performNotificationResource(String language, JournalHeader 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<JournalHeader>
- Parameters:
language
- the language in ISO-639-2resource
- the resource concerned by the notificationnotificationResourceData
- data about the notification
-
getResourceURL
protected String getResourceURL(JournalHeader resource)
- Overrides:
getResourceURL
in classAbstractResourceUserNotificationBuilder<JournalHeader>
-
getTemplatePath
protected String getTemplatePath()
Description copied from class:AbstractTemplateUserNotificationBuilder
Gets the string template path- Specified by:
getTemplatePath
in classAbstractTemplateUserNotificationBuilder<JournalHeader>
- 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.
-
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.
-
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<JournalHeader>
- Returns:
- true if the notification to build has to be sent immediately.
-
getSilverpeasCalendar
protected SilverpeasCalendar getSilverpeasCalendar()
- Returns:
- the calendarBm
-
getContributionAccessLinkLabelBundleKey
protected String getContributionAccessLinkLabelBundleKey()
Description copied from class:AbstractTemplateUserNotificationBuilder
Gets the string bundle key for contribution access link- Overrides:
getContributionAccessLinkLabelBundleKey
in classAbstractTemplateUserNotificationBuilder<JournalHeader>
- Returns:
- the string bundle key.
-
-