Class NotifyCommentAuthorWhenReplyingObserver
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.web.repository.comment.AbstractNotifyCommentAuthorObserver
org.ametys.web.repository.comment.NotifyCommentAuthorWhenReplyingObserver
- All Implemented Interfaces:
Observer,LogEnabled,PluginAware,Prioritizable,Supporter<Event>,Contextualizable,Serviceable
- Direct Known Subclasses:
NotifyCommentAuthorWhenReplyingObserver
Observer to notify the comment's author when someone reply to its commments
-
Field Summary
FieldsFields inherited from class org.ametys.web.repository.comment.AbstractNotifyCommentAuthorObserver
_commentsDAO, _contentHelper, _context, _i18nUtils, _pluginName, _populationContextHelper, _siteManager, _userLanguagesManager, _userManagerFields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Map<String, I18nizableTextParameter> Get the i18n parameters for mail bodyprotected I18nizableTextgetMailBody(Content content, Page page, Comment parentComment, Comment reply) Get the mail bodyprotected I18nizableTextgetMailSubject(Content content, Page page) Get the mail subjectprotected I18nizableTextgetMailTitle(Content content, Page page) Get the mail titleprotected StringgetOrphanContentUri(Content content) Get the absolute front url of an orphan contentprotected StringgetPageUri(Page page) Get the absolute front url of the pageprotected Map<String, I18nizableTextParameter> getSubjectI18nParams(Content content, Page page) Get the i18n parameters for mail subjectvoidObserves an event.voidservice(ServiceManager smanager) booleanCheck if an element is supportedMethods inherited from class org.ametys.web.repository.comment.AbstractNotifyCommentAuthorObserver
contextualize, getMailLanguage, getMailLanguage, getMailLanguage, getMailRecipient, getMailSender, getPriority, resolveCommentAuthor, resolveCommentAuthor, setPluginInfoMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_renderingContextHandler
The rendering context handler
-
-
Constructor Details
-
NotifyCommentAuthorWhenReplyingObserver
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractNotifyCommentAuthorObserver- Throws:
ServiceException
-
supports
Description copied from interface:SupporterCheck if an element is supported- Parameters:
event- The element- Returns:
trueif the element is supported,falseotherwise
-
observe
Description copied from interface:ObserverObserves an event.- Parameters:
event- the event.transientVars- transientVars passed from one Observer to another when processing a single Event. This may allow optimizations between observers.- Throws:
Exception- if an error occurs. All exceptions will be logged but not propagated, as the observation mechanism should never fail.
-
getMailSubject
Get the mail subject- Parameters:
content- The commented contentpage- The page holding the commented content. Can be null.- Returns:
- The mail subject
-
getMailTitle
Get the mail title- Parameters:
content- The commented contentpage- The page holding the commented content. Can be null.- Returns:
- The mail title
-
getMailBody
protected I18nizableText getMailBody(Content content, Page page, Comment parentComment, Comment reply) Get the mail body- Parameters:
content- The commented contentpage- The page holding the commented content. Can be null.parentComment- The initial commentreply- The reply to the comment- Returns:
- the mail body
-
getSubjectI18nParams
Get the i18n parameters for mail subject- Parameters:
content- the commented contentpage- The page holding the commented content. Can be null.- Returns:
- the i18n parameters for mail subject
-
getBodyI18nParams
protected Map<String,I18nizableTextParameter> getBodyI18nParams(Content content, Comment parentComment, Comment subComment, Site site, Page page) Get the i18n parameters for mail body- Parameters:
content- the commented contentparentComment- The initial commentsubComment- The answser to the commentsite- The sitepage- The page holding the commented content. Can be null.- Returns:
- the i18n parameters for mail body
-
getOrphanContentUri
Get the absolute front url of an orphan content- Parameters:
content- the commented content- Returns:
- the url of content
-
getPageUri
Get the absolute front url of the page- Parameters:
page- the page- Returns:
- the page url
-