Class SearchGeneratorHelper

java.lang.Object
org.ametys.cms.search.cocoon.SearchGeneratorHelper

public final class SearchGeneratorHelper extends Object
Helper for search generator
  • Method Details

    • copyAndFilterViewItemAccessor

      public static ViewItemAccessor copyAndFilterViewItemAccessor(ViewItemAccessor viewItemAccessor, List<String> itemPathsToKeep)
      Copy the items of the given accessor, keeping only the items with the given paths
      Parameters:
      viewItemAccessor - the view item accessor to copy
      itemPathsToKeep - the paths of the items to keep. If the list is empty, copy the accessor and keep all items
      Returns:
      the view items accessor's copy
    • removeResultItems

      public static void removeResultItems(ViewItemAccessor viewItemAccessor, List<String> itemPathsToRemove)
      Removes the items with the given paths from the given accessor
      Parameters:
      viewItemAccessor - the view item accessor
      itemPathsToRemove - the paths of the items to remove