source: main/trunk/greenstone2/runtime-src/src/oaiservr/oaiconfig.h@ 22286

Last change on this file since 22286 was 22286, checked in by kjdon, 11 years ago

previous commit message was for a different file. Should have been: added repositoryId and repositoryIdVersion to oai.cfg, so added code to read these in in configure and methods to reqtrieve them. Also added code to configure oaiversion as it was being ignored

  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
1#ifndef _OAICONFIG_H_
2#define _OAICONFIG_H_
3
4#include "cnfgable.h"
5
6#include <map>
7
8class oaicollectconfig {
9 public:
10 oaicollectconfig(const text_t &collectname) { this->collection = collectname; }
11 text_t collection;
12 text_t setName; // A display name for the set (collection)
13 text_t setDescription; // A display description for the set (collection)
14 text_tmap fieldMap; // maps from OAI name to GSDL name
15};
16
17typedef map<text_t, oaicollectconfig *, lttext_t> oaicollectmap;
18
19class oaiconfig : configurable {
20 public:
21 oaiconfig();
22 oaiconfig(text_t &gsdlhome, text_t &gsdlcollect);
23 virtual ~oaiconfig();
24 virtual void configure(const text_t &key, const text_tarray &cfgline);
25 text_tarray & getCollectionsList() { return this->collectList; }
26 text_tset & getMetadataSet() { return this->metadataSet; }
27 text_t getMapping(const text_t &collection, const text_t &collectfield);
28 text_t getMapping(const text_t &collection, const text_t &collectfield, const text_t &format);
29 text_tmap * getInformation() { return &this->infoMap; }
30 text_t getSetName(const text_t &setSpec);
31 text_t getSetDescription(const text_t &setSpec);
32 int getOAIVersion();
33 int resumeAfter();
34 text_t getBaseURL();
35 text_t getBaseLibraryURL();
36 text_t getBaseDocRoot();
37 text_t getRepositoryName();
38 text_t getRepositoryId();
39 text_t getRepositoryIdVersion();
40 text_t getMaintainer();
41 private:
42 bool configureCollection(const text_t &gsdlhome, const text_t &collection);
43
44 text_t repositoryName; // human readable name
45 text_t repositoryId; // unique (among oai servers) domain name or id for the repository
46 text_t repositoryIdVersion; // 1.1 or 2.0 for identifier scheme
47 text_t baseURL; // URL of oaiserver.cgi
48 text_t baseLibraryURL; // URL of library.cgi (used for urls to greenstone documents )
49 text_t baseDocRoot; // Base URL for gsdl directory (used for urls to source documents )
50 text_t oaiVersion; // The version of OAI running
51 int resumptionSize; // The number of items to produce before spitting out a resumptionToken
52 text_t maintainer;
53
54 text_tarray collectList; // The list of collections to be taken in hand
55 text_tset metadataSet; // The list of metadata sets to be supported
56 text_tmap infoMap; // Holds the information to be given in the case
57 // of an OAI identify request
58 oaicollectmap collectMap; // The configuration of collections
59 text_t collection; // Used to track which collection is being configured
60
61};
62#endif
63
64
Note: See TracBrowser for help on using the repository browser.