Changeset 8303 for trunk/gsdl/src/oaiservr/oaiconfig.cpp
- Timestamp:
- 2004-10-13T04:48:30+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.