source: gsdl/trunk/src/colservr/z3950_to_gsdl.h@ 15413

Last change on this file since 15413 was 15413, checked in by mdewsnip, 16 years ago

(Untangling colservr/recpt) Removed all the inclusions of recptproto.h, as these aren't actually used.

  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
1/**********************************************************************
2 *
3 * z3950_to_gsdl.h --
4 * Copyright (C) 2000 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#ifndef Z3950_TO_GSDL_H
27#define Z3950_TO_GSDL_H
28
29
30void toUpperString(char *&text);
31
32class gsdlCollection
33{
34 public:
35 gsdlCollection();
36 gsdlCollection(text_t collectionName, text_t gsdlhome);
37 ~gsdlCollection(void);
38
39 bool z3950Capeable() const;
40
41 // converts a Bib1 field number to a short index name,
42 // returns true if a mapping existed, false otherwise
43 bool getFieldArg(int Bib1, text_t &Short);
44
45 text_t getName(); // returns the name of the collection in short form
46
47 protected:
48
49
50 bool bib1_to_dc_mapping(text_t& filename);
51 bool dc_to_short_mapping(text_t& filename, text_t& collectionName);
52
53 protected:
54 text_t name;
55 map<int, text_t> Bib1_to_DCES; // Bib-1 to DC metadata names
56 map<text_t, text_t> DCES_to_Short; // DC to short (2-3 letter) internal name
57
58 bool z3950ready; // is the collection Z39.50-ready ?
59 // (i.e. does it have the cfg files for mappings)
60
61
62};
63
64class z3950Server
65{
66protected:
67 text_tarray collections;
68 nullproto *protocol;
69 text_t gsdlhome;
70
71 // save particular YAZ variables ...
72
73 void openLogfile(text_t extension, ofstream &out);
74
75
76public:
77 z3950Server(nullproto *protocol, text_t home);
78
79 bool initialise();
80
81 void configure(const text_t &key, const text_tarray &cfgline, comerror_t &err);
82
83 int run_z3950( int argc, char **argv );
84
85};
86
87#endif
Note: See TracBrowser for help on using the repository browser.