Ignore:
Timestamp:
2009-04-22T13:25:39+12:00 (15 years ago)
Author:
ak19
Message:
  1. Changes made together with related changes in gliserver.pl for making the DownloadPane available in the remote client-gli. DownloadInfo.pl is called and gliserver now expects a downloader argument with the name of the downloader. 2. Variable client_lang now renamed to lang_env and some changes to tidy this up. More importantly, when lang_env is the empty string (signifying that the LANG env var on the client side was not set and the Java zip tools were run in that environment) this empty LANG environment is reused by the server to run the ziptools as well, to ensure consistency in this special case.
File:
1 edited

Legend:

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

    r19172 r19189  
    494494   
    495495    # language and region Environment Variable setting on the client side that was used to zip files.
    496     my $client_lang = $gsdl_cgi->clean_param("lr");
     496    my $lang_env = $gsdl_cgi->clean_param("lr") || "";
    497497    $gsdl_cgi->delete("lr");
    498498
     
    520520    $java_args .= " gsdl3"; ## must this be done elsewhere as well?
    521521    }
    522     my $java_command = "\"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionShell $java_args";
    523     $java_command = "LANG=$client_lang $java_command" if $client_lang;
     522    my $java_command = "LANG=$lang_env \"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionShell $java_args";
    524523
    525524    my $java_output = `$java_command`;
     
    549548
    550549    # language and region Environment Variable setting on the client side that was used to zip files.
    551     my $client_lang = $gsdl_cgi->clean_param("lr");
     550    my $lang_env = $gsdl_cgi->clean_param("lr") || "";
    552551    $gsdl_cgi->delete("lr");
    553552   
     
    571570    my $zip_file_path = &util::filename_cat($collect_directory, $collection . "-archives-" . $timestamp . ".zip");
    572571    my $java_args = "\"$zip_file_path\" \"$collect_directory\" \"$collection\"";
    573     my $java_command = "\"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionArchives $java_args";
    574     $java_command = "LANG=$client_lang $java_command" if $client_lang;
     572    my $java_command = "LANG=$lang_env \"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionArchives $java_args";
    575573
    576574    my $java_output = `$java_command`;
     
    596594
    597595    # language and region Environment Variable setting on the client side that was used to zip files.
    598     my $client_lang = $gsdl_cgi->clean_param("lr");
     596    my $lang_env = $gsdl_cgi->clean_param("lr") || "";
    599597    $gsdl_cgi->delete("lr");
    600598   
     
    610608    my $zip_file_path = &util::filename_cat($collect_directory, "collection-configurations-" . $timestamp . ".zip");
    611609    my $java_args = "\"$zip_file_path\" \"$collect_directory\" \"$username\" \"$user_groups\"";
    612     my $java_command = "\"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionConfigurations $java_args";
    613     $java_command = "LANG=$client_lang $java_command" if $client_lang;
     610    my $java_command = "LANG=$lang_env \"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipCollectionConfigurations $java_args";
    614611    my $java_output = `$java_command`;
    615612    my $java_status = $?;
     
    669666    }
    670667    # language and region Environment Variable setting on the client side that was used to zip files.
    671     my $client_lang = $gsdl_cgi->clean_param("lr");
     668    my $lang_env = $gsdl_cgi->clean_param("lr") || "";
    672669    $gsdl_cgi->delete("lr");
    673670    my $file = $gsdl_cgi->clean_param("file");
     
    702699    my $zip_file_path = &util::filename_cat($collection_directory, $collection . "-file-" . $timestamp . ".zip");
    703700    my $java_args = "\"$zip_file_path\" \"$collection_directory\" \"$file\"";
    704     my $java_command = "\"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipFiles $java_args";
    705     $java_command = "LANG=$client_lang $java_command" if $client_lang;
     701    my $java_command = "LANG=$lang_env \"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipFiles $java_args";
    706702
    707703    my $java_output = `$java_command`;
     
    729725
    730726    # language and region Environment Variable setting on the client side that was used to zip files.
    731     my $client_lang = $gsdl_cgi->clean_param("lr");
     727    my $lang_env = $gsdl_cgi->clean_param("lr") || "";
    732728    $gsdl_cgi->delete("lr");
    733729    my $file = $gsdl_cgi->clean_param("file");
     
    755751    my $zip_file_path = &util::filename_cat($web_inf_directory, "webxml" . $timestamp . ".zip");
    756752    my $java_args = "\"$zip_file_path\" \"$web_inf_directory\" \"$file\"";
    757     my $java_command = "\"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipFiles $java_args";
    758     $java_command = "LANG=$client_lang $java_command" if $client_lang;
     753    my $java_command = "LANG=$lang_env \"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.ZipFiles $java_args";
    759754    my $java_output = `$java_command`;
    760755
     
    799794    $perl_args = $gsdl_cgi->clean_param("plugin") || "";
    800795    $gsdl_cgi->delete("plugin");
     796    }
     797    if ($script eq "downloadinfo.pl") {
     798    $perl_args = $gsdl_cgi->clean_param("downloader") || "";
     799    $gsdl_cgi->delete("downloader");
    801800    }
    802801
     
    10781077    # zip files. This needs to be consistent on both client and server sides, otherwise zip
    10791078    # and unzip seem to produce different values.
    1080     my $client_lang = $gsdl_cgi->clean_param("lr");
     1079    my $lang_env = $gsdl_cgi->clean_param("lr") || "";
    10811080    $gsdl_cgi->delete("lr");
    10821081
     
    11591158    my $java_classpath = &util::filename_cat($ENV{'GSDLHOME'}, "bin", "java", "GLIServer.jar");
    11601159    my $java_args = "\"$file_path\" \"$directory_path\"";
    1161     my $java_command = "\"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.Unzip $java_args";
    1162     $java_command = "LANG=$client_lang $java_command" if $client_lang;
     1160    my $java_command = "LANG=$lang_env \"$java\" -classpath \"$java_classpath\" org.greenstone.gatherer.remote.Unzip $java_args";
    11631161    my $java_output = `$java_command`;
    11641162    my $java_status = $?;
Note: See TracChangeset for help on using the changeset viewer.