[8182] | 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 |
|
---|
| 11 | class oaicollectconfig {
|
---|
| 12 | public:
|
---|
| 13 | oaicollectconfig(const text_t &collectname) { this->collection = collectname; }
|
---|
| 14 | text_t collection;
|
---|
| 15 | text_t maintainer;
|
---|
| 16 | text_t repositoryName;
|
---|
[14285] | 17 | text_t baseURL;
|
---|
[8182] | 18 | text_tmap fieldMap; // maps from OAI name to GSDL name
|
---|
| 19 | };
|
---|
| 20 |
|
---|
| 21 | typedef map<text_t, oaicollectconfig *, lttext_t> oaicollectmap;
|
---|
| 22 |
|
---|
| 23 | class oaiconfig : configurable {
|
---|
| 24 | public:
|
---|
| 25 | oaiconfig();
|
---|
| 26 | oaiconfig(text_t &gsdlhome, text_t &gsdlcollect);
|
---|
| 27 | ~oaiconfig();
|
---|
[8303] | 28 | virtual void configure(const text_t &key, const text_tarray &cfgline);
|
---|
| 29 | text_t getCollectionConfig(const text_t &collection, const text_t &field);
|
---|
| 30 | text_tarray & getCollectionsList() { return this->collectList; }
|
---|
| 31 | text_t getMapping(const text_t &collection, const text_t &collectfield);
|
---|
| 32 | text_t getMapping(const text_t &collection, const text_t &collectfield, const text_t &format);
|
---|
| 33 | text_tmap * getInformation() { return &this->infoMap; }
|
---|
| 34 | int getOAIVersion();
|
---|
[11732] | 35 | int resumeAfter();
|
---|
[8182] | 36 | private:
|
---|
| 37 | void configureCollection(const text_t &gsdlhome, const text_t &collection);
|
---|
| 38 |
|
---|
[8303] | 39 | text_tarray collectList; // The list of collections to be taken in hand
|
---|
[8182] | 40 | text_tmap infoMap; // Holds the information to be given in the case
|
---|
| 41 | // of an OAI identify request
|
---|
| 42 | oaicollectmap collectMap; // The configuration of collections
|
---|
| 43 | text_t collection; // Used to track which collection is being configured
|
---|
| 44 | text_t oaiVersion; // The version of OAI running
|
---|
[11732] | 45 | int resumptionSize; // The number of items to produce before spitting out a
|
---|
| 46 | // resumptionToken
|
---|
[8182] | 47 | };
|
---|
| 48 | #endif
|
---|