diff --git a/deploy_checkit_tiff/add_dnx_mappings/add_dnx_mappings.pl b/deploy_checkit_tiff/add_dnx_mappings/add_dnx_mappings.pl index 59a3983b04659abf119a83e4723fdf4c76d82eda..d1a6df54a8b21722e0de5da1bbae9d62fe633149 100644 --- a/deploy_checkit_tiff/add_dnx_mappings/add_dnx_mappings.pl +++ b/deploy_checkit_tiff/add_dnx_mappings/add_dnx_mappings.pl @@ -31,6 +31,7 @@ my $institution; my $plugin_name = 'SLUBTechnicalMetadataExtractorCheckItTiffPlugin'; my $classification_group = 'Image (Mix)'; my $driver; +my $step; GetOptions( "rosetta_host=s{1}" => \$host, @@ -40,7 +41,8 @@ GetOptions( "password=s{1}" => \$passwd, "institution=s{1}" => \$institution, "plugin_name:s{1}" => \$plugin_name, - "classification_group:s{1}" => \$classification_group + "classification_group:s{1}" => \$classification_group, + "step=i" => \$step, ) or die("Error in command line arguments\n"); die("invalid/missing argument: --rosetta_host") unless $host; die("invalid/missing argument: --protocol") unless $protocol; @@ -167,7 +169,7 @@ sub join_dnx_property_to_classification_group ($dnx_property) { sub extractors_add_mapping ($dnx_property, $exiftool_property) { say "try to add extractor mapping"; # go to custom extractor page (local format library) - $driver->get("$protocol://$host:${ui_port}//mng/action/pageAction.page_xml.page_extractors_list.xml.do?pageBean.deploymentMode=BUNDLED&pageViewMode=Edit&pageBean.currentUserMode=LOCAL&RenewBean=true&menuKey=com.exlibris.dps.wrk.general.menu.Preservation.AdvancedPreservationActivities.mngLibraryLOCAL.mngLibraryHeader.Extractors.InnerMenu&menuKey=com.exlibris.dps.wrk.general.menu.Preservation.AdvancedPreservationActivities.mngLibraryLOCAL.mngLibraryHeader.Extractors.InnerMenu&backUrl="); + $driver->get("$protocol://$host:${ui_port}/mng/action/pageAction.page_xml.page_extractors_list.xml.do?pageBean.deploymentMode=BUNDLED&pageViewMode=Edit&pageBean.currentUserMode=LOCAL&RenewBean=true&menuKey=com.exlibris.dps.wrk.general.menu.Preservation.AdvancedPreservationActivities.mngLibraryLOCAL.mngLibraryHeader.Extractors.InnerMenu&menuKey=com.exlibris.dps.wrk.general.menu.Preservation.AdvancedPreservationActivities.mngLibraryLOCAL.mngLibraryHeader.Extractors.InnerMenu"); $driver->pause(); $driver->find_element("Custom", "link")->click; # filter by plugin name @@ -221,24 +223,30 @@ printf colored("Step 2 of 7: change to global format library \n", 'bold green'); change_to_global_format_library(); # add dnx property -printf colored("Step 3 of 7: add dnx property \n", 'bold green'); -foreach my $exiftool_property (sort keys %exiftool2dnx) { - my $dnx_property = $exiftool2dnx{ $exiftool_property }; - add_dnx_property($dnx_property, "$dnx_property <- Exiftool '$exiftool_property'"); +if (!defined $step or $step == 3) { + printf colored("Step 3 of 7: add dnx property \n", 'bold green'); + foreach my $exiftool_property (sort keys %exiftool2dnx) { + my $dnx_property = $exiftool2dnx{ $exiftool_property }; + add_dnx_property($dnx_property, "$dnx_property <- Exiftool '$exiftool_property'"); + } } # include dnx property to classification group -printf colored("Step 4 of 7: join dnx property to classification group \n", 'bold green'); -foreach my $exiftool_property (sort keys %exiftool2dnx) { - my $dnx_property = $exiftool2dnx{ $exiftool_property }; - join_dnx_property_to_classification_group($dnx_property); +if (!defined $step or $step == 4) { + printf colored("Step 4 of 7: join dnx property to classification group \n", 'bold green'); + foreach my $exiftool_property (sort keys %exiftool2dnx) { + my $dnx_property = $exiftool2dnx{ $exiftool_property }; + join_dnx_property_to_classification_group($dnx_property); + } } # add mapping -printf colored("Step 5 of 7: extractors add mapping \n", 'bold green'); -foreach my $exiftool_property (sort keys %exiftool2dnx) { - my $dnx_property = $exiftool2dnx{ $exiftool_property }; - extractors_add_mapping($dnx_property, $exiftool_property); +if (!defined $step or $step == 5) { + printf colored("Step 5 of 7: extractors add mapping \n", 'bold green'); + foreach my $exiftool_property (sort keys %exiftool2dnx) { + my $dnx_property = $exiftool2dnx{ $exiftool_property }; + extractors_add_mapping($dnx_property, $exiftool_property); + } } # change to local format library