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 AdvancedQueryBuilderThe builder of advanced queriesprotected ContentSearcherFactoryThe content searcher factoryprotected ODFSearchHelperThe ODF search helperprotected SearchComponentHelperThe 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 QuerybuildQuery(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 treevoidExecutes the component.intGet 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, theSubPrograms that match the same query than thePrograms, for further special display.voidservice(ServiceManager manager) protected QuerysingleCriterionToQuery(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 criterionbooleanCheck if an element is supportedMethods inherited from class org.ametys.web.frontoffice.search.requesttime.AbstractSearchComponent
getId, setPluginInfoMethods 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:
servicein interfaceServiceable- Throws:
ServiceException
-
getPriority
Description copied from interface:PrioritizableGet the priority for the component. On components usingPrioritizableinterface, each implementation define the order. In most cases, less is the number, more prior is the component.- Specified by:
getPriorityin interfacePrioritizable- Returns:
- the priority
-
supports
Description copied from interface:SupporterCheck if an element is supported- Specified by:
supportsin interfaceSupporter<SearchComponentArguments>- Parameters:
args- The element- Returns:
trueif the element is supported,falseotherwise
-
execute
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<SearchServiceFacetDefinition> serviceFacets, Map<String, throws ExceptionList<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.- 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<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
-