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
Fields Modifier and Type Field Description protected AdvancedQueryBuilder
_advancedQueryBuilder
The builder of advanced queriesprotected ContentSearcherFactory
_contentSearcherfactory
The content searcher factoryprotected ODFSearchHelper
_odfSearchHelper
The ODF search helperprotected SearchComponentHelper
_searchComponentHelper
The 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 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
execute(SearchComponentArguments args)
Executes the component.int
priority()
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, 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
supports(SearchComponentArguments args)
Returnstrue
if 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:
service
in interfaceServiceable
- Throws:
ServiceException
-
priority
public int 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
public boolean supports(SearchComponentArguments args)
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
public void execute(SearchComponentArguments args) throws Exception
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,List<String>> userFacets, String lang) throws Exception
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
-
-