Class AbstractAutocompletionSearchServiceAction
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.acting.AbstractAction
org.apache.cocoon.acting.ServiceableAction
org.ametys.web.frontoffice.search.fast.AbstractAutocompletionSearchServiceAction
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
,Action
- Direct Known Subclasses:
ProgramItemAutocompletionSearchServiceAction
Abstract to get the proposed ametys object while beginning a search from a given search service
-
Field Summary
Modifier and TypeFieldDescriptionprotected URIPrefixHandler
The prefix handlerprotected RenderingContextHandler
The rendering context handlerprotected AmetysObjectResolver
The ametys object resolverprotected SearchComponentHelper
The search component helperprotected SearcherFactory
The search factoryprotected SearchServiceInstanceManager
Component for search serviceprotected SiteManager
The site managerprotected static final int
The default max number of resultsFields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected AmetysObjectIterable<AmetysObject>
_search
(Site site, String zoneItemId, String lang, String escapedQuery, int limit, RightCheckingMode rightCheckingMode) Get the ametys object matching the query_searchAmetysObject
(Site site, String zoneItemId, String lang, String escapedQuery, int limit, RightCheckingMode rightCheckingMode) Search ametys object and set the resultsprotected void
_setRightCheckingMode
(SearcherFactory.Searcher searcher, RightCheckingMode rightCheckingMode) Set whether to check rights when searching,act
(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) protected RightCheckingMode
getRightCheckingMode
(String zoneItemId) Get the mode for checking rightsvoid
service
(ServiceManager serviceManager) protected abstract void
setHitsInResults
(Map<String, Object> results, AmetysObjectIterable<AmetysObject> searchHits, Site site, String zoneItemId, String lang) Set the hits in the resultsMethods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
NB_MAX_RESULTS
The default max number of results- See Also:
-
_searcherFactory
The search factory -
_searchServiceInstanceManager
Component for search service -
_searchComponentHelper
The search component helper -
_resolver
The ametys object resolver -
_siteManager
The site manager -
_prefixHandler
The prefix handler -
_renderingContextHandler
The rendering context handler
-
-
Constructor Details
-
AbstractAutocompletionSearchServiceAction
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableAction
- Throws:
ServiceException
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception - Throws:
Exception
-
_searchAmetysObject
protected Map<String,Object> _searchAmetysObject(Site site, String zoneItemId, String lang, String escapedQuery, int limit, RightCheckingMode rightCheckingMode) throws Exception Search ametys object and set the results- Parameters:
site
- the sitezoneItemId
- the zone item idlang
- the langescapedQuery
- the escaped querylimit
- the limitrightCheckingMode
- the right checking mode- Returns:
- the search results
- Throws:
Exception
- if an error occurred during search
-
setHitsInResults
protected abstract void setHitsInResults(Map<String, Object> results, AmetysObjectIterable<AmetysObject> searchHits, Site site, String zoneItemId, String lang) Set the hits in the results- Parameters:
results
- the resultssearchHits
- the search hitssite
- the sitezoneItemId
- the zone item itlang
- the lang
-
_search
protected AmetysObjectIterable<AmetysObject> _search(Site site, String zoneItemId, String lang, String escapedQuery, int limit, RightCheckingMode rightCheckingMode) throws Exception Get the ametys object matching the query- Parameters:
site
- the sitezoneItemId
- the zone item itlang
- the languageescapedQuery
- the querylimit
- the max number of resultsrightCheckingMode
- the mode for checking rights- Returns:
- the matching ametys object
- Throws:
Exception
- if an error occurred during search
-
_setRightCheckingMode
protected void _setRightCheckingMode(SearcherFactory.Searcher searcher, RightCheckingMode rightCheckingMode) Set whether to check rights when searching,- Parameters:
searcher
- the searcherrightCheckingMode
- the the mode for checking rights
-
getRightCheckingMode
Get the mode for checking rights- Parameters:
zoneItemId
- the id of zone item- Returns:
- the mode for checking rights
-