1 | /**********************************************************************
|
---|
2 | *
|
---|
3 | * mggdbmsource.h --
|
---|
4 | * Copyright (C) 1999 The New Zealand Digital Library Project
|
---|
5 | *
|
---|
6 | * PUT COPYRIGHT NOTICE HERE
|
---|
7 | *
|
---|
8 | * $Id: mggdbmsource.h 312 1999-06-29 23:06:07Z sjboddie $
|
---|
9 | *
|
---|
10 | *********************************************************************/
|
---|
11 |
|
---|
12 |
|
---|
13 | #ifndef MGGDBMSOURCE_H
|
---|
14 | #define MGGDBMSOURCE_H
|
---|
15 |
|
---|
16 | #include "gsdlconf.h"
|
---|
17 | #include "text_t.h"
|
---|
18 | #include "comtypes.h"
|
---|
19 | #include "infodbclass.h"
|
---|
20 | #include "maptools.h"
|
---|
21 | #include "mgsearch.h"
|
---|
22 | #include "source.h"
|
---|
23 |
|
---|
24 |
|
---|
25 | class mggdbmsourceclass : public sourceclass {
|
---|
26 | protected:
|
---|
27 | text_t gsdlhome;
|
---|
28 | text_t collection;
|
---|
29 | text_t collectdir;
|
---|
30 |
|
---|
31 | // these maps are only needed to convert the default indexes
|
---|
32 | stringmap indexmap;
|
---|
33 | stringmap subcollectionmap;
|
---|
34 | stringmap languagemap;
|
---|
35 |
|
---|
36 | text_t defaultindex;
|
---|
37 | text_t defaultsubcollection;
|
---|
38 | text_t defaultlanguage;
|
---|
39 |
|
---|
40 | text_t parentOID;
|
---|
41 | infodbclass parentinfo;
|
---|
42 | text_tarray parentcontents;
|
---|
43 |
|
---|
44 | text_t gdbm_filename;
|
---|
45 | gdbmclass *gdbmptr;
|
---|
46 |
|
---|
47 | mgsearchclass *mgsearchptr;
|
---|
48 |
|
---|
49 | public:
|
---|
50 | mggdbmsourceclass ();
|
---|
51 | virtual ~mggdbmsourceclass ();
|
---|
52 |
|
---|
53 | // the gdbmptr remains the responsability of the calling code
|
---|
54 | void set_gdbmptr (gdbmclass *thegdbmptr) {gdbmptr=thegdbmptr;}
|
---|
55 |
|
---|
56 | // the mgsearchptr remains the responsability of the calling code
|
---|
57 | void set_mgsearchptr (mgsearchclass *themgsearchptr) {mgsearchptr=themgsearchptr;}
|
---|
58 |
|
---|
59 | void configure (const text_t &key, const text_tarray &cfgline);
|
---|
60 | bool init (ostream &logout);
|
---|
61 | bool translate_OID (const text_t &OIDin, text_t &OIDout,
|
---|
62 | comerror_t &err, ostream &logout);
|
---|
63 | bool get_metadata (const text_t &requestParams, const text_t &refParams,
|
---|
64 | bool getParents, const text_tarray &fields, const text_t &OID,
|
---|
65 | MetadataInfo_tarray &metadata, comerror_t &err, ostream &logout);
|
---|
66 | bool get_document (const text_t &OID, text_t &doc,
|
---|
67 | comerror_t &err, ostream &logout);
|
---|
68 | };
|
---|
69 |
|
---|
70 |
|
---|
71 |
|
---|
72 | #endif
|
---|