Changeset 14284 for gsdl


Ignore:
Timestamp:
2007-07-31T10:46:08+12:00 (17 years ago)
Author:
xiao
Message:

modify getCollectionConfig() to read 'baseURL' parameter from oai.cfg.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/src/oaiservr/oaiconfig.cpp

    r11732 r14284  
    244244    }
    245245  }
     246  else if (key == "baseURL" && cfgline.size() >= 1) {
     247    int line = 0;
     248   
     249    while (line < cfgline.size()) {
     250      if (cfgline[line] != "NULL" &&
     251      cfgline[line] != "") {
     252    // do something
     253    break;
     254      }
     255      else {
     256    ++line;
     257      }
     258    }
     259   
     260    // Only try to set the configuration if we have a legitimate value ...
     261    if (line < cfgline.size()) {
     262      // ensure we have a map to write to
     263      if (this->collectMap[this->collection] == NULL) {
     264    this->collectMap[this->collection] = new oaicollectconfig(this->collection);
     265      }
     266      this->collectMap[this->collection]->baseURL = cfgline[line];
     267    }
     268  }
    246269}
    247270
     
    260283  if (field == "repositoryName") {
    261284    return this->collectMap[collection]->repositoryName;
     285  }
     286
     287  if (field == "baseURL") {
     288    return this->collectMap[collection]->baseURL;
    262289  }
    263290
Note: See TracChangeset for help on using the changeset viewer.