Changeset 6023
- Timestamp:
- 2003-11-28T16:45:31+13:00 (20 years ago)
- Location:
- trunk/gsdl/src/w32server
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/w32server/cgiwrapper.cpp
r4291 r6023 175 175 return 0; 176 176 } 177 178 receptionist recpt;179 nullproto nproto;180 textstreambuf textstream;181 logstreambuf logstream;182 DWORD lastlibaccesstime;183 DWORD baseavailvirtual;184 text_t current_gsdlhome;185 colinfo_tmap translated_collectinfo;186 177 187 178 static void page_errormaincfg (const text_t &gsdlhome, const text_t &collection) { … … 333 324 334 325 335 // returns 1 if successful, 0 if unsuccessful 336 int gsdl_init () { 326 receptionist recpt; 327 nullproto nproto; 328 collectset *cservers = NULL; 329 330 textstreambuf textstream; 331 logstreambuf logstream; 332 DWORD lastlibaccesstime; 333 DWORD baseavailvirtual; 334 text_t current_gsdlhome; 335 colinfo_tmap translated_collectinfo; 336 337 statusaction *astatusaction = NULL; 338 pageaction *apageaction = NULL; 339 pingaction *apingaction = NULL; 340 tipaction *atipaction = NULL; 341 queryaction *aqueryaction = NULL; 342 documentaction *adocumentaction = NULL; 343 usersaction *ausersaction = NULL; 344 extlinkaction *anextlinkaction = NULL; 345 collectoraction *acollectoraction = NULL; 346 authenaction *aauthenaction = NULL; 347 phindaction *aphindaction = NULL; 348 configaction *aconfigaction = NULL; 349 vlistbrowserclass *avlistbrowserclass = NULL; 350 hlistbrowserclass *ahlistbrowserclass = NULL; 351 datelistbrowserclass *adatelistbrowserclass = NULL; 352 invbrowserclass *ainvbrowserclass = NULL; 353 pagedbrowserclass *apagedbrowserclass = NULL; 354 htmlbrowserclass *ahtmlbrowserclass = NULL; 355 phindbrowserclass *aphindbrowserclass = NULL; 356 357 // returns 1 if successful, 0 if unsuccessful (note that as well as being 358 // called when the server first starts up this function is called when the 359 // "restart library" button is pressed) 360 int gsdl_init (bool atStartup) { 361 362 if (atStartup) { 337 363 #if defined (GSDL_USE_IOS_H) 338 cerr = &logstream;339 cout = &textstream;364 cerr = &logstream; 365 cout = &textstream; 340 366 #else 341 cerr.rdbuf(&logstream);342 cout.rdbuf(&textstream);367 cerr.rdbuf(&logstream); 368 cout.rdbuf(&textstream); 343 369 #endif 370 } 344 371 345 372 // collection should be set to "" unless in collection specific mode - … … 350 377 text_tset collections; 351 378 352 // note the current time 353 lastlibaccesstime = GetTickCount(); 354 355 // before we do the init we should make sure 356 // that we can find the relevant directories 357 if (!checkdir (gsdl_gsdlhome + "\\")) return 0; 358 if (!checkdir (gsdl_gsdlhome + "\\macros\\")) return 0; 359 360 collectset *cservers = new collectset(); 379 if (atStartup) { 380 // note the current time 381 lastlibaccesstime = GetTickCount(); 382 383 // before we do the init we should make sure 384 // that we can find the relevant directories 385 if (!checkdir (gsdl_gsdlhome + "\\")) return 0; 386 if (!checkdir (gsdl_gsdlhome + "\\macros\\")) return 0; 387 } 388 389 // deleting cservers clears all the collection servers 390 if (cservers != NULL) delete cservers; 391 392 cservers = new collectset(); 361 393 362 394 // get all collections from each gsdlhome (this relies 363 395 // on there not being more than one collection with the same 364 396 // name) 365 366 397 if (!collection.empty()) { 367 398 // collection specific receptionist - one collection, one gsdlhome … … 459 490 460 491 // add the protocol to the receptionist 461 recpt.add_protocol (&nproto);492 if (atStartup) recpt.add_protocol (&nproto); 462 493 463 494 // the list of actions. 464 statusaction *astatusaction = new statusaction(); 465 astatusaction->set_receptionist (&recpt); 466 recpt.add_action (astatusaction); 467 468 pageaction *apageaction = new pageaction(); 469 apageaction->set_receptionist (&recpt); 470 recpt.add_action (apageaction); 471 472 pingaction *apingaction = new pingaction(); 473 recpt.add_action (apingaction); 474 475 tipaction *atipaction = new tipaction(); 476 recpt.add_action (atipaction); 477 478 queryaction *aqueryaction = new queryaction(); 479 aqueryaction->set_receptionist (&recpt); 480 recpt.add_action (aqueryaction); 481 482 documentaction *adocumentaction = new documentaction(); 483 adocumentaction->set_receptionist (&recpt); 484 recpt.add_action (adocumentaction); 485 486 usersaction *ausersaction = new usersaction(); 487 recpt.add_action (ausersaction); 488 489 extlinkaction *anextlinkaction = new extlinkaction(); 490 recpt.add_action (anextlinkaction); 491 492 collectoraction *acollectoraction = new collectoraction(); 493 acollectoraction->set_receptionist (&recpt); 494 recpt.add_action (acollectoraction); 495 496 authenaction *aauthenaction = new authenaction(); 497 aauthenaction->set_receptionist(&recpt); 498 recpt.add_action (aauthenaction); 499 500 phindaction *aphindaction = new phindaction(); 501 recpt.add_action (aphindaction); 502 503 configaction *aconfigaction = new configaction(); 504 aconfigaction->set_receptionist(&recpt); 505 recpt.add_action (aconfigaction); 495 if (astatusaction == NULL) { 496 astatusaction = new statusaction(); 497 astatusaction->set_receptionist (&recpt); 498 recpt.add_action (astatusaction); 499 } 500 501 if (apageaction == NULL) { 502 apageaction = new pageaction(); 503 apageaction->set_receptionist (&recpt); 504 recpt.add_action (apageaction); 505 } 506 507 if (apingaction == NULL) { 508 apingaction = new pingaction(); 509 recpt.add_action (apingaction); 510 } 511 512 if (atipaction == NULL) { 513 atipaction = new tipaction(); 514 recpt.add_action (atipaction); 515 } 516 517 if (aqueryaction == NULL) { 518 aqueryaction = new queryaction(); 519 aqueryaction->set_receptionist (&recpt); 520 recpt.add_action (aqueryaction); 521 } 522 523 if (adocumentaction == NULL) { 524 adocumentaction = new documentaction(); 525 adocumentaction->set_receptionist (&recpt); 526 recpt.add_action (adocumentaction); 527 } 528 529 if (ausersaction == NULL) { 530 ausersaction = new usersaction(); 531 recpt.add_action (ausersaction); 532 } 533 534 if (anextlinkaction == NULL) { 535 anextlinkaction = new extlinkaction(); 536 recpt.add_action (anextlinkaction); 537 } 538 539 if (acollectoraction == NULL) { 540 acollectoraction = new collectoraction(); 541 acollectoraction->set_receptionist (&recpt); 542 recpt.add_action (acollectoraction); 543 } 544 545 if (aauthenaction == NULL) { 546 aauthenaction = new authenaction(); 547 aauthenaction->set_receptionist(&recpt); 548 recpt.add_action (aauthenaction); 549 } 550 551 if (aphindaction == NULL) { 552 aphindaction = new phindaction(); 553 recpt.add_action (aphindaction); 554 } 555 556 if (aconfigaction == NULL) { 557 aconfigaction = new configaction(); 558 aconfigaction->set_receptionist(&recpt); 559 recpt.add_action (aconfigaction); 560 } 506 561 507 562 508 563 // list of browsers 509 vlistbrowserclass *avlistbrowserclass = new vlistbrowserclass(); 510 recpt.add_browser (avlistbrowserclass); 511 recpt.setdefaultbrowser ("VList"); 512 513 hlistbrowserclass *ahlistbrowserclass = new hlistbrowserclass(); 514 recpt.add_browser (ahlistbrowserclass); 515 516 datelistbrowserclass *adatelistbrowserclass = new datelistbrowserclass(); 517 recpt.add_browser (adatelistbrowserclass); 518 519 invbrowserclass *ainvbrowserclass = new invbrowserclass(); 520 recpt.add_browser (ainvbrowserclass); 521 522 pagedbrowserclass *apagedbrowserclass = new pagedbrowserclass(); 523 recpt.add_browser (apagedbrowserclass); 524 525 htmlbrowserclass *ahtmlbrowserclass = new htmlbrowserclass(); 526 recpt.add_browser (ahtmlbrowserclass); 527 528 phindbrowserclass *aphindbrowserclass = new phindbrowserclass();; 529 recpt.add_browser (aphindbrowserclass); 564 if (avlistbrowserclass == NULL) { 565 avlistbrowserclass = new vlistbrowserclass(); 566 recpt.add_browser (avlistbrowserclass); 567 recpt.setdefaultbrowser ("VList"); 568 } 569 570 if (ahlistbrowserclass == NULL) { 571 ahlistbrowserclass = new hlistbrowserclass(); 572 recpt.add_browser (ahlistbrowserclass); 573 } 574 575 if (adatelistbrowserclass == NULL) { 576 adatelistbrowserclass = new datelistbrowserclass(); 577 recpt.add_browser (adatelistbrowserclass); 578 } 579 580 if (ainvbrowserclass == NULL) { 581 ainvbrowserclass = new invbrowserclass(); 582 recpt.add_browser (ainvbrowserclass); 583 } 584 585 if (apagedbrowserclass == NULL) { 586 apagedbrowserclass = new pagedbrowserclass(); 587 recpt.add_browser (apagedbrowserclass); 588 } 589 590 if (ahtmlbrowserclass == NULL) { 591 ahtmlbrowserclass = new htmlbrowserclass(); 592 recpt.add_browser (ahtmlbrowserclass); 593 } 594 595 if (aphindbrowserclass == NULL) { 596 aphindbrowserclass = new phindbrowserclass();; 597 recpt.add_browser (aphindbrowserclass); 598 } 530 599 531 600 // set defaults -
trunk/gsdl/src/w32server/cgiwrapper.h
r2280 r6023 40 40 // sets up the library 41 41 // returns 1 if successful, 0 if unsuccessful 42 int gsdl_init ( );42 int gsdl_init (bool atStartup = true); 43 43 44 44 // returns 0 if the directories cant be found -
trunk/gsdl/src/w32server/fnord.cpp
r5889 r6023 322 322 int res; 323 323 324 if (infostring == strrestartlib) { 325 326 // the "restart library" button was pressed so we want to reinitialize 327 // greenstone, read in all the macrofiles again, etc. 328 gsdl_init(false); 329 } 330 324 331 // get the url and attempt to start a browser 325 332 char *localname = GetLocalName(NULL);
Note:
See TracChangeset
for help on using the changeset viewer.