source: gsdl/trunk/src/oaiservr/oaiconfig.h@ 14119

Last change on this file since 14119 was 11732, checked in by grbuchan, 18 years ago

Improved functionality in resumptiontoken; additional support of resumption
behaviour in configuration; better honouring of OAI settings on collections
(i.e. collections not explicitly listed could be revealed through OAI by
accident).

  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1#ifndef _OAICONFIG_H_
2#define _OAICONFIG_H_
3
4#include "cnfgable.h"
5
6#include <map>
7
8// TODO: sort out the members of oaicollectconfig as private/public and add
9// corresponding set/get functions
10
11class oaicollectconfig {
12 public:
13 oaicollectconfig(const text_t &collectname) { this->collection = collectname; }
14 text_t collection;
15 text_t maintainer;
16 text_t repositoryName;
17 text_tmap fieldMap; // maps from OAI name to GSDL name
18};
19
20typedef map<text_t, oaicollectconfig *, lttext_t> oaicollectmap;
21
22class oaiconfig : configurable {
23 public:
24 oaiconfig();
25 oaiconfig(text_t &gsdlhome, text_t &gsdlcollect);
26 ~oaiconfig();
27 virtual void configure(const text_t &key, const text_tarray &cfgline);
28 text_t getCollectionConfig(const text_t &collection, const text_t &field);
29 text_tarray & getCollectionsList() { return this->collectList; }
30 text_t getMapping(const text_t &collection, const text_t &collectfield);
31 text_t getMapping(const text_t &collection, const text_t &collectfield, const text_t &format);
32 text_tmap * getInformation() { return &this->infoMap; }
33 int getOAIVersion();
34 int resumeAfter();
35 private:
36 void configureCollection(const text_t &gsdlhome, const text_t &collection);
37
38 text_tarray collectList; // The list of collections to be taken in hand
39 text_tmap infoMap; // Holds the information to be given in the case
40 // of an OAI identify request
41 oaicollectmap collectMap; // The configuration of collections
42 text_t collection; // Used to track which collection is being configured
43 text_t oaiVersion; // The version of OAI running
44 int resumptionSize; // The number of items to produce before spitting out a
45 // resumptionToken
46};
47#endif
Note: See TracBrowser for help on using the repository browser.