Class FacetSearchComponent

java.lang.Object
org.ametys.web.frontoffice.search.requesttime.impl.FacetSearchComponent
All Implemented Interfaces:
SearchComponent

public class FacetSearchComponent extends Object implements SearchComponent
SearchComponent for executing the search with facets.
  • Constructor Details

  • Method Details

    • priority

      public int priority()
      Description copied from interface: SearchComponent
      Get the priority of the component. The lowest one will be executed first, and so on.
      Specified by:
      priority in interface SearchComponent
      Returns:
      the priority of the component
    • supports

      public boolean supports(SearchComponentArguments args)
      Description copied from interface: SearchComponent
      Returns true if the component must be executed.
      Specified by:
      supports in interface SearchComponent
      Parameters:
      args - the arguments
      Returns:
      true if the component must be executed.
    • execute

      public void execute(SearchComponentArguments args) throws Exception
      Description copied from interface: SearchComponent
      Executes the component.
      Specified by:
      execute in interface SearchComponent
      Parameters:
      args - the arguments
      Throws:
      Exception - if an exception occurs. Other search components will be attempted to be executed
    • checkValidInputs

      protected Map<String,List<String>> checkValidInputs(Collection<FacetDefinition> serviceFacets, Map<String,List<String>> userFacets, boolean isFromUserPref, Logger logger) throws org.ametys.web.frontoffice.search.requesttime.impl.InvalidUserInputException
      Checks the user inputs are valid
      Parameters:
      serviceFacets - The facets of the service instance
      userFacets - The user input facets
      isFromUserPref - true if the facets are from user pref. Then return only the valid input, otherwise throw an exception
      logger - The logger
      Returns:
      the filtered user facets
      Throws:
      org.ametys.web.frontoffice.search.requesttime.impl.InvalidUserInputException - if at least user one input is invalid