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
public class ResourcesMailNotifierObserver extends AbstractSendNotificationObserver
This observer observes event of resources to notify concerned users
-
-
Field Summary
Fields Modifier and Type Field Description private static int__MAX_RESOURCE_LINKprivate DocumentWorkspaceModule_documentModuleprotected ResourceNotifierHelper_webdavNotifyHelperWebdav Notify Helper-
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
Constructors Constructor Description ResourcesMailNotifierObserver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String_getBodyI18nKey(String eventType, Map<String,Object> eventParams)Get the i18n subject keyprotected List<String>_getBodyParams(String eventType, Project project, User issuer, Map<String,Object> eventParams)Get the i18n parameters for body keyprotected String_getDownloadURL(Project project, String id)Get the url to download fileprivate String_getDownloadURL(Project project, Map<String,Resource> resources)protected String_getSubjectI18nKey(String eventType, Map<String,Object> eventParams)Get the i18n subject keyprotected List<String>_getSubjectParams(String eventType, Project project, User issuer, Map<String,Object> eventParams)Get the i18n parameters for subject keyprotected StringgetRightIdForNotify()Get the right to check allowed users to notify by mailprotected StringgetUrl(Project project, String objectId)Get the URL of project to insert in email bodyprotected voidnotifyEvent(Project project, String eventId, Map<String,Object> eventParams, User issuer)Notify email by mailvoidservice(ServiceManager smanager)booleansupports(Event event)Checks if the event is supported.-
Methods inherited from class org.ametys.plugins.workspaces.project.notification.AbstractSendNotificationObserver
_getPath, contextualize, getDefaultLanguage, getMailCommonParams, getModulePage, getModuleUrl, getPriority, getProject, getProjectUrl, getUsersToNotify, observe, sendMail, setPluginInfo
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
__MAX_RESOURCE_LINK
private static final int __MAX_RESOURCE_LINK
- See Also:
- Constant Field Values
-
_webdavNotifyHelper
protected ResourceNotifierHelper _webdavNotifyHelper
Webdav Notify Helper
-
_documentModule
private DocumentWorkspaceModule _documentModule
-
-
Constructor Detail
-
ResourcesMailNotifierObserver
public ResourcesMailNotifierObserver()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractSendNotificationObserver- Throws:
ServiceException
-
supports
public boolean supports(Event event)
Description copied from interface:ObserverChecks if the event is supported. If true, the observe(Event) method will be called.- Parameters:
event- the event.- Returns:
truefor observing this event,falseotherwise.
-
notifyEvent
protected void notifyEvent(Project project, String eventId, Map<String,Object> eventParams, User issuer)
Description copied from class:AbstractSendNotificationObserverNotify email by mail- Specified by:
notifyEventin classAbstractSendNotificationObserver- Parameters:
project- The projecteventId- The id of eventeventParams- The event's argumentsissuer- The issuer
-
_getSubjectI18nKey
protected String _getSubjectI18nKey(String eventType, Map<String,Object> eventParams)
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
protected String _getBodyI18nKey(String eventType, Map<String,Object> eventParams)
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
protected String getUrl(Project project, String objectId)
Description copied from class:AbstractSendNotificationObserverGet the URL of project to insert in email body- Specified by:
getUrlin classAbstractSendNotificationObserver- Parameters:
project- The projectobjectId- The id of concerned object- Returns:
- The full URL
-
getRightIdForNotify
protected String getRightIdForNotify()
Description copied from class:AbstractSendNotificationObserverGet the right to check allowed users to notify by mail- Specified by:
getRightIdForNotifyin classAbstractSendNotificationObserver- Returns:
- the right id to check
-
_getDownloadURL
protected String _getDownloadURL(Project project, String id)
Get the url to download file- Parameters:
project- The projectid- The id of resource- Returns:
- The download url
-
-