Package io.goobi.viewer.model.search
Class SearchQueryItem
java.lang.Object
io.goobi.viewer.model.search.SearchQueryItem
- All Implemented Interfaces:
Serializable
Field/operator/value tuple for the advanced search.
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddNewLine(int afterIndex) booleangenerateQuery(Set<String> searchTerms, boolean aggregateHits, boolean allowFuzzySearch) Generates the advanced query part for this item.getAvailableOperators.getCheckboxSelectables(String language, String... additionalValues) intgetField()Getter for the fieldfield.getLabel()getLines()Convenience getter.intgetSelectItems(String language) getSelectItems.getValue()Backwards compatibility getter.Backwards compatibility method.inthashCode()booleanbooleanbooleanisDisplayAddNewItemButton(int lineIndex) booleanisDisplaySelectItems.booleanisFirstLine(int lineIndex) booleanisHierarchical.booleanisLastLine(int lineIndex) booleanisRange()isRange.booleanisUntokenizeForPhraseSearch.booleanisValueSet(String value) Backwards compatibility method.booleanremoveLine.voidreset()reset.voidselectOneMenuListener(jakarta.faces.event.ValueChangeEvent ev) This is called aftersetField, so no point in callingtoggleDisplaySelectItemshere.voidsetDisplaySelectItems(boolean displaySelectItems) Setter for unit tets.voidSetter for the fieldfield.voidConvenience setter.voidsetPreselectValue(String preselectValue) voidBackwards compatibility setter.voidBackwards compatibility method.protected voidtoggleDisplaySelectItems.voidtoggleValue(String value) Backwards compatibility method.
-
Constructor Details
-
SearchQueryItem
public SearchQueryItem()Zero-argument constructor. -
SearchQueryItem
- Parameters:
template-
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
getAvailableOperators
getAvailableOperators.
- Returns:
- a
Listobject.
-
getSelectItems
public List<StringPair> getSelectItems(String language) throws PresentationException, IndexUnreachableException, DAOException getSelectItems.
- Parameters:
language- aStringobject.- Returns:
- a
Listobject. - Throws:
PresentationException- if any.IndexUnreachableException- if any.DAOException- if any.
-
getCheckboxSelectables
public List<CheckboxSelectable<String>> getCheckboxSelectables(String language, String... additionalValues) throws DAOException, PresentationException, IndexUnreachableException - Parameters:
language-additionalValues- 0-n additional, manually added values- Returns:
- List<CheckboxSelectable<String>>
- Throws:
DAOExceptionPresentationExceptionIndexUnreachableException
-
reset
public void reset()reset.
-
isDisplayAddNewItemButton
public boolean isDisplayAddNewItemButton(int lineIndex) - Parameters:
lineIndex-- Returns:
- a boolean
-
isFirstLine
public boolean isFirstLine(int lineIndex) - Parameters:
lineIndex-- Returns:
- true if given line is first in list; false otherwise
-
isLastLine
public boolean isLastLine(int lineIndex) - Parameters:
lineIndex-- Returns:
- true if given line is last in list; false otherwise
-
addNewLine
public boolean addNewLine(int afterIndex) - Parameters:
afterIndex-- Returns:
- true if new line successfully added; false otherwise
-
removeLine
removeLine.
- Parameters:
line- aSearchQueryItemLineobject.- Returns:
- a boolean.
-
isHierarchical
public boolean isHierarchical()isHierarchical.
- Returns:
- true or false
-
isRange
public boolean isRange()isRange.
- Returns:
- true or false
-
isUntokenizeForPhraseSearch
public boolean isUntokenizeForPhraseSearch()isUntokenizeForPhraseSearch.
- Returns:
- true or false
-
isAllowMultipleItems
public boolean isAllowMultipleItems()- Returns:
- a boolean
-
isAllFields
public boolean isAllFields()- Returns:
- true if selected field is "all fields"; false otherwise
-
getDisplaySelectItemsThreshold
public int getDisplaySelectItemsThreshold()- Returns:
- Configured threshold for displayed select items
-
getSelectType
- Returns:
- the selectType
-
getReplaceRegex
- Returns:
- the replaceRegex
-
getReplaceWith
- Returns:
- the replaceWith
-
getLabel
- Returns:
- the label
-
setLabel
- Parameters:
label- the label to set- Returns:
- this
-
getField
Getter for the field
field.- Returns:
- the field
-
setField
Setter for the field
field.- Parameters:
field- the field to set
-
getLines
- Returns:
- the lines
-
getOperator
Convenience getter.- Returns:
- Operator of the first line
-
setOperator
Convenience setter.- Parameters:
operator-
-
getValue
Backwards compatibility getter.- Returns:
- the value
-
setValue
Backwards compatibility setter.- Parameters:
value- the value to set
-
isValueSet
Backwards compatibility method.- Parameters:
value-- Returns:
- true if values contains given value; false otherwise
-
toggleValue
Backwards compatibility method.- Parameters:
value- Value to set/unset
-
getValue2
Backwards compatibility method.- Returns:
- the value2
-
setValue2
Backwards compatibility method.- Parameters:
value2- the value2 to set
-
isDisplaySelectItems
public boolean isDisplaySelectItems()isDisplaySelectItems.
- Returns:
- a boolean.
-
setDisplaySelectItems
public void setDisplaySelectItems(boolean displaySelectItems) Setter for unit tets.- Parameters:
displaySelectItems- the displaySelectItems to set
-
selectOneMenuListener
public void selectOneMenuListener(jakarta.faces.event.ValueChangeEvent ev) This is called aftersetField, so no point in callingtoggleDisplaySelectItemshere.- Parameters:
ev- aValueChangeEventobject.
-
toggleDisplaySelectItems
protected void toggleDisplaySelectItems()toggleDisplaySelectItems.
-
generateQuery
public String generateQuery(Set<String> searchTerms, boolean aggregateHits, boolean allowFuzzySearch) Generates the advanced query part for this item. -
getProximitySearchDistance
public int getProximitySearchDistance() -
getPreselectValue
- Returns:
- the preselectValue
-
setPreselectValue
- Parameters:
preselectValue- the preselectValue to set
-