Package org.dspace.search
Class Harvest
java.lang.Object
org.dspace.search.Harvest
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 Summary
FieldsModifier and TypeFieldDescriptionprotected static final AuthorizeServiceprotected static final HandleServiceprotected static final ItemService -
Method Summary
Modifier and TypeMethodDescriptionstatic HarvestedItemInfoGet harvested item info for a single item.static List<HarvestedItemInfo>harvest(Context context, DSpaceObject scope, String startDate, String endDate, int offset, int limit, boolean items, boolean collections, boolean withdrawn, boolean nonAnon) Obtain information about items that have been created, modified or withdrawn within a given date range.
-
Field Details
-
authorizeService
-
handleService
-
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 contextscope- a Collection, Community, ornullindicating the scope is all of DSpacestartDate- start of date range, ornullendDate- end of date range, ornulloffset- 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- iftruetheitemfield of eachHarvestedItemInfoobject is filled outcollections- iftruethecollectionHandlesfield of eachHarvestedItemInfoobject is filled outwithdrawn- Iftrue, information about withdrawn items is includednonAnon- If items without anonymous access should be included or not- Returns:
- List of
HarvestedItemInfoobjects - Throws:
SQLException- if database errorParseException- 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.itemfield in returnedHarvestedItemInfoobject is always filled out.- Parameters:
context- DSpace contexthandle- Prefix-less Handle of itemcollections- iftruethecollectionHandlesfield of theHarvestedItemInfoobject is filled out- Returns:
HarvestedItemInfoobject for the single item, ornull- Throws:
SQLException- if database error
-