Class AbstractCommentNotifyMentionsObserver<T extends AmetysObject>
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.repository.mentions.AbstractNotifyMentionsObserver<T>
org.ametys.cms.repository.comment.contributor.AbstractCommentNotifyMentionsObserver<T>
- Type Parameters:
T
- type of theAmetysObject
- All Implemented Interfaces:
AsyncObserver
,Observer
,LogEnabled
,Prioritizable
,Supporter<Event>
,Component
,Serviceable
- Direct Known Subclasses:
AbstractNotifyWorkspacesCommentMentionsObserver
,NotifyContentMentionsObserver
public abstract class AbstractCommentNotifyMentionsObserver<T extends AmetysObject>
extends AbstractNotifyMentionsObserver<T>
Abstract observer to send mails to mentioned users in contributor comments of
AmetysObject
-
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.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 abstract String
_getAmetysObjectTitle
(T ametysObject) Get the title to display in the mailprotected AbstractComment
_getComment
(T ametysObject, Map<String, Object> arguments) Get the comment form the argumentsprotected I18nizableText
Get the type of message to display before the messageprotected I18nizableText
_getMailSubject
(AbstractNotifyMentionsObserver.MentionableObject mentionableObject) Retrieves the notification mail's subjectprotected String
_transformSyntaxTextToReadableTextWithColors
(String syntaxText, UserIdentity recipient) Transform syntax text to readable text with colors according to whether the recipient is the one being tagged or notMethods inherited from class org.ametys.cms.repository.mentions.AbstractNotifyMentionsObserver
_canSendMailToMentionedUser, _createBody, _getMailMessage, _getMailTitle, _getMentionableObjectFromArguments, _sendMail, _sendMailToMentionedUsers, getPriority, getStandardMailBodyHelper, observe, service
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
-
AbstractCommentNotifyMentionsObserver
-
-
Method Details
-
_transformSyntaxTextToReadableTextWithColors
protected String _transformSyntaxTextToReadableTextWithColors(String syntaxText, UserIdentity recipient) Description copied from class:AbstractNotifyMentionsObserver
Transform syntax text to readable text with colors according to whether the recipient is the one being tagged or not- Specified by:
_transformSyntaxTextToReadableTextWithColors
in classAbstractNotifyMentionsObserver<T extends AmetysObject>
- Parameters:
syntaxText
- the syntax textrecipient
- the recipient- Returns:
- the readable text
-
_getMailMessageType
Description copied from class:AbstractNotifyMentionsObserver
Get the type of message to display before the message- Specified by:
_getMailMessageType
in classAbstractNotifyMentionsObserver<T extends AmetysObject>
- Returns:
- the message type
-
_getMailSubject
protected I18nizableText _getMailSubject(AbstractNotifyMentionsObserver.MentionableObject mentionableObject) Description copied from class:AbstractNotifyMentionsObserver
Retrieves the notification mail's subject- Specified by:
_getMailSubject
in classAbstractNotifyMentionsObserver<T extends AmetysObject>
- Parameters:
mentionableObject
- the mentionable object- Returns:
- the notification mail's subject
-
_getComment
Get the comment form the arguments- Parameters:
ametysObject
- the ametys objectarguments
- the arguments map- Returns:
- the comment
-
_getAmetysObjectTitle
Get the title to display in the mail- Parameters:
ametysObject
- the ametys object- Returns:
- the ametys object title
-