public class MatchingSubprogramSearchComponent extends CriterionTreeSearchComponent
SearchComponent
for getting subprograms matching search
Modifier and Type | Class and Description |
---|---|
private static class |
MatchingSubprogramSearchComponent.NoSubprogramSearchAdditionalParameterValueMap |
Modifier and Type | Field and Description |
---|---|
private static String |
__MATCHING_SUBPROGRAM_IDS_ATTR_NAME |
protected ContentSearcherFactory |
_contentSearcherfactory
The content searcher factory
|
__EMPTY_QUERY, _advancedQueryBuilder, _i18nUtils, _treeMaker
DISABLE_DEFAULT_SAX_PARAMETER_NAME, MAX_PRIORITY, MIN_PRIORITY, SEARCH_PRIORITY
Constructor and Description |
---|
MatchingSubprogramSearchComponent() |
Modifier and Type | Method and Description |
---|---|
private boolean |
_containsProgramReturnable(SearchServiceInstance serviceInstance) |
(package private) static List<String> |
_getMatchingSubProgramIds(Request request) |
private boolean |
_mustKeepCriterion(FOSearchCriterion criterion) |
private boolean |
_needSubprogramDiscrimination(SearchServiceInstance serviceInstance) |
(package private) static void |
_removeMatchingSubProgramIdsRequestAttribute(Request request) |
private static void |
_storeInReqMatchingSubProgramIds(Request request,
List<String> subPrograms) |
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
|
void |
execute(SearchComponentArguments args)
Executes the component.
|
int |
priority()
Get the priority of the component.
|
protected List<String> |
retrieveSubProgramsMatchingSearch(SearchServiceInstance serviceInstance,
Map<String,Object> userCriteria,
String lang)
Retrieves, thanks to a (independent but close to the main one) Solr search, the
SubProgram s that match the same query than the Program 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 criterion
|
boolean |
supports(SearchComponentArguments args)
Returns
true if the component must be executed . |
checkValidInputs, checkValidInputSingleValue, checkValidInputValues
private static final String __MATCHING_SUBPROGRAM_IDS_ATTR_NAME
protected ContentSearcherFactory _contentSearcherfactory
public MatchingSubprogramSearchComponent()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
service
in class CriterionTreeSearchComponent
ServiceException
public int priority()
SearchComponent
priority
in interface SearchComponent
priority
in class CriterionTreeSearchComponent
public boolean supports(SearchComponentArguments args)
SearchComponent
true
if the component must be executed
.supports
in interface SearchComponent
supports
in class CriterionTreeSearchComponent
args
- the argumentstrue
if the component must be executed
.private boolean _containsProgramReturnable(SearchServiceInstance serviceInstance)
private boolean _needSubprogramDiscrimination(SearchServiceInstance serviceInstance)
public void execute(SearchComponentArguments args) throws Exception
SearchComponent
execute
in interface SearchComponent
execute
in class CriterionTreeSearchComponent
args
- the argumentsException
- if an exception occurs. Other search components will be attempted to be executedprotected List<String> retrieveSubProgramsMatchingSearch(SearchServiceInstance serviceInstance, Map<String,Object> userCriteria, String lang) throws Exception
SubProgram
s that match the same query than the Program
s, for further special display.serviceInstance
- The service instanceuserCriteria
- The user criterialang
- The current langSubProgram
s that match the same query than the Program
sException
- If an exception occured during the Solr searchprotected Query buildQuery(AbstractTreeNode<FOSearchCriterion> criterionTree, Map<String,Object> userCriteria, Collection<Returnable> returnables, Collection<Searchable> searchables, AdditionalParameterValueMap additionalParameters, String currentLang, Map<String,Object> contextualParameters)
CriterionTreeSearchComponent
buildQuery
in class CriterionTreeSearchComponent
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.protected Query singleCriterionToQuery(FOSearchCriterion searchCriterion, Map<String,Object> userCriteria, Collection<Returnable> returnables, Collection<Searchable> searchables, AdditionalParameterValueMap additionalParameters, String currentLang, Map<String,Object> contextualParameters)
CriterionTreeSearchComponent
singleCriterionToQuery
in class CriterionTreeSearchComponent
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.private boolean _mustKeepCriterion(FOSearchCriterion criterion)
private static void _storeInReqMatchingSubProgramIds(Request request, List<String> subPrograms)
static List<String> _getMatchingSubProgramIds(Request request)
static void _removeMatchingSubProgramIdsRequestAttribute(Request request)