public class OAIHarvester extends Object
| Modifier and Type | Field and Description |
|---|---|
protected BitstreamFormatService |
bitstreamFormatService |
protected BitstreamService |
bitstreamService |
protected BundleService |
bundleService |
protected CollectionService |
collectionService |
protected ConfigurationService |
configurationService |
protected HandleService |
handleService |
protected HarvestedCollectionService |
harvestedCollection |
protected HarvestedItemService |
harvestedItemService |
protected InstallItemService |
installItemService |
protected ItemService |
itemService |
static String |
OAI_ADDRESS_ERROR |
static String |
OAI_DMD_ERROR |
static String |
OAI_ORE_ERROR |
static String |
OAI_SET_ERROR |
protected PluginService |
pluginService |
protected WorkspaceItemService |
workspaceItemService |
| Constructor and Description |
|---|
OAIHarvester(Context c,
DSpaceObject dso,
HarvestedCollection hc) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
alertAdmin(int status,
Exception ex)
Generate and send an email to the administrator.
|
protected String |
extractHandle(Item item)
Scan an item's metadata, looking for the value "identifier.*".
|
protected List<org.jdom.Element> |
getMDrecord(String oaiSource,
String itemOaiId,
String metadataPrefix)
Query the OAI-PMH provider for a specific metadata record.
|
static String |
oaiResolveNamespaceToPrefix(String oaiSource,
String MDNamespace)
Query the OAI-PMH server for its mapping of the supplied namespace and metadata prefix.
|
protected void |
processRecord(org.jdom.Element record,
String OREPrefix,
long currentRecord,
long totalListSize)
Process an individual PMH record, making (or updating) a corresponding DSpace Item.
|
void |
runHarvest()
Performs a harvest cycle on this collection.
|
List<String> |
verifyOAIharvester()
Verify OAI settings for the current collection
|
static List<String> |
verifyOAIharvester(String oaiSource,
String oaiSetId,
String metaPrefix,
boolean testORE)
Verify the existence of an OAI server with the specified set and
supporting the provided metadata formats.
|
public static final String OAI_ADDRESS_ERROR
public static final String OAI_SET_ERROR
public static final String OAI_DMD_ERROR
public static final String OAI_ORE_ERROR
protected BitstreamService bitstreamService
protected BitstreamFormatService bitstreamFormatService
protected BundleService bundleService
protected CollectionService collectionService
protected HarvestedCollectionService harvestedCollection
protected InstallItemService installItemService
protected ItemService itemService
protected HandleService handleService
protected HarvestedItemService harvestedItemService
protected WorkspaceItemService workspaceItemService
protected PluginService pluginService
protected ConfigurationService configurationService
public OAIHarvester(Context c, DSpaceObject dso, HarvestedCollection hc) throws HarvestingException, SQLException
HarvestingExceptionSQLExceptionpublic void runHarvest()
throws SQLException,
IOException,
AuthorizeException
protected void processRecord(org.jdom.Element record,
String OREPrefix,
long currentRecord,
long totalListSize)
throws SQLException,
AuthorizeException,
IOException,
CrosswalkException,
HarvestingException,
ParserConfigurationException,
SAXException,
TransformerException
record - a JDOM Element containing the actual PMH record with descriptive metadata.OREPrefix - the metadataprefix value used by the remote PMH server to disseminate ORE. Only used for collections set up to harvest content.currentRecord - totalListSize - The total number of records that this Harvest containsSQLExceptionAuthorizeExceptionIOExceptionCrosswalkExceptionHarvestingExceptionParserConfigurationExceptionSAXExceptionTransformerExceptionprotected String extractHandle(Item item)
item - a newly created, but not yet installed, DSpace Itempublic static String oaiResolveNamespaceToPrefix(String oaiSource, String MDNamespace) throws IOException, ParserConfigurationException, SAXException, TransformerException, ConnectException
oaiSource - the address of the OAI-PMH providerMDNamespace - the namespace that we are trying to resolve to the metadataPrefixIOExceptionParserConfigurationExceptionSAXExceptionTransformerExceptionConnectExceptionprotected void alertAdmin(int status,
Exception ex)
status - the current status of the collection, usually HarvestedCollection.STATUS_OAI_ERROR or HarvestedCollection.STATUS_UNKNOWN_ERRORex - the Exception that prompted this actionprotected List<org.jdom.Element> getMDrecord(String oaiSource, String itemOaiId, String metadataPrefix) throws IOException, ParserConfigurationException, SAXException, TransformerException, HarvestingException
oaiSource - the address of the OAI-PMH provideritemOaiId - the OAI identifier of the target itemmetadataPrefix - the OAI metadataPrefix of the desired metadataIOExceptionParserConfigurationExceptionSAXExceptionTransformerExceptionHarvestingExceptionpublic List<String> verifyOAIharvester()
public static List<String> verifyOAIharvester(String oaiSource, String oaiSetId, String metaPrefix, boolean testORE)
oaiSource - the address of the OAI-PMH provideroaiSetId - metaPrefix - testORE - whether the method should also check the PMH provider for ORE supportCopyright © 2022 LYRASIS. All rights reserved.