Interface ItemDAO

    • Method Detail

      • findByLastModifiedSince

        Iterator<Item> findByLastModifiedSince​(Context context,
                                               Date since)
                                        throws SQLException
        Find all Items modified since a Date.
        Parameters:
        context - Context
        since - Earliest interesting last-modified date.
        Returns:
        iterator over items
        Throws:
        SQLException - if database error
      • findBySubmitter

        Iterator<Item> findBySubmitter​(Context context,
                                       EPerson eperson,
                                       boolean retrieveAllItems)
                                throws SQLException
        Find all the items by a given submitter. The order is indeterminate. All items are included.
        Parameters:
        context - DSpace context object
        eperson - the submitter
        retrieveAllItems - flag to determine if only archive should be returned
        Returns:
        an iterator over the items submitted by eperson
        Throws:
        SQLException - if database error
      • findArchivedByCollectionExcludingOwning

        Iterator<Item> findArchivedByCollectionExcludingOwning​(Context context,
                                                               Collection collection,
                                                               Integer limit,
                                                               Integer offset)
                                                        throws SQLException
        Returns all the Items in an iterator that are archived and for which the given Collection is part of the Item's Collections but it is not the owning collection
        Parameters:
        context - The relevant DSpace context
        collection - The collection to check on
        limit - The limit for the query
        offset - The offset for the query
        Returns:
        An iterator containing the items for which the constraints hold true
        Throws:
        SQLException - If something goes wrong
      • countArchivedByCollectionExcludingOwning

        int countArchivedByCollectionExcludingOwning​(Context context,
                                                     Collection collection)
                                              throws SQLException
        Counts all the items that are archived and for which the given Collection is part of the Item's Collections but it is not the owning Collection
        Parameters:
        context - The relevant DSpace context
        collection - The collection to check on
        Returns:
        The total amount of items that fit the constraints
        Throws:
        SQLException - If something goes wrong
      • countItems

        int countItems​(Context context,
                       Collection collection,
                       boolean includeArchived,
                       boolean includeWithdrawn)
                throws SQLException
        Count number of items in a given collection
        Parameters:
        context - context
        collection - the collection
        includeArchived - whether to include archived items in count
        includeWithdrawn - whether to include withdrawn items in count
        Returns:
        item count
        Throws:
        SQLException - if database error
      • countItems

        int countItems​(Context context,
                       List<Collection> collections,
                       boolean includeArchived,
                       boolean includeWithdrawn)
                throws SQLException
        Count number of unique items across several collections at once. This method can be used with CommunityService.getAllCollections(Context, Community) to determine the unique number of items in a Community.
        Parameters:
        context - context
        collections - the list of collections
        includeArchived - whether to include archived items in count
        includeWithdrawn - whether to include withdrawn items in count
        Returns:
        item count
        Throws:
        SQLException - if database error
      • findAll

        Iterator<Item> findAll​(Context context,
                               boolean archived,
                               boolean withdrawn,
                               boolean discoverable,
                               Date lastModified)
                        throws SQLException
        Get all Items installed or withdrawn, discoverable, and modified since a Date.
        Parameters:
        context - context
        archived - whether to find archived
        withdrawn - whether to find withdrawn
        discoverable - whether to find discoverable
        lastModified - earliest interesting last-modified date.
        Returns:
        iterator over items
        Throws:
        SQLException - if database error
      • countRows

        int countRows​(Context context)
               throws SQLException
        Count total number of items (rows in item table)
        Parameters:
        context - context
        Returns:
        total count
        Throws:
        SQLException - if database error
      • countItems

        int countItems​(Context context,
                       boolean includeArchived,
                       boolean includeWithdrawn)
                throws SQLException
        Count number of items based on specific status flags
        Parameters:
        context - context
        includeArchived - whether to include archived items in count
        includeWithdrawn - whether to include withdrawn items in count
        Returns:
        count of items
        Throws:
        SQLException - if database error
      • countItems

        int countItems​(Context context,
                       EPerson submitter,
                       boolean includeArchived,
                       boolean includeWithdrawn)
                throws SQLException
        Count number of items from the specified submitter based on specific status flags
        Parameters:
        context - context
        submitter - the submitter
        includeArchived - whether to include archived items in count
        includeWithdrawn - whether to include withdrawn items in count
        Returns:
        count of items
        Throws:
        SQLException - if database error