Class MatchingSubprogramSearchComponent
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.web.frontoffice.search.requesttime.AbstractSearchComponent
org.ametys.plugins.odfweb.service.search.MatchingSubprogramSearchComponent
- All Implemented Interfaces:
LogEnabled
,PluginAware
,Prioritizable
,Supporter<SearchComponentArguments>
,SearchComponent
,Serviceable
public class MatchingSubprogramSearchComponent
extends AbstractSearchComponent
implements Serviceable
SearchComponent
for getting subprograms matching search-
Field Summary
FieldsModifier 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Query
buildQuery
(AbstractTreeNode<SearchServiceCriterion<?>> 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
Get the priority for the component.retrieveSubProgramsMatchingSearch
(SearchServiceInstance serviceInstance, Map<String, Object> userCriteria, Collection<SearchServiceFacetDefinition> 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
(SearchServiceCriterion<?> criterion, 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
Check if an element is supportedMethods inherited from class org.ametys.web.frontoffice.search.requesttime.AbstractSearchComponent
getId, setPluginInfo
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
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
-
getPriority
Description copied from interface:Prioritizable
Get the priority for the component. On components usingPrioritizable
interface, each implementation define the order. In most cases, less is the number, more prior is the component.- Specified by:
getPriority
in interfacePrioritizable
- Returns:
- the priority
-
supports
Description copied from interface:Supporter
Check if an element is supported- Specified by:
supports
in interfaceSupporter<SearchComponentArguments>
- Parameters:
args
- The element- Returns:
true
if the element is supported,false
otherwise
-
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<SearchServiceFacetDefinition> 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<SearchServiceCriterion<?>> 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(SearchServiceCriterion<?> criterion, 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:
criterion
- 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
-