Class AbstractResourceUserNotificationBuilder<T>
- java.lang.Object
-
- org.silverpeas.core.notification.user.builder.AbstractUserNotificationBuilder
-
- org.silverpeas.core.notification.user.builder.AbstractResourceUserNotificationBuilder<T>
-
- All Implemented Interfaces:
UserNotificationBuilder
- Direct Known Subclasses:
AbstractPdcSubscriptionUserNotification
,AbstractTemplateUserNotificationBuilder
public abstract class AbstractResourceUserNotificationBuilder<T> extends AbstractUserNotificationBuilder
- Author:
- Yohann Chastagnier
-
-
Constructor Summary
Constructors Constructor Description AbstractResourceUserNotificationBuilder(T resource)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected UserNotification
createNotification()
Creates the user notification.protected T
getResource()
protected String
getResourceURL(T resource)
protected void
initialize()
Performs common initializations from a given resourceprotected NotificationResourceData
initializeNotificationResourceData()
protected boolean
isGroupCanBeNotified(String groupId)
The access control of the specified group to the resource behind this notification builder is verified.protected boolean
isSendImmediately()
Is the notification to build has to be sent immediately?protected boolean
isUserCanBeNotified(String userId)
The access control of the specified user to the resource behind this notification builder is verified.protected void
performBuild()
Builds the notification data containerprotected abstract void
performBuild(T resource)
protected void
performNotificationResource(T resource)
protected abstract void
performNotificationResource(T resource, NotificationResourceData notificationResourceData)
protected void
setResource(T resource)
-
Methods inherited from class org.silverpeas.core.notification.user.builder.AbstractUserNotificationBuilder
build, getAction, getBundle, getBundle, getComponentInstanceId, getContent, getExternalAddressesToNotify, getGroupIdsToNotify, getLocalizationBundlePath, getMessageType, getNotificationMetaData, getSender, getTitle, getUserIdsToExcludeFromNotifying, getUserIdsToNotify, stop, stopWhenNoUserToNotify
-
-
-
-
Constructor Detail
-
AbstractResourceUserNotificationBuilder
public AbstractResourceUserNotificationBuilder(T resource)
-
-
Method Detail
-
initialize
protected void initialize()
Performs common initializations from a given resource- Overrides:
initialize
in classAbstractUserNotificationBuilder
-
isUserCanBeNotified
protected boolean isUserCanBeNotified(String userId)
The access control of the specified user to the resource behind this notification builder is verified. If the resource is a contribution, then the access controllers are used to verify such an access. Otherwise, by default the user can be notified (no access control required).- Specified by:
isUserCanBeNotified
in classAbstractUserNotificationBuilder
- Parameters:
userId
- the unique identifier of the user.- Returns:
- true if the user can access the resource. False otherwise.
-
isGroupCanBeNotified
protected boolean isGroupCanBeNotified(String groupId)
The access control of the specified group to the resource behind this notification builder is verified. If the resource is a contribution, then the access controllers are used to verify such an access. Otherwise, by default the users in the group can be notified (no access control required).- Specified by:
isGroupCanBeNotified
in classAbstractUserNotificationBuilder
- Parameters:
groupId
- the unique identifier of the group of users.- Returns:
- true if the group can access the resource. False otherwise.
-
performBuild
protected final void performBuild()
Builds the notification data container- Specified by:
performBuild
in classAbstractUserNotificationBuilder
-
createNotification
protected UserNotification createNotification()
Description copied from class:AbstractUserNotificationBuilder
Creates the user notification. This method is used to construct and initialize aUserNotification
object in theAbstractUserNotificationBuilder.build()
method.- Specified by:
createNotification
in classAbstractUserNotificationBuilder
- Returns:
- a
UserNotification
object.
-
performBuild
protected abstract void performBuild(T resource)
-
performNotificationResource
protected void performNotificationResource(T resource)
-
initializeNotificationResourceData
protected NotificationResourceData initializeNotificationResourceData()
-
performNotificationResource
protected abstract void performNotificationResource(T resource, NotificationResourceData notificationResourceData)
-
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 classAbstractUserNotificationBuilder
- Returns:
- true if the notification to build has to be sent immediately.
-
getResource
protected final T getResource()
-
setResource
protected final void setResource(T resource)
-
-