Configuration

The details of the configuration options for OAI-PMH server.

invenio_oaiserver.config.OAISERVER_ADMIN_EMAILS = ['info@inveniosoftware.org']

The e-mail addresses of administrators of the repository.

It must include one or more instances.

invenio_oaiserver.config.OAISERVER_CACHE_KEY = 'DynamicOAISets::'

Key prefix added before all keys in cache server.

invenio_oaiserver.config.OAISERVER_CELERY_TASK_CHUNK_SIZE = 100

Specify the maximum number of records each task will update.

invenio_oaiserver.config.OAISERVER_CONTROL_NUMBER_FETCHER = 'recid'

PIDStore fetcher for the OAI ID control number.

invenio_oaiserver.config.OAISERVER_DESCRIPTIONS = []

Specify the optional description containers that can be used to express properties of the repository that are not covered by the standard response to the Identify verb. For further information see: http://www.openarchives.org/OAI/2.0/guidelines.htm

The eprints, oai_identifier and friends description can be added using the helper functions in utils.py as follows:

from invenio_oaiserver.utils import eprints_description
from invenio_oaiserver.utils import friends_description
from invenio_oaiserver.utils import oai_identifier_description

OAISERVER_DESCRIPTIONS = [
    eprints_description(metadataPolicy, dataPolicy,
                        submissionPolicy, content),
    oai_identifier_description(scheme, repositoryIdentifier,
                               delimiter, sampleIdentifier),
    friends_description(baseUrls)
]

The parameters of each description element are strings if their type is unique or dictionaries, with the type being the key, if it can differ. E.g. the dataPolicy of the eprints element can consist of a text and or URL so it will have the form:

metadataPolicy = {'text': 'Metadata can be used by commercial'
                  'and non-commercial service providers',
                  'URL': 'http://arXiv.org/arXiv_metadata_use.htm'}

Whereas for the scheme of the oai_identifier it will just be:

scheme = 'oai'

If the parameter can take an arbitrary amount of elements it can be a list:

baseUrls = [http://oai.east.org/foo/,
            http://oai.hq.org/bar/,
            http://oai.south.org/repo.cgi]
invenio_oaiserver.config.OAISERVER_GRANULARITY = 'YYYY-MM-DDThh:mm:ssZ'

The finest harvesting granularity supported by the repository.

The legitimate values are YYYY-MM-DD and YYYY-MM-DDThh:mm:ssZ with meanings as defined in ISO8601.

invenio_oaiserver.config.OAISERVER_METADATA_FORMATS = {'marc21': {'namespace': 'http://www.loc.gov/MARC21/slim', 'serializer': ('invenio_oaiserver.utils:dumps_etree', {'prefix': 'marc'}), 'schema': 'http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd'}, 'oai_dc': {'namespace': 'http://www.openarchives.org/OAI/2.0/oai_dc/', 'serializer': ('invenio_oaiserver.utils:dumps_etree', {'xslt_filename': '/home/docs/checkouts/readthedocs.org/user_builds/invenio-oaiserver/envs/latest/local/lib/python2.7/site-packages/invenio_oaiserver-1.0.1-py2.7.egg/invenio_oaiserver/static/xsl/MARC21slim2OAIDC.xsl'}), 'schema': 'http://www.openarchives.org/OAI/2.0/oai_dc.xsd'}}

Define the metadata formats available from a repository.

Every key represents a metadataPrefix and its value has a following structure.

  • schema - the location of an XML Schema describing the format;
  • namespace - the namespace of serialized document;
  • serializer - the importable string or tuple with the importable string and keyword arguments.

Note

If you are migrating an instance running older versions of Invenio<=2.1, you might want to copy settings from 'marc21' key to 'marcxml' in order to ensure compatibility for all your OAI-PMH clients.

invenio_oaiserver.config.OAISERVER_PAGE_SIZE = 10

Define maximum length of list responses.

Request with verbs ListRecords, ListIdentifiers, and ListSets are affected by this option.

invenio_oaiserver.config.OAISERVER_QUERY_PARSER = 'elasticsearch_dsl:Q'

Define query parser for OIASet definition.

invenio_oaiserver.config.OAISERVER_RECORD_INDEX = 'records'

Specify an Elastic index with records that should be exposed via OAI-PMH.

invenio_oaiserver.config.OAISERVER_REGISTER_RECORD_SIGNALS = True

Catch record/set insert/update/delete signals and update the _oai field.

invenio_oaiserver.config.OAISERVER_REGISTER_SET_SIGNALS = True

Catch set insert/update/delete signals and update the _oai record field.

invenio_oaiserver.config.OAISERVER_RESUMPTION_TOKEN_EXPIRE_TIME = 60

The expiration time of a resumption token in seconds.

Default: 60 seconds = 1 minute.

Note

Setting longer expiration time may have a negative impact on your Elasticsearch cluster as it might need to keep open cursors.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html

invenio_oaiserver.config.OAISERVER_XSL_URL = None

Specify the url (relative or absolute) to the XML Stylesheet file to transform XML OAI 2.0 responses into XHTML.

The url can be a relative path to a local static file:

OAISERVER_XSL_URL = '/static/xsl/oai2.xsl'

or an absolute url to a remote file (be aware of CORS restrictions):

OAISERVER_XSL_URL = 'https//www.otherdomain.org/oai2.xsl'

You can obtain an already defined XSL Stylesheet for OAIS 2.0 on EPrints repository (GPLv3 licensed).