Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

OAI manager it's an utility that allows one to do some administrative operations with OAI. 

Syntax

Wiki Markup&nbsp;bin bin/dspace oai <action> \ [parameters\]

Actions

  • import  Imports DSpace items into OAI Solr index (also cleans OAI cache)
  • clean-cache  Cleans the OAI cache

...

  • -o Optimize index after indexing
  • -c Clears the Solr index before indexing (it will import all items again)
  • -v Verbose output
  • -h Shows an help text

Scheduled Tasks

Wiki MarkupIn order to refresh the OAI Solr index, it is required to run the {{\[dspace\]/bin/dspace oai import&nbsp;import }}command periodically. You can add the following task to your crontab:

Code Block
0 3 * * * [dspace]/bin/dspace oai import

Wiki MarkupNote that {{\[dspace\]}} should be replaced by the correct value, that is, the value defined in {{dspace.cfg}} parameter {{dspace.dir}}.

Using Database

Wiki MarkupOAI 2.0 could also work using the database for querying. To configure that one must change the \ [dspace\]/config/modules/xoai.cfg file, specifically parameter 'storage', setting it to _database_.

OAI Manager (Database Data Source)

OAI manager it's an utility that allows one to do some administrative operations with OAI. 

Syntax

Wiki Markup&nbsp;bin bin/dspace oai <action> \ [parameters\]

Actions

  • clean-cache  Cleans the OAI cache
  • compile-items  Compiles DSpace items
  • erase-compiled-items  Erases all DSpace compiled items

...

  • -v Verbose output
  • -h Shows an help text

Scheduled Tasks

Wiki MarkupIn order to refresh the OAI cache and compile DSpace items (for fast responses), it is required to run the {{\[dspace\]/bin/dspace xoai compile-items&nbsp;items }}command periodically. You can add the following task to your crontab:

Code Block
0 3 * * * [dspace]/bin/dspace oai compile-items

...

Note that {{\[dspace\]}} should be replaced by the correct value, that is, the value defined in {{dspace.cfg}} parameter {{dspace.dir}}.

Client-side stylesheet

...

The OAI-PMH response is an XML file. While OAI-PMH is primarily used by harvesting tools and usually not directly by humans, sometimes it can be useful to look at the OAI-PMH requests directly - usually when setting it up for the first time or to verify any changes you make. For these cases, XOAI provides an XSLT stylesheet to transform the response XML to a nice looking, human-readable and interactive HTML. The stylesheet is linked from the XML response and the transformation takes place in the user's browser. Most automated tools are interested only in the XML file itself and will not perform the transformation. If you want, you can change which stylesheet will be used by placing it into the {{\[dspace\]/webapps/xoai/static}} directory (or into the {{\[dspace-src\]/dspace-xoai/dspace-xoai-webapp/src/main/webapp/static}} after which you have to rebuild DSpace), modifying the "stylesheet" attribute of the "Configuration" element in {{\[dspace\]/config/modules/xoai/xoai.xml}} and restarting your servlet container.

Metadata Formats

By default OAI 2.0 provides 12 metadata formats within the /request context:

...

Configuration

Basic Configuration

...

Configuration File:

[dspace]/config/modules/oai.cfg

]]></ac:plain-text-body></ac:structured-macro>

Property:

storage

Example Value:

storage = solr

Information Note:

This allows to choose the OAI data source between solr and database

Property:

solr.url

Example Value:

solr.url = ${default.solr.server}/oai

Informational Note:

Solr Server location

Property:

identifier.prefix

Example Value:

identifier.prefix = ${dspace.hostname}

Informational Note:

OAI persistent identifier prefix. Format - oai:PREFIX:HANDLE

Property:

config.dir

Example Value:

config.dir = ${dspace.dir}/config/modules/oai

Informational Note:

Configuration directory, used by XOAI (core library). Contains xoai.xml, metadata format XSLTs and transformer XSLTs.

Property:

cache.dir

Example Value:

cache.dir = ${dspace.dir}/var/oai

Informational Note:

Directory to store runtime generated files (for caching purposes).

...

Parameter

Description

IDENTIFIER

The identifier used within context configurations to reference this specific format, must be unique within all Metadata Formats available.

PREFIX

The prefix used in OAI interface (metadataPrefix=PREFIX).

XSLT

The name of the XSLT file within ${dspace.dir}/config/modules/oai/metadataFormats directory

NAMESPACE

XML Default Namespace of the created Schema

SCHEMA_LOCATION

URI Location of the XSD of the created Schema

...

*NOTE*: Changes in \ [dspace\]/config/modules/oai/xoai.xml requires reloading/restarting the servlet container.