Changeset 184
- Timestamp:
- 1999-03-04T12:26:35+13:00 (25 years ago)
- Location:
- trunk/gsdl/src/recpt
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/comproto.asn
r183 r184 266 266 267 267 MetadataInfoResponse ::= SEQUENCE { 268 supportedFields StringSet 268 supportedFields StringSet, 269 supportedLanguages StringSet 269 270 } 270 271 271 272 MetadataRequest ::= SEQUENCE { 272 docIDs StringSequence, 273 attributes StringSequence 274 } 275 273 OIDs StringSequence, 274 fields StringSequence, 275 languages StringSequence 276 } 277 278 -- for each OID it will return all the fields 279 -- in each of the languages 276 280 MetadataResponse ::= SEQUENCE { 277 metadata SEQUENCE OF Metadata 278 } 279 280 Metadata ::= StringSequence 281 metadata SEQUENCE OF GeneralString 282 } 281 283 282 284 283 285 DocumentRequest ::= SEQUENCE { 284 docIDGeneralString,286 OID GeneralString, 285 287 docType GeneralString, 286 288 docFormat GeneralString … … 297 299 298 300 299 -- filter options which might be supported for the query filter301 -- filter options which might be supported for the QueryFilter 300 302 -- 301 303 -- onePerQuery StartResults integer 302 304 -- onePerQuery EndResults integer 303 -- onePerQuery InverseOrder boolean 304 -- onePerQuery Ordering enumerated (rank, or metadata field) 305 -- onePerQuery QueryType enumerated (boolean, ranked) 305 306 -- onePerTerm Term string ??? 306 -- onePerTerm MimeType enumerated307 -- onePerTerm Language enumerated308 -- onePerTerm MatchOption enumerated (must match, can match, mustn't match)309 307 -- onePerTerm Casefold boolean 310 308 -- onePerTerm Stem boolean 311 309 -- onePerTerm Index enumerated 312 310 -- onePerTerm Subcollection enumerated 311 -- 312 -- filter options which might be supported for the BrowseFilter 313 -- 314 -- onePerQuery StartResults integer 315 -- onePerQuery EndResults integer 316 -- onePerQuery ParentNode string ("" will return the browsing available) 313 317 314 318 InfoFilterOptionsRequest ::= SEQUENCE { … … 325 329 326 330 FilterOption ::= SEQUENCE { 327 name GeneralString,328 type ENUMERATED {boolean(0), integer(1), enumerated(2), string(3)},329 repeatable ENUMERATED {onePerQuery(0), onePerTerm(1), nPerTerm(2)},330 default 331 name GeneralString, 332 type ENUMERATED {booleant(0), integert(1), enumeratedt(2), stringt(3)}, 333 repeatable ENUMERATED {onePerQuery(0), onePerTerm(1), nPerTerm(2)}, 334 defaultValue GeneralString, 331 335 -- the interpretation of the validValues depends on the type 332 336 -- for boolean: the first value is the false value, the second is true value … … 334 338 -- for enumerated: all values a listed 335 339 -- for string: this value is ignored 336 validValues StringSequence340 validValues StringSequence 337 341 } 338 342 … … 348 352 filterOptions [1] IMPLICIT SEQUENCE OF OptionValue, 349 353 docSet [2] IMPLICIT StringSequence OPTIONAL, 350 filterResultOptions [3] BIT STRING {termFreq(0), matchTerms(1), docID(2), subCol(3),354 filterResultOptions [3] BIT STRING {termFreq(0), matchTerms(1), OID(2), subCol(3), 351 355 ranking(4), docFreq(5)} 352 356 } … … 371 375 372 376 ResultDocInfo ::= SEQUENCE { 373 docID[0] IMPLICIT GeneralString,377 OID [0] IMPLICIT GeneralString, 374 378 subCol [1] IMPLICIT StringSequence OPTIONAL, 375 379 ranking [2] IMPLICIT REAL OPTIONAL, -
trunk/gsdl/src/recpt/comtypes.h
r166 r184 16 16 #include "gsdlconf.h" 17 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\set> 23 #elif defined(GSDL_USE_STL_H) 24 # include <vector.h> 25 # include <list.h> 26 # include <set.h> 27 #else 28 # include <vector> 29 # include <list> 30 # include <set> 31 #endif 18 32 19 33 … … 59 73 60 74 75 76 // FilterOption ::= SEQUENCE { 77 // name GeneralString, 78 // type ENUMERATED {booleant(0), integert(1), enumeratedt(2), stringt(3)}, 79 // repeatable ENUMERATED {onePerQuery(0), onePerTerm(1), nPerTerm(2)}, 80 // defaultValue GeneralString, 81 // -- the interpretation of the validValues depends on the type 82 // -- for boolean: the first value is the false value, the second is true value 83 // -- for integer: the first value is the minimum, the second the maximum 84 // -- for enumerated: all values a listed 85 // -- for string: this value is ignored 86 // validValues StringSequence 87 // } 88 struct FilterOption_t { 89 FilterOption_t () {type=booleant; repeatable=onePerQuery;} 90 91 text_t name; 92 93 enum type_t {booleant=0, integert=1, enumeratedt=2, stringt=3}; 94 type_t type; 95 96 enum repeatable_t {onePerQuery=0, onePerTerm=1, nPerTerm=2}; 97 repeatable_t repeatable; 98 99 text_t defaultValue; 100 text_tarray validValues; 101 }; 102 103 inline bool operator<(const FilterOption_t &f1, const FilterOption_t &f2) { 104 return ((f1.name < f2.name) || 105 ((f1.name == f2.name) && 106 ((f1.type < f2.type) || 107 ((f1.type == f2.type) && 108 ((f1.repeatable < f2.repeatable) || 109 ((f1.repeatable == f2.repeatable) && 110 ((f1.defaultValue < f2.defaultValue) || 111 ((f1.defaultValue == f2.defaultValue) && 112 (f1.validValues < f2.validValues))))))))); 113 } 114 115 116 struct ltFilterOption_t { 117 bool operator()(const FilterOption_t &f1, const FilterOption_t &f2) const 118 { return f1 < f2; } 119 }; 120 121 typedef set<FilterOption_t, ltFilterOption_t> FilterOption_tset; 122 123 // FilterDescript ::= SEQUENCE { 124 // filterName GeneralString, 125 // filterOptions SET OF FilterOption 126 // } 127 struct FilterDescript_t { 128 text_t filterName; 129 FilterOption_tset filterOptions; 130 }; 131 132 struct ltFilterDescript_t { 133 bool operator()(const FilterDescript_t &f1, const FilterDescript_t &f2) const 134 { return ((f1.filterName < f2.filterName) || 135 ((f1.filterName == f2.filterName) && (f1.filterOptions < f2.filterOptions))); } 136 }; 137 138 typedef set<FilterDescript_t, ltFilterDescript_t> FilterDescript_tset; 139 140 // InfoFilterOptionsResponse ::= SEQUENCE { 141 // filterOptions SET OF FilterDescript 142 // } 143 struct InfoFilterOptionsResponse_t { 144 FilterDescript_tset filterOptions; 145 }; 146 147 148 149 // OptionValue ::= SEQUENCE { 150 // name GeneralString, 151 // value GeneralString 152 // } 153 struct OptionValue_t { 154 text_t name; 155 text_t value; 156 }; 157 158 typedef vector<OptionValue_t> OptionValue_tarray; 159 160 161 // -- Terms are presented in the same order that they are requested, 162 // -- any information relating to the terms is in reference to the 163 // -- index specified for that term. 164 // -- Metadata is presented in the same order that it is requested. 165 // 166 // FilterRequest ::= SEQUENCE { 167 // filterName [0] GeneralString, 168 // filterOptions [1] IMPLICIT SEQUENCE OF OptionValue, 169 // docSet [2] IMPLICIT StringSequence OPTIONAL, 170 // filterResultOptions [3] BIT STRING {termFreq(0), matchTerms(1), OID(2), subCol(3), 171 // ranking(4), docFreq(5)} 172 // } 173 #define FRtermFreq 1 174 #define FRmatchTerms 2 175 #define FROID 4 176 #define FRsubCol 8 177 #define FRranking 16 178 #define FRdocFreq 32 179 180 struct FilterRequest_t { 181 FilterRequest_t () {filterResultOptions=0;} 182 183 text_t filterName; 184 OptionValue_tarray filterOptions; 185 text_tarray docSet; // empty if not used 186 int filterResultOptions; // use the FR* defines above 187 }; 188 189 190 // TermInfo ::= SEQUENCE { 191 // term [0] GeneralString, 192 // freq [0] IMPLICIT INTEGER OPTIONAL, 193 // matchTerms [1] IMPLICIT StringSequence OPTIONAL 194 // } 195 struct TermInfo_t { 196 TermInfo_t () {freq=0;} 197 198 text_t term; 199 int freq; // 0 if not requested 200 text_tarray matchTerms; // empty if not requested 201 }; 202 203 typedef vector<TermInfo_t> TermInfo_tarray; 204 205 // ResultDocInfo ::= SEQUENCE { 206 // OID [0] IMPLICIT GeneralString, 207 // subCol [1] IMPLICIT StringSequence OPTIONAL, 208 // ranking [2] IMPLICIT REAL OPTIONAL, 209 // docFreq [3] IMPLICIT SEQUENCE OF INTEGER OPTIONAL, 210 // } 211 struct ResultDocInfo_t { 212 ResultDocInfo_t () {ranking=0.0;} 213 214 text_t OID; 215 text_tarray subCol; // empty if not requested 216 float ranking; // 0.0 if not requested 217 vector<int> docFreq; // empty if not requested 218 219 ResultDocInfo_t &operator=(const ResultDocInfo_t &x) 220 {OID=x.OID; subCol=x.subCol; ranking=x.ranking; 221 docFreq=x.docFreq; return *this;} 222 }; 223 224 typedef vector<ResultDocInfo_t> ResultDocInfo_tarray; 225 226 // FilterResponse ::= SEQUENCE { 227 // docsFound [0] IMPLICIT INTEGER, 228 // isApprox [1] IMPLICIT BOOLEAN, -- whether docsFound is approximate 229 // termInfo [2] IMPLICIT SEQUENCE OF TermInfo OPTIONAL, 230 // docInfo [3] IMPLICIT SEQUENCE OF ResultDocInfo OPTIONAL 231 // } 232 struct FilterResponse_t { 233 FilterResponse_t () {docsFound=0; isApprox=false;} 234 235 int docsFound; 236 bool isApprox; 237 TermInfo_tarray termInfo; // empty if not requested 238 ResultDocInfo_tarray docInfo; // empty if not requested 239 }; 240 241 242 243 // MetadataInfoResponse ::= SEQUENCE { 244 // supportedFields StringSet, 245 // supportedLanguages StringSet 246 // } 247 struct MetadataInfoResponse_t { 248 text_tset supportedFields; 249 text_tset supportedLanguages; 250 }; 251 252 // MetadataRequest ::= SEQUENCE { 253 // OIDs StringSequence, 254 // fields StringSequence, 255 // languages StringSequence 256 // } 257 struct MetadataRequest_t { 258 text_tarray OIDs; 259 text_tarray fields; 260 text_tarray languages; 261 }; 262 263 264 // -- for each OID it will return all the fields 265 // -- in each of the languages 266 // MetadataResponse ::= SEQUENCE { 267 // metadata SEQUENCE OF GeneralString 268 // } 269 struct MetadataResponse_t { 270 text_tarray metadata; 271 }; 272 273 61 274 #endif -
trunk/gsdl/src/recpt/nullproto.cpp
r172 r184 12 12 /* 13 13 $Log$ 14 Revision 1.3 1999/03/03 23:26:35 sjboddie 15 16 Implemented more of the protocol 17 14 18 Revision 1.2 1999/02/25 21:58:58 rjmcnab 15 19 … … 122 126 void nullproto::get_collectinfo (const text_t &collection, 123 127 ColInfoResponse_t &collectinfo, 124 comerror_t &err, ostream & /*logout*/) {128 comerror_t &err, ostream &logout) { 125 129 collectserver *cserver = cservers.getcollectserver (collection); 126 if (cserver != NULL) {127 collectinfo = cserver->get_collectinfo ();128 err = noError; 130 if (cserver != NULL) cserver->get_collectinfo (collectinfo, err, logout); 131 else err = protocolError; 132 } 129 133 130 } else { 131 err = protocolError; 132 } 134 135 void nullproto::get_filteroptions (const text_t &collection, 136 InfoFilterOptionsResponse_t &response, 137 comerror_t &err, ostream &logout) { 138 collectserver *cserver = cservers.getcollectserver (collection); 139 if (cserver != NULL) cserver->get_filteroptions (response, err, logout); 140 else err = protocolError; 133 141 } 142 143 void nullproto::filter (const text_t &collection, 144 const FilterRequest_t &request, 145 FilterResponse_t &response, 146 comerror_t &err, ostream &logout) { 147 collectserver *cserver = cservers.getcollectserver (collection); 148 if (cserver != NULL) cserver->filter (request, response, err, logout); 149 else err = protocolError; 150 } 151 152 void nullproto::get_metadataoptions (const text_t &collection, 153 MetadataInfoResponse_t &response, 154 comerror_t &err, ostream &logout) { 155 collectserver *cserver = cservers.getcollectserver (collection); 156 if (cserver != NULL) cserver->get_metadataoptions (response, err, logout); 157 else err = protocolError; 158 } 159 160 void nullproto::get_metadata (const text_t &collection, 161 const MetadataRequest_t &request, 162 MetadataResponse_t &response, 163 comerror_t &err, ostream &logout) { 164 collectserver *cserver = cservers.getcollectserver (collection); 165 if (cserver != NULL) cserver->get_metadata (request, response, err, logout); 166 else err = protocolError; 167 } 168 -
trunk/gsdl/src/recpt/nullproto.h
r166 r184 46 46 ColInfoResponse_t &collectinfo, 47 47 comerror_t &err, ostream &logout); 48 void get_filteroptions (const text_t &collection, 49 InfoFilterOptionsResponse_t &response, 50 comerror_t &err, ostream &logout); 51 void filter (const text_t &collection, 52 const FilterRequest_t &request, 53 FilterResponse_t &response, 54 comerror_t &err, ostream &logout); 55 void get_metadataoptions (const text_t &collection, 56 MetadataInfoResponse_t &response, 57 comerror_t &err, ostream &logout); 58 void get_metadata (const text_t &collection, 59 const MetadataRequest_t &request, 60 MetadataResponse_t &response, 61 comerror_t &err, ostream &logout); 48 62 }; 49 63 -
trunk/gsdl/src/recpt/recptproto.cpp
r172 r184 12 12 /* 13 13 $Log$ 14 Revision 1.3 1999/03/03 23:26:35 sjboddie 15 16 Implemented more of the protocol 17 14 18 Revision 1.2 1999/02/25 21:59:01 rjmcnab 15 19 … … 79 83 } 80 84 85 // gets all the filter options for a collection 86 void recptproto::get_filteroptions (const text_t &/*collection*/, 87 InfoFilterOptionsResponse_t &/*response*/, 88 comerror_t &err, ostream &/*logout*/) { 89 err = protocolError; 90 } 91 92 // filters (search or browse) a result set 93 void recptproto::filter (const text_t &/*collection*/, 94 const FilterRequest_t &/*request*/, 95 FilterResponse_t &/*response*/, 96 comerror_t &err, ostream &/*logout*/) { 97 err = protocolError; 98 } 99 100 // gets all the metadata options for a collection 101 void recptproto::get_metadataoptions (const text_t &/*collection*/, 102 MetadataInfoResponse_t &/*response*/, 103 comerror_t &err, ostream &/*logout*/) { 104 err = protocolError; 105 } 106 107 // gets all the metadata for a result set 108 void recptproto::get_metadata (const text_t &/*collection*/, 109 const MetadataRequest_t &/*request*/, 110 MetadataResponse_t &/*response*/, 111 comerror_t &err, ostream &/*logout*/) { 112 err = protocolError; 113 } 114 115 116 117 81 118 82 119 -
trunk/gsdl/src/recpt/recptproto.h
r166 r184 74 74 ColInfoResponse_t &collectinfo, 75 75 comerror_t &err, ostream &logout); 76 77 // gets all the filter options for a collection 78 virtual void get_filteroptions (const text_t &collection, 79 InfoFilterOptionsResponse_t &response, 80 comerror_t &err, ostream &logout); 81 82 // filters (search or browse) a result set 83 virtual void filter (const text_t &collection, 84 const FilterRequest_t &request, 85 FilterResponse_t &response, 86 comerror_t &err, ostream &logout); 87 88 // gets all the metadata options for a collection 89 virtual void get_metadataoptions (const text_t &collection, 90 MetadataInfoResponse_t &response, 91 comerror_t &err, ostream &logout); 92 93 // gets all the metadata for a result set 94 virtual void get_metadata (const text_t &collection, 95 const MetadataRequest_t &request, 96 MetadataResponse_t &response, 97 comerror_t &err, ostream &logout); 76 98 }; 77 99
Note:
See TracChangeset
for help on using the changeset viewer.