Changeset 17142 for gsdl/trunk/bin/script/import.pl
- Timestamp:
- 2008-09-04T14:27:27+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/bin/script/import.pl
r17038 r17142 253 253 'modegli' => "4" }, 254 254 { 'name' => "gli", 255 'desc' => " ",255 'desc' => "{scripts.gli}", 256 256 'type' => "flag", 257 257 'reqd' => "no", … … 273 273 # params 274 274 my ($language, $verbosity, $debug, 275 $importdir, $site, $manifest, $incremental, $keepold, 276 $removeold, $saveas, 275 $collectdir, $importdir, $archivedir, $site, $manifest, 276 $incremental, $keepold, $removeold, 277 $saveas, 277 278 $OIDtype, $OIDmetadata, 278 279 $maxdocs, $statsfile, 279 $out, $faillog, $collectdir, $gli, 280 281 $archivedir, 280 $out, $faillog, $gli, 282 281 $gzip, $groupsize, 283 $sortmeta, $reversesort, $removeprefix, $removesuffix ,282 $sortmeta, $reversesort, $removeprefix, $removesuffix 284 283 ); 285 284 … … 287 286 288 287 # other vars 289 my ($configfilename, $collect cfg, $collection,288 my ($configfilename, $collection, $collectcfg, 290 289 $archive_info_filename, $archive_info, 291 290 $gs_mode, … … 331 330 if ($intArgLeftinAfterParsing != 1 || (@ARGV && $ARGV[0] =~ /^\-+h/)) 332 331 { 333 &PrintUsage::print_txt_usage($options, "{ buildcol.params}");332 &PrintUsage::print_txt_usage($options, "{import.params}"); 334 333 die "\n"; 335 334 } … … 432 431 } 433 432 434 if ( $OIDtype !~ /^(hash|incremental|assigned|dirname)$/) {433 if (!defined $OIDtype || ($OIDtype !~ /^(hash|incremental|assigned|dirname)$/ )) { 435 434 if (defined $collectcfg->{'OIDtype'} && $collectcfg->{'OIDtype'} =~ /^(hash|incremental|assigned|dirname)$/) { 436 435 $OIDtype = $collectcfg->{'OIDtype'}; 437 436 } else { 438 437 $OIDtype = "hash"; # the default 439 }440 }441 442 my ($plugout);443 if (defined $collectcfg->{'plugout'}) {444 $plugout = $collectcfg->{'plugout'};445 }446 else{447 if ($saveas !~ /^(GA|.*METS|DSpace|MARCXML)$/) {448 push @$plugout,"GAPlugout";449 }450 else{451 push @$plugout,$saveas."Plugout";452 438 } 453 439 } … … 484 470 $gli = 1; 485 471 } 486 487 488 # global plugin stuff 489 if (defined $collectcfg->{'separate_cjk'} && $collectcfg->{'separate_cjk'} =~ /^true$/i) { 490 push @global_opts, "-separate_cjk"; 491 } 492 472 $gli = 0 unless defined $gli; 473 493 474 # check keepold and removeold 494 475 ($removeold, $keepold, $incremental) = &scriptutil::check_removeold_and_keepold($removeold, $keepold, $incremental, "archives", $collectcfg); 495 476 496 $gli = 0 unless defined $gli;497 477 498 478 print STDERR "<Import>\n" if $gli; … … 538 518 539 519 # read the archive information file 540 541 # If saveas=DSpace, a "contents" file will be created, otherwise "archives.inf" 542 543 # the plugouts should be doing this!! 544 if ($saveas eq "DSpace"){ 545 $archive_info_filename = &util::filename_cat ($archivedir, "contents"); 546 } elsif ($saveas =~ m/^.*METS$/ || $saveas eq "GA" || $saveas eq "MARC" ) { 547 $archive_info_filename = &util::filename_cat ($archivedir, "archives.inf"); 548 } 549 520 $archive_info_filename = &util::filename_cat ($archivedir, "archives.inf"); 521 550 522 $archive_info = new arcinfo (); 551 523 $archive_info->load_info ($archive_info_filename); … … 555 527 556 528 ####Use Plugout#### 529 my ($plugout); 530 if (defined $collectcfg->{'plugout'} && $collectcfg->{'plugout'} =~ /^(GA|GreenstoneMETS)Plugout/) { 531 $plugout = $collectcfg->{'plugout'}; 532 } 533 else{ 534 if ($saveas !~ /^(GA|GreenstoneMETS)$/) { 535 push @$plugout,"GAPlugout"; 536 } 537 else{ 538 push @$plugout,$saveas."Plugout"; 539 } 540 } 541 557 542 push @$plugout,("-output_info",$archive_info) if (defined $archive_info); 558 543 push @$plugout,("-verbosity",$verbosity) if (defined $verbosity); … … 590 575 } 591 576 } 592 593 if ($saveas eq "FedoraMETS")594 {595 # This would be better (should?!) be done in Plugout!!596 597 # create collection "doc obj" for Fedora that contains598 # collection-level metadata599 600 my $doc_obj = new doc($configfilename,"nonindexed_doc");601 $doc_obj->set_OID("collection");602 603 my $col_name = undef;604 my $col_meta = $collectcfg->{'collectionmeta'};605 if (defined $col_meta)606 {607 store_collectionmeta($col_meta,"collectionname",$doc_obj);608 store_collectionmeta($col_meta,"collectioextra",$doc_obj);609 610 }611 612 $processor->process($doc_obj);613 }614 615 577 616 578 &plugin::end($pluginfo, $processor);
Note:
See TracChangeset
for help on using the changeset viewer.