Class 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 Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager smanager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Overrides:
      service in class AbstractNotifyCommentAuthorObserver
      Throws:
      ServiceException
    • supports

      public boolean supports(Event event)
      Description copied from interface: Supporter
      Check if an element is supported
      Parameters:
      event - The element
      Returns:
      true if the element is supported, false otherwise
    • observe

      public void observe(Event event, Map<String,Object> transientVars) throws Exception
      Description copied from interface: Observer
      Observes 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

      protected I18nizableText getMailSubject(Content content, Page page)
      Get the mail subject
      Parameters:
      content - The commented content
      page - The page holding the commented content. Can be null.
      Returns:
      The mail subject
    • getMailTitle

      protected I18nizableText getMailTitle(Content content, Page page)
      Get the mail title
      Parameters:
      content - The commented content
      page - 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 content
      page - The page holding the commented content. Can be null.
      parentComment - The initial comment
      reply - The reply to the comment
      Returns:
      the mail body
    • getSubjectI18nParams

      Get the i18n parameters for mail subject
      Parameters:
      content - the commented content
      page - 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 content
      parentComment - The initial comment
      subComment - The answser to the comment
      site - The site
      page - The page holding the commented content. Can be null.
      Returns:
      the i18n parameters for mail body
    • getOrphanContentUri

      protected String getOrphanContentUri(Content content)
      Get the absolute front url of an orphan content
      Parameters:
      content - the commented content
      Returns:
      the url of content
    • getPageUri

      protected String getPageUri(Page page)
      Get the absolute front url of the page
      Parameters:
      page - the page
      Returns:
      the page url