- Timestamp:
- 2000-09-07T09:49:07+12:00 (24 years ago)
- Location:
- branches/corba/gsdl/src/recpt
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/corba/gsdl/src/recpt/comtypes.cpp
r823 r1509 28 28 /* 29 29 $Log$ 30 Revision 1.22.2.1 2000/09/06 21:48:58 davidb 31 32 Improvements to corba implementation so images within a collection 33 are handled better and images in the remote site but not in the local 34 site are cached locally. 35 30 36 Revision 1.22 1999/12/13 02:24:33 davidb 31 37 Data fields for cross collection searching (CCS) … … 138 144 format.erase(format.begin(), format.end()); 139 145 building.erase(format.begin(), format.end()); 146 httpdomain.clear(); 147 httpprefix.clear(); 140 148 receptionist.clear(); 141 149 } -
branches/corba/gsdl/src/recpt/comtypes.h
r871 r1509 98 98 text_tmap format; 99 99 text_tmap building; 100 text_t httpdomain; 101 text_t httpprefix; 100 102 text_t receptionist; 101 103 }; -
branches/corba/gsdl/src/recpt/corbaclient.mpp
r1074 r1509 62 62 #include "recptconfig.h" 63 63 64 int main ( ) {64 int main (int argc, char* argv[]) { 65 65 receptionist recpt; 66 corbaproto nproto;66 corbaproto* cproto_array[argc]; 67 67 text_t gsdlhome; 68 text_t httpdomain; 69 text_t httpprefix; 68 70 69 site_cfg_read(gsdlhome);71 cproto_array[0] = NULL; // unused 70 72 71 // cout << "GRB 0" << endl; 73 if (argc==1) 74 { 75 cout << "Content-type: text/html" << endl << endl; 76 cout << "Usage: " << argv[0] << "site1.objid [site2.objid ...]" << endl; 77 return(0); 78 } 72 79 73 // add the protocol to the receptionist 74 recpt.add_protocol (&nproto); 80 // Strictly speaking httpdomain and httpprefix are not needed. 81 // Need to modify site_cfg_read to eliminate this dependency. // **** 82 site_cfg_read(gsdlhome,httpdomain,httpprefix); 75 83 76 // cout << "GRB 1" << endl; 84 for (int i=1; i<argc; i++) 85 { 86 // add the protocol to the receptionist 87 cproto_array[i] = new corbaproto(argv[i]); 88 recpt.add_protocol (cproto_array[i]); 89 } 77 90 78 91 // add other converters … … 86 99 gboutconvert.setmapfile (gsdlhome, "ugbk", 0xa1f5); 87 100 recpt.add_converter ("g", &gbinconvert, &gboutconvert); 88 89 // cout << "GRB 2" << endl;90 101 91 102 // the list of actions. Note: these actions will become invalid … … 114 125 115 126 buildaction abuildaction; 127 abuildaction.set_receptionist (&recpt); 116 128 recpt.add_action (&abuildaction); 117 129 … … 119 131 aauthenaction.set_receptionist(&recpt); 120 132 recpt.add_action (&aauthenaction); 121 122 // cout << "GRB 3" << endl;123 133 124 134 // list of browsers … … 144 154 cgiwrapper (recpt, ""); 145 155 146 // cout << "TEST" << endl; 156 for (int i=1; i<argc; i++) 157 { 158 delete cproto_array[i]; 159 } 160 147 161 return 0; 148 162 } 149 163 164 165 166 167 -
branches/corba/gsdl/src/recpt/corbaproto.h
r1074 r1509 42 42 CORBA::BOA_var boa; 43 43 CORBA::Object_var obj; 44 text_t gsdlhome; 45 text_t site_name; 46 44 47 public: 45 48 virtual ~corbaproto() {} 46 corbaproto( );49 corbaproto(char* site_name); 47 50 48 51 // add_collectserver should be called for each collection server … … 56 59 // this init will init each of the collection servers 57 60 bool init (ostream &logout); 61 62 // used to check for icons and retrieve them from the collection 63 // site if they are missing 64 void cache_missing_icons(text_tmap& format_map, 65 text_t& httpdomain, 66 text_t& httpprefix); 67 68 text_t get_site_name (); 58 69 59 70 text_t get_protocol_name (); -
branches/corba/gsdl/src/recpt/corbaproto.mpp
r1074 r1509 29 29 #include <fstream.h> 30 30 31 #include "fileutil.h" 32 31 33 // protocol headers for CORBA 32 34 #include "corbaiface.h" … … 275 277 } 276 278 277 corbaproto::corbaproto( )279 corbaproto::corbaproto(char* _site_name) 278 280 { char *dummyv[1] = {""}; 279 281 int dummyc = 0; 280 /* // CORBA variables 281 static CORBA::ORB_var orb = CORBA::ORB_init( dummyc , dummyv, "mico-local-orb" ); 282 static CORBA::BOA_var boa = orb->BOA_init( dummyc , dummyv, "mico-local-boa" ); 282 // CORBA variables 283 /* static CORBA::ORB_var orb = CORBA::ORB_init( dummyc , dummyv, "mico-local-orb" ); 284 static CORBA::BOA_var boa = orb->BOA_init( dummyc , dummyv, "mico-local-boa" ); */ 285 286 CORBA::ORB_var orb = CORBA::ORB_init( dummyc , dummyv, "mico-local-orb" ); 287 CORBA::BOA_var boa = orb->BOA_init( dummyc , dummyv, "mico-local-boa" ); 288 289 char objid_filename[256]; 290 sprintf(objid_filename,"/tmp/%s.objid",_site_name); 283 291 284 292 // Get ref from "naming service" 285 ifstream in ( "/tmp/account.objid");293 ifstream in (objid_filename); 286 294 char ref[1000]; 287 295 in >> ref; … … 289 297 290 298 // startup corba 291 static CORBA::Object_var obj = orb->string_to_object (ref); 292 293 client = corbaiface::_narrow( obj );*/ 294 client = NULL; 299 // static CORBA::Object_var obj = orb->string_to_object (ref); 300 CORBA::Object_var obj = orb->string_to_object (ref); 301 302 client = corbaiface::_narrow( obj ); 303 // client = NULL; // **** 304 305 gsdlhome.clear(); 306 site_name = _site_name; 295 307 } 296 308 297 309 corbaiface_var corbaproto::getCorbaClient() 298 310 { 311 // This function was written to help corba when ORB and BOA were 312 // not working in "persistent" mode. 313 // Now that persistent mode is working it is not longer needed/used. 314 299 315 char *dummyv[1] = {""}; 300 316 int dummyc = 0; 301 317 // CORBA variables 302 static CORBA::ORB_var orb = CORBA::ORB_init( dummyc , dummyv, "mico-local-orb" ); 303 static CORBA::BOA_var boa = orb->BOA_init( dummyc , dummyv, "mico-local-boa" ); 318 // static CORBA::ORB_var orb = CORBA::ORB_init( dummyc , dummyv, "mico-local-orb" ); 319 // static CORBA::BOA_var boa = orb->BOA_init( dummyc , dummyv, "mico-local-boa" ); 320 321 // DB // Try this out!! // **** 322 CORBA::ORB_var orb = CORBA::ORB_init( dummyc , dummyv, "mico-local-orb" ); 323 CORBA::BOA_var boa = orb->BOA_init( dummyc , dummyv, "mico-local-boa" ); 324 325 /* char* site_name_chars = site_name.getcstr(); 326 char objid_filename[256]; 327 sprintf(objid_filename,"/tmp/%s.objid",site_name_chars); 328 // delete site_name_chars; */ 329 330 text_t objid_filename = "/tmp/" + site_name + ".objid"; 304 331 305 332 // Get ref from "naming service" 306 ifstream in ( "/tmp/account.objid");333 ifstream in (objid_filename.getcstr()); 307 334 char ref[1000]; 308 335 in >> ref; … … 310 337 311 338 // startup corba 312 static CORBA::Object_var obj = orb->string_to_object (ref); 339 // DB // Try this out!! // **** 340 // static CORBA::Object_var obj = orb->string_to_object (ref); 341 CORBA::Object_var obj = orb->string_to_object (ref); 313 342 314 343 return corbaiface::_narrow( obj ); … … 327 356 328 357 // get the corba client reference 329 corbaiface_var lclient = this->getCorbaClient(); 358 // corbaiface_var lclient = this->getCorbaClient(); // **** 359 corbaiface_var lclient = client; 330 360 331 361 // convert all the requisite structures into their CORBA form … … 335 365 // execute the corba transaction 336 366 lclient->configure(corbaKey, corbaCfgline); 367 368 if (key=="gsdlhome") 369 { 370 // store gsdlhome in corba prototype so it can be used later to 371 // check if icons specified in format statements exist on the 372 // recptionist's side 373 gsdlhome = cfgline[0]; 374 } 337 375 } 338 376 … … 342 380 343 381 // get the corba client reference 344 corbaiface_var lclient = this->getCorbaClient(); 345 346 // execute the corba transaction 347 return lclient->init(); 382 // corbaiface_var lclient = this->getCorbaClient(); // **** 383 corbaiface_var lclient = client; 384 385 // execute the corba transaction 386 return lclient->initialise(); 387 } 388 389 void corbaproto::cache_missing_icons(text_tmap& format_map, 390 text_t& httpdomain, 391 text_t& httpprefix) 392 { 393 // consider making this a member function in the object? 394 395 text_tmap::iterator format_here = format_map.begin(); 396 text_tmap::iterator format_end = format_map.end(); 397 while (format_here!=format_end) 398 { 399 text_t format_line = format_here->second; 400 401 // cout << "*** format line = " << format_line << endl; // **** 402 403 text_t::iterator fl_begin = format_line.begin(); 404 text_t::iterator fl_end = format_line.end(); 405 406 text_t::iterator httpimg_find = findword(fl_begin,fl_end,"_httpimg_"); 407 text_t::iterator http_find = httpimg_find; 408 409 while (httpimg_find!=fl_end) 410 { 411 http_find = httpimg_find+5; 412 httpimg_find += 9; 413 414 // look for white space " or > 415 text_t::iterator filename_end = httpimg_find; 416 while (filename_end != fl_end) 417 { 418 if (*filename_end == ' ') break; 419 if (*filename_end == '\t') break; 420 if (*filename_end == '\"') break; 421 if (*filename_end == '>') break; 422 filename_end++; 423 } 424 425 text_t img_filename = substr(httpimg_find,filename_end); 426 427 text_t site_img_filename = filename_cat(gsdlhome,"images",img_filename); 428 429 // look to see if img filename exists in images directory 430 if (!file_exists(site_img_filename)) 431 { 432 text_t cache_img_dir 433 = filename_cat(gsdlhome,"images",".cache"); 434 435 text_t remote_img_url = "http://" + httpdomain + httpprefix 436 + "/images" + img_filename; 437 438 text_t wget_cmd = "wget -q -N --directory-prefix="+cache_img_dir 439 + " " + remote_img_url; 440 441 char* wget_cmd_chars = wget_cmd.getcstr(); 442 443 system(wget_cmd_chars); 444 delete wget_cmd_chars; 445 446 format_map[format_here->first] 447 = substr(fl_begin,http_find) + "cache" + substr(http_find,fl_end); 448 449 } 450 451 httpimg_find = findword(httpimg_find,fl_end,"_httpimg_"); 452 } 453 format_here++; 454 } 455 } 456 457 text_t corbaproto::get_site_name () { 458 return site_name; 348 459 } 349 460 … … 356 467 ostream &/*logout*/) { 357 468 358 cout << "Corbaproto::Collection list" << endl;469 // cout << "Corbaproto::Collection list" << endl; 359 470 360 471 corbatext_tarray corba_collist; … … 362 473 363 474 // get the corba client reference 364 corbaiface_var lclient = this->getCorbaClient(); 475 // corbaiface_var lclient = this->getCorbaClient(); // **** 476 corbaiface_var lclient = client; 365 477 366 478 // execute the corba transaction … … 383 495 384 496 // get the corba client reference 385 corbaiface_var lclient = this->getCorbaClient(); 497 // corbaiface_var lclient = this->getCorbaClient(); // **** 498 corbaiface_var lclient = client; 386 499 387 500 // convert all the requisite structures into their CORBA form … … 405 518 406 519 // get the corba client reference 407 corbaiface_var lclient = this->getCorbaClient(); 520 // corbaiface_var lclient = this->getCorbaClient(); // **** 521 corbaiface_var lclient = client; 408 522 409 523 // convert all the requisite structures into their CORBA form … … 417 531 } 418 532 533 419 534 void corbaproto::get_collectinfo (const text_t &collection, 420 535 ColInfoResponse_t &collectinfo, … … 427 542 428 543 // get the corba client reference 429 corbaiface_var lclient = this->getCorbaClient(); 544 // corbaiface_var lclient = this->getCorbaClient(); // **** 545 corbaiface_var lclient = client; 430 546 431 547 // convert all the requisite structures into their CORBA form … … 447 563 corbatext_corbaMapToMap(corbaCollectInfo.format, collectinfo.format); 448 564 corbatext_corbaMapToMap(corbaCollectInfo.building, collectinfo.building); 565 corbaconv_text_t::setCorbatext(collectinfo.httpdomain,corbaCollectInfo.httpdomain); 566 corbaconv_text_t::setCorbatext(collectinfo.httpprefix,corbaCollectInfo.httpprefix); 449 567 corbaconv_text_t::setCorbatext(collectinfo.receptionist,corbaCollectInfo.receptionist); 568 569 cache_missing_icons(collectinfo.format,collectinfo.httpdomain, 570 collectinfo.httpprefix); 450 571 451 572 err = (comerror_t) corbaError; … … 463 584 464 585 // get the corba client reference 465 corbaiface_var lclient = this->getCorbaClient(); 586 // corbaiface_var lclient = this->getCorbaClient(); // **** 587 corbaiface_var lclient = client; 466 588 467 589 // convert all the requisite structures into their CORBA form … … 492 614 493 615 // get the corba client reference 494 corbaiface_var lclient = this->getCorbaClient(); 616 // corbaiface_var lclient = this->getCorbaClient(); // **** 617 corbaiface_var lclient = client; 495 618 496 619 // convert all the requisite structures into their CORBA form … … 531 654 532 655 // get the corba client reference 533 corbaiface_var lclient = this->getCorbaClient(); 656 // corbaiface_var lclient = this->getCorbaClient(); // **** 657 corbaiface_var lclient = client; 534 658 535 659 // convert all the requisite structures into their CORBA form … … 572 696 573 697 // get the corba client reference 574 corbaiface_var lclient = this->getCorbaClient(); 698 // corbaiface_var lclient = this->getCorbaClient(); // **** 699 corbaiface_var lclient = client; 575 700 576 701 // convert all the requisite structures into their CORBA form -
branches/corba/gsdl/src/recpt/documentaction.cpp
r1067 r1509 28 28 /* 29 29 $Log$ 30 Revision 1.36.2.2 2000/09/06 21:49:00 davidb 31 32 Improvements to corba implementation so images within a collection 33 are handled better and images in the remote site but not in the local 34 site are cached locally. 35 30 36 Revision 1.36.2.1 2000/04/04 15:02:35 cs025 31 37 Corba first commit … … 963 969 << "<html><head></head>\n" 964 970 << "<frameset rows=\"68,*\" noresize border=0>\n" 965 << "<frame scrolling=no frameborder=0 src=\"_gwcgi_? e=_compressedoptions_&a=p&p=nav\">\n"966 << "<frame name=\"documenttop\" frameborder=0 src=\"_gwcgi_? e=_compressedoptions_&a=d&d="971 << "<frame scrolling=no frameborder=0 src=\"_gwcgi_?_optsite_e=_compressedoptions_&a=p&p=nav\">\n" 972 << "<frame name=\"documenttop\" frameborder=0 src=\"_gwcgi_?_optsite_e=_compressedoptions_&a=d&d=" 967 973 << args["d"] << "\">" 968 974 << "<noframes>\n" -
branches/corba/gsdl/src/recpt/nullproto.cpp
r1067 r1509 28 28 /* 29 29 $Log$ 30 Revision 1.12.2.2 2000/09/06 21:49:01 davidb 31 32 Improvements to corba implementation so images within a collection 33 are handled better and images in the remote site but not in the local 34 site are cached locally. 35 30 36 Revision 1.12.2.1 2000/04/04 15:02:36 cs025 31 37 Corba first commit … … 101 107 } 102 108 109 text_t nullproto::get_site_name () { 110 return ""; 111 } 112 103 113 text_t nullproto::get_protocol_name () { 104 114 return "nullproto"; -
branches/corba/gsdl/src/recpt/nullproto.h
r1067 r1509 44 44 // add_collectserver should be called for each collection server 45 45 // before any configuration is done 46 void set_collectset(collectset *set) 47 { this->cset = set; 48 } 46 void set_collectset(collectset *set) { this->cset = set; } 49 47 50 48 // this configure will configure each of the collection servers … … 53 51 // this init will init each of the collection servers 54 52 bool init (ostream &logout); 53 54 text_t get_site_name (); 55 55 56 56 text_t get_protocol_name (); -
branches/corba/gsdl/src/recpt/pageaction.cpp
r1033 r1509 28 28 /* 29 29 $Log$ 30 Revision 1.29.2.1 2000/09/06 21:49:02 davidb 31 32 Improvements to corba implementation so images within a collection 33 are handled better and images in the remote site but not in the local 34 site are cached locally. 35 30 36 Revision 1.29 2000/03/19 21:16:46 nzdl 31 37 added german language interface … … 204 210 while (collist_here != collist_end) { 205 211 212 text_t protocol_name = (*rprotolist_here).p->get_protocol_name (); 213 206 214 ColInfoResponse_t cinfo; 207 215 (*rprotolist_here).p->get_collectinfo (*collist_here, cinfo, err, logout); 208 216 209 217 if (err == noError) { 210 218 if (cinfo.isPublic && (cinfo.buildDate > 0)) { … … 217 225 text_t collectionname = *collist_here; 218 226 text_t alt = collectionname; 227 219 228 if (get_info ("collection", *collist_here, metadata, false, 220 229 (*rprotolist_here).p, response, logout)) { 221 230 if (!response.docInfo[0].metadata["collectionname"].values[0].empty()) 222 231 alt = response.docInfo[0].metadata["collectionname"].values[0]; 223 232 233 text_t iconurl; 234 iconurl.clear(); 235 224 236 if (!response.docInfo[0].metadata["iconcollectionsmall"].values[0].empty()) 225 collectionname = "<img width=150 border=1 src=\"" 226 + response.docInfo[0].metadata["iconcollectionsmall"].values[0] 227 + "\" alt=\"" + alt + "\">"; 237 { 238 iconurl = response.docInfo[0].metadata["iconcollectionsmall"].values[0]; 239 240 } 228 241 else if (!response.docInfo[0].metadata["iconcollection"].values[0].empty()) 229 collectionname = "<img width=150 border=1 src=\"" 230 + response.docInfo[0].metadata["iconcollection"].values[0] 231 + "\" alt=\"" + alt + "\">"; 232 else collectionname = alt; 242 { 243 iconurl = response.docInfo[0].metadata["iconcollection"].values[0]; 244 } 245 246 if (!iconurl.empty()) 247 { 248 // check to see URL is local to colserver 249 text_t::iterator iconurl_head = iconurl.begin(); 250 text_t iconhead = substr(iconurl_head,iconurl_head+16); 251 if (iconhead=="_httpcollection_") 252 { 253 // local and using _httpcollection_ 254 text_t icontail = substr(iconurl_head+16,iconurl.end()); 255 iconurl = "http://" + cinfo.httpdomain 256 + cinfo.httpprefix + "/collect/" 257 + *collist_here + "/" + icontail; 258 } 259 else if (iconurl[0]=='/') 260 { 261 // local but with full path 262 iconurl = "http://" + cinfo.httpdomain + iconurl; 263 } 264 265 collectionname 266 = "<img width=150 border=1 src=\"" + iconurl + "\" alt=\"" + alt + "\">"; 267 } 268 else 269 { 270 collectionname = alt; 271 } 272 233 273 } 234 274 … … 246 286 } 247 287 248 text_t link = "<a href=\"_gwcgi_?a=p&p=about&c=" + *collist_here + "\">"; 288 text_t optsite = ""; 289 text_t site_name = (*rprotolist_here).p->get_site_name (); 290 if (!site_name.empty()) { optsite = "site="+site_name+"&"; } 291 292 text_t link = "<a href=\"_gwcgi_?"+optsite+"a=p&p=about&c=" + *collist_here + "\">"; 249 293 if (*collist_here == "chinese") 250 link = "<a href=\"_gwcgi_? a=p&p=about&l=zh&nw=u&c=" + *collist_here + "\">";294 link = "<a href=\"_gwcgi_?"+optsite+"a=p&p=about&l=zh&nw=u&c=" + *collist_here + "\">"; 251 295 if (*collist_here == "arabic") 252 link = "<a href=\"_gwcgi_? a=p&p=about&w=a&c=" + *collist_here + "\">";296 link = "<a href=\"_gwcgi_?"+optsite+"a=p&p=about&w=a&c=" + *collist_here + "\">"; 253 297 254 298 if (!cinfo.receptionist.empty()) … … 266 310 collist_here ++; 267 311 } 268 homeextra += "</tr></table></center>\n"; 269 disp.setmacro ("homeextra", "home", homeextra); 270 } 271 } 312 } 313 } 314 homeextra += "</td>"; 272 315 rprotolist_here ++; 273 316 } 317 homeextra += "</tr></table></center>\n"; 318 disp.setmacro ("homeextra", "home", homeextra); 319 274 320 } 275 321 -
branches/corba/gsdl/src/recpt/queryaction.cpp
r962 r1509 28 28 /* 29 29 $Log$ 30 Revision 1.36.2.1 2000/09/06 21:49:03 davidb 31 32 Improvements to corba implementation so images within a collection 33 are handled better and images in the remote site but not in the local 34 site are cached locally. 35 30 36 Revision 1.36 2000/02/21 21:57:48 sjboddie 31 37 actions are now configured with gsdlhome … … 648 654 if (size>5&&args["hcl"]==1) { //compress the list, show the expand button 649 655 650 historylist += "<td><a href=\"_gwcgi_? e=_compressedoptions_&a=q&hcl=0\">_textexpand_</a></td>\n";656 historylist += "<td><a href=\"_gwcgi_?_optsite_e=_compressedoptions_&a=q&hcl=0\">_textexpand_</a></td>\n"; 651 657 } 652 658 else if (size >5 && args["hcl"]==0) { // expand the list, show contract button 653 historylist += "<td><a href=\"_gwcgi_? e=_compressedoptions_&a=q&hcl=1\">_textcontract_</a></td>\n";659 historylist += "<td><a href=\"_gwcgi_?_optsite_e=_compressedoptions_&a=q&hcl=1\">_textcontract_</a></td>\n"; 654 660 } 655 661 historylist += "</table>\n"; … … 673 679 historylist += "<tr> <td width=40 align=center>"+c+"</td>\n"; 674 680 historylist += "<td width=340 align=left>"+query+"</td><td width=60 align=center>"+numdocs+"</td>\n"; 675 historylist += "<td width=60 align=center><a href=\"_gwcgi_? e=_compressedoptions_&";681 historylist += "<td width=60 align=center><a href=\"_gwcgi_?_optsite_e=_compressedoptions_&"; 676 682 historylist += *here+"\"><img name=\"display\" src=\"_httpicondisplay_\" width=_widthdisplay_ "; 677 683 historylist += "height=_heightdisplay_ border=\"0\" alt=\"" + userinfo +"\"></a></td></tr>\n"; … … 714 720 << "<form name=QueryForm method=get action=\"_gwcgi_\">\n" 715 721 << "<input type=hidden name=a value=\"q\">\n" 722 << "<input type=hidden name=site value=\"_cgiargsite_\">\n" 716 723 << "<input type=hidden name=e value=\"_compressedoptions_\">\n" 717 724 << "<input type=hidden name=ccp value=\"1\">\n" -
branches/corba/gsdl/src/recpt/receptionist.cpp
r950 r1509 28 28 /* 29 29 $Log$ 30 Revision 1.47.2.1 2000/09/06 21:49:04 davidb 31 32 Improvements to corba implementation so images within a collection 33 are handled better and images in the remote site but not in the local 34 site are cached locally. 35 30 36 Revision 1.47 2000/02/17 22:26:17 sjboddie 31 37 set macros for displaying macrons in utf8 … … 1230 1236 disp.setmacro ("httpimg", "Global", configinfo.httpimg); 1231 1237 disp.setmacro ("httpprefix", "Global", configinfo.httpprefix); 1238 1239 if (!collection.empty()) { 1240 // DB // **** 1241 ColInfoResponse_t cinfo; 1242 comerror_t err; 1243 recptproto *collectproto = protocols.getrecptproto (collection, logout); 1244 if (collectproto != NULL) { 1245 collectproto->get_collectinfo (collection, cinfo, err, logout); 1246 text_t httpcollection 1247 = "http://" + cinfo.httpdomain + cinfo.httpprefix 1248 +"/collect/" + collection; 1249 1250 disp.setmacro ("httpcollection", "Global", httpcollection); 1251 } 1252 } 1253 1232 1254 text_t compressedoptions = get_compressed_arg(args, logout); 1233 1255 disp.setmacro ("compressedoptions", "Global", dm_safe(compressedoptions)); … … 1296 1318 } 1297 1319 } 1298 } 1299 } 1300 } 1320 1321 text_t iconcollection; 1322 disp.expandstring ("Global", "_iconcollection_", iconcollection); 1323 if (!iconcollection.empty()) 1324 { 1325 if (iconcollection[0]=='/') 1326 { 1327 // local but with full path 1328 ColInfoResponse_t cinfo; 1329 comerror_t err; 1330 collectproto->get_collectinfo (collection, cinfo, err, logout); 1331 iconcollection = "http://" + cinfo.httpdomain + iconcollection; 1332 disp.setmacro("iconcollection","Global",iconcollection); 1333 } 1334 } 1335 } 1336 } 1337 } 1338 -
branches/corba/gsdl/src/recpt/recptconfig.cpp
r1074 r1509 28 28 /* 29 29 $Log$ 30 Revision 1.6.2.3 2000/09/06 21:49:05 davidb 31 32 Improvements to corba implementation so images within a collection 33 are handled better and images in the remote site but not in the local 34 site are cached locally. 35 30 36 Revision 1.6.2.2 2000/04/06 11:11:40 cs025 31 37 Corba improvements; tidied client initialisation in corbaproto and also … … 84 90 private: 85 91 text_t *gsdlhome; 92 text_t *httpdomain; 93 text_t *httpprefix; 86 94 int *maxrequests; 87 95 public: 88 96 __site_configuration (text_t *_gsdlhome, int *_maxrequests) { 89 97 gsdlhome = _gsdlhome; 98 httpdomain = NULL; 99 httpprefix = NULL; 90 100 maxrequests = _maxrequests; 91 101 } 92 102 93 __site_configuration (text_t *_gsdlhome) { 103 __site_configuration (text_t *_gsdlhome, text_t *_httpdomain, 104 text_t *_httpprefix) { 94 105 gsdlhome = _gsdlhome; 106 httpdomain = _httpdomain; 107 httpprefix = _httpprefix; 95 108 maxrequests = NULL; 96 109 } … … 99 112 if (key == "gsdlhome") { 100 113 *gsdlhome = cfgline[0]; 114 } 115 116 if (key == "httpprefix" && 117 httpprefix != NULL) { 118 *httpprefix = cfgline[0]; 119 } 120 121 if (key == "httpdomain" && 122 httpdomain != NULL) { 123 *httpdomain = cfgline[0]; 101 124 } 102 125 … … 124 147 // blank the gsdl home text 125 148 gsdlhome.clear(); 126 127 /* 128 // Look for gsdlsite.cfg in same directory that executable is in. 129 text_tarray cfgline; 130 text_t key; 131 ifstream confin ("gsdlsite.cfg"); 132 133 if (confin) { 134 while (read_cfg_line(confin, cfgline) >= 0) { 135 if (cfgline.size () >= 2) { 136 key = cfgline[0]; 137 cfgline.erase(cfgline.begin()); 138 139 sitecfg.configure(key, cfgline); 140 // configure the receptionist 141 recpt.configure (key, cfgline); 142 } 143 } 144 confin.close (); 145 146 return true; 147 } 148 */ 149 // also set maxrequests to 0 ?? 149 150 150 151 if (gsdlconfigurator.configure("gsdlsite.cfg")) { … … 154 155 } 155 156 156 // this version just grabs gsdlhome, returns false if it can't find it 157 bool site_cfg_read (text_t &gsdlhome) { 157 // this version grabs gsdlhome, httpdomain and httpprefix, 158 // returns false if it can't find all of them 159 bool site_cfg_read (text_t &gsdlhome, text_t &httpdomain, 160 text_t &httpprefix) { 158 161 // get gsdlhome etc 159 __site_configuration sitecfg(&gsdlhome );162 __site_configuration sitecfg(&gsdlhome,&httpdomain,&httpprefix); 160 163 configurator gsdlconfigurator(&sitecfg); 161 164 162 165 gsdlhome.clear(); 166 httpdomain.clear(); 167 httpprefix.clear(); 163 168 164 169 if (gsdlconfigurator.configure("gsdlsite.cfg") && 165 !gsdlhome.empty() ) {170 !gsdlhome.empty() && !httpdomain.empty() && !httpprefix.empty()) { 166 171 return true; 167 172 } 168 /* 169 // Look for gsdlsite.cfg in same directory that executable is in. 170 text_tarray cfgline; 171 text_t key; 172 ifstream confin ("gsdlsite.cfg"); 173 174 if (confin) { 175 while (read_cfg_line(confin, cfgline) >= 0) { 176 if (cfgline.size () >= 2) { 177 if (cfgline[0] == "gsdlhome") { 178 gsdlhome = cfgline[1]; 179 return true; 180 } 181 } 182 } 183 confin.close (); 184 } 185 */ 173 186 174 return false; 187 175 } -
branches/corba/gsdl/src/recpt/recptconfig.h
r1067 r1509 39 39 // reads site configuration file returning true on success 40 40 bool site_cfg_read (receptionist &recpt, text_t &gsdlhome, int &maxrequests); 41 bool site_cfg_read (text_t &gsdlhome );41 bool site_cfg_read (text_t &gsdlhome, text_t &httpdomain, text_t &httpprefix); 42 42 43 43 // main_cfg_read reads either collect.cfg or main.cfg and returning -
branches/corba/gsdl/src/recpt/recptproto.cpp
r533 r1509 28 28 /* 29 29 $Log$ 30 Revision 1.7.2.1 2000/09/06 21:49:06 davidb 31 32 Improvements to corba implementation so images within a collection 33 are handled better and images in the remote site but not in the local 34 site are cached locally. 35 30 36 Revision 1.7 1999/09/07 04:56:59 sjboddie 31 37 added GPL notice … … 69 75 bool recptproto::init (ostream &/*logout*/) { 70 76 return true; 77 } 78 79 // get_site_name should return the name of the site used. 80 // This is trivially empty in the case of a null protocol. If a remote 81 // connection to a site is being used then this should return the name 82 // used to label a site. 83 text_t recptproto::get_site_name () { 84 return ""; 71 85 } 72 86 -
branches/corba/gsdl/src/recpt/recptproto.h
r722 r1509 62 62 // out to the log file and no other output should be produced. 63 63 virtual bool init (ostream &logout); 64 65 // get_site_name should return the name of the site used. 66 // This is trivially empty in the case of a null protocol. If a remote 67 // connection to a site is being used then this should return the name 68 // used to label a site. 69 virtual text_t get_site_name (); 64 70 65 71 // get_protocol_name should return the name of this protocol (e.g. recptproto) -
branches/corba/gsdl/src/recpt/statusaction.cpp
r995 r1509 28 28 /* 29 29 $Log$ 30 Revision 1.25.2.1 2000/09/06 21:49:07 davidb 31 32 Improvements to corba implementation so images within a collection 33 are handled better and images in the remote site but not in the local 34 site are cached locally. 35 30 36 Revision 1.25 2000/02/29 21:00:31 sjboddie 31 37 fixed some compiler warnings … … 443 449 } else { 444 450 textout << outconvert << disp 445 << "\"<a href=\"_gwcgi_? e=_compressedoptions_&a=status&sp=collectioninfo&pr="451 << "\"<a href=\"_gwcgi_?_optsite_e=_compressedoptions_&a=status&sp=collectioninfo&pr=" 446 452 << protoname 447 453 << "&c="
Note:
See TracChangeset
for help on using the changeset viewer.