source: trunk/gsdl/src/recpt/z3950server.h@ 1900

Last change on this file since 1900 was 1900, checked in by jrm21, 23 years ago

The z39.50 client now does "and" or "or" boolean searches depending on
whether "some" or "all" is chosen in the UI. Note that this has been claimed
for some time, but it actually does it now :)

  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 KB
Line 
1/**********************************************************************
2 *
3 * z3950server.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 Z3950SERVER_H
27#define Z3050SERVER_H
28
29#include "comtypes.h"
30
31// each "server" (ie collection) consists of a {z39.50 server + database} pair.
32class z3950_server {
33 protected:
34 text_t title; // Descriptive name
35 text_t z_initstr; // a string returned when the connection is initialised.
36 text_tmap meta; // metadata for this collection (ie server/database pair)
37 text_tmap format;
38 text_tmap about; // langauge/abouttext pair for collection.
39 ShortColInfo_t *info; // has (database) name, host and port
40 text_tarray *titles;
41 bool connect();
42 bool connected; // tcp connection to the z39.50 server (target)
43 bool gotsinglerecord; // if we do, then we don't need all titles...
44
45 public:
46 z3950_server();
47 ~z3950_server();
48 void setName(const text_t &newname);
49 const text_t getName() {return title;}
50 void setMeta(const text_t &key, const text_t &value);
51 const text_tmap *getMeta() {return &meta;}
52 const text_tmap *getFormat() {return &format;}
53 void setInfo(ShortColInfo_t *newinfo) {info=newinfo;}
54 const ShortColInfo_t *getInfo() {return info;}
55 void addcfgAbout(const text_t &lang, const text_t &abouttext);
56 bool getcfgAbout(const text_t &lang, text_t &abouttext);
57 // now the functions that actually talk to the target (ie zserver) over tcp
58 text_t &getzAbout(); // gets any name, id, MOTD, etc from server.
59 text_tarray *getrecordTitles(const text_t &query,
60 const int querytype,
61 const text_t &fields,
62 const int first, const int count,
63 int *nummatches, comerror_t &err);
64 /* only get one record at a time? (Eventually we could buffer them, but
65 for now... */
66 bool getfullrecord(const text_t &query, const int querytype,
67 const text_t &fields,
68 const int ID, text_t &rettitle,
69 text_t &rettext,comerror_t &err);
70 private:
71 void parseQuery(const text_t &query, const int querytype,
72 const text_t &fields,
73 text_t &parsed_query);
74};
75
76typedef vector<z3950_server *> z3950_server_array;
77
78#endif
Note: See TracBrowser for help on using the repository browser.