- Timestamp:
- 2010-10-27T14:41:49+13:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/runtime-src/src/oaiservr/oaiconfig.cpp
r22739 r23233 293 293 this->repositoryIdVersion = cfgline[0]; 294 294 } 295 else if (key == "baseURL") { 296 this->baseURL = cfgline[0]; 297 } 298 else if (key == "baseLibraryURL") { 299 this->baseLibraryURL = cfgline[0]; 300 } 301 else if (key == "baseDocRoot") { 302 this->baseDocRoot = cfgline[0]; 303 } 295 else if (key == "baseServerURL") { 296 this->baseServerURL = cfgline[0]; 297 } 298 else if (key == "oaiserverPath") { 299 this->oaiserverPath = cfgline[0]; 300 } 301 else if (key == "libraryPath") { 302 this->libraryPath = cfgline[0]; 303 } 304 else if (key == "docRootPath") { 305 this->docRootPath = cfgline[0]; 306 } 307 304 308 else if (key == "oaiversion") { 305 309 this->oaiVersion = cfgline[0]; 306 310 } 307 311 312 } 313 314 text_t oaiconfig::generateBaseServerURL() { 315 char *server_name = getenv("SERVER_NAME"); 316 char *server_port = getenv("SERVER_PORT"); 317 text_t url = "http://"; 318 url.append(server_name); 319 url.append(":"); 320 url.append(server_port); 321 return url; 308 322 } 309 323 … … 354 368 text_t oaiconfig::getBaseURL() 355 369 { 356 return this->baseURL; 370 if (this->baseServerURL.empty()) { 371 this->baseServerURL = generateBaseServerURL(); 372 } 373 return this->baseServerURL + this->oaiserverPath; 357 374 } 358 375 text_t oaiconfig::getBaseLibraryURL() 359 376 { 360 return this->baseLibraryURL; 377 if (this->baseServerURL.empty()) { 378 this->baseServerURL = generateBaseServerURL(); 379 } 380 return this->baseServerURL + this->libraryPath; 361 381 } 362 382 text_t oaiconfig::getBaseDocRoot() 363 383 { 364 return this->baseDocRoot; 384 if (this->baseServerURL.empty()) { 385 this->baseServerURL = generateBaseServerURL(); 386 } 387 return this->baseServerURL + this->docRootPath; 388 } 389 390 text_t oaiconfig::getRelativeBaseDocRoot() 391 { 392 return this->docRootPath; 365 393 } 366 394 text_t oaiconfig::getRepositoryName()
Note:
See TracChangeset
for help on using the changeset viewer.