Class NotifyFileCommentMentionsObserver
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.repository.mentions.AbstractNotifyMentionsObserver<File>
org.ametys.cms.repository.comment.contributor.AbstractCommentNotifyMentionsObserver<File>
org.ametys.plugins.workspaces.comments.AbstractNotifyWorkspacesCommentMentionsObserver<File>
org.ametys.plugins.workspaces.comments.NotifyFileCommentMentionsObserver
- All Implemented Interfaces:
AsyncObserver,Observer,LogEnabled,Prioritizable,Supporter<Event>,Component,Contextualizable,Serviceable
public class NotifyFileCommentMentionsObserver
extends AbstractNotifyWorkspacesCommentMentionsObserver<File>
Observer to send mails to mentioned users in contributor comments of
File-
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, _workspaceHelperFields inherited from class org.ametys.cms.repository.mentions.AbstractNotifyMentionsObserver
_currentUserProvider, _i18nUtils, _mentionUtils, _resolvedUsers, _resolver, _userLanguagesManager, _userManagerFields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String_getAmetysObjectTitle(File file) 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 StringGet the module id to check read accessprotected StringGet the URL of the given Ametys object in the context of the given projectbooleanCheck if an element is supportedMethods inherited from class org.ametys.plugins.workspaces.comments.AbstractNotifyWorkspacesCommentMentionsObserver
_canSendMailToMentionedUser, _getAbsoluteUrl, _getAmetysObjectFromArguments, _getLanguage, _getMailSubject, _getMailTitle, contextualize, getStandardMailBodyHelper, observe, serviceMethods inherited from class org.ametys.cms.repository.comment.contributor.AbstractCommentNotifyMentionsObserver
_getComment, _getMailMessageType, _transformSyntaxTextToReadableTextWithColorsMethods inherited from class org.ametys.cms.repository.mentions.AbstractNotifyMentionsObserver
_createBody, _sendMail, _sendMailToMentionedUsers, getPriorityMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.core.observation.AsyncObserver
parallelizable
-
Constructor Details
-
NotifyFileCommentMentionsObserver
public NotifyFileCommentMentionsObserver()
-
-
Method Details
-
supports
Description copied from interface:SupporterCheck if an element is supported- Parameters:
event- The element- Returns:
trueif the element is supported,falseotherwise
-
_getMentionableObjectFromArguments
protected AbstractNotifyMentionsObserver.MentionableObject _getMentionableObjectFromArguments(Map<String, Object> arguments) throws ExceptionDescription copied from class:AbstractNotifyMentionsObserverGet all information of the mentionable object from the arguments- Specified by:
_getMentionableObjectFromArgumentsin classAbstractNotifyMentionsObserver<File>- Parameters:
arguments- the arguments map- Returns:
- the mentionable object
- Throws:
Exception- if an error occurs.
-
_getAmetysObjectTitle
Description copied from class:AbstractCommentNotifyMentionsObserverGet the title to display in the mail- Specified by:
_getAmetysObjectTitlein classAbstractCommentNotifyMentionsObserver<File>- Parameters:
file- the ametys object- Returns:
- the ametys object title
-
_getMailMessage
protected I18nizableText _getMailMessage(AbstractNotifyMentionsObserver.MentionableObject mentionableObject) Description copied from class:AbstractNotifyMentionsObserverRetrieves the notification mail's subject- Specified by:
_getMailMessagein classAbstractNotifyMentionsObserver<File>- Parameters:
mentionableObject- the mentionable object- Returns:
- the notification mail's subject
-
_getModuleId
Description copied from class:AbstractNotifyWorkspacesCommentMentionsObserverGet the module id to check read access- Specified by:
_getModuleIdin classAbstractNotifyWorkspacesCommentMentionsObserver<File>- Returns:
- the module id
-
getUrl
Description copied from class:AbstractNotifyWorkspacesCommentMentionsObserverGet the URL of the given Ametys object in the context of the given project- Specified by:
getUrlin classAbstractNotifyWorkspacesCommentMentionsObserver<File>- Parameters:
ametysObject- the Ametys objectproject- the project containing the Ametys object- Returns:
- the URL (may be relative or absolute depending on the implementation)
-