Changeset 13169 for trunk/gsdl/bin/script/export.pl
- Timestamp:
- 2006-10-27T13:31:13+13:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/export.pl
r12965 r13169 50 50 use plugin; 51 51 use plugout; 52 use docprint;53 52 use util; 54 53 use scriptutil; … … 459 458 460 459 # read the export information file 461 if (!$debug) {462 463 460 461 # Export to DSpace Archive format or METs format 462 # If saveas=DSpace, a "contents" file will be created, otherwise "export.inf" 464 463 465 if ($saveas eq "DSpace"){ 466 $export_info_filename = &util::filename_cat ($exportdir, "contents"); 467 } elsif ($saveas eq "METS" || $saveas eq "GA" || $saveas eq "MARC" ) { 468 $export_info_filename = &util::filename_cat ($exportdir, "export.inf"); 469 } 470 471 $export_info = new arcinfo(); 472 $export_info -> load_info ($export_info_filename); 473 474 if ($saveas !~ /^(GA|METS|DSpace|MARCXML)$/) { 475 if (defined $collectcfg->{'plugout'} && $collectcfg->{'plugout'}[0] =~ /^(GAPlugout|METSPlugout)$/) { 476 $saveas = $collectcfg->{'plugout'}[0]; 477 } else { 478 $saveas ="GAPlugout"; 479 } 480 } 481 482 483 ####Use Plugout#### 484 my ($plugout_name); 485 if ($saveas !~ /^(GA|METS|DSpace|MARCXML)Plugout$/ ){ 486 $plugout_name = $saveas."Plugout"; 487 } 488 else{ 489 $plugout_name = $saveas; 490 } 491 492 my $opts=[]; 493 494 495 push @$opts,("-output_info",$export_info) if (defined $export_info); 496 497 push @$opts,("-verbosity",$verbosity) if (defined $verbosity); 498 499 push @$opts,("-gzip_output",$gzip) if (defined $gzip); 500 push @$opts,("-group_size",$groupsize) if (defined $groupsize); 501 push @$opts,("-output_handle",$out) if (defined $out); 502 push @$opts,("-xslt_file",$xsltfile) if (defined $xsltfile); 503 push @$opts,("-group") if ($group_marc && $plugout_name =~ /^MARCXMLPlugout$/); 504 push @$opts,("-mapping_file",$mapping_file) if (defined $mapping_file && $plugout_name =~ /^MARCXMLPlugout$/); 505 push @$opts,("-saveas_version",$saveas_version) if (defined $saveas_version && $plugout_name =~ /^METSPlugout$/); 506 push @$opts,("-xslt_mets",$xslt_mets) if (defined $xslt_mets && $plugout_name =~ /^METSPlugout$/); 507 push @$opts,("-xslt_txt",$xslt_txt) if (defined $xslt_txt && $plugout_name =~ /^METSPlugout$/); 508 $processor = &plugout::load_plugout($plugout_name,$opts); 509 510 $processor->setoutputdir ($exportdir); 511 512 $processor->set_sortmeta ($sortmeta) if defined $sortmeta; 513 $processor->set_OIDtype ($OIDtype, $OIDmetadata); 514 515 } else { 516 $processor = new docprint (); 517 } 464 # the plugouts should be doing this!! 465 if ($saveas eq "DSpace"){ 466 $export_info_filename = &util::filename_cat ($exportdir, "contents"); 467 } elsif ($saveas eq "METS" || $saveas eq "GA" || $saveas eq "MARC" ) { 468 $export_info_filename = &util::filename_cat ($exportdir, "export.inf"); 469 } 470 471 $export_info = new arcinfo(); 472 $export_info -> load_info ($export_info_filename); 473 474 if ($saveas !~ /^(GA|METS|DSpace|MARCXML)$/) { 475 if (defined $collectcfg->{'plugout'} && $collectcfg->{'plugout'}[0] =~ /^(GAPlugout|METSPlugout)$/) { 476 $saveas = $collectcfg->{'plugout'}[0]; 477 } else { 478 $saveas ="GAPlugout"; 479 } 480 } 481 482 483 ####Use Plugout#### 484 my ($plugout_name); 485 if ($saveas !~ /^(GA|METS|DSpace|MARCXML)Plugout$/ ){ 486 $plugout_name = $saveas."Plugout"; 487 } 488 else { 489 $plugout_name = $saveas; 490 } 491 492 my $opts=[]; 493 494 push @$opts,("-output_info",$export_info) if (defined $export_info); 495 push @$opts,("-verbosity",$verbosity) if (defined $verbosity); 496 push @$opts,("-debug") if ($debug); 497 push @$opts,("-gzip_output",$gzip) if (defined $gzip); 498 push @$opts,("-group_size",$groupsize) if (defined $groupsize); 499 push @$opts,("-output_handle",$out) if (defined $out); 500 push @$opts,("-xslt_file",$xsltfile) if (defined $xsltfile); 501 push @$opts,("-group") if ($group_marc && $plugout_name =~ /^MARCXMLPlugout$/); 502 push @$opts,("-mapping_file",$mapping_file) if (defined $mapping_file && $plugout_name =~ /^MARCXMLPlugout$/); 503 push @$opts,("-saveas_version",$saveas_version) if (defined $saveas_version && $plugout_name =~ /^METSPlugout$/); 504 push @$opts,("-xslt_mets",$xslt_mets) if (defined $xslt_mets && $plugout_name =~ /^METSPlugout$/); 505 push @$opts,("-xslt_txt",$xslt_txt) if (defined $xslt_txt && $plugout_name =~ /^METSPlugout$/); 506 $processor = &plugout::load_plugout($plugout_name,$opts); 507 508 $processor->setoutputdir ($exportdir); 509 510 $processor->set_sortmeta ($sortmeta) if defined $sortmeta; 511 $processor->set_OIDtype ($OIDtype, $OIDmetadata); 518 512 519 513 &plugin::begin($pluginfo, $importdir, $processor, $maxdocs); … … 527 521 528 522 # write out the export information file 529 if (!$debug) { 530 $processor->close_file_output() if $groupsize > 1; 531 $processor->close_group_output() if $processor->is_group(); 532 if ($saveas eq "METS") { 533 $export_info->save_info($export_info_filename); 534 } 523 $processor->close_file_output() if $groupsize > 1; 524 $processor->close_group_output() if $processor->is_group(); 525 if ($saveas eq "METS") { 526 $export_info->save_info($export_info_filename); 535 527 } 536 528
Note:
See TracChangeset
for help on using the changeset viewer.