Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • You can test that it is working by sending a request to: [dspace.server.url]/[oai.path]/request?verb=Identify  (e.g. http://localhost:8080/server/oai/request?verb=Identify)
  • The response should look similar to the response from the DSpace 7 Demo Server: httphttps://demoapi7.dspace.org/server/oai/request?verb=Identify

If you're using a recent browser, you should see a HTML page describing your repository. What you're getting from the server is in fact an XML file with a link to an XSLT stylesheet that renders this HTML in your browser (client-side). Any browser that cannot interpret XSLT will display pure XML. The default stylesheet is located in [dspace-source]/dspace-oai/src/main/resources/static/style.xsl and can be changed by configuring the stylesheet attribute of the Configuration element in [dspace]/config/crosswalks/oai/xoai.xml.

...

Code Block
# Update the OAI-PMH index with the newest content (and re-optimize that index) at midnight every day
# NOTE: ONLY NECESSARY IF YOU ARE RUNNING OAI-PMH 
# (This ensures new content is available via OAI-PMH and ensures the OAI-PMH index is optimized for better performance)
0 0 * * * [dspace.dir]/bin/dspace oai import -o > /dev/null

More information about the dspace oai commandline tool can be found in the OAI Manager documentation.

...

The harvest script can be called from both the CLI and REST API by calling "harvest". It uses the paramaters as defined in the following table.

Short optionLong optionArgumentExplanation
-p--purge[none]Delete all the items in the collection provided with the -c parameter.
-r--run[none]Run the standard harvesting procedure for the collection provided with the -c parameter.
-g--ping[none]Verify that the server provided through the -a parameter and the set provided through the -i parameter can be resolved and work.
-s--setup[none]Set the collection provided with the -c parameter up for harvesting. The server will need to be provided through the -a parameter, and the oai set id needs to be provided by the -i parameter.
-S--start[none]Start the harvest loop for all collections.
-R--reset[none]Reset the harvest status on all collections.
-P--purgeCollections[none]Purge all harvestable collections.
-o--reimport[none]Reimport all items the items in the collection provided by the -c parameter. This is the equivalent of running both the -p and the -r command for the provided collection.
-c--collection[id-or-handle]The harvesting collection (handle or id)
-t--type[type-code]The type of harvesting: 0 for no harvesting, 1 for metadata only, 2 for metadata and bitstream references (requires ORE support), 3 for metadata and bitstreams (requires ORE support)
-a--address[url]The address of the OAI-PMH server to be harvested
-i--oai_set_id[set-id]The id of the PMH set representing the harvested collection. In case all sets need to harvested the value "all" should be provided.
-m--metadata_format[format]The name of the desired metadata format for harvesting, resolved to namespace and crosswalk in the dspace.cfg
-h --help[none]Print the help message
-e--eperson[email](CLI ONLY) The eperson that performs the harvest. When the command is used from the REST API, the currently logged in user will be used.


Examples of harvesting a collection through CLI commands

...

dspace/bin/dspace harvest -s -c 123456789/123 -e harvest-user@dspace.org -a https://harvest.source.org -i harvest-set -m dc -t 1

Replace the 123456789/123 with your collection, the harvest-user@dspace.org with an existing user in DSpace that has sufficient rights to perform the ingestion, https://harvest.source.org with the source you want to use, the harvest-set with the set/sets you want to harves or all in case you want to harvest all sets. The -m parameter indicated the metadata format to be used and the -t parameter indicates the harvest type to be used. When the value 0 is used for -t , harvesting will be disabled.

...

Replace the 123456789/123 with your collection, the harvest-user@dspace.org with an existing user in DSpace that has sufficient rights to perform the ingestion.

...

If the current server configuration needs to be retested at a later point, the "Test configuration" button can be used. To fully reset the collection by purging all items and starting a reimport, click the "Reset and reimport" button.

DSpace 7 Demo - OAI-PMH