Class NotifyTaskCommentMentionsObserver
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.repository.mentions.AbstractNotifyMentionsObserver<Task>
org.ametys.cms.repository.comment.contributor.AbstractCommentNotifyMentionsObserver<Task>
org.ametys.plugins.workspaces.comments.AbstractNotifyWorkspacesCommentMentionsObserver<Task>
org.ametys.plugins.workspaces.comments.NotifyTaskCommentMentionsObserver
- All Implemented Interfaces:
AsyncObserver
,Observer
,LogEnabled
,Prioritizable
,Supporter<Event>
,Component
,Contextualizable
,Serviceable
public class NotifyTaskCommentMentionsObserver
extends AbstractNotifyWorkspacesCommentMentionsObserver<Task>
Observer to send mails to mentioned users in contributor comments of
Task
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.cms.repository.mentions.AbstractNotifyMentionsObserver
AbstractNotifyMentionsObserver.LinkToAmetysObject, AbstractNotifyMentionsObserver.MentionableObject
-
Field Summary
Fields inherited from class org.ametys.plugins.workspaces.comments.AbstractNotifyWorkspacesCommentMentionsObserver
_context, _documentModule, _projectManager, _projectRightsHelper, _renderingContextHandler, _rightManager, _taskModule, _workspaceHelper
Fields inherited from class org.ametys.cms.repository.mentions.AbstractNotifyMentionsObserver
_currentUserProvider, _i18nUtils, _mentionUtils, _resolvedUsers, _resolver, _userManager
Fields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
_getAmetysObjectTitle
(Task task) Get the title to display in the mailprotected I18nizableText
_getMailMessage
(AbstractNotifyMentionsObserver.MentionableObject mentionableObject) Retrieves the notification mail's subject_getMentionableObjectFromArguments
(Map<String, Object> arguments) Get all information of the mentionable object from the argumentsprotected String
Get the module id to check read accessprotected String
Get the URL of the given Ametys object in the context of the given projectboolean
Check if an element is supportedMethods inherited from class org.ametys.plugins.workspaces.comments.AbstractNotifyWorkspacesCommentMentionsObserver
_canSendMailToMentionedUser, _getAbsoluteUrl, _getAmetysObjectFromArguments, _getLanguage, _getMailSubject, _getMailTitle, contextualize, getStandardMailBodyHelper, observe, service
Methods inherited from class org.ametys.cms.repository.comment.contributor.AbstractCommentNotifyMentionsObserver
_getComment, _getMailMessageType, _transformSyntaxTextToReadableTextWithColors
Methods inherited from class org.ametys.cms.repository.mentions.AbstractNotifyMentionsObserver
_createBody, _sendMail, _sendMailToMentionedUsers, getPriority
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.core.observation.AsyncObserver
parallelizable
-
Constructor Details
-
NotifyTaskCommentMentionsObserver
public NotifyTaskCommentMentionsObserver()
-
-
Method Details
-
supports
Description copied from interface:Supporter
Check if an element is supported- Parameters:
event
- The element- Returns:
true
if the element is supported,false
otherwise
-
_getAmetysObjectTitle
Description copied from class:AbstractCommentNotifyMentionsObserver
Get the title to display in the mail- Specified by:
_getAmetysObjectTitle
in classAbstractCommentNotifyMentionsObserver<Task>
- Parameters:
task
- the ametys object- Returns:
- the ametys object title
-
_getMentionableObjectFromArguments
protected AbstractNotifyMentionsObserver.MentionableObject _getMentionableObjectFromArguments(Map<String, Object> arguments) throws ExceptionDescription copied from class:AbstractNotifyMentionsObserver
Get all information of the mentionable object from the arguments- Specified by:
_getMentionableObjectFromArguments
in classAbstractNotifyMentionsObserver<Task>
- Parameters:
arguments
- the arguments map- Returns:
- the mentionable object
- Throws:
Exception
- if an error occurs.
-
_getMailMessage
protected I18nizableText _getMailMessage(AbstractNotifyMentionsObserver.MentionableObject mentionableObject) Description copied from class:AbstractNotifyMentionsObserver
Retrieves the notification mail's subject- Specified by:
_getMailMessage
in classAbstractNotifyMentionsObserver<Task>
- Parameters:
mentionableObject
- the mentionable object- Returns:
- the notification mail's subject
-
_getModuleId
Description copied from class:AbstractNotifyWorkspacesCommentMentionsObserver
Get the module id to check read access- Specified by:
_getModuleId
in classAbstractNotifyWorkspacesCommentMentionsObserver<Task>
- Returns:
- the module id
-
getUrl
Description copied from class:AbstractNotifyWorkspacesCommentMentionsObserver
Get the URL of the given Ametys object in the context of the given project- Specified by:
getUrl
in classAbstractNotifyWorkspacesCommentMentionsObserver<Task>
- Parameters:
task
- the Ametys objectproject
- the project containing the Ametys object- Returns:
- the URL (may be relative or absolute depending on the implementation)
-