Interface SavedSearchHandler
A service provider
SavedSearchHandler interface i.e. search module Assets, Sites
would need to implement this interface.
OmniSearch allows different modules to register themselves for Saved Search functionality , by implementing this interface.-
Method Summary
Modifier and TypeMethodDescriptioncreateOrUpdateSavedSearch(ResourceResolver resolver, Map<String, String> predicateMap) This function creates a new saved search or updates a existing saved search based on the parameters provided in predicateMap parameter.booleandeleteSavedSearch(ResourceResolver resolver, String path) This function delete the saved search node existing on the provided pathgetID()This function returns ID ofSavedSearchHandleraka Search Module This ID helps identify the search module uniquely i.e.getSavedSearches(ResourceResolver resolver, long limit, long offset) This function returns list of all saved search for the module i.e.getSavedSearchParameters(ResourceResolver resolver, String path) This function provide the detail of saved query from the saved search node of the provided path
-
Method Details
-
getID
String getID()This function returns ID ofSavedSearchHandleraka Search Module This ID helps identify the search module uniquely i.e. assets, sites, projects etc.- Returns:
- ID of
SavedSearchHandler
-
getSavedSearches
Iterator<Resource> getSavedSearches(ResourceResolver resolver, long limit, long offset) throws OmniSearchException This function returns list of all saved search for the module i.e. sites, Asset with specified limit and offset.- Parameters:
resolver-ResourceResolverinstancelimit- number of result on a pageoffset- offset/start of result- Returns:
IteratorofResourceof nodes of saved search for the module.- Throws:
OmniSearchException- instance ofOmniSearchExceptionwhich provide error from the module
-
getSavedSearchParameters
Map<String,String> getSavedSearchParameters(ResourceResolver resolver, String path) throws OmniSearchException This function provide the detail of saved query from the saved search node of the provided path- Parameters:
resolver-ResourceResolverinstancepath- path of the node of saved search, from which parameters of saved searchQueryrequired- Returns:
Mapcontaining parameters of theQuery- Throws:
OmniSearchException- instance ofOmniSearchExceptionwhich provide error from the module
-
createOrUpdateSavedSearch
Resource createOrUpdateSavedSearch(ResourceResolver resolver, Map<String, String> predicateMap) throws OmniSearchExceptionThis function creates a new saved search or updates a existing saved search based on the parameters provided in predicateMap parameter.- Parameters:
resolver-ResourceResolverinstancepredicateMap-Mapof type <String, String> containing all the parameters that needed to be saved in query parameters of saved search node.- Returns:
Resourcethat is created or updated for saved search- Throws:
OmniSearchException- instance ofOmniSearchExceptionwhich provide error from the module
-
deleteSavedSearch
This function delete the saved search node existing on the provided path- Parameters:
resolver-ResourceResolverinstancepath- path of saved search node that needed to be deleted.- Returns:
- true if node deleted successfully , false otherwise
- Throws:
OmniSearchException- instance ofOmniSearchExceptionwhich provide error from the module
-