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 271 1999-06-16 02:00:34Z 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 | text_t parentOID;
|
---|
32 | infodbclass parentinfo;
|
---|
33 | text_tarray parentcontents;
|
---|
34 |
|
---|
35 | text_t gdbm_filename;
|
---|
36 | gdbmclass *gdbmptr;
|
---|
37 |
|
---|
38 | mgsearchclass *mgsearchptr;
|
---|
39 |
|
---|
40 | public:
|
---|
41 | mggdbmsourceclass ();
|
---|
42 | virtual ~mggdbmsourceclass ();
|
---|
43 |
|
---|
44 | // the gdbmptr remains the responsability of the calling code
|
---|
45 | void set_gdbmptr (gdbmclass *thegdbmptr) {gdbmptr=thegdbmptr;}
|
---|
46 |
|
---|
47 | // the mgsearchptr remains the responsability of the calling code
|
---|
48 | void set_mgsearchptr (mgsearchclass *themgsearchptr) {mgsearchptr=themgsearchptr;}
|
---|
49 |
|
---|
50 | void configure (const text_t &key, const text_tarray &cfgline);
|
---|
51 | bool init (ostream &logout);
|
---|
52 | bool translate_OID (const text_t &OIDin, text_t &OIDout,
|
---|
53 | comerror_t &err, ostream &logout);
|
---|
54 | bool get_metadata (const text_t &requestParams, const text_t &refParams,
|
---|
55 | bool getParents, const text_tarray &fields, const text_t &OID,
|
---|
56 | MetadataInfo_tarray &metadata, comerror_t &err, ostream &logout);
|
---|
57 | bool get_document (const text_t &OID, text_t &doc,
|
---|
58 | comerror_t &err, ostream &logout);
|
---|
59 | };
|
---|
60 |
|
---|
61 |
|
---|
62 |
|
---|
63 | #endif
|
---|