source: trunk/gsdl/src/recpt/comtypes.h@ 272

Last change on this file since 272 was 272, checked in by sjboddie, 25 years ago

Few changes to get getParents filter option to return metadata of parents
as well as current OID

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 8.4 KB
Line 
1/**********************************************************************
2 *
3 * comtypes.h --
4 * Copyright (C) 1999 The New Zealand Digital Library Project
5 *
6 * PUT COPYRIGHT NOTICE HERE
7 *
8 * $Id: comtypes.h 272 1999-06-16 02:01:22Z sjboddie $
9 *
10 *********************************************************************/
11
12
13#ifndef COMTYPES_H
14#define COMTYPES_H
15
16#include "gsdlconf.h"
17#include "text_t.h"
18
19#if defined(GSDL_USE_OBJECTSPACE)
20# include <ospace\std\vector>
21# include <ospace\std\list>
22# include <ospace\std\map>
23#elif defined(GSDL_USE_STL_H)
24# include <vector.h>
25# include <list.h>
26# include <map.h>
27#else
28# include <vector>
29# include <list>
30# include <map>
31#endif
32
33
34enum comerror_t {noError, authenticationFailure, protocolError,
35 configurationError, systemProblem};
36text_t get_comerror_string (comerror_t err);
37
38// ShortColInfo ::= SEQUENCE {
39// name GeneralString,
40// host GeneralString,
41// port INTEGER
42// }
43struct ShortColInfo_t {
44 void clear ();
45 ShortColInfo_t () {clear();}
46
47 text_t name;
48 text_t host;
49 int port;
50};
51
52
53// ColInfoResponse ::= SEQUENCE {
54// shortInfo [0] IMPLICIT ShortCollectionInfo,
55// isPublic [2] IMPLICIT BOOLEAN, -- whether has anonymous access
56// isBeta [3] IMPLICIT BOOLEAN, -- beta if still under development
57// buildDate [4] IMPLICIT GeneralizedTime,
58// languages [5] IMPLICIT StringSet, -- languages in the collection
59// numDocs [6] IMPLICIT INTEGER,
60// numWords [7] IMPLICIT INTEGER OPTIONAL,
61// numBytes [8] IMPLICIT INTEGER OPTIONAL
62// }
63struct ColInfoResponse_t {
64 void clear ();
65 ColInfoResponse_t () {clear();}
66
67 ShortColInfo_t shortInfo;
68 bool isPublic;
69 bool isBeta;
70 unsigned long buildDate;
71 text_tarray languages;
72 unsigned long numDocs; // 0 if not known
73 unsigned long numWords; // 0 if not known
74 unsigned long numBytes; // 0 if not known
75};
76
77
78// -- filter options which might be supported for the QueryFilter
79// --
80// -- onePerQuery StartResults integer
81// -- onePerQuery EndResults integer
82// -- onePerQuery QueryType enumerated (boolean, ranked)
83// -- onePerTerm Term string ???
84// -- onePerTerm Casefold boolean
85// -- onePerTerm Stem boolean
86// -- onePerTerm Index enumerated
87// -- onePerTerm Subcollection enumerated
88// --
89// -- filter options which might be supported for the BrowseFilter
90// --
91// -- onePerQuery StartResults integer
92// -- onePerQuery EndResults integer
93// -- onePerQuery ParentNode string ("" will return the browsing available)
94// --
95// -- The NullFilter always returns the set it was given, it doesn't have
96// -- any options
97
98// InfoFiltersResponse ::= SEQUENCE {
99// filterNames StringSet
100// }
101struct InfoFiltersResponse_t {
102 void clear ();
103
104 text_tset filterNames;
105};
106
107// InfoFilterOptionsRequest ::= SEQUENCE {
108// filterName GeneralString
109// }
110struct InfoFilterOptionsRequest_t {
111 void clear ();
112
113 text_t filterName;
114};
115
116// FilterOption ::= SEQUENCE {
117// name GeneralString,
118// type ENUMERATED {booleant(0), integert(1), enumeratedt(2), stringt(3)},
119// repeatable ENUMERATED {onePerQuery(0), onePerTerm(1), nPerTerm(2)},
120// defaultValue GeneralString,
121// -- the interpretation of the validValues depends on the type
122// -- for boolean: the first value is the false value, the second is true value
123// -- for integer: the first value is the minimum, the second the maximum
124// -- for enumerated: all values a listed
125// -- for string: this value is ignored
126// validValues StringSequence
127// }
128struct FilterOption_t {
129 void clear ();
130 void check_defaultValue ();
131 FilterOption_t () {clear();}
132
133 text_t name;
134
135 enum type_t {booleant=0, integert=1, enumeratedt=2, stringt=3};
136 type_t type;
137
138 enum repeatable_t {onePerQuery=0, onePerTerm=1, nPerTerm=2};
139 repeatable_t repeatable;
140
141 text_t defaultValue;
142 text_tarray validValues;
143};
144
145typedef map<text_t, FilterOption_t, lttext_t> FilterOption_tmap;
146
147
148// InfoFilterOptionsResponse ::= SEQUENCE {
149// filterOptions SET OF FilterOption
150// }
151struct InfoFilterOptionsResponse_t {
152 void clear ();
153
154 FilterOption_tmap filterOptions;
155};
156
157
158// OptionValue ::= SEQUENCE {
159// name GeneralString,
160// value GeneralString
161// }
162struct OptionValue_t {
163 void clear ();
164
165 text_t name;
166 text_t value;
167};
168
169typedef vector<OptionValue_t> OptionValue_tarray;
170
171
172// -- Terms are presented in the same order that they are requested,
173// -- any information relating to the terms is in reference to the
174// -- index specified for that term.
175// -- Metadata is presented in the same order that it is requested.
176//
177// FilterRequest ::= SEQUENCE {
178// filterName [0] GeneralString,
179// filterOptions [1] IMPLICIT SEQUENCE OF OptionValue,
180// docSet [2] IMPLICIT StringSequence, -- the OID "" represents everything
181// filterResultOptions [3] IMPLICIT BIT STRING {termFreq(0), matchTerms(1), OID(2),
182// subCol(3), ranking(4), docFreq(5),
183// metadata(6)}
184//
185// -- the next set of options are for the metadata request,
186// -- they can be left blank if metadata is not wanted
187// requestParams [4] IMPLICIT GeneralString, -- used to negotiate the metadata content
188// refParams [5] IMPLICIT GeneralString, -- used to decide whether to return a
189// -- reference to the data or the actual data
190// fields [6] IMPLICIT StringSequence
191// getParents [7] IMPLICIT BOOLEAN -- gets metadata of all parents too
192// }
193#define FRtermFreq 1
194#define FRmatchTerms 2
195#define FROID 4
196#define FRsubCol 8
197#define FRranking 16
198#define FRdocFreq 32
199#define FRmetadata 64
200
201struct FilterRequest_t {
202 void clear ();
203 FilterRequest_t () {clear();}
204
205 text_t filterName;
206 OptionValue_tarray filterOptions;
207 text_tset docSet; // empty if not used
208 int filterResultOptions; // use the FR* defines above
209
210 text_t requestParams; // empty if not used
211 text_t refParams; // empty if not used
212 text_tarray fields; // empty if not used
213 bool getParents; // defaults to false
214};
215
216
217// TermInfo ::= SEQUENCE {
218// term [0] GeneralString,
219// freq [1] IMPLICIT INTEGER, -- 0 if not requested
220// matchTerms [2] IMPLICIT StringSequence -- empty if not requested
221// }
222struct TermInfo_t {
223 void clear ();
224 TermInfo_t () {clear();}
225
226 text_t term;
227 int freq; // 0 if not requested
228 text_tarray matchTerms; // empty if not requested
229};
230
231typedef vector<TermInfo_t> TermInfo_tarray;
232
233
234// MetadataInfo ::= SEQUENCE {
235// params [0] IMPLICIT GeneralString,
236// isRef [1] IMPLICIT BOOLEAN,
237// values [3] IMPLICIT SEQUENCE OF GeneralString
238// }
239struct MetadataInfo_t {
240 void clear ();
241 MetadataInfo_t () {clear();}
242
243 text_t params;
244 bool isRef;
245 text_tarray values;
246};
247
248typedef vector<MetadataInfo_t> MetadataInfo_tarray;
249
250
251// ResultDocInfo ::= SEQUENCE {
252// OID [0] IMPLICIT GeneralString,
253// ranking [1] IMPLICIT INTEGER, -- 0 if not requested, range 0-10000
254// docFreq [2] IMPLICIT SEQUENCE OF INTEGER, -- empty if not requested
255// metadata [3] IMPLICIT SEQUENCE OF MetadataInfo
256// }
257struct ResultDocInfo_t {
258 void clear ();
259 ResultDocInfo_t () {clear();}
260
261 text_t OID;
262 int ranking; // 0 if not requested
263 vector<int> docFreq; // empty if not requested
264 MetadataInfo_tarray metadata; // empty if not requested
265
266 ResultDocInfo_t &operator=(const ResultDocInfo_t &x);
267};
268
269typedef vector<ResultDocInfo_t> ResultDocInfo_tarray;
270
271
272// FilterResponse ::= SEQUENCE {
273// numDocs [0] IMPLICIT INTEGER,
274// isApprox [1] IMPLICIT BOOLEAN, -- whether numDocs is approximate
275// termInfo [2] IMPLICIT SEQUENCE OF TermInfo, -- empty if not required
276// docInfo [3] IMPLICIT SEQUENCE OF ResultDocInfo -- empty if not required
277// }
278struct FilterResponse_t {
279 void clear ();
280 FilterResponse_t () {clear();}
281
282 int numDocs;
283 bool isApprox;
284 TermInfo_tarray termInfo; // empty if not requested
285 ResultDocInfo_tarray docInfo; // empty if not requested
286};
287
288
289// DocumentRequest ::= SEQUENCE {
290// OID GeneralString,
291// docType GeneralString,
292// docFormat GeneralString
293// }
294struct DocumentRequest_t {
295 void clear ();
296 DocumentRequest_t () {clear();}
297
298 text_t OID;
299 text_t docType;
300 text_t docFormat;
301};
302
303
304// DocumentResponse ::= SEQUENCE {
305// doc OCTET STRING
306// }
307
308struct DocumentResponse_t {
309 void clear ();
310 DocumentResponse_t () {clear();}
311
312 text_t doc;
313};
314
315
316#endif
Note: See TracBrowser for help on using the repository browser.