Changeset 12335


Ignore:
Timestamp:
2006-07-28T15:05:10+12:00 (18 years ago)
Author:
shaoqun
Message:

now it uses plugouts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/import.pl

    r12266 r12335  
    3737    unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan");
    3838    unshift (@INC, "$ENV{'GSDLHOME'}/perllib/plugins");
     39    unshift (@INC, "$ENV{'GSDLHOME'}/perllib/plugouts");
    3940    unshift (@INC, "$ENV{'GSDLHOME'}/perllib/classify");
    4041}
     
    4344use colcfg;
    4445use plugin;
     46use plugout;
    4547use docprint;
    4648use manifest;
     
    374376    }
    375377    }
     378
     379     
    376380    if ($saveas !~ /^(GA|METS)$/) {
    377     if (defined $collectcfg->{'saveas'} && $collectcfg->{'saveas'} =~ /^(GA|METS)$/) {
    378         $saveas = $collectcfg->{'saveas'};
     381    if (defined $collectcfg->{'plugout'} && $collectcfg->{'plugout'}[0] =~ /^(GAPlugout|METSPlugout)$/) {
     382        $saveas = $collectcfg->{'plugout'}[0];
    379383    } else {
    380         $saveas ="GA";
    381     }
    382     }
     384        $saveas ="GAPlugout";
     385    }
     386    }
     387
    383388    if (defined $collectcfg->{'sortmeta'} && (!defined $sortmeta || $sortmeta eq "")) {
    384389    $sortmeta = $collectcfg->{'sortmeta'};
     
    464469    $archive_info->load_info ($archive_info_filename);
    465470
     471<<<<<<< import.pl
     472         ####Use Plugout####
     473         my ($plugout_name);
     474        if ($saveas !~ /^(GA|METS)Plugout$/  ){     
     475        $plugout_name = $saveas."Plugout";
     476    }
     477        else{
     478            $plugout_name = $saveas;
     479          }
     480
     481         my $opts=[];
     482
     483    push @$opts,("-output_info",$export_info) if (defined $export_info);
     484   
     485    push @$opts,("-verbosity",$verbosity) if (defined $verbosity);
     486    push @$opts,("-gzip_output",$gzip) if (defined $gzip);
     487    push @$opts,("-group_size",$groupsize) if (defined $groupsize);
     488    push @$opts,("-output_handle",$out) if (defined $out);
     489       
     490        #$processor = new docsave ($collection, $archive_info, $verbosity, $gzip, $groupsize, $out, $service, $saveas);
     491        $processor = &plugout::load_plugout($plugout_name,$opts);                       
     492        $processor->setoutputdir ($archivedir);
     493        $processor->set_sortmeta ($sortmeta, $removeprefix, $removesuffix) if defined $sortmeta;
     494    $processor->set_OIDtype ($OIDtype);
     495    #$processor->set_saveas ($saveas);
     496    #$processor->set_saveas_version ("greenstone");
     497=======
    466498    # create a docsave object to process the documents
    467499    $processor = new docsave ($collection, $archive_info, $verbosity, $gzip, $groupsize, $out, $service, $saveas);
     
    472504    $processor->set_saveas_version ("greenstone");
    473505
     506>>>>>>> 1.78
    474507    } else {
    475508    $processor = new docprint ();
     
    503536    if (!$debug) {
    504537    $processor->close_file_output() if $groupsize > 1;
     538        $processor->close_group_output() if $processor->is_group();
    505539    $archive_info->save_info($archive_info_filename);
    506540    }
Note: See TracChangeset for help on using the changeset viewer.