Class Harvest

java.lang.Object
org.dspace.search.Harvest

public class Harvest extends Object
Utility class for extracting information about items, possibly just within a certain community or collection, that have been created, modified or withdrawn within a particular range of dates.
Author:
Robert Tansley
  • Field Details

    • authorizeService

      protected static final AuthorizeService authorizeService
    • handleService

      protected static final HandleService handleService
    • itemService

      protected static final ItemService itemService
  • Method Details

    • harvest

      public static List<HarvestedItemInfo> harvest(Context context, DSpaceObject scope, String startDate, String endDate, int offset, int limit, boolean items, boolean collections, boolean withdrawn, boolean nonAnon) throws SQLException, ParseException
      Obtain information about items that have been created, modified or withdrawn within a given date range. You can also specify 'offset' and 'limit' so that a big harvest can be split up into smaller sections.

      Note that dates are passed in the standard ISO8601 format used by DSpace (and OAI-PMH).

      FIXME: Assumes all in_archive items have public metadata

      Parameters:
      context - DSpace context
      scope - a Collection, Community, or null indicating the scope is all of DSpace
      startDate - start of date range, or null
      endDate - end of date range, or null
      offset - for a partial harvest, the point in the overall list of matching items to start at. 0 means just start at the beginning.
      limit - the number of matching items to return in a partial harvest. Specify 0 to return the whole list (or the rest of the list if an offset was specified.)
      items - if true the item field of each HarvestedItemInfo object is filled out
      collections - if true the collectionHandles field of each HarvestedItemInfo object is filled out
      withdrawn - If true, information about withdrawn items is included
      nonAnon - If items without anonymous access should be included or not
      Returns:
      List of HarvestedItemInfo objects
      Throws:
      SQLException - if database error
      ParseException - If the date is not in a supported format
    • getSingle

      public static HarvestedItemInfo getSingle(Context context, String handle, boolean collections) throws SQLException
      Get harvested item info for a single item. item field in returned HarvestedItemInfo object is always filled out.
      Parameters:
      context - DSpace context
      handle - Prefix-less Handle of item
      collections - if true the collectionHandles field of the HarvestedItemInfo object is filled out
      Returns:
      HarvestedItemInfo object for the single item, or null
      Throws:
      SQLException - if database error