Class InputValidator
- 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 bothrejects()andvalidate()returnfalse, then it is unknown and the search will not be launched.
-
-
Field Summary
Fields Modifier and Type Field Description protected String_fromZoneItemIdThe zone item id the request comes fromprotected SearchServiceInstance_serviceInstanceThe current service instanceprotected String_submittedFormParamValueThe value of the parameter for "submit-form"protected ZoneItem_zoneItemThe current zone item
-
Constructor Summary
Constructors Constructor Description InputValidator(SearchServiceInstance serviceInstance, ZoneItem zoneItem, String submittedFormParamValue, String fromZoneItemId)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancomesFromSameGroupId()It comes from the same group idprotected booleancomesFromSameZoneItemId()It comes from the same zone item idprotected booleancomesFromSourcePageWithNoGroupId()Request comes from another page with a search service configured withResultDisplayType.ON_PAGEand no service group idprotected booleannotPartOfAService()The current request is not part of a servicebooleanrejects()Determines if the search has NOT to be launched
If this method returnstrue, then it will ensure that is the search will not be launched, even thoughvalidate()would returntrueas well.protected booleanresultDisplayTypeIsOnPage()ResultDisplayTypeof the service instance ison page(whether on another or on itself)booleanvalidate()Validates in order to determine if the search has to be launched or not
-
-
-
Field Detail
-
_serviceInstance
protected SearchServiceInstance _serviceInstance
The current service instance
-
_submittedFormParamValue
protected String _submittedFormParamValue
The value of the parameter for "submit-form"
-
_fromZoneItemId
protected String _fromZoneItemId
The zone item id the request comes from
-
-
Constructor Detail
-
InputValidator
public InputValidator(SearchServiceInstance serviceInstance, ZoneItem zoneItem, String submittedFormParamValue, String fromZoneItemId)
Constructor- Parameters:
serviceInstance- The current service instancezoneItem- The current zone itemsubmittedFormParamValue- The value of the parameter for "submit-form"fromZoneItemId- The zone item id the request comes from
-
-
Method Detail
-
rejects
public boolean rejects()
Determines if the search has NOT to be launched
If this method returnstrue, then it will ensure that is the search will not be launched, even thoughvalidate()would returntrueas well.- Returns:
trueif the search has NOT to be launched
-
resultDisplayTypeIsOnPage
protected boolean resultDisplayTypeIsOnPage()
ResultDisplayTypeof the service instance ison page(whether on another or on itself)- Returns:
trueifResultDisplayTypeof the service instance ison 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:
trueif the search has to be launched
-
notPartOfAService
protected boolean notPartOfAService()
The current request is not part of a service- Returns:
trueif the current request is not part of a service
-
comesFromSourcePageWithNoGroupId
protected boolean comesFromSourcePageWithNoGroupId()
Request comes from another page with a search service configured withResultDisplayType.ON_PAGEand no service group id- Returns:
trueif request comes from another page with a search service configured withResultDisplayType.ON_PAGEand no service group id
-
comesFromSameGroupId
protected boolean comesFromSameGroupId()
It comes from the same group id- Returns:
trueif it comes from the same group id
-
comesFromSameZoneItemId
protected boolean comesFromSameZoneItemId()
It comes from the same zone item id- Returns:
trueif it comes from the same zone item id
-
-