Class ResourcesMailNotifierObserver
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.project.notification.AbstractSendNotificationObserver
org.ametys.plugins.workspaces.project.notification.ResourcesMailNotifierObserver
- All Implemented Interfaces:
Observer
,LogEnabled
,PluginAware
,Contextualizable
,Serviceable
This observer observes event of resources to notify concerned users
-
Field Summary
Fields inherited from class org.ametys.plugins.workspaces.project.notification.AbstractSendNotificationObserver
_context, _i18nUtils, _moduleManagerEP, _pluginName, _projectManager, _renderingContextHandler, _resolver, _rightManager, _userManager
Fields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
_getBodyI18nKey
(String eventType, Map<String, Object> eventParams) Get the i18n subject keyGet the i18n parameters for body keyprotected String
_getDownloadURL
(Project project, String id) Get the url to download fileprotected String
_getSubjectI18nKey
(String eventType, Map<String, Object> eventParams) Get the i18n subject keyGet the i18n parameters for subject keyprotected String
Get the right to check allowed users to notify by mailprotected String
Get the URL of project to insert in email bodyprotected void
Notify email by mailvoid
service
(ServiceManager smanager) boolean
Checks if the event is supported.Methods inherited from class org.ametys.plugins.workspaces.project.notification.AbstractSendNotificationObserver
_getPath, contextualize, getMailCommonParams, getModulePage, getModuleUrl, getPriority, getProject, getProjectUrl, getUsersToNotify, observe, sendMail, setPluginInfo
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_webdavNotifyHelper
Webdav Notify Helper
-
-
Constructor Details
-
ResourcesMailNotifierObserver
public ResourcesMailNotifierObserver()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractSendNotificationObserver
- Throws:
ServiceException
-
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.
-
notifyEvent
protected void notifyEvent(Project project, String eventId, Map<String, Object> eventParams, User issuer) Description copied from class:AbstractSendNotificationObserver
Notify email by mail- Specified by:
notifyEvent
in classAbstractSendNotificationObserver
- Parameters:
project
- The projecteventId
- The id of eventeventParams
- The event's argumentsissuer
- The issuer
-
_getSubjectI18nKey
Get the i18n subject key- Parameters:
eventType
- The type of eventeventParams
- The optional event parameters- Returns:
- the i18 key
-
_getSubjectParams
protected List<String> _getSubjectParams(String eventType, Project project, User issuer, Map<String, Object> eventParams) Get the i18n parameters for subject key- Parameters:
eventType
- The event typeproject
- The parent projectissuer
- The user responsible of the actioneventParams
- The optional event parameters- Returns:
- the i18n parameters
-
_getBodyI18nKey
Get the i18n subject key- Parameters:
eventType
- The type of eventeventParams
- The optional event parameters- Returns:
- the i18n key
-
_getBodyParams
protected List<String> _getBodyParams(String eventType, Project project, User issuer, Map<String, Object> eventParams) Get the i18n parameters for body key- Parameters:
eventType
- The event typeproject
- The parent projectissuer
- The user responsible of the actioneventParams
- The optional event parameters- Returns:
- he i18n parameters
-
getUrl
Description copied from class:AbstractSendNotificationObserver
Get the URL of project to insert in email body- Specified by:
getUrl
in classAbstractSendNotificationObserver
- Parameters:
project
- The projectobjectId
- The id of concerned object- Returns:
- The full URL
-
getRightIdForNotify
Description copied from class:AbstractSendNotificationObserver
Get the right to check allowed users to notify by mail- Specified by:
getRightIdForNotify
in classAbstractSendNotificationObserver
- Returns:
- the right id to check
-
_getDownloadURL
Get the url to download file- Parameters:
project
- The projectid
- The id of resource- Returns:
- The download url
-