- Timestamp:
- 2000-07-13T10:21:53+12:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/New_Config_Format-branch/gsdl/src/recpt/buildaction.cpp
r1000 r1279 24 24 *********************************************************************/ 25 25 26 #ifndef __WIN32__27 #include <unistd.h>28 #endif29 30 26 #include "OIDtools.h" 31 27 #include "fileutil.h" 32 28 #include "htmlutils.h" 29 #include "gsdltools.h" 33 30 #include "buildaction.h" 34 31 … … 80 77 bool buildaction::check_cgiargs (cgiargsinfoclass &/*argsinfo*/, cgiargsclass &args, 81 78 ostream &/*logout*/) { 82 if ((args["bca"] != "buildstatus") && (args["bca"] != "collog")) 79 80 text_t &arg_bca = args["bca"]; 81 if (!((arg_bca == "buildstatus") || (arg_bca == "collog") || (arg_bca == "blankpage") 82 || ((arg_bca == "buildcol") && (args["wizard"] == "buildexec")))) 83 83 { 84 84 // authenticate the user if authentication is avaiable … … 102 102 // make sure we know about a receptionist 103 103 if (recpt == NULL) { 104 logout << "The pageaction does not contain information\n"104 logout << "The build action does not contain information\n" 105 105 << "about any receptionists. The method set_receptionist\n" 106 106 << "was probably not called from the module which instantiated\n" 107 << "this pageaction.\n";107 << "this build action.\n"; 108 108 return; 109 109 } … … 116 116 text_t fullnamelist = "var fullnamelist = new Array("; 117 117 text_t dirnamelist = "var dirnamelist = new Array("; 118 text_t fullnamemenu = (text_t)"<input type=hidden name=\"bc1fullnameindex\""119 +" value=\"_bcargfullnameindex_\">\n"120 +"<select name=\"bc1fullnamemenu\" onChange=fullnameindex_changed()>\n";118 text_t fullnamemenu = "<input type=hidden name=\"bc1fullnameindex\""; 119 fullnamemenu += " value=\"_bcargfullnameindex_\">\n"; 120 fullnamemenu += "<select name=\"bc1fullnamemenu\" onChange=fullnameindex_changed()>\n"; 121 121 int rcount = 1; 122 122 int fcount = 1; … … 146 146 while (collist_here != collist_end) { 147 147 148 ColInfoResponse_t cinfo; 149 (*rprotolist_here).p->get_collectinfo (*collist_here, cinfo, err, logout); 150 if (err == noError) { 148 ColInfoResponse_t *cinfo = recpt->get_collectinfo_ptr ((*rprotolist_here).p, *collist_here, logout); 149 if (cinfo != NULL) { 151 150 text_t collectionname = *collist_here; 152 if (!cinfo .collectionmeta["collectionname"].empty())151 if (!cinfo->collectionmeta["collectionname"].empty()) 153 152 { 154 153 // get collection name from the collection cfg file 155 collectionname = cinfo .collectionmeta["collectionname"];154 collectionname = cinfo->collectionmeta["collectionname"]; 156 155 } 157 156 else … … 169 168 dirnamelist += (text_t)"\"" + *collist_here + "\""; 170 169 171 fullnamemenu += (text_t)"<option value=\"" + collectionname + "\""; 172 if (args["bc1dirname"] == "") 170 fullnamemenu += "<option value=\"" + collectionname; 171 fullnamemenu.push_back ('"'); 172 if (args["bc1dirname"].empty()) 173 173 { 174 174 if ((rcount==1) && (ccount==1)) … … 202 202 if (args["bca"]=="buildcol") 203 203 { 204 if (((args["bc1dirname"] =="") && (rcount==1) && (ccount==1))204 if (((args["bc1dirname"].empty()) && (rcount==1) && (ccount==1)) 205 205 || (args["bc1dirname"]==*collist_here)) 206 206 { 207 disp.setmacro("bcargingsdlarea","build",cinfo .building["ingsdlarea"]);208 disp.setmacro("bcargcopydir","build",cinfo .building["copydir"]);207 disp.setmacro("bcargingsdlarea","build",cinfo->building["ingsdlarea"]); 208 disp.setmacro("bcargcopydir","build",cinfo->building["copydir"]); 209 209 210 if (cinfo .buildDate==0) // not built210 if (cinfo->buildDate==0) // not built 211 211 { 212 212 // assume that's because this is the first build ever for the collection … … 240 240 } 241 241 242 if ((args["bca"]=="delcol") || (args["bca"]=="editcol") || (args["bca"]=="buildcol") || (args["bca"]=="collog")) 242 if ((args["bca"]=="delcol") || (args["bca"]=="editcol") || 243 (args["bca"]=="buildcol") || (args["bca"]=="collog")) 243 244 { 244 245 disp.setmacro ("dirnamelist", "build", dirnamelist); … … 268 269 text_t bc1name = substr(args_entry.begin()+3,args_entry.end()); 269 270 text_t cached_cgiarg = "bcarg" + bc1name; 270 disp.setmacro(cached_cgiarg, "build",args[args_entry]);271 disp.setmacro(cached_cgiarg, "build", dm_safe(args[args_entry])); 271 272 } 272 273 args_here++; … … 288 289 text_t cfg_fname 289 290 = filename_cat(gsdlhome, "collect", dirname, "etc", "collect.cfg"); 291 292 #ifdef GSDL_USE_IOS_H 290 293 ifstream cfg_ifs (cfg_fname.getcstr(), ios::in | ios::nocreate); 294 #else 295 ifstream cfg_ifs (cfg_fname.getcstr(), ios::in); 296 #endif 297 291 298 if (cfg_ifs) 292 299 { … … 323 330 // read in collect.bld 324 331 text_t bld_fname = filename_cat(gsdlhome, "log", dirname+ ".bld"); 332 333 #ifdef GSDL_USE_IOS_H 325 334 ifstream bld_ifs (bld_fname.getcstr(), ios::in | ios::nocreate); 335 #else 336 ifstream bld_ifs (bld_fname.getcstr(), ios::in); 337 #endif 338 326 339 if (bld_ifs) 327 340 { … … 427 440 ostream &logout) { 428 441 429 430 431 432 442 text_tarray wizard_split; 433 const text_t & wizard = (args["wizard"]=="") ? (text_t)"buildcol" : args["wizard"];443 const text_t wizard = (args["wizard"].empty()) ? "buildcol" : args["wizard"]; 434 444 splitchar(wizard.begin(),wizard.end(),':',wizard_split); 435 const text_t &wizard_last = wizard_split.back();445 const text_t wizard_last = wizard_split.back(); 436 446 437 447 if (wizard_last != "buildframe") … … 444 454 else 445 455 { 446 text_t dirname = (args["bc1dirname"] == "") ? (text_t)"unknown" : args["bc1dirname"]; 456 text_t dirname = (args["bc1dirname"] == "") ? 457 "unknown" : args["bc1dirname"]; 458 447 459 text_t tmpname = dirname+"_XXXXXX"; 448 if (mktemp(tmpname.getcstr())==NULL) 449 { 450 logout << "Failed to create temporary filename" << endl; 451 } 460 char *cstr_tmpname = tmpname.getcstr(); 461 462 if (GSDL_MKTEMP (cstr_tmpname)==NULL) 463 logout << "Failed to create temporary filename" << endl; 464 465 delete cstr_tmpname; 466 452 467 disp.setmacro("bcargtmpname","build",tmpname); 453 468 … … 457 472 458 473 textout << outconvert << disp << headmess << content << "_build:framefooter_\n"; 459 text_t cmd = filename_cat(gsdlhome, "cgi-bin", "webpage_buildcol.pl"); 460 cmd += " gsdlhome=\""+args["gsdlhome"]+"\" httpbuild=\""+args["httpbuild"]+"\""; 461 cmd += " bc1copydata=\""+args["bc1copydata"]+"\""; 462 cmd += " bc1doimport=\""+args["bc1doimport"]+"\""; 463 cmd += " bc1dobuild=\""+args["bc1dobuild"]+"\""; 464 cmd += " bc1dirname=\""+args["bc1dirname"]+"\" bc1tmpname=\""+tmpname+"\" &"; 465 466 system(cmd.getcstr()); 474 text_t cmd = "perl \"" + 475 filename_cat(gsdlhome, "cgi-bin", "webpage_buildcol.pl") + "\""; 476 cmd += " \"httpbuild="+args["httpbuild"]+"\""; 477 cmd += " \"bc1copydata="+args["bc1copydata"]+"\""; 478 cmd += " \"bc1doimport="+args["bc1doimport"]+"\""; 479 cmd += " \"bc1dobuild="+args["bc1dobuild"]+"\""; 480 cmd += " \"bc1dirname="+args["bc1dirname"]+"\" \"bc1tmpname="+tmpname+"\""; 481 // run webpage_buildcol.pl in background on unix systems 482 #if !defined (__WIN32__) 483 cmd += " &"; 484 #endif 485 486 char *cstr_cmd = cmd.getcstr(); 487 488 #if defined (__WIN32__) 489 gsdl_system (cstr_cmd, logout); 490 #else 491 system (cstr_cmd); 492 #endif 493 494 delete cstr_cmd; 467 495 } 468 496
Note:
See TracChangeset
for help on using the changeset viewer.