Class SearchQueryGroup

java.lang.Object
io.goobi.viewer.model.search.SearchQueryGroup
All Implemented Interfaces:
Serializable

public class SearchQueryGroup extends Object implements Serializable
Searches query group for the advanced search.
See Also:
  • Constructor Details

    • SearchQueryGroup

      public SearchQueryGroup(List<AdvancedSearchFieldConfiguration> fieldConfigs, String template)
      Creates a new SearchQueryGroup instance.
      Parameters:
      fieldConfigs - list of advanced search field configurations
      template - search template name to use for initialization
  • Method Details

    • init

      public void init(List<AdvancedSearchFieldConfiguration> fieldConfigs, String template)
      Parameters:
      fieldConfigs - list of advanced search field configurations
      template - search template name to determine available fields
    • injectItems

      public void injectItems(List<SearchQueryItem> items)
      Replaces query items in this group with the given list.
      Parameters:
      items - list of search query items to inject
    • resetItems

      public void resetItems()
      Resets all items.
    • isBlank

      public boolean isBlank()
      Returns:
      true if none of the items has any value input; false otherwise
    • getAvailableOperators

      public List<SearchQueryGroup.SearchQueryGroupOperator> getAvailableOperators()
      getAvailableOperators.
      Returns:
      a list of all available search query group operators
    • getQueryItems

      public List<SearchQueryItem> getQueryItems()
      Getter for the field queryItems.
      Returns:
      the list of individual search query items within this group
    • addNewQueryItem

      public boolean addNewQueryItem(String field, int afterIndex)
      addNewQueryItem.
      Parameters:
      field - Index field for the new item
      afterIndex - Item index after which to place new new item
      Returns:
      true if operation successful; false otherwise
    • removeQueryItem

      public boolean removeQueryItem(SearchQueryItem item)
      removeQueryItem.
      Parameters:
      item - a SearchQueryItem object.
      Returns:
      true if the item was removed successfully, false if it could not be removed (e.g. it is the last remaining item)
    • getOperator

      Getter for the field operator.
      Returns:
      the logical operator (AND/OR) used to combine items within this query group
    • setOperator

      public void setOperator(SearchQueryGroup.SearchQueryGroupOperator operator)
      Setter for the field operator.
      Parameters:
      operator - the logical operator (AND/OR) used to combine items within this query group