Class NotifyThreadCommentMentionsObserver
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.repository.mentions.AbstractNotifyMentionsObserver<Thread>
org.ametys.cms.repository.comment.contributor.AbstractCommentNotifyMentionsObserver<Thread>
org.ametys.plugins.workspaces.comments.AbstractNotifyWorkspacesCommentMentionsObserver<Thread>
org.ametys.plugins.workspaces.comments.NotifyThreadCommentMentionsObserver
- All Implemented Interfaces:
AsyncObserver,Observer,LogEnabled,Prioritizable,Supporter<Event>,Component,Contextualizable,Serviceable
public class NotifyThreadCommentMentionsObserver
extends AbstractNotifyWorkspacesCommentMentionsObserver<Thread>
Observer to send mails to mentioned users in contributor comments of
Thread-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.cms.repository.mentions.AbstractNotifyMentionsObserver
AbstractNotifyMentionsObserver.LinkToAmetysObject, AbstractNotifyMentionsObserver.MentionableObject -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ForumWorkspaceModuleThe forum moduleprotected ThreadJSONHelperThe project tags DAOFields 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(Thread thread) Get the title to display in the mailprotected I18nizableText_getMailMessage(AbstractNotifyMentionsObserver.MentionableObject mentionableObject) Retrieves the notification mail's subjectprotected I18nizableTextGet the type of message to display before the message_getMentionableObjectFromArguments(Map<String, Object> arguments) Get all information of the mentionable object from the argumentsprotected StringGet the module id to check read accessprotected String_transformSyntaxTextToReadableTextWithColors(String content, UserIdentity recipient) Transform syntax text to readable text with colors according to whether the recipient is the one being tagged or notvoidcontextualize(Context context) protected StringGet the URL of the given Ametys object in the context of the given projectvoidservice(ServiceManager manager) booleanCheck if an element is supportedMethods inherited from class org.ametys.plugins.workspaces.comments.AbstractNotifyWorkspacesCommentMentionsObserver
_canSendMailToMentionedUser, _getAbsoluteUrl, _getAmetysObjectFromArguments, _getLanguage, _getMailSubject, _getMailTitle, getStandardMailBodyHelper, observeMethods inherited from class org.ametys.cms.repository.comment.contributor.AbstractCommentNotifyMentionsObserver
_getCommentMethods 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
-
Field Details
-
_forumModule
The forum module -
_threadJSONHelper
The project tags DAO
-
-
Constructor Details
-
NotifyThreadCommentMentionsObserver
public NotifyThreadCommentMentionsObserver()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractNotifyWorkspacesCommentMentionsObserver<Thread>- Throws:
ServiceException
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Overrides:
contextualizein classAbstractNotifyWorkspacesCommentMentionsObserver<Thread>- Throws:
ContextException
-
supports
Description copied from interface:SupporterCheck if an element is supported- Parameters:
event- The element- Returns:
trueif the element is supported,falseotherwise
-
_getAmetysObjectTitle
Description copied from class:AbstractCommentNotifyMentionsObserverGet the title to display in the mail- Specified by:
_getAmetysObjectTitlein classAbstractCommentNotifyMentionsObserver<Thread>- Parameters:
thread- 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<Thread>- Parameters:
mentionableObject- the mentionable object- Returns:
- the notification mail's subject
-
_transformSyntaxTextToReadableTextWithColors
protected String _transformSyntaxTextToReadableTextWithColors(String content, UserIdentity recipient) Description copied from class:AbstractNotifyMentionsObserverTransform syntax text to readable text with colors according to whether the recipient is the one being tagged or not- Overrides:
_transformSyntaxTextToReadableTextWithColorsin classAbstractCommentNotifyMentionsObserver<Thread>- Parameters:
content- the syntax textrecipient- the recipient- Returns:
- the readable text
-
_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<Thread>- Parameters:
arguments- the arguments map- Returns:
- the mentionable object
- Throws:
Exception- if an error occurs.
-
_getMailMessageType
Description copied from class:AbstractNotifyMentionsObserverGet the type of message to display before the message- Overrides:
_getMailMessageTypein classAbstractCommentNotifyMentionsObserver<Thread>- Returns:
- the message type
-
_getModuleId
Description copied from class:AbstractNotifyWorkspacesCommentMentionsObserverGet the module id to check read access- Specified by:
_getModuleIdin classAbstractNotifyWorkspacesCommentMentionsObserver<Thread>- 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<Thread>- Parameters:
thread- the Ametys objectproject- the project containing the Ametys object- Returns:
- the URL (may be relative or absolute depending on the implementation)
-