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

Last change on this file since 21455 was 21455, checked in by ak19, 14 years ago

Major bug fix after Dr Bainbridge debugged the server code which was causing the server to crash upon Enter Library: the line where it failed was simply where a local-scope text_t object was being naturally destructed. The real error was a memory corruption which the use of the new heapchk function helped to locate: collectset's inherited method configure() ought to have been specified as virtual, since it was declared virtual in the superclass configurable. A couple of destructors (in collectset and oaiservr's oaiconfig) have been made virtual as well since the superclass configurable has virtual methods which requires all related destructors to be virtual.

  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
RevLine 
[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
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;
[18859]17 text_t baseURL; // URL of oaiserver.cgi
18 text_t baseDocRoot; // Base URL for gsdl directory
[8182]19 text_tmap fieldMap; // maps from OAI name to GSDL name
20};
21
22typedef map<text_t, oaicollectconfig *, lttext_t> oaicollectmap;
23
24class oaiconfig : configurable {
25 public:
26 oaiconfig();
27 oaiconfig(text_t &gsdlhome, text_t &gsdlcollect);
[21455]28 virtual ~oaiconfig();
[8303]29 virtual void configure(const text_t &key, const text_tarray &cfgline);
30 text_t getCollectionConfig(const text_t &collection, const text_t &field);
31 text_tarray & getCollectionsList() { return this->collectList; }
[18891]32 text_tset & getMetadataSet() { return this->metadataSet; }
[8303]33 text_t getMapping(const text_t &collection, const text_t &collectfield);
34 text_t getMapping(const text_t &collection, const text_t &collectfield, const text_t &format);
35 text_tmap * getInformation() { return &this->infoMap; }
[20629]36 text_t getSetName(const text_t &setSpec);
37 text_t getSetDescription(const text_t &setSpec);
[8303]38 int getOAIVersion();
[11732]39 int resumeAfter();
[8182]40 private:
[18903]41 bool configureCollection(const text_t &gsdlhome, const text_t &collection);
[8182]42
[8303]43 text_tarray collectList; // The list of collections to be taken in hand
[18891]44 text_tset metadataSet; // The list of metadata sets to be supported
[8182]45 text_tmap infoMap; // Holds the information to be given in the case
46 // of an OAI identify request
[20629]47 text_tmap setNameMap; // Holds user-defined names for the sets
48 text_tmap setDescriptionMap; // Holds user-defined descriptions for the sets
[8182]49 oaicollectmap collectMap; // The configuration of collections
50 text_t collection; // Used to track which collection is being configured
51 text_t oaiVersion; // The version of OAI running
[11732]52 int resumptionSize; // The number of items to produce before spitting out a
53 // resumptionToken
[18859]54
[8182]55};
56#endif
Note: See TracBrowser for help on using the repository browser.