Interface FilterManager

All Superinterfaces:
ModuleManager
All Known Implementing Classes:
DefaultFilterManager

public interface FilterManager
extends ModuleManager
  • Field Details

  • Method Details

    • addPageFilter

      void addPageFilter​(PageFilter f, int priority) throws java.lang.IllegalArgumentException
      Adds a page filter to the queue. The priority defines in which order the page filters are run, the highest priority filters go in the queue first.

      In case two filters have the same priority, their execution order is the insertion order.

      Parameters:
      f - PageFilter to add
      priority - The priority in which position to add it in.
      Throws:
      java.lang.IllegalArgumentException - If the PageFilter is null or invalid.
      Since:
      2.1.44.
    • doPreTranslateFiltering

      java.lang.String doPreTranslateFiltering​(Context context, java.lang.String pageData) throws FilterException
      Does the filtering before a translation.
      Parameters:
      context - The WikiContext
      pageData - WikiMarkup data to be passed through the preTranslate chain.
      Returns:
      The modified WikiMarkup
      Throws:
      FilterException - If any of the filters throws a FilterException
      See Also:
      PageFilter.preTranslate(Context, String)
    • doPostTranslateFiltering

      java.lang.String doPostTranslateFiltering​(Context context, java.lang.String htmlData) throws FilterException
      Does the filtering after HTML translation.
      Parameters:
      context - The WikiContext
      htmlData - HTML data to be passed through the postTranslate
      Returns:
      The modified HTML
      Throws:
      FilterException - If any of the filters throws a FilterException
      See Also:
      PageFilter.postTranslate(Context, String)
    • doPreSaveFiltering

      java.lang.String doPreSaveFiltering​(Context context, java.lang.String pageData) throws FilterException
      Does the filtering before a save to the page repository.
      Parameters:
      context - The WikiContext
      pageData - WikiMarkup data to be passed through the preSave chain.
      Returns:
      The modified WikiMarkup
      Throws:
      FilterException - If any of the filters throws a FilterException
      See Also:
      PageFilter.preSave(Context, String)
    • doPostSaveFiltering

      void doPostSaveFiltering​(Context context, java.lang.String pageData) throws FilterException
      Does the page filtering after the page has been saved.
      Parameters:
      context - The WikiContext
      pageData - WikiMarkup data to be passed through the postSave chain.
      Throws:
      FilterException - If any of the filters throws a FilterException
      See Also:
      PageFilter.postSave(Context, String)
    • getFilterList

      java.util.List<PageFilter> getFilterList()
      Returns the list of filters currently installed. Note that this is not a copy, but the actual list. So be careful with it.
      Returns:
      A List of PageFilter objects
    • destroy

      void destroy()
      Notifies PageFilters to clean up their resources.