User Tools

Site Tools


en:user_advanced:oai_server_gs2

This is an old revision of the document!


Greenstone 2 OAI server

Greenstone comes with a built-in OAI data provider. This runs as a CGI program called oaiserver.cgi, and is installed in the Greenstone cgi-bin directory. It can be accessed via the same URL as the Greenstone library (replacing library.cgi with oaiserver.cgi). On Windows, you must be using a web server (eg Apache) not the local library server.

Configuration of the server is done via the oai.cfg file in the Greenstone etc directory. This file specifies general information about the repository, lists collections to be made accessible and may include metadata mapping information. Important: the oai.cfg file must be utf-8 encoded.

Please edit oai.cfg and set the repositoryName and repositoryId fields. If you are not using the standard Apache setup that comes with Greenstone, you may need to set oaiserverPath, libraryPath, docRootPath. Optionally, you can set baseServerURL to use a domain name instead of IP address in URLs.

By default, collections are not accessible. To enable a collection, add its name to the oaicollection list.

Greenstone's OAI server currently supports Dublin Core, Qualified Dublin Core, and RFC1807 metadata. For collections that use other metadata sets, including extracted metadata, metadata mapping rules should be provided to map the existing metadata to Dublin Core. oai.cfg has more details.

To add a new metadata set for use with oaiserver

You need to do the following:

  • Create a schema (or find an existing one) for the metadata set. See Greenstone's qualified dublin core schema, OAI standard dublin core files for examples.
    • Put the new schema somewhere web accessible
  • Coding in GSDLHOME/runtime-src/src/oaiservr:
    • Create a new metaformat class for the metadata set. See dublincore.h/cpp, qualified_dublincore.h/cpp, rfc1807.h/cpp for examples.
    • edit Makefile.in, Makefile and win32.mak to use the new files
    • Edit recordaction.cpp to include the new header file and instantiate the new class (in recordaction())
  • Tell the server to use the new set: edit etc/oai.cfg and add the set name to the oaimetadata line. You may also need to add oaimapping information.
  • Recompile and test.
en/user_advanced/oai_server_gs2.1532991594.txt.gz · Last modified: 2018/07/30 22:59 by kjdon