Changeset 2112


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

Implemented export function in collector

Location:
trunk/gsdl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/macros/collect.dm

    r1816 r2112  
    9292_httpbild_ {_gwcgi_?e=_compressedoptions_&p=bild}
    9393_httpview_ {_gwcgi_?a=p&p=about&c=_cgiargbc1dirname_}
    94 _httpdel_  {javascript:do_delete();}
     94_httpdel_  {javascript:do\_delete();}
    9595_httpexpt_ {_gwcgi_?e=_compressedoptions_&p=expt}
    9696
     
    218218\}
    219219
    220 function do_delete () \{
     220function do\_delete () \{
    221221  var form = document.collectorform; 
    222222  var i = form.bc1dirname.selectedIndex;
     
    246246<td valign=bottom>Delete the collection entirely</td></tr>
    247247<tr><td align=right valign=bottom>4.</td>
    248 <td valign=bottom>_gsimage_(_collector:httpexpt_,_collector:httpicongcexptof_,_collector:httpicongcexpton_,export,_collector:textexpt_)</td>
     248<td valign=bottom>_gsjimage_( ,_collector:httpicongcexptof_,_collector:httpicongcexpton_,expt,_collector:textexpt_)</td>
    249249<td valign=bottom>Export the collection for writing to a self-installing Windows CD-ROM</td></tr>
    250250</table>
     
    10941094_messagefoot_
    10951095}
     1096
     1097_exptsuccesscontent_ {
     1098_messagehead_
     1099<input type=hidden name=p value=existing>
     1100<p>
     1101
     1102The _cgiargbc1dirname_ collection was successfully exported to the
     1103_gsdlhome_/tmp/exported\__cgiargbc1dirname_ directory.
     1104
     1105_messagefoot_
     1106}
     1107
     1108_exptfailcontent_ {
     1109_messagehead_
     1110<input type=hidden name=p value=existing>
     1111<p>
     1112
     1113Failed to export the _cgiargbc1dirname_ collection.
     1114
     1115_messagefoot_
     1116}
  • 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.