public class SearchService extends StaticService
Modifier and Type | Class and Description |
---|---|
(package private) static class |
SearchService.ParsedAdditionalParameterConf |
Modifier and Type | Field and Description |
---|---|
protected SearchServiceCreationHelper |
_creationHelper
The helper component for defining this service
|
protected RenderingContextHandler |
_renderingContextHandler
The handler of rendering context
|
protected SearchServiceInstanceManager |
_searchServiceInstanceManager
The manager for
SearchServiceInstance |
static String |
PARAM_NAME_COMPUTE_COUNTS
The parameter name for computing counts
|
static String |
PARAM_NAME_CONTEXTS
The parameter name for contexts
|
static String |
PARAM_NAME_CRITERIA
The parameter name for criteria
|
static String |
PARAM_NAME_FACETS
The parameter name for facets
|
static String |
PARAM_NAME_HEADER
The parameter name for header
|
static String |
PARAM_NAME_INITIAL_SORTS
The parameter name for initial sorts
|
static String |
PARAM_NAME_LAUNCH_SEARCH_AT_STARTUP
The parameter name for launching search at startup
|
static String |
PARAM_NAME_LINK_PAGE
The parameter name for link page
|
static String |
PARAM_NAME_LINK_TITLE
The parameter name for link title
|
static String |
PARAM_NAME_MAX_RESULTS
The parameter name for maximum number of results
|
static String |
PARAM_NAME_PROPOSED_SORTS
The parameter name for proposed sorts
|
static String |
PARAM_NAME_RESULT_PAGE
The parameter name for result page
|
static String |
PARAM_NAME_RESULT_PLACE
The parameter name for result place
|
static String |
PARAM_NAME_RESULTS_PER_PAGE
The parameter name for number of results per page
|
static String |
PARAM_NAME_RETURNABLES
The parameter name for returnables
|
static String |
PARAM_NAME_RIGHT_CHECKING_MODE
The parameter name for right checking mode
|
static String |
PARAM_NAME_RSS
The parameter name for handling RSS
|
static String |
PARAM_NAME_SAVE_USER_PREFS
The parameter name for saving user preferences
|
static String |
PARAM_NAME_SERVICE_GROUP_ID
The parameter name for service group id
|
static String |
PARAM_NAME_XSLT
The parameter name for XSLT
|
static String |
ROLE
Avalon Role
|
_context, _featureName, _manager, _modelItems, _paramsScript, _pluginName, _view
Constructor and Description |
---|
SearchService() |
Modifier and Type | Method and Description |
---|---|
protected Collection<AdditionalSearchServiceParameter> |
_buildAdditionalSearchServiceParameters(Map<String,SearchService.ParsedAdditionalParameterConf> parsedAdditionalParameterConfs)
Build the
AdditionalSearchServiceParameter s from intermediate SearchService.ParsedAdditionalParameterConf objects. |
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
|
private static boolean |
_hasUserInput(SearchServiceInstance serviceInstance) |
private boolean |
_isDebug(Request request,
RenderingContextHandler renderingContextHandler) |
protected Map<String,SearchService.ParsedAdditionalParameterConf> |
_parseAndInjectDisplayAdditionalParameters(DefaultConfiguration lastGroupConf)
Retrieve the configurations of additional parameters for 'Display' group, inject them into the group configuration and return their parsed representation.
|
protected Map<String,SearchService.ParsedAdditionalParameterConf> |
_parseAndInjectGeneralAdditionalParameters(DefaultConfiguration firstGroupConf)
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 widget
|
protected void |
configureParameters(Configuration parametersConfiguration)
Configure the service parameters.
|
static boolean |
hasUserCriteria(Optional<AbstractTreeNode<FOSearchCriterion>> criterionTree)
Returns
true if the given instance of search service has at least one user criterion |
static boolean |
hasUserInput(Optional<AbstractTreeNode<FOSearchCriterion>> criterionTree,
Collection<FacetDefinition> facets,
Collection<SortDefinition> proposedSorts)
Returns
true if the given instance of search service has some user input |
boolean |
isCacheable(Page currentPage,
ZoneItem zoneItem)
Returns true if the result of this service may be cached, depending on the
ZoneItem containing an instance of this service. |
void |
service(ServiceManager smanager) |
_configureClass, _configureImports, _configureScript, _parseChildren, _parseI18nizableText, _parseParameter, _parseParameter, _parseRepeater, _parseRepeater, _parseSimpleViewItemGroup, 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
getLogger, setLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFamilyId
getChild, getModelItem, hasModelItem
public static final String ROLE
public static final String PARAM_NAME_HEADER
public static final String PARAM_NAME_RETURNABLES
public static final String PARAM_NAME_CONTEXTS
public static final String PARAM_NAME_CRITERIA
public static final String PARAM_NAME_COMPUTE_COUNTS
public static final String PARAM_NAME_FACETS
public static final String PARAM_NAME_INITIAL_SORTS
public static final String PARAM_NAME_PROPOSED_SORTS
public static final String PARAM_NAME_RESULTS_PER_PAGE
public static final String PARAM_NAME_MAX_RESULTS
public static final String PARAM_NAME_RIGHT_CHECKING_MODE
public static final String PARAM_NAME_XSLT
public static final String PARAM_NAME_RESULT_PLACE
public static final String PARAM_NAME_RESULT_PAGE
public static final String PARAM_NAME_LAUNCH_SEARCH_AT_STARTUP
public static final String PARAM_NAME_SERVICE_GROUP_ID
public static final String PARAM_NAME_LINK_PAGE
public static final String PARAM_NAME_LINK_TITLE
public static final String PARAM_NAME_RSS
public static final String PARAM_NAME_SAVE_USER_PREFS
protected SearchServiceCreationHelper _creationHelper
protected RenderingContextHandler _renderingContextHandler
protected SearchServiceInstanceManager _searchServiceInstanceManager
SearchServiceInstance
public SearchService()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
service
in class StaticService
ServiceException
public static boolean hasUserInput(Optional<AbstractTreeNode<FOSearchCriterion>> criterionTree, Collection<FacetDefinition> facets, Collection<SortDefinition> proposedSorts)
true
if the given instance of search service has some user inputcriterionTree
- The tree of criteria of the search service instancefacets
- The facets of the search service instanceproposedSorts
- The proposed sorts of the search service instancetrue
if the given instance of search service has some user inputpublic static boolean hasUserCriteria(Optional<AbstractTreeNode<FOSearchCriterion>> criterionTree)
true
if the given instance of search service has at least one user criterioncriterionTree
- The tree of criteria of the search service instancetrue
if the given instance of search service has at least one user criterionprivate static boolean _hasUserInput(SearchServiceInstance serviceInstance)
public boolean isCacheable(Page currentPage, ZoneItem zoneItem)
Service
ZoneItem
containing an instance of this service.isCacheable
in interface Service
isCacheable
in class StaticService
currentPage
- the current Page
containing the service.zoneItem
- the ZoneItem
containing an instance of this service.private boolean _isDebug(Request request, RenderingContextHandler renderingContextHandler)
protected void configureParameters(Configuration parametersConfiguration) throws ConfigurationException
StaticService
configureParameters
in class StaticService
parametersConfiguration
- the service parameters configuration.ConfigurationException
- if an error occurs.protected Map<String,SearchService.ParsedAdditionalParameterConf> _parseAndInjectGeneralAdditionalParameters(DefaultConfiguration firstGroupConf)
firstGroupConf
- The first group configuration ('General') for injecting.SearchService.ParsedAdditionalParameterConf
sprotected Map<String,SearchService.ParsedAdditionalParameterConf> _parseAndInjectDisplayAdditionalParameters(DefaultConfiguration lastGroupConf)
lastGroupConf
- The last group configuration ('Display') for injecting.SearchService.ParsedAdditionalParameterConf
sprotected Collection<AdditionalSearchServiceParameter> _buildAdditionalSearchServiceParameters(Map<String,SearchService.ParsedAdditionalParameterConf> parsedAdditionalParameterConfs)
AdditionalSearchServiceParameter
s from intermediate SearchService.ParsedAdditionalParameterConf
objects.parsedAdditionalParameterConfs
- The parsed configurations for each additional parameterAdditionalSearchServiceParameter
sprotected void _setWidgetParameters(String parameterName, List<String> fieldsReloadingCriteriaWidget)
parameterName
- The parameter namefieldsReloadingCriteriaWidget
- the names of the fields which will launch a reload of the widget when their value changeprotected List<String> _fieldsReloadingWidget(Collection<AdditionalSearchServiceParameter> additionalParameters)
additionalParameters
- The additional parameters