Class MatchingSubprogramSearchComponent
java.lang.Object
org.ametys.plugins.odfweb.service.search.MatchingSubprogramSearchComponent
- All Implemented Interfaces:
SearchComponent
,Serviceable
public class MatchingSubprogramSearchComponent
extends Object
implements SearchComponent, Serviceable
SearchComponent
for getting subprograms matching search-
Field Summary
Modifier and TypeFieldDescriptionprotected AdvancedQueryBuilder
The builder of advanced queriesprotected ContentSearcherFactory
The content searcher factoryprotected ODFSearchHelper
The ODF search helperprotected SearchComponentHelper
The search component helperFields inherited from interface org.ametys.web.frontoffice.search.requesttime.SearchComponent
DISABLE_DEFAULT_SAX_PARAMETER_NAME, MAX_PRIORITY, MIN_PRIORITY, SEARCH_PRIORITY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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 treevoid
Executes the component.int
priority()
Get the priority of the component.retrieveSubProgramsMatchingSearch
(SearchServiceInstance serviceInstance, Map<String, Object> userCriteria, Collection<FacetDefinition> serviceFacets, Map<String, List<String>> userFacets, String lang) Retrieves, thanks to a (independent but close to the main one) Solr search, theSubProgram
s that match the same query than theProgram
s, for further special display.void
service
(ServiceManager manager) protected Query
singleCriterionToQuery
(FOSearchCriterion searchCriterion, Map<String, Object> userCriteria, Collection<Returnable> returnables, Collection<Searchable> searchables, AdditionalParameterValueMap additionalParameters, String currentLang, Map<String, Object> contextualParameters) Builds the query of the single criterionboolean
Returnstrue
if the component must beexecuted
.
-
Field Details
-
_contentSearcherfactory
The content searcher factory -
_advancedQueryBuilder
The builder of advanced queries -
_searchComponentHelper
The search component helper -
_odfSearchHelper
The ODF search helper
-
-
Constructor Details
-
MatchingSubprogramSearchComponent
public MatchingSubprogramSearchComponent()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
priority
Description copied from interface:SearchComponent
Get the priority of the component. The lowest one will be executed first, and so on.- Specified by:
priority
in interfaceSearchComponent
- Returns:
- the priority of the component
-
supports
Description copied from interface:SearchComponent
Returnstrue
if the component must beexecuted
.- Specified by:
supports
in interfaceSearchComponent
- Parameters:
args
- the arguments- Returns:
true
if the component must beexecuted
.
-
execute
Description copied from interface:SearchComponent
Executes the component.- Specified by:
execute
in interfaceSearchComponent
- Parameters:
args
- the arguments- Throws:
Exception
- if an exception occurs. Other search components will be attempted to be executed
-
retrieveSubProgramsMatchingSearch
protected List<String> retrieveSubProgramsMatchingSearch(SearchServiceInstance serviceInstance, Map<String, Object> userCriteria, Collection<FacetDefinition> serviceFacets, Map<String, throws ExceptionList<String>> userFacets, String lang) Retrieves, thanks to a (independent but close to the main one) Solr search, theSubProgram
s that match the same query than theProgram
s, for further special display.- Parameters:
serviceInstance
- The service instanceuserCriteria
- The user criteriaserviceFacets
- the service facetsuserFacets
- the user facetslang
- The current lang- Returns:
- the
SubProgram
s that match the same query than theProgram
s - Throws:
Exception
- If an exception occured during the Solr search
-
buildQuery
protected 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
-
singleCriterionToQuery
protected Query singleCriterionToQuery(FOSearchCriterion searchCriterion, Map<String, Object> userCriteria, Collection<Returnable> returnables, Collection<Searchable> searchables, AdditionalParameterValueMap additionalParameters, String currentLang, Map<String, Object> contextualParameters) Builds the query of the single criterion- Parameters:
searchCriterion
- The criterionuserCriteria
- 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 single criterion
-