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
Fields inherited from class org.ametys.web.frontoffice.search.fast.AbstractAutocompletionSearchServiceAction
_prefixHandler, _renderingContextHandler, _resolver, _searchComponentHelper, _searcherFactory, _searchServiceInstanceManager, _siteManager, NB_MAX_RESULTS
Fields 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 TypeMethodDescription_getCatalogNames
(String zoneItemId) Get the configured catalog in search criteria_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, 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 resultsvoid
service
(ServiceManager serviceManager) protected 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.ametys.web.frontoffice.search.fast.AbstractAutocompletionSearchServiceAction
_search, _setRightCheckingMode, act, getRightCheckingMode
Methods 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:
service
in interfaceServiceable
- Overrides:
service
in 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:AbstractAutocompletionSearchServiceAction
Search ametys object and set the results- Overrides:
_searchAmetysObject
in 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:AbstractAutocompletionSearchServiceAction
Set the hits in the results- Specified by:
setHitsInResults
in classAbstractAutocompletionSearchServiceAction
- Parameters:
results
- the resultssearchHits
- the search hitssite
- the sitezoneItemId
- the zone item itlang
- the lang
-
_getCatalogNames
Get the configured catalog in search criteria- Parameters:
zoneItemId
- The id of zone item- Returns:
- the catalog's name
-
_getSkills
protected AmetysObjectIterable<Content> _getSkills(String escapedQuery, String lang, int limit, RightCheckingMode rightCheckingMode) throws Exception Get the skills contents matching the query- Parameters:
escapedQuery
- the querylang
- 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
-