Interface Searchable
- All Known Implementing Classes:
AbstractContentBasedSearchable
,AbstractParameterAdderSearchable
,CalendarContentSearchable
,ContentSearchable
,CourseSearchable
,PageSearchable
,PrivateContentSearchable
,ProgramSearchable
,ResourceSearchable
public interface Searchable
Brings a set of criteria, facets, sorts on a type of objects.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Collection<Configuration>
Retrieves the additional parameters to add to the search service
The ids of the parameters must be unique across allReturnable
s andSearchable
sbuildQuery
(AbstractTreeNode<FOSearchCriterion> criterionTree, Map<String, Object> userCriteria, Collection<Returnable> returnables, Collection<Searchable> searchables, AdditionalParameterValueMap additionalParameters, String currentLang, Map<String, Object> contextualParameters) Builds the query of the criterion treedefault int
The position of the criteria provided by thisSearchable
among criteria provided by otherSearchable
s.getCriteria
(AdditionalParameterValueMap additionalParameterValues) Gets the criteriagetLabel()
Gets the label of the searchablejoinQuery
(Query queryOnCriterion, SearchCriterionDefinition criterion, Collection<Returnable> returnables, AdditionalParameterValueMap additionalParameters) Returns the query which joins the given one (on a criterion) with the given result typesdefault Collection<Returnable>
Retrieves the relations the type must have with someReturnable
s.
-
Method Details
-
getLabel
Gets the label of the searchable- Returns:
- the label of the searchable
-
relationsWith
Retrieves the relations the type must have with someReturnable
s.
It does not have to be exhaustive (for instance ifReturnable.relationsWith()
declares the relation, it is useless to declare it twice)- Returns:
- some relations the type must have with some
Returnable
s
-
additionalServiceParameters
Retrieves the additional parameters to add to the search service
The ids of the parameters must be unique across allReturnable
s andSearchable
s- Returns:
- some additional parameters to add to the search service
-
getCriteria
Collection<SearchCriterionDefinition> getCriteria(AdditionalParameterValueMap additionalParameterValues) Gets the criteria- Parameters:
additionalParameterValues
- The additional parameter values- Returns:
- the criteria
-
criteriaPosition
The position of the criteria provided by thisSearchable
among criteria provided by otherSearchable
s.
All criteria provided by the sameSearchable
are always packed together, this integer just affects the relative position compared to otherSearchable
criteria.
The lowest the integer, the higher it will appear in the UI.- Returns:
- The position of the criteria of this
Searchable
-
joinQuery
Optional<Query> joinQuery(Query queryOnCriterion, SearchCriterionDefinition criterion, Collection<Returnable> returnables, AdditionalParameterValueMap additionalParameters) Returns the query which joins the given one (on a criterion) with the given result types- Parameters:
queryOnCriterion
- The query on the criterion to join fromcriterion
- the criterionreturnables
- The returnables to join toadditionalParameters
- The additional parameters- Returns:
- the joined query
-
buildQuery
Query buildQuery(AbstractTreeNode<FOSearchCriterion> criterionTree, Map<String, Object> userCriteria, Collection<Returnable> returnables, Collection<Searchable> searchables, AdditionalParameterValueMap additionalParameters, String currentLang, Map<String, Object> contextualParameters) Builds the query of the criterion tree- Parameters:
criterionTree
- The criterion tree of the service instanceuserCriteria
- The user input criteriareturnables
- The returnables of the service instancesearchables
- The searchables of the service instanceadditionalParameters
- The values of additional parameters of the service instancecurrentLang
- The current langcontextualParameters
- the search contextual parameters.- Returns:
- The query of the criterion tree
-