Interface SavedSearchHandler


  • @ConsumerType
    public 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 Detail

      • getID

        String getID()
        This function returns ID of SavedSearchHandler aka 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 - ResourceResolver instance
        limit - number of result on a page
        offset - offset/start of result
        Returns:
        Iterator of Resource of nodes of saved search for the module.
        Throws:
        OmniSearchException - instance of OmniSearchException which 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 - ResourceResolver instance
        path - path of the node of saved search, from which parameters of saved search Query required
        Returns:
        Map containing parameters of the Query
        Throws:
        OmniSearchException - instance of OmniSearchException which provide error from the module
      • createOrUpdateSavedSearch

        Resource createOrUpdateSavedSearch​(ResourceResolver resolver,
                                           Map<String,​String> predicateMap)
                                    throws OmniSearchException
        This function creates a new saved search or updates a existing saved search based on the parameters provided in predicateMap parameter.
        Parameters:
        resolver - ResourceResolver instance
        predicateMap - Map of type <String, String> containing all the parameters that needed to be saved in query parameters of saved search node.
        Returns:
        Resource that is created or updated for saved search
        Throws:
        OmniSearchException - instance of OmniSearchException which provide error from the module
      • deleteSavedSearch

        boolean deleteSavedSearch​(ResourceResolver resolver,
                                  String path)
                           throws OmniSearchException
        This function delete the saved search node existing on the provided path
        Parameters:
        resolver - ResourceResolver instance
        path - path of saved search node that needed to be deleted.
        Returns:
        true if node deleted successfully , false otherwise
        Throws:
        OmniSearchException - instance of OmniSearchException which provide error from the module