source: trunk/gsdl/src/colservr/gdbmsource.h@ 9400

Last change on this file since 9400 was 9345, checked in by davidb, 19 years ago

Restructuring of lucenegdbmsource and mggdbmsource to inherit from new class
(gdbsource) that contains the code in common between these two very similar
object.

  • Property svn:keywords set to Author Date Id Revision
File size: 2.7 KB
Line 
1/**********************************************************************
2 *
3 * gdbmsource.h --
4 * Copyright (C) 1999 The New Zealand Digital Library Project
5 *
6 * A component of the Greenstone digital library software
7 * from the New Zealand Digital Library Project at the
8 * University of Waikato, New Zealand.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 *
24 *********************************************************************/
25
26
27#ifndef GDBMSOURCE_H
28#define GDBMSOURCE_H
29
30#include "gsdlconf.h"
31#include "text_t.h"
32#include "comtypes.h"
33#include "infodbclass.h"
34#include "maptools.h"
35#include "search.h"
36#include "source.h"
37
38
39class gdbmsourceclass : public sourceclass {
40protected:
41 text_t gsdlhome;
42 text_t gdbmhome;
43 text_t collection;
44 text_t collectdir;
45
46 // these maps are only needed to convert the default indexes
47 stringmap indexmap;
48 stringmap subcollectionmap;
49 stringmap languagemap;
50
51 text_t defaultindex;
52 text_t defaultsubcollection;
53 text_t defaultlanguage;
54
55 text_t parentOID;
56 infodbclass parentinfo;
57 text_tarray parentcontents;
58
59 text_t gdbm_filename;
60 gdbmclass *gdbmptr;
61
62 searchclass *textsearchptr;
63
64public:
65 gdbmsourceclass ();
66 virtual ~gdbmsourceclass ();
67
68 // the gdbmptr remains the responsability of the calling code
69 void set_gdbmptr (gdbmclass *thegdbmptr) {gdbmptr=thegdbmptr;}
70
71 // the textsearchptr remains the responsability of the calling code
72 void set_textsearchptr (searchclass *thetextsearchptr) {textsearchptr=thetextsearchptr;}
73
74 void configure (const text_t &key, const text_tarray &cfgline);
75 bool init (ostream &logout);
76 bool translate_OID (const text_t &OIDin, text_t &OIDout,
77 comerror_t &err, ostream &logout);
78 bool get_metadata (const text_t &requestParams, const text_t &refParams,
79 bool getParents, const text_tset &fields,
80 const text_t &OID, MetadataInfo_tmap &metadata,
81 comerror_t &err, ostream &logout);
82 bool get_document (const text_t &OID, text_t &doc,
83 comerror_t &err, ostream &logout);
84 bool is_searchable(bool &issearchable, comerror_t &err, ostream &logout);
85
86 protected:
87 text_t classname;
88
89};
90
91
92
93#endif
Note: See TracBrowser for help on using the repository browser.