Class TagUpdatedObserver

All Implemented Interfaces:
Observer, LogEnabled, Contextualizable, Serviceable

Tag added Observer: - Clear the cache. - Re-index contents tagged with this tag or a descendant tag.
  • Constructor Details

  • Method Details

    • supports

      public boolean supports(Event event)
      Description copied from interface: Observer
      Checks if the event is supported. If true, the observe(Event) method will be called.
      Parameters:
      event - the event.
      Returns:
      true for observing this event, false otherwise.
    • observe

      protected void observe(Site site, AmetysObject aoTag, String tagName, Event rawEvent)
      Description copied from class: AbstractTagObserver
      Typed observe method
      Specified by:
      observe in class AbstractTagObserver
      Parameters:
      site - the site
      aoTag - the tag or its parent
      tagName - the tag name corresponding the the object tagOrParent when applicable.
      rawEvent - The raw event from which the previous arguments have been extracted.
    • _reindexTaggedContents

      protected void _reindexTaggedContents(Collection<String> descendantNames) throws Exception
      Re-index content tagged with at least of this tags
      Parameters:
      descendantNames - the descendant's name
      Throws:
      Exception - if an error occurs
    • _reindexContent

      protected void _reindexContent(Content content) throws Exception
      Re-index the given content
      Parameters:
      content - the content to re-index
      Throws:
      Exception - if unable to create or update the index