Changeset 8303
- Timestamp:
- 2004-10-13T04:48:30+13:00 (20 years ago)
- Location:
- trunk/gsdl/src/oaiservr
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/oaiservr/abstractlistaction.cpp
r8223 r8303 261 261 FilterResponse_t response; 262 262 text_tset metadata; 263 ofstream logout(" grb.log", ios::app);263 ofstream logout("oai.log", ios::app); 264 264 265 265 // exclude false children of a top-level classifier immediately... … … 300 300 FilterResponse_t response; 301 301 text_tset metadata; 302 ofstream logout(" grb.log", ios::app);302 ofstream logout("oai.log", ios::app); 303 303 text_t from = params["from"]; 304 304 text_t until = params["until"]; … … 391 391 FilterResponse_t response; 392 392 text_tset metadata; 393 ofstream logout(" grb.log", ios::app);393 ofstream logout("oai.log", ios::app); 394 394 bool prevDocSeen = false; 395 395 -
trunk/gsdl/src/oaiservr/listsetsaction.cpp
r8182 r8303 39 39 FilterResponse_t response; 40 40 comerror_t err; 41 text_tarray collections;41 text_tarray & collections = this->configuration->getCollectionsList(); 42 42 text_tset metadata; 43 ofstream logout(" grb.log", ios::app);43 ofstream logout("oai.log", ios::app); 44 44 text_tarray *result = new text_tarray; 45 45 46 46 // get a list of the collections available 47 protocol->get_collection_list(collections, err, output); 48 // cerr << "Found " << collections.size() << " collections.\n"; 47 // protocol->get_collection_list(collections, err, output); 48 if (collections.size() == 0) { 49 logout << "Found *no* OAI collections - check main.cfg for oaicollection items and read the OAI documentation.\n"; 50 } 49 51 50 for(int current_col = 0; current_col < collections.size(); current_col++) {52 for(int current_col = 0; current_col < collections.size(); current_col++) { 51 53 // output the collection as a set, first, then its children 52 54 text_t gsdlCollect = collections[current_col]; … … 75 77 FilterResponse_t response; 76 78 text_tset metadata; 77 ofstream logout(" grb.log", ios::app);79 ofstream logout("oai.log", ios::app); 78 80 79 81 metadata.insert("contains"); -
trunk/gsdl/src/oaiservr/metaformat.cpp
r8276 r8303 121 121 FilterResponse_t response; 122 122 text_tset metadata; 123 ofstream logout(" grb.log", ios::app);123 ofstream logout("oai.log", ios::app); 124 124 125 125 // get the document information -
trunk/gsdl/src/oaiservr/oaiconfig.cpp
r8276 r8303 46 46 // parameter, read in all the collection's individual configurations 47 47 if (gsdlcollect == "") { 48 text_t set::iterator here = this->collectList.begin();49 text_t set::iterator end = this->collectList.end();48 text_tarray::iterator here = this->collectList.begin(); 49 text_tarray::iterator end = this->collectList.end(); 50 50 while (here != end) { 51 51 this->configureCollection(gsdlhome, *here); … … 88 88 if (key == "oaimapping" && cfgline.size() > 1) { 89 89 text_t::const_iterator colonAt; 90 text_t index, name; 90 text_t index, name, configCollection; 91 92 // Take a default collection as being whatever the collection being configured is... 93 configCollection = this->collection; 91 94 92 95 // get the name of the (collection) field to map; this may actually … … 94 97 // <collection name>:<field name> 95 98 index = cfgline[0]; 99 if ((colonAt = find(index.begin(), index.end(), ':')) != index.end()) { 100 configCollection = substr(index.begin(), colonAt); 101 102 if (this->collection != "" && configCollection != this->collection) { 103 cerr << "Attempt to configure OAI mappings for " << configCollection << " in " << this->collection << endl; 104 } 105 106 colonAt += 1; 107 index = substr(colonAt, index.end()); 108 } 96 109 97 110 // the second parameter is the metadata field to map the collection … … 110 123 } 111 124 112 // now 'index' is in the form :113 // (collection):<collectionfield>:(formatname) and name is114 // simply formatfieldname125 // now 'index' is in the form <collectionfield>:(formatname) 126 // 'name' is simply the fieldname within the format 127 // 'configCollection' is the collection to be configured 115 128 116 129 // now simply map the field name (index) onto the collection name (name) 117 if (this->collectMap[ this->collection] == NULL) {118 this->collectMap[ this->collection] = new oaicollectconfig(this->collection);119 } 120 this->collectMap[ this->collection]->fieldMap[index] = name;121 122 // cerr << "Mapping " << index << " to " << name << " in " << this->collection << endl;130 if (this->collectMap[configCollection] == NULL) { 131 this->collectMap[configCollection] = new oaicollectconfig(configCollection); 132 } 133 this->collectMap[configCollection]->fieldMap[index] = name; 134 135 // cerr << "Mapping " << index << " to " << name << " in " << configCollection << endl; 123 136 124 137 // TODO: check that the mapped field is actually in use 125 138 } 126 else if (key == "oaicollection" && cfgline.size() > 1) {139 else if (key == "oaicollection" && cfgline.size() >= 1) { 127 140 // Configure a collection to be used as part of the OAI archive. 128 141 // This line should read: … … 145 158 } 146 159 for (int c = 0; c < cfgline.size(); c ++) { 147 this->collectList. insert(cfgline[c]);160 this->collectList.push_back(cfgline[c]); 148 161 } 149 162 } -
trunk/gsdl/src/oaiservr/oaiconfig.h
r8182 r8303 25 25 oaiconfig(text_t &gsdlhome, text_t &gsdlcollect); 26 26 ~oaiconfig(); 27 virtual void configure(const text_t &key, const text_tarray &cfgline); 28 text_t getCollectionConfig(const text_t &collection, const text_t &field); 29 text_t getMapping(const text_t &collection, const text_t &collectfield); 30 text_t getMapping(const text_t &collection, const text_t &collectfield, const text_t &format); 31 text_tmap *getInformation() { return &this->infoMap; } 32 int getOAIVersion(); 27 virtual void configure(const text_t &key, const text_tarray &cfgline); 28 text_t getCollectionConfig(const text_t &collection, const text_t &field); 29 text_tarray & getCollectionsList() { return this->collectList; } 30 text_t getMapping(const text_t &collection, const text_t &collectfield); 31 text_t getMapping(const text_t &collection, const text_t &collectfield, const text_t &format); 32 text_tmap * getInformation() { return &this->infoMap; } 33 int getOAIVersion(); 33 34 private: 34 35 void configureCollection(const text_t &gsdlhome, const text_t &collection); 35 36 36 text_t set collectList;// The list of collections to be taken in hand37 text_tarray collectList; // The list of collections to be taken in hand 37 38 text_tmap infoMap; // Holds the information to be given in the case 38 39 // of an OAI identify request -
trunk/gsdl/src/oaiservr/recordaction.cpp
r8182 r8303 88 88 { 89 89 text_tset metadata; 90 ofstream logout(" grb.log", ios::app);90 ofstream logout("oai.log", ios::app); 91 91 92 92 // get the document information
Note:
See TracChangeset
for help on using the changeset viewer.