Class SearchService
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.web.service.StaticService
org.ametys.web.frontoffice.search.SearchService
- All Implemented Interfaces:
Model,ModelItemAccessor,ModelItemContainer,LogEnabled,PluginAware,Labelable,Service,Disposable,Configurable,Contextualizable,Serviceable
- Direct Known Subclasses:
CalendarSearchService
Front search service.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SearchServiceCreationHelperThe helper component for defining this serviceprotected RenderingContextHandlerThe handler of rendering contextprotected SearchServiceInstanceManagerThe manager forSearchServiceInstancestatic final StringThe parameter name for computing countsstatic final StringThe parameter name for contextsstatic final StringThe parameter name for criteriastatic final StringThe parameter name for facetsstatic final StringThe parameter name for headerstatic final StringThe parameter name for initial sortsstatic final StringThe parameter name for launching search at startupstatic final StringThe parameter name for link pagestatic final StringThe parameter name for link titlestatic final StringThe parameter name for maximum number of resultsstatic final StringThe parameter name for proposed sortsstatic final StringThe parameter name for result pagestatic final StringThe parameter name for result placestatic final StringThe parameter name for number of results per pagestatic final StringThe parameter name for returnablesstatic final StringThe parameter name for right checking modestatic final StringThe parameter name for handling RSSstatic final StringThe parameter name for saving user preferencesstatic final StringThe parameter name for service group idstatic final StringThe parameter name for XSLTstatic final StringAvalon RoleFields inherited from class org.ametys.web.service.StaticService
_context, _featureName, _manager, _modelItems, _paramsScript, _pluginName, _repeaterDefinitionParser, _serviceParameterDefinitionParser, _view, _viewAndParametersParser -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<AdditionalSearchServiceParameter> _buildAdditionalSearchServiceParameters(Map<String, org.ametys.web.frontoffice.search.SearchService.ParsedAdditionalParameterConf> parsedAdditionalParameterConfs) Build theAdditionalSearchServiceParameters from intermediateSearchService.ParsedAdditionalParameterConfobjects._fieldsReloadingWidget(Collection<AdditionalSearchServiceParameter> additionalParameters) Gets the names of the fields which will launch a reload of this widget when their value changeprotected static boolean_hasUserInput(SearchServiceInstance serviceInstance) Returnstrueif the given instance of search service has some user inputprotected boolean_isDebug(Request request, RenderingContextHandler renderingContextHandler) Is debug enabled_parseAndInjectDisplayAdditionalParameters(DefaultConfiguration containerConf) Retrieve the configurations of additional parameters for 'Display' group, inject them into the group configuration and return their parsed representation._parseAndInjectGeneralAdditionalParameters(DefaultConfiguration containerConf) Retrieve the configurations of additional parameters for 'General' group, inject them into the group configuration and return their parsed representation.protected void_setWidgetParameters(String parameterName, List<String> fieldsReloadingCriteriaWidget) Set the widget parameters of the given parameter, by adding the list of the fields reloading the widgetprotected voidconfigureParameters(Configuration parametersConfiguration) Configure the service parametersstatic booleanhasUserCriteria(Optional<AbstractTreeNode<SearchServiceCriterion<?>>> criterionTree) Returnstrueif the given instance of search service has at least one user criterionstatic booleanhasUserInput(Optional<AbstractTreeNode<SearchServiceCriterion<?>>> criterionTree, Collection<SearchServiceFacetDefinition> facets, Collection<SearchServiceSortDefinition> proposedSorts) Returnstrueif the given instance of search service has some user inputbooleanisCacheable(Page currentPage, ZoneItem zoneItem) Returns true if the result of this service may be cached, depending on theZoneItemcontaining an instance of this service.voidservice(ServiceManager smanager) Methods inherited from class org.ametys.web.service.StaticService
_configureClass, _configureImports, _configureScript, configure, configureDialogBoxDimension, configureIndexation, contextualize, dispose, getCategory, getCreationBoxHeight, getCreationBoxWidth, getCSSFiles, getDescription, getIconDecorator, getIconGlyph, getId, getLabel, getLargeIcon, getMediumIcon, getModelItems, getName, getParameters, getParametersScript, getPluginName, getRight, getSmallIcon, getURL, getView, index, isPrivate, setPluginInfoMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.runtime.model.ModelItemAccessor
getChild, getModelItem, hasModelItemMethods inherited from interface org.ametys.web.service.Service
getFamilyId
-
Field Details
-
ROLE
Avalon Role- See Also:
-
PARAM_NAME_HEADER
The parameter name for header- See Also:
-
PARAM_NAME_RETURNABLES
The parameter name for returnables- See Also:
-
PARAM_NAME_CONTEXTS
The parameter name for contexts- See Also:
-
PARAM_NAME_CRITERIA
The parameter name for criteria- See Also:
-
PARAM_NAME_COMPUTE_COUNTS
The parameter name for computing counts- See Also:
-
PARAM_NAME_FACETS
The parameter name for facets- See Also:
-
PARAM_NAME_INITIAL_SORTS
The parameter name for initial sorts- See Also:
-
PARAM_NAME_PROPOSED_SORTS
The parameter name for proposed sorts- See Also:
-
PARAM_NAME_RESULTS_PER_PAGE
The parameter name for number of results per page- See Also:
-
PARAM_NAME_MAX_RESULTS
The parameter name for maximum number of results- See Also:
-
PARAM_NAME_RIGHT_CHECKING_MODE
The parameter name for right checking mode- See Also:
-
PARAM_NAME_XSLT
The parameter name for XSLT- See Also:
-
PARAM_NAME_RESULT_PLACE
The parameter name for result place- See Also:
-
PARAM_NAME_RESULT_PAGE
The parameter name for result page- See Also:
-
PARAM_NAME_LAUNCH_SEARCH_AT_STARTUP
The parameter name for launching search at startup- See Also:
-
PARAM_NAME_SERVICE_GROUP_ID
The parameter name for service group id- See Also:
-
PARAM_NAME_LINK_PAGE
The parameter name for link page- See Also:
-
PARAM_NAME_LINK_TITLE
The parameter name for link title- See Also:
-
PARAM_NAME_RSS
The parameter name for handling RSS- See Also:
-
PARAM_NAME_SAVE_USER_PREFS
The parameter name for saving user preferences- See Also:
-
_creationHelper
The helper component for defining this service -
_renderingContextHandler
The handler of rendering context -
_searchServiceInstanceManager
The manager forSearchServiceInstance
-
-
Constructor Details
-
SearchService
public SearchService()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classStaticService- Throws:
ServiceException
-
hasUserInput
public static boolean hasUserInput(Optional<AbstractTreeNode<SearchServiceCriterion<?>>> criterionTree, Collection<SearchServiceFacetDefinition> facets, Collection<SearchServiceSortDefinition> proposedSorts) Returnstrueif the given instance of search service has some user input- Parameters:
criterionTree- The tree of criteria of the search service instancefacets- The facets of the search service instanceproposedSorts- The proposed sorts of the search service instance- Returns:
trueif the given instance of search service has some user input
-
hasUserCriteria
public static boolean hasUserCriteria(Optional<AbstractTreeNode<SearchServiceCriterion<?>>> criterionTree) Returnstrueif the given instance of search service has at least one user criterion- Parameters:
criterionTree- The tree of criteria of the search service instance- Returns:
trueif the given instance of search service has at least one user criterion
-
_hasUserInput
Returnstrueif the given instance of search service has some user input- Parameters:
serviceInstance- The service instance- Returns:
trueif the given instance of search service has some user input
-
isCacheable
Description copied from interface:ServiceReturns true if the result of this service may be cached, depending on theZoneItemcontaining an instance of this service.- Specified by:
isCacheablein interfaceService- Overrides:
isCacheablein classStaticService- Parameters:
currentPage- the currentPagecontaining the service.zoneItem- theZoneItemcontaining an instance of this service.
N.B: The ZoneItem can belong to a page that is not the current page, when it is inherited.- Returns:
- true if the result of this service may be cached.
-
_isDebug
Is debug enabled- Parameters:
request- the requestrenderingContextHandler- the rendering context handler- Returns:
- true if debug enable
-
configureParameters
protected void configureParameters(Configuration parametersConfiguration) throws ConfigurationException Description copied from class:StaticServiceConfigure the service parameters- Overrides:
configureParametersin classStaticService- Parameters:
parametersConfiguration- the parameters configuration- Throws:
ConfigurationException- if a configuration exception occurred
-
_parseAndInjectGeneralAdditionalParameters
protected Map<String,org.ametys.web.frontoffice.search.SearchService.ParsedAdditionalParameterConf> _parseAndInjectGeneralAdditionalParameters(DefaultConfiguration containerConf) Retrieve the configurations of additional parameters for 'General' group, inject them into the group configuration and return their parsed representation.- Parameters:
containerConf- The container configuration for injecting.- Returns:
- the
SearchService.ParsedAdditionalParameterConfs
-
_parseAndInjectDisplayAdditionalParameters
protected Map<String,org.ametys.web.frontoffice.search.SearchService.ParsedAdditionalParameterConf> _parseAndInjectDisplayAdditionalParameters(DefaultConfiguration containerConf) Retrieve the configurations of additional parameters for 'Display' group, inject them into the group configuration and return their parsed representation.- Parameters:
containerConf- The container configuration for injecting.- Returns:
- the
SearchService.ParsedAdditionalParameterConfs
-
_buildAdditionalSearchServiceParameters
protected Collection<AdditionalSearchServiceParameter> _buildAdditionalSearchServiceParameters(Map<String, org.ametys.web.frontoffice.search.SearchService.ParsedAdditionalParameterConf> parsedAdditionalParameterConfs) Build theAdditionalSearchServiceParameters from intermediateSearchService.ParsedAdditionalParameterConfobjects.- Parameters:
parsedAdditionalParameterConfs- The parsed configurations for each additional parameter- Returns:
- the
AdditionalSearchServiceParameters
-
_setWidgetParameters
protected void _setWidgetParameters(String parameterName, List<String> fieldsReloadingCriteriaWidget) Set the widget parameters of the given parameter, by adding the list of the fields reloading the widget- Parameters:
parameterName- The parameter namefieldsReloadingCriteriaWidget- the names of the fields which will launch a reload of the widget when their value change
-
_fieldsReloadingWidget
protected List<String> _fieldsReloadingWidget(Collection<AdditionalSearchServiceParameter> additionalParameters) Gets the names of the fields which will launch a reload of this widget when their value change- Parameters:
additionalParameters- The additional parameters- Returns:
- the names of the fields which will launch a reload of this widget when their value change
-