Changeset 23768

Show
Ignore:
Timestamp:
09.03.2011 15:06:32 (8 years ago)
Author:
davidb
Message:

Setting of the collect directory changed to be compliant with Greenstone 3 and its 'site' variable

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/cgiactions/explodeaction.pm

    r23742 r23768  
    3232use dbutil; 
    3333use ghtml; 
     34use util; 
    3435 
    3536use File::Basename; 
     
    9596    my @docids = @_; 
    9697 
     98    my $collect   = $self->{'collect'}; 
     99    my $gsdl_cgi  = $self->{'gsdl_cgi'}; 
    97100    my $infodb_type = $self->{'infodbtype'}; 
    98101 
    99102    # Derive the archives dir     
    100     my $archive_dir = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},"archives"); 
     103    my $site = $self->{'site'}; 
     104    my $collect_dir = $gsdl_cgi->get_collection_dir($site); 
     105    my $archive_dir = &util::filename_cat($collect_dir,$collect,"archives"); 
     106    ##my $archive_dir = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},"archives"); 
    101107 
    102108    my $arcinfo_doc_filename  
     
    138144{ 
    139145    my $self = shift @_; 
    140  
    141146    my ($import_filenames) = @_; 
    142147 
     148    my $collect   = $self->{'collect'};    
     149    my $gsdl_cgi  = $self->{'gsdl_cgi'}; 
    143150    my $infodb_type = $self->{'infodbtype'}; 
    144151 
    145152    # Derive the archives dir     
    146     my $archive_dir = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},"archives"); 
     153    my $site = $self->{'site'}; 
     154    my $collect_dir = $gsdl_cgi->get_collection_dir($site); 
     155    my $archive_dir = &util::filename_cat($collect_dir,$collect,"archives"); 
     156    ##my $archive_dir = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},"archives"); 
    147157 
    148158    # Obtain the oids for the specified import filenames 
     
    154164 
    155165    foreach my $if (@$import_filenames) { 
     166        $if = &util::upgrade_if_dos_filename($if); 
     167 
     168    print STDERR "*** looking import filename key \"$if\"\n"; 
    156169 
    157170    my $src_rec 
     
    190203    my ($docids) = @_; 
    191204 
     205    my $collect   = $self->{'collect'}; 
     206    my $gsdl_cgi  = $self->{'gsdl_cgi'}; 
    192207    my $infodb_type = $self->{'infodbtype'}; 
    193208 
    194209    # Derive the archives and import directories 
    195     my $archive_dir = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},"archives"); 
    196     my $import_dir  = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},"import"); 
     210    my $site = $self->{'site'}; 
     211    my $collect_dir = $gsdl_cgi->get_collection_dir($site); 
     212     
     213    my $archive_dir = &util::filename_cat($collect_dir,$collect,"archives"); 
     214    my $import_dir  = &util::filename_cat($collect_dir,$collect,"import"); 
    197215 
    198216    # Obtain the doc.xml path for the specified docID 
     
    254272    } 
    255273     
    256     # Obtain the collect dir 
    257     my $collect_dir = &util::filename_cat($gsdl_home, "collect"); 
     274    # Derive the archives dir     
     275    my $site = $self->{'site'}; 
     276    my $collect_dir = $gsdl_cgi->get_collection_dir($site); 
     277     
     278    my $archive_dir = &util::filename_cat($collect_dir,$collect,"archives"); 
     279    ##my $archive_dir = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},"archives"); 
    258280 
    259281    # Make sure the collection isn't locked by someone else