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 |
|
---|
30 | void toUpperString(char *&text);
|
---|
31 |
|
---|
32 | class 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 |
|
---|
64 | class z3950Server
|
---|
65 | {
|
---|
66 | protected:
|
---|
67 | text_tarray collections;
|
---|
68 | recptproto *protocol;
|
---|
69 | text_t gsdlhome;
|
---|
70 |
|
---|
71 | // save particular YAZ variables ...
|
---|
72 |
|
---|
73 | void openLogfile(text_t extension, ofstream &out);
|
---|
74 |
|
---|
75 |
|
---|
76 | public:
|
---|
77 | //z3950Server(recptproto *protocol, text_t home);
|
---|
78 | z3950Server(nullproto *protocol, text_t home);
|
---|
79 |
|
---|
80 | bool initialise();
|
---|
81 |
|
---|
82 | void configure(const text_t &key, const text_tarray &cfgline, comerror_t &err);
|
---|
83 |
|
---|
84 | int run_z3950( int argc, char **argv );
|
---|
85 |
|
---|
86 | };
|
---|
87 |
|
---|
88 | #endif
|
---|