#ifndef _OAICONFIG_H_ #define _OAICONFIG_H_ #include "cnfgable.h" #include class oaicollectconfig { public: oaicollectconfig(const text_t &collectname) { this->collection = collectname; } text_t collection; text_t setName; // A display name for the set (collection) text_t setDescription; // A display description for the set (collection) text_tmap fieldMap; // maps from OAI name to GSDL name }; typedef map oaicollectmap; class oaiconfig : configurable { public: oaiconfig(); oaiconfig(text_t &gsdlhome, text_t &gsdlcollect); virtual ~oaiconfig(); virtual void configure(const text_t &key, const text_tarray &cfgline); text_tarray & getCollectionsList() { return this->collectList; } text_tset & getMetadataSet() { return this->metadataSet; } text_t getMapping(const text_t &collection, const text_t &collectfield); text_t getMapping(const text_t &collection, const text_t &collectfield, const text_t &format); text_tmap * getInformation() { return &this->infoMap; } text_t getSetName(const text_t &setSpec); text_t getSetDescription(const text_t &setSpec); int getOAIVersion(); int resumeAfter(); text_t getBaseURL(); text_t getBaseLibraryURL(); text_t getBaseDocRoot(); text_t getRepositoryName(); text_t getRepositoryId(); text_t getRepositoryIdVersion(); text_t getMaintainer(); private: bool configureCollection(const text_t &gsdlhome, const text_t &collection); text_t repositoryName; // human readable name text_t repositoryId; // unique (among oai servers) domain name or id for the repository text_t repositoryIdVersion; // 1.1 or 2.0 for identifier scheme text_t baseURL; // URL of oaiserver.cgi text_t baseLibraryURL; // URL of library.cgi (used for urls to greenstone documents ) text_t baseDocRoot; // Base URL for gsdl directory (used for urls to source documents ) text_t oaiVersion; // The version of OAI running int resumptionSize; // The number of items to produce before spitting out a resumptionToken text_t maintainer; text_tarray collectList; // The list of collections to be taken in hand text_tset metadataSet; // The list of metadata sets to be supported text_tmap infoMap; // Holds the information to be given in the case // of an OAI identify request oaicollectmap collectMap; // The configuration of collections text_t collection; // Used to track which collection is being configured }; #endif