java.lang.Object
org.ametys.web.frontoffice.search.requesttime.input.InputValidator

public class InputValidator extends Object
Validator to determine if the search has to be launched or not
If both rejects() and validate() return false, then it is unknown and the search will not be launched.
  • Field Details

  • Constructor Details

    • InputValidator

      public InputValidator(SearchServiceInstance serviceInstance, ZoneItem zoneItem, String submittedFormParamValue, String fromZoneItemId)
      Constructor
      Parameters:
      serviceInstance - The current service instance
      zoneItem - The current zone item
      submittedFormParamValue - The value of the parameter for "submit-form"
      fromZoneItemId - The zone item id the request comes from
  • Method Details

    • rejects

      public boolean rejects()
      Determines if the search has NOT to be launched
      If this method returns true, then it will ensure that is the search will not be launched, even though validate() would return true as well.
      Returns:
      true if the search has NOT to be launched
    • resultDisplayTypeIsOnPage

      protected boolean resultDisplayTypeIsOnPage()
      ResultDisplayType of the service instance is on page (whether on another or on itself)
      Returns:
      true if ResultDisplayType of the service instance is on page (whether on another or on itself)
    • validate

      public boolean validate()
      Validates in order to determine if the search has to be launched or not
      Returns:
      true if the search has to be launched
    • notPartOfAService

      protected boolean notPartOfAService()
      The current request is not part of a service
      Returns:
      true if the current request is not part of a service
    • comesFromSourcePageWithNoGroupId

      protected boolean comesFromSourcePageWithNoGroupId()
      Request comes from another page with a search service configured with ResultDisplayType.ON_PAGE and no service group id
      Returns:
      true if request comes from another page with a search service configured with ResultDisplayType.ON_PAGE and no service group id
    • comesFromSameGroupId

      protected boolean comesFromSameGroupId()
      It comes from the same group id
      Returns:
      true if it comes from the same group id
    • comesFromSameZoneItemId

      protected boolean comesFromSameZoneItemId()
      It comes from the same zone item id
      Returns:
      true if it comes from the same zone item id