Changeset 13811


Ignore:
Timestamp:
2007-01-25T17:24:31+13:00 (15 years ago)
Author:
mdewsnip
Message:

Now uses the new timestamp argument instead of the username in zip file names, to avoid having the username in the name twice for personal collections.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/cgi-bin/gliserver.pl

    r13810 r13811  
    5959    # Get then remove the ts (timestamp) argument (since this can mess up other scripts)
    6060    my $timestamp = $gsdl_cgi->clean_param("ts");
     61    if ((!defined $timestamp) || ($timestamp =~ m/^\s*$/)) {
     62    $timestamp = time();  # Fall back to using the Perl time() function to generate a timestamp
     63    }
    6164    $gsdl_cgi->delete("ts");
    6265
     
    375378    my $java = $gsdl_cgi->get_java_path();
    376379    my $java_classpath = &util::filename_cat($gsdlhome, "bin", "java", "GLIServer.jar");
    377     my $zip_file_path = &util::filename_cat($collect_directory, $username . "-" . $collection . ".zip");
     380    my $zip_file_path = &util::filename_cat($collect_directory, $collection . "-" . $timestamp . ".zip");
    378381    my $java_args = "\"$zip_file_path\" \"$collect_directory\" \"$collection\"";
    379382    my $java_command = "$java -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionShell $java_args";
     
    422425    my $java = $gsdl_cgi->get_java_path();
    423426    my $java_classpath = &util::filename_cat($gsdlhome, "bin", "java", "GLIServer.jar");
    424     my $zip_file_path = &util::filename_cat($collect_directory, $username . "-" . $collection . "-archives.zip");
     427    my $zip_file_path = &util::filename_cat($collect_directory, $collection . "-archives-" . $timestamp . ".zip");
    425428    my $java_args = "\"$zip_file_path\" \"$collect_directory\" \"$collection\"";
    426429    my $java_command = "$java -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionArchives $java_args";
     
    457460    my $java = $gsdl_cgi->get_java_path();
    458461    my $java_classpath = &util::filename_cat($gsdlhome, "bin", "java", "GLIServer.jar");
    459     my $zip_file_path = &util::filename_cat($collect_directory, $username . "-" . "collection-configurations.zip");
     462    my $zip_file_path = &util::filename_cat($collect_directory, "collection-configurations-" . $timestamp . ".zip");
    460463    my $java_args = "\"$zip_file_path\" \"$collect_directory\" \"$username\" \"$user_groups\"";
    461464    my $java_command = "$java -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionConfigurations $java_args";
     
    514517    my $java = $gsdl_cgi->get_java_path();
    515518    my $java_classpath = &util::filename_cat($gsdlhome, "bin", "java", "GLIServer.jar");
    516     my $zip_file_path = &util::filename_cat($collection_directory, $username . "-" . $collection . "-file.zip");
     519    my $zip_file_path = &util::filename_cat($collection_directory, $collection . "-file-" . $timestamp . ".zip");
    517520    my $java_args = "\"$zip_file_path\" \"$collection_directory\" \"$file\"";
    518521    my $java_command = "$java -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipFiles $java_args";
     
    786789    }
    787790
    788     my $file_path = &util::filename_cat($directory_path, $username . "-" . $file);
     791    my $file_path = &util::filename_cat($directory_path, $file . "-" . $timestamp);
    789792    if (!open(FOUT, ">$file_path")) {
    790793    $gsdl_cgi->generate_error("Unable to write file $file_path");
Note: See TracChangeset for help on using the changeset viewer.