Ignore:
Timestamp:
2008-08-15T17:05:08+12:00 (13 years ago)
Author:
mdewsnip
Message:

Now gets the list of OAI nodes to output from the GDBM file ("oai" node). Previously it just used the numdocs value from the build.cfg file, and assumed that the oai nodes were "oai.0" -> "oai.X". This isn't any good if you want to include section-level nodes in the OAI output.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/runtime-src/src/oaiservr/abstractlistaction.cpp

    r16722 r16835  
    7373{ int startDoc = 0;
    7474
    75   // get the collection information
    76   protocol->get_collectinfo(gsdlCollect, cinfo, err, *this->logout);
    77 
    7875  text_t metadataPrefix = params["metadataPrefix"];
    7976
     
    8683    }
    8784  }
     85
     86  // Get the OAI nodes from the info db file
     87  text_t oai_root_node = "oai";
     88  text_tset metadata;  // Must be empty for efficiency
     89  FilterResponse_t response;
     90  get_children(oai_root_node, gsdlCollect, "", metadata, false, protocol, response, *this->logout);
    8891 
    8992  // If numDocs is 0, do nothing - this->prevDocSeen will stay false if this is the only collection
    9093  // looked at, or will keep whatever value it had prior to this col (ensures that if the flag has
    9194  // been set to true by a previous collection that this won't overwrite it to be false).
    92   if (cinfo.numDocs > 0) {
     95  if (response.docInfo.size() > 0) {
    9396    int errorCount      = 0; // Count the number of errors found in the given collection
    9497
    95     for (long i = startDoc; i < cinfo.numDocs; ++i) {
     98    for (long i = startDoc; i < response.docInfo.size(); ++i) {
    9699      if (errorCount > 3) { // If num errors reaches the cut-off value, bail.
    97100    cerr << "Error: too many records(" << errorCount << ") in the " << gsdlCollect
Note: See TracChangeset for help on using the changeset viewer.