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
SearchComponentfor getting subprograms matching search
-
-
Field Summary
Fields Modifier and Type Field Description protected AdvancedQueryBuilder_advancedQueryBuilderThe builder of advanced queriesprotected ContentSearcherFactory_contentSearcherfactoryThe content searcher factoryprotected ODFSearchHelper_odfSearchHelperThe ODF search helperprotected SearchComponentHelper_searchComponentHelperThe search component helper-
Fields inherited from interface org.ametys.web.frontoffice.search.requesttime.SearchComponent
DISABLE_DEFAULT_SAX_PARAMETER_NAME, MAX_PRIORITY, MIN_PRIORITY, SEARCH_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description MatchingSubprogramSearchComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected QuerybuildQuery(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 treevoidexecute(SearchComponentArguments args)Executes the component.intpriority()Get the priority of the component.protected List<String>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, theSubPrograms that match the same query than thePrograms, for further special display.voidservice(ServiceManager manager)protected QuerysingleCriterionToQuery(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 criterionbooleansupports(SearchComponentArguments args)Returnstrueif the component must beexecuted.
-
-
-
Field Detail
-
_contentSearcherfactory
protected ContentSearcherFactory _contentSearcherfactory
The content searcher factory
-
_advancedQueryBuilder
protected AdvancedQueryBuilder _advancedQueryBuilder
The builder of advanced queries
-
_searchComponentHelper
protected SearchComponentHelper _searchComponentHelper
The search component helper
-
_odfSearchHelper
protected ODFSearchHelper _odfSearchHelper
The ODF search helper
-
-
Constructor Detail
-
MatchingSubprogramSearchComponent
public MatchingSubprogramSearchComponent()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
priority
public int priority()
Description copied from interface:SearchComponentGet the priority of the component. The lowest one will be executed first, and so on.- Specified by:
priorityin interfaceSearchComponent- Returns:
- the priority of the component
-
supports
public boolean supports(SearchComponentArguments args)
Description copied from interface:SearchComponentReturnstrueif the component must beexecuted.- Specified by:
supportsin interfaceSearchComponent- Parameters:
args- the arguments- Returns:
trueif the component must beexecuted.
-
execute
public void execute(SearchComponentArguments args) throws Exception
Description copied from interface:SearchComponentExecutes the component.- Specified by:
executein 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,List<String>> userFacets, String lang) throws Exception
Retrieves, thanks to a (independent but close to the main one) Solr search, theSubPrograms that match the same query than thePrograms, for further special display.- Parameters:
serviceInstance- The service instanceuserCriteria- The user criteriaserviceFacets- the service facetsuserFacets- the user facetslang- The current lang- Returns:
- the
SubPrograms that match the same query than thePrograms - 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
-
-