Interface ProfileSearchLogic


  • public interface ProfileSearchLogic
    An interface for dealing with profile searches.
    Author:
    Steve Swinsburg (steve.swinsburg@gmail.com), Daniel Robinson (d.b.robinson@lancaster.ac.uk)
    • Method Detail

      • findUsersByNameOrEmail

        List<Person> findUsersByNameOrEmail​(String search,
                                            boolean includeConnections,
                                            String worksiteId)
        Find all users that match the search string in either name or email.

        Searches SakaiPerson, UserDirectorySerice internal users as well as external users if your provider supports SearchExternalUsersUDP.

        This list is automatically cleaned for non-existent users by way of UserDirectoryService.getUsers.

        Parameters:
        search - string to search for
        includeConnections - should connections be returned in results
        worksiteId - optional parameter to limit search to a single worksite. Specify null to search all users.
        Returns:
        List Persons
      • findUsersByInterest

        List<Person> findUsersByInterest​(String search,
                                         boolean includeConnections,
                                         String worksiteId)
        Find all users that match the search string in any of the relevant SakaiPerson fields

        This list is automatically cleaned for non-existent users by way of UserDirectoryService.getUsers.

        Parameters:
        search - string to search for
        includeConnections - should connections be returned in results
        worksiteId - optional parameter to limit search to a single worksite. Specify null to search all users.
        Returns:
        List Persons
      • getLastSearchTerm

        ProfileSearchTerm getLastSearchTerm​(String userUuid)
        Retrieves the last search term made by the user with the given UUID.
        Parameters:
        userUuid - the UUID of the user to query by.
        Returns:
        the last search term made by the user with the given UUID. Returns null if no search term is found.
      • getSearchHistory

        List<ProfileSearchTerm> getSearchHistory​(String userUuid)
        Retrieves the search history for the user with the given UUID.
        Parameters:
        userUuid - the UUID of the user to query by.
        Returns:
        the search history for the user with the given UUID. Returns null if no search history is found.
      • addSearchTermToHistory

        void addSearchTermToHistory​(String userUuid,
                                    ProfileSearchTerm searchTerm)
        Adds the given profile search term to a user's search history.
        Parameters:
        userUuid - the user whose history we're adding to.
        searchTerm - the search term to add.
      • clearSearchHistory

        void clearSearchHistory​(String userUuid)
        Clears the search history for the user with the given UUID.
        Parameters:
        userUuid - the UUID of the user to clear history for.