Changeset 13169
- Timestamp:
- 2006-10-27T13:31:13+13:00 (18 years ago)
- Location:
- trunk/gsdl/bin/script
- Files:
-
- 2 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 -
trunk/gsdl/bin/script/import.pl
r13163 r13169 45 45 use plugin; 46 46 use plugout; 47 use docprint;48 47 use manifest; 49 48 use util; … … 482 481 483 482 # read the archive information file 484 if (!$debug) { 485 $archive_info_filename = &util::filename_cat ($archivedir, "archives.inf"); 486 $archive_info = new arcinfo (); 487 $archive_info->load_info ($archive_info_filename); 488 489 490 ####Use Plugout#### 491 my ($plugout_name); 492 if ($saveas !~ /^(GA|METS)Plugout$/ ){ 493 $plugout_name = $saveas."Plugout"; 494 } 495 else{ 496 $plugout_name = $saveas; 497 } 498 499 my $opts=[]; 500 push @$opts,("-output_info",$archive_info) if (defined $archive_info); 501 502 push @$opts,("-verbosity",$verbosity) if (defined $verbosity); 503 push @$opts,("-gzip_output") if ($gzip); 504 push @$opts,("-group_size",$groupsize) if (defined $groupsize); 505 push @$opts,("-output_handle",$out) if (defined $out); 506 507 $processor = &plugout::load_plugout($plugout_name,$opts); 508 $processor->setoutputdir ($archivedir); 509 $processor->set_sortmeta ($sortmeta, $removeprefix, $removesuffix) if defined $sortmeta; 510 $processor->set_OIDtype ($OIDtype, $OIDmetadata); 511 512 513 } else { 514 $processor = new docprint (); 515 } 516 483 $archive_info_filename = &util::filename_cat ($archivedir, "archives.inf"); 484 $archive_info = new arcinfo (); 485 $archive_info->load_info ($archive_info_filename); 486 487 488 ####Use Plugout#### 489 my ($plugout_name); 490 if ($saveas !~ /^(GA|METS)Plugout$/ ){ 491 $plugout_name = $saveas."Plugout"; 492 } 493 else { 494 $plugout_name = $saveas; 495 } 496 497 my $opts=[]; 498 push @$opts,("-output_info",$archive_info) if (defined $archive_info); 499 500 push @$opts,("-verbosity",$verbosity) if (defined $verbosity); 501 push @$opts,("-gzip_output") if ($gzip); 502 push @$opts,("-group_size",$groupsize) if (defined $groupsize); 503 push @$opts,("-output_handle",$out) if (defined $out); 504 505 push @$opts,("-debug") if ($debug); 506 507 $processor = &plugout::load_plugout($plugout_name,$opts); 508 $processor->setoutputdir ($archivedir); 509 $processor->set_sortmeta ($sortmeta, $removeprefix, $removesuffix) if defined $sortmeta; 510 $processor->set_OIDtype ($OIDtype, $OIDmetadata); 511 517 512 &plugin::begin($pluginfo, $importdir, $processor, $maxdocs, $gli); 518 513 … … 540 535 541 536 # write out the archive information file 542 if (!$debug) { 543 $processor->close_file_output() if $groupsize > 1; 544 $processor->close_group_output() if $processor->is_group(); 545 $archive_info->save_info($archive_info_filename); 546 } 537 $processor->close_file_output() if $groupsize > 1; 538 $processor->close_group_output() if $processor->is_group(); 539 # should we still do this in debug mode?? 540 $archive_info->save_info($archive_info_filename); 547 541 548 542 # write out import stats
Note:
See TracChangeset
for help on using the changeset viewer.