Ignore:
Timestamp:
2001-03-05T12:19:24+13:00 (23 years ago)
Author:
sjboddie
Message:

Implemented export function in collector

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/collectoraction.cpp

    r1837 r2112  
    11721172  }
    11731173
     1174  if (collector_page == "expt") {
     1175
     1176    // export the collection - we'll do a synchronous system call to
     1177    // exportcol.pl as that's the easiest way to do it. if it becomes a
     1178    // problem that it's taking too long to export a large collection then
     1179    // we may have to revisit this.
     1180    text_t tmpfile = filename_cat (gsdlhome, "tmp", collection + "_export.txt");
     1181    text_t export_cmd = "perl -S exportcol.pl -out " + tmpfile + " " + collection;
     1182    gsdl_system (export_cmd, true, logout);
     1183    if (file_exists (tmpfile)) {
     1184      text_t returnline = file_tail (tmpfile, 1, 0);
     1185      if (returnline.size() > 23 && (substr(returnline.begin(), returnline.begin()+23) == "exportcol.pl succeeded:")) {
     1186    // success
     1187    message = "exptsuccess";
     1188      } else {
     1189    message = "exptfail";
     1190      }
     1191    } else {
     1192      message = "exptfail";
     1193    }
     1194  }
     1195
    11741196  if (message.empty()) {
    11751197    if (collector_page != "bild") {
Note: See TracChangeset for help on using the changeset viewer.