Changeset 14286


Ignore:
Timestamp:
2007-07-31T11:03:58+12:00 (17 years ago)
Author:
oranfry
Message:

added xiao's last six changes to the 2.74 release branch

Location:
gsdl/branches/gsdl-2.74
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • gsdl/branches/gsdl-2.74/etc/error.txt

    r2939 r14286  
     1Warning: couldn't read build.cfg file for collection "demo", gsdlhome="/research/oranfry/sandbox/gsdl-2.74"
     2Warning: couldn't read build.cfg file for collection "demo", gsdlhome="/research/oranfry/sandbox/gsdl-2.74"
  • gsdl/branches/gsdl-2.74/etc/oai.cfg

    r11774 r14286  
    2424
    2525# Strings containing spaces should be enclosed in double quotes ""
     26
     27#the baseURL used by the oaiserver
     28#Example: baseURL "http://your-domain-name/cgi-bin/oaiserver"
     29baseURL "your-own-baseURL-goes-here"
    2630
    2731# The OAI repository name - human readable
  • gsdl/branches/gsdl-2.74/src/oaiservr/README.txt

    r10150 r14286  
    4444  * maintainer
    4545       One item only, as a valid email address
     46  * baseURL
     47       One item only, see the example in the oai.cfg file.
    4648  * httpdomain
    4749       NB: in the gsdlsite.cfg file, NOT oai.cfg
  • gsdl/branches/gsdl-2.74/src/oaiservr/identityaction.cpp

    r9608 r14286  
    2626  text_t version = (this->configuration->getOAIVersion() <= 110) ? (text_t)"1.1":(text_t)"2.0";
    2727
    28   site_cfg_read(gsdlhome, httpdomain, httpprefix);
     28  //site_cfg_read(gsdlhome, httpdomain, httpprefix);
     29  text_t baseURL = this->configuration->getCollectionConfig("", "baseURL");
    2930 
    3031  output << "  <repositoryName>"  << repositoryName << "</repositoryName>" << endl;
    31   output << "  <baseURL>"         << httpdomain     << "/oaimain</baseURL>" << endl; // Tack on the app name
     32  output << "  <baseURL>"         << baseURL     << "</baseURL>" << endl; // Tack on the app name
    3233  output << "  <adminEmail>"      << maintainer     << "</adminEmail>" << endl;
    3334  output << "  <protocolVersion>" << version        << "</protocolVersion>" << endl;
  • gsdl/branches/gsdl-2.74/src/oaiservr/oaiaction.cpp

    r9608 r14286  
    216216 
    217217  // Read stuff from the gsdlsite.cfg file. We do this to get the base URL (httpdomain)
    218   site_cfg_read(gsdlhome, httpdomain, httpprefix);
     218  //site_cfg_read(gsdlhome, httpdomain, httpprefix);
     219  text_t baseURL = this->configuration->getCollectionConfig("", "baseURL");
    219220
    220221  int version = this->configuration->getOAIVersion();
     
    225226     * <requestURL>http://baseURL.com/oaimain?verb="someVerb"&amp;key=value</requestURL>
    226227     */
    227     requestURL = "  <requestURL>" + httpdomain + "/oaimain";
     228    requestURL = "  <requestURL>" + baseURL;
    228229   
    229230    if(numArgs == 0) break; // If no args, all done - the error will be picked up later
     
    251252     */
    252253    if(numArgs == 0) {
    253       requestURL = "  <request>" + httpdomain + "/oaimain</request>\n";
     254      requestURL = "  <request>" + baseURL + "</request>\n";
    254255      break;
    255256    }
     
    260261      ++here;
    261262    }
    262     requestURL += ">\n           " + httpdomain + "/oaimain</request>\n";
     263    requestURL += ">\n           " + baseURL + "</request>\n";
    263264    break;
    264265  }
  • gsdl/branches/gsdl-2.74/src/oaiservr/oaiconfig.cpp

    r11732 r14286  
    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
  • gsdl/branches/gsdl-2.74/src/oaiservr/oaiconfig.h

    r11732 r14286  
    1515  text_t    maintainer;
    1616  text_t    repositoryName;
     17  text_t    baseURL;
    1718  text_tmap fieldMap;    // maps from OAI name to GSDL name
    1819};
Note: See TracChangeset for help on using the changeset viewer.