Class ProgramItemAutocompletionSearchServiceAction
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
org.ametys.plugins.odfweb.service.search.ProgramItemAutocompletionSearchServiceAction
- All Implemented Interfaces:
Component,LogEnabled,Serviceable,Action
public class ProgramItemAutocompletionSearchServiceAction
extends AbstractAutocompletionSearchServiceAction
Get the proposed program's pages and skills for auto-completion while beginning a search
-
Field Summary
FieldsFields inherited from class org.ametys.web.frontoffice.search.fast.AbstractAutocompletionSearchServiceAction
_prefixHandler, _renderingContextHandler, _resolver, _searchComponentHelper, _searcherFactory, _searchServiceInstanceManager, _siteManager, NB_MAX_RESULTSFields inherited from class org.apache.cocoon.acting.ServiceableAction
managerFields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_getCatalogNames(String zoneItemId) Get the configured catalog in criterion definitions_getContentHit(Content content) Get the JSON representation of a content hit_getPageHit(Content content, String siteName, Page odfRootPage) Get the JSON representation of a page hitprotected AmetysObjectIterable<Content> _getSkills(String escapedQuery, List<String> catalogNames, String lang, int limit, RightCheckingMode rightCheckingMode) Get the skills contents matching the query_searchAmetysObject(Site site, String zoneItemId, String lang, String escapedQuery, int limit, RightCheckingMode rightCheckingMode) Search ametys object and set the resultsvoidservice(ServiceManager serviceManager) protected voidsetHitsInResults(Map<String, Object> results, AmetysObjectIterable<AmetysObject> searchHits, Site site, String zoneItemId, String lang) Set the hits in the resultsMethods inherited from class org.ametys.web.frontoffice.search.fast.AbstractAutocompletionSearchServiceAction
_search, _setRightCheckingMode, act, getRightCheckingModeMethods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_odfPageResolver
The ODF page resolver
-
-
Constructor Details
-
ProgramItemAutocompletionSearchServiceAction
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractAutocompletionSearchServiceAction- Throws:
ServiceException
-
_searchAmetysObject
protected Map<String,Object> _searchAmetysObject(Site site, String zoneItemId, String lang, String escapedQuery, int limit, RightCheckingMode rightCheckingMode) throws Exception Description copied from class:AbstractAutocompletionSearchServiceActionSearch ametys object and set the results- Overrides:
_searchAmetysObjectin classAbstractAutocompletionSearchServiceAction- 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 void setHitsInResults(Map<String, Object> results, AmetysObjectIterable<AmetysObject> searchHits, Site site, String zoneItemId, String lang) Description copied from class:AbstractAutocompletionSearchServiceActionSet the hits in the results- Specified by:
setHitsInResultsin classAbstractAutocompletionSearchServiceAction- Parameters:
results- the resultssearchHits- the search hitssite- the sitezoneItemId- the zone item itlang- the lang
-
_getCatalogNames
Get the configured catalog in criterion definitions- Parameters:
zoneItemId- The id of zone item- Returns:
- the catalog's name
-
_getSkills
protected AmetysObjectIterable<Content> _getSkills(String escapedQuery, List<String> catalogNames, String lang, int limit, RightCheckingMode rightCheckingMode) throws Exception Get the skills contents matching the query- Parameters:
escapedQuery- the querycatalogNames- The catalog nameslang- the languagelimit- the max number of resultsrightCheckingMode- the mode for checking rights- Returns:
- the matching contents
- Throws:
Exception- if an error occurred during search
-
_getPageHit
Get the JSON representation of a page hit- Parameters:
content- the contentsiteName- the current site nameodfRootPage- the ODF root page. Can be null if search is configured for multiple catalogs- Returns:
- the page as json
-
_getContentHit
Get the JSON representation of a content hit- Parameters:
content- the content- Returns:
- the content as json
-