Class TaskMailNotifierObserver
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.project.notification.AbstractSendNotificationObserver
org.ametys.plugins.workspaces.project.notification.TaskMailNotifierObserver
- All Implemented Interfaces:
Observer
,LogEnabled
,PluginAware
,Contextualizable
,Serviceable
This
Observer
observes events on task to notify concerned users-
Field Summary
Fields inherited from class org.ametys.plugins.workspaces.project.notification.AbstractSendNotificationObserver
_context, _i18nUtils, _jsonUtils, _notificationPrefHelper, _pluginName, _renderingContextHandler, _resolver, _rightManager, _srcResolver, _userManager
Fields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
_getSubjectI18nKey
(String eventType, Map<String, Object> eventParams) Get the i18n subject key_getSubjectParams
(Project project, Map<String, Object> eventParams) Get the i18n parameters for subject keyprotected AmetysObject
getEventAmetysObject
(Event event) Get the AmetysObject that triggered the event to compute the rightsprotected I18nizableText
getI18nSubject
(Event event, Project project) Get theI18nizableText
for mail subjectprotected String
getMailBodyURI
(Event event, Project project) Returns the URI for HTML mail bodyprotected List<UserIdentity>
getUsersToNotify
(String eventId, AmetysObject object, Project project) Get the users allowed to be notifiedboolean
Checks if the event is supported.Methods inherited from class org.ametys.plugins.workspaces.project.notification.AbstractSendNotificationObserver
_getRelativePath, contextualize, getPriority, getProject, notifyEvent, observe, sendMail, service, setPluginInfo
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Constructor Details
-
TaskMailNotifierObserver
public TaskMailNotifierObserver()
-
-
Method Details
-
supports
Description copied from interface:Observer
Checks if the event is supported. If true, the observe(Event) method will be called.- Parameters:
event
- the event.- Returns:
true
for observing this event,false
otherwise.
-
getEventAmetysObject
Description copied from class:AbstractSendNotificationObserver
Get the AmetysObject that triggered the event to compute the rights- Specified by:
getEventAmetysObject
in classAbstractSendNotificationObserver
- Parameters:
event
- the event- Returns:
- the AmetysObject
-
getMailBodyURI
Description copied from class:AbstractSendNotificationObserver
Returns the URI for HTML mail body- Specified by:
getMailBodyURI
in classAbstractSendNotificationObserver
- Parameters:
event
- the eventproject
- the project- Returns:
- The URI for HTML mail body
-
getI18nSubject
Description copied from class:AbstractSendNotificationObserver
Get theI18nizableText
for mail subject- Specified by:
getI18nSubject
in classAbstractSendNotificationObserver
- Parameters:
event
- the eventproject
- the project- Returns:
- the
I18nizableText
for subject
-
getUsersToNotify
Description copied from class:AbstractSendNotificationObserver
Get the users allowed to be notified- Overrides:
getUsersToNotify
in classAbstractSendNotificationObserver
- Parameters:
eventId
- The id of eventobject
- The object on which to test rightsproject
- The project of the event to test user pref- Returns:
- The allowed users
-
_getSubjectI18nKey
Get the i18n subject key- Parameters:
eventType
- The type of eventeventParams
- The optional event parameters- Returns:
- the i18 key
-
_getSubjectParams
Get the i18n parameters for subject key- Parameters:
project
- The parent projecteventParams
- The optional event parameters- Returns:
- the i18n parameters
-