Class AbstractPageSubscriptionObserver

java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.pagesubscription.observer.AbstractPageSubscriptionObserver
All Implemented Interfaces:
Observer, LogEnabled, Serviceable
Direct Known Subclasses:
PageSubscriptionDeletePageObserver, PageSubscriptionExplorerObserver, PageSubscriptionValidateContentObserver

Abstract implementation of the observers of Page Subscription.
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager smanager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • getPriority

      public int getPriority(Event event)
      Description copied from interface: Observer
      Retrieves the priority to observe this event.
      This can be used to process a supported event before others observers.
      Specified by:
      getPriority in interface Observer
      Parameters:
      event - the event.
      Returns:
      the priority where 0 the max priority and Integer.MAX_VALUE the min priority.
    • observe

      public void observe(Event event, Map<String,Object> transientVars)
      Description copied from interface: Observer
      Observes an event.
      Specified by:
      observe in interface Observer
      Parameters:
      event - the event.
      transientVars - transientVars passed from one Observer to another when processing a single Event. This may allow optimizations between observers.
    • isNotificationEnabled

      protected boolean isNotificationEnabled(Page page)
      Determines if the notification is currently enabled
      Parameters:
      page - The page
      Returns:
      true if the notification is enabled
    • getSiteParameterId

      protected abstract String getSiteParameterId()
      Id of the site parameter to enable/disable the notification
      Returns:
      The id of site
    • _getAbsolutePageUrl

      protected String _getAbsolutePageUrl(Page page)
      Get the absolute URL of a page
      Parameters:
      page - The page to retrieve the url
      Returns:
      The absolute url of the page
    • _getMailSubject

      protected abstract String _getMailSubject(Event event, Page page)
      Create the mail subject depend on the event
      Parameters:
      event - the event
      page - the page
      Returns:
      the mail subject
    • _getMailBody

      protected abstract String _getMailBody(Event event, Page page)
      Create the mail body depend on the event
      Parameters:
      event - the event
      page - the page
      Returns:
      the mail body
    • _getPages

      protected abstract Collection<Page> _getPages(Event event)
      Get the pages linked to the event
      Parameters:
      event - the event
      Returns:
      the pages linked to the event