Class FileSharingUserNotification
- 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<Ticket>
-
- org.silverpeas.core.web.sharing.notification.FileSharingUserNotification
-
- All Implemented Interfaces:
UserNotificationBuilder
public class FileSharingUserNotification extends AbstractTemplateUserNotificationBuilder<Ticket>
-
-
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 FileSharingUserNotification(Ticket resource, SharingNotificationVO fileSharingParam)
-
Method Summary
All Methods Static 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()
Core service, component instance identifier is uselessprotected String
getContributionAccessLinkLabelBundleKey()
Gets the string bundle key for contribution access linkprotected Collection<String>
getExternalAddressesToNotify()
Gets a collection of email addresses, each of them corresponding to a person external of Silverpeas.protected String
getLocalizationBundlePath()
Gets the path of the localization bundle to load.protected String
getResourceURL(Ticket 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.static void
notify(Ticket resource, SharingNotificationVO fileSharingParam)
Builds and sends a file sharing notification.protected void
performNotificationResource(String language, Ticket resource, NotificationResourceData notificationResourceData)
Builds the notification resource data container from a given language.protected void
performTemplateData(String language, Ticket 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, isSendImmediately, isUserCanBeNotified, performBuild, setResource
-
Methods inherited from class org.silverpeas.core.notification.user.builder.AbstractUserNotificationBuilder
build, getBundle, getBundle, getContent, getGroupIdsToNotify, getMessageType, getNotificationMetaData, getUserIdsToExcludeFromNotifying, stop, stopWhenNoUserToNotify
-
-
-
-
Constructor Detail
-
FileSharingUserNotification
public FileSharingUserNotification(Ticket resource, SharingNotificationVO fileSharingParam)
- Parameters:
resource
- the sharing ticket entityfileSharingParam
- file sharing parameters which contains selected users and external emails ...
-
-
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<Ticket>
- 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, Ticket resource, SilverpeasTemplate template)
- Specified by:
performTemplateData
in classAbstractTemplateUserNotificationBuilder<Ticket>
-
performNotificationResource
protected void performNotificationResource(String language, Ticket 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<Ticket>
- 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<Ticket>
- Returns:
- the StringTemplate file path
-
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.
-
getTemplateFileName
protected String getTemplateFileName()
Description copied from class:AbstractTemplateUserNotificationBuilder
Gets the fileName of StringTemplate- Specified by:
getTemplateFileName
in classAbstractTemplateUserNotificationBuilder<Ticket>
- 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()
Core service, component instance identifier is useless- Specified by:
getComponentInstanceId
in classAbstractUserNotificationBuilder
- Returns:
- the unique identifier of the component instance concerned by the notification to build.
- See Also:
#getComponentInstanceId()
-
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:
-
getExternalAddressesToNotify
protected Collection<String> getExternalAddressesToNotify()
Description copied from class:AbstractUserNotificationBuilder
Gets a collection of email addresses, each of them corresponding to a person external of Silverpeas. By default, an empty collection is returned.- Overrides:
getExternalAddressesToNotify
in classAbstractUserNotificationBuilder
- Returns:
- a collection of email addresses.
-
notify
public static void notify(Ticket resource, SharingNotificationVO fileSharingParam)
Builds and sends a file sharing notification. A warning message is logged when an exception is catched.- Parameters:
resource
- the ticket file sharing resource
-
getResourceURL
protected String getResourceURL(Ticket resource)
- Overrides:
getResourceURL
in classAbstractResourceUserNotificationBuilder<Ticket>
-
getContributionAccessLinkLabelBundleKey
protected String getContributionAccessLinkLabelBundleKey()
Description copied from class:AbstractTemplateUserNotificationBuilder
Gets the string bundle key for contribution access link- Overrides:
getContributionAccessLinkLabelBundleKey
in classAbstractTemplateUserNotificationBuilder<Ticket>
- Returns:
- the string bundle key.
-
-