Interface EPersonDAO

    • Method Detail

      • search

        List<EPerson> search​(Context context,
                             String query,
                             List<MetadataField> queryFields,
                             List<MetadataField> sortFields,
                             int offset,
                             int limit)
                      throws SQLException
        Search all EPersons by the given MetadataField objects, sorting by the given sort fields.

        NOTE: As long as a query is specified, the EPerson's email address is included in the search alongside any given metadata fields.

        Parameters:
        context - DSpace context
        query - the text to search EPersons for
        queryFields - the metadata fields to search within (email is also included automatically)
        sortFields - the metadata field(s) to sort the results by
        offset - the position of the first result to return
        limit - how many results return
        Returns:
        List of matching EPerson objects
        Throws:
        SQLException - if an error occurs
      • searchResultCount

        int searchResultCount​(Context context,
                              String query,
                              List<MetadataField> queryFields)
                       throws SQLException
        Count number of EPersons who match a search on the given metadata fields. This returns the count of total results for the same query using the 'search()', and therefore can be used to provide pagination.
        Parameters:
        context - DSpace context
        query - the text to search EPersons for
        queryFields - the metadata fields to search within (email is also included automatically)
        Returns:
        total number of EPersons who match the query
        Throws:
        SQLException - if an error occurs
      • searchNotMember

        List<EPerson> searchNotMember​(Context context,
                                      String query,
                                      List<MetadataField> queryFields,
                                      Group excludeGroup,
                                      List<MetadataField> sortFields,
                                      int offset,
                                      int limit)
                               throws SQLException
        Search all EPersons via their firstname, lastname, email (fuzzy match), limited to those EPersons which are NOT a member of the given group. This may be used to search across EPersons which are valid to add as members to the given group.
        Parameters:
        context - The DSpace context
        query - the text to search EPersons for
        queryFields - the metadata fields to search within (email is also included automatically)
        excludeGroup - Group to exclude results from. Members of this group will never be returned.
        offset - the position of the first result to return
        limit - how many results return
        Returns:
        EPersons matching the query (which are not members of the given group)
        Throws:
        SQLException - if database error
      • searchNotMemberCount

        int searchNotMemberCount​(Context context,
                                 String query,
                                 List<MetadataField> queryFields,
                                 Group excludeGroup)
                          throws SQLException
        Count number of EPersons that match a given search (fuzzy match) across firstname, lastname and email. This search is limited to those EPersons which are NOT a member of the given group. This may be used (with searchNotMember()) to perform a paginated search across EPersons which are valid to add to the given group.
        Parameters:
        context - The DSpace context
        query - querystring to fuzzy match against.
        queryFields - the metadata fields to search within (email is also included automatically)
        excludeGroup - Group to exclude results from. Members of this group will never be returned.
        Returns:
        Groups matching the query (which are not members of the given parent)
        Throws:
        SQLException - if database error
      • findByGroups

        List<EPerson> findByGroups​(Context context,
                                   Set<Group> groups,
                                   int pageSize,
                                   int offset)
                            throws SQLException
        Find all EPersons who are a member of one or more of the listed groups in a paginated fashion. This returns EPersons ordered by UUID.
        Parameters:
        context - current Context
        groups - Set of group(s) to check membership in
        pageSize - number of EPerson objects to load at one time. Set to <=0 to disable pagination
        offset - number of page to load (starting with 1). Set to <=0 to disable pagination
        Returns:
        List of all EPersons who are a member of one or more groups.
        Throws:
        SQLException
      • countByGroups

        int countByGroups​(Context context,
                          Set<Group> groups)
                   throws SQLException
        Count total number of EPersons who are a member of one or more of the listed groups. This provides the total number of results to expect from corresponding findByGroups() for pagination purposes.
        Parameters:
        context - current Context
        groups - Set of group(s) to check membership in
        Returns:
        total number of (unique) EPersons who are a member of one or more groups.
        Throws:
        SQLException