Class CombinedSearchFormAndSearchFilterHandler
java.lang.Object
ch.tocco.nice2.netui.impl.bind.entity.search.CombinedSearchFormAndSearchFilterHandler
- All Implemented Interfaces:
SearchRequestHandler
@Component
public class CombinedSearchFormAndSearchFilterHandler
extends Object
implements SearchRequestHandler
Handler for when the search form is filled in and a search filter is selected.
impl notes: i've tried to not copy/paste code from the 2 other handlers searchFormHandler and searchFilterHandler, and instead use them. this required an additional method in searchFilterHandler only. after getting it to work eike and me were wondering if it would be better to try to avoid the string concatenation for the query. we can't avoid it completely for the simple fact that the search filter comes in as a string. what could be done is to generally use the QueryBuilder here, and add a method to append a full query part like "a=b and c=d" without any type checking. for now i leave it as is - it's working, but probably not the final version.
-
Constructor Summary
ConstructorDescriptionCombinedSearchFormAndSearchFilterHandler
(SearchFormHandler searchFormHandler, SearchFilterHandler searchFilterHandler) -
Method Summary
Modifier and TypeMethodDescriptioncreateSearchQuery
(SearchRequest request) Returns the search query for this search request.int
getScore
(SearchRequest request) Returns the priority of this handler.
-
Constructor Details
-
CombinedSearchFormAndSearchFilterHandler
public CombinedSearchFormAndSearchFilterHandler(SearchFormHandler searchFormHandler, SearchFilterHandler searchFilterHandler)
-
-
Method Details
-
getScore
Description copied from interface:SearchRequestHandler
Returns the priority of this handler. The most positive score is considered as highest priority. The higher the score, the more specialized this handler is in handling the request. This is called on every search!- Specified by:
getScore
in interfaceSearchRequestHandler
-
createSearchQuery
Description copied from interface:SearchRequestHandler
Returns the search query for this search request.- Specified by:
createSearchQuery
in interfaceSearchRequestHandler
- Throws:
RpcExecutionException
-