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
Front search service.
-
Field Summary
Modifier and TypeFieldDescriptionprotected SearchServiceCreationHelper
The helper component for defining this serviceprotected RenderingContextHandler
The handler of rendering contextprotected SearchServiceInstanceManager
The manager forSearchServiceInstance
static final String
The parameter name for computing countsstatic final String
The parameter name for contextsstatic final String
The parameter name for criteriastatic final String
The parameter name for facetsstatic final String
The parameter name for headerstatic final String
The parameter name for initial sortsstatic final String
The parameter name for launching search at startupstatic final String
The parameter name for link pagestatic final String
The parameter name for link titlestatic final String
The parameter name for maximum number of resultsstatic final String
The parameter name for proposed sortsstatic final String
The parameter name for result pagestatic final String
The parameter name for result placestatic final String
The parameter name for number of results per pagestatic final String
The parameter name for returnablesstatic final String
The parameter name for right checking modestatic final String
The parameter name for handling RSSstatic final String
The parameter name for saving user preferencesstatic final String
The parameter name for service group idstatic final String
The parameter name for XSLTstatic final String
Avalon RoleFields inherited from class org.ametys.web.service.StaticService
_context, _featureName, _manager, _modelItems, _paramsScript, _pluginName, _repeaterDefinitionParser, _serviceParameterDefinitionParser, _view, _viewAndParametersParser
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<AdditionalSearchServiceParameter>
_buildAdditionalSearchServiceParameters
(Map<String, org.ametys.web.frontoffice.search.SearchService.ParsedAdditionalParameterConf> parsedAdditionalParameterConfs) Build theAdditionalSearchServiceParameter
s from intermediateSearchService.ParsedAdditionalParameterConf
objects._fieldsReloadingWidget
(Collection<AdditionalSearchServiceParameter> additionalParameters) Gets the names of the fields which will launch a reload of this widget when their value change_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 void
configureParameters
(Configuration parametersConfiguration) Configure the service parametersstatic boolean
hasUserCriteria
(Optional<AbstractTreeNode<FOSearchCriterion>> criterionTree) Returnstrue
if the given instance of search service has at least one user criterionstatic boolean
hasUserInput
(Optional<AbstractTreeNode<FOSearchCriterion>> criterionTree, Collection<FacetDefinition> facets, Collection<SortDefinition> proposedSorts) Returnstrue
if the given instance of search service has some user inputboolean
isCacheable
(Page currentPage, ZoneItem zoneItem) Returns true if the result of this service may be cached, depending on theZoneItem
containing an instance of this service.void
service
(ServiceManager smanager) Methods inherited from class org.ametys.web.service.StaticService
_configureClass, _configureImports, _configureScript, _parseI18nizableText, 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, setPluginInfo
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.runtime.model.ModelItemAccessor
getChild, getModelItem, hasModelItem
Methods 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:
service
in interfaceServiceable
- Overrides:
service
in classStaticService
- Throws:
ServiceException
-
hasUserInput
public static boolean hasUserInput(Optional<AbstractTreeNode<FOSearchCriterion>> criterionTree, Collection<FacetDefinition> facets, Collection<SortDefinition> proposedSorts) Returnstrue
if 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:
true
if the given instance of search service has some user input
-
hasUserCriteria
Returnstrue
if the given instance of search service has at least one user criterion- Parameters:
criterionTree
- The tree of criteria of the search service instance- Returns:
true
if the given instance of search service has at least one user criterion
-
isCacheable
Description copied from interface:Service
Returns true if the result of this service may be cached, depending on theZoneItem
containing an instance of this service.- Specified by:
isCacheable
in interfaceService
- Overrides:
isCacheable
in classStaticService
- Parameters:
currentPage
- the currentPage
containing the service.zoneItem
- theZoneItem
containing 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.
-
configureParameters
protected void configureParameters(Configuration parametersConfiguration) throws ConfigurationException Description copied from class:StaticService
Configure the service parameters- Overrides:
configureParameters
in 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.ParsedAdditionalParameterConf
s
-
_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.ParsedAdditionalParameterConf
s
-
_buildAdditionalSearchServiceParameters
protected Collection<AdditionalSearchServiceParameter> _buildAdditionalSearchServiceParameters(Map<String, org.ametys.web.frontoffice.search.SearchService.ParsedAdditionalParameterConf> parsedAdditionalParameterConfs) Build theAdditionalSearchServiceParameter
s from intermediateSearchService.ParsedAdditionalParameterConf
objects.- Parameters:
parsedAdditionalParameterConfs
- The parsed configurations for each additional parameter- Returns:
- the
AdditionalSearchServiceParameter
s
-
_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
-