--- foxridge-archiver/makemeta-lib.pl 2006/05/16 18:58:21 1.8 +++ foxridge-archiver/makemeta-lib.pl 2006/05/16 19:56:32 1.9 @@ -10,7 +10,7 @@ use MPIWGStor; $|=1; # program version -my $version = "0.2.3 (16.5.2006 ROC)"; +my $version = "0.2.4 (16.5.2006 ROC)"; my $help = "use: makemeta-lib [options] file.xml options: @@ -20,6 +20,7 @@ options: -cw-mode mode for copying einstein_cw archive documents -digifiles-mode mode for copying files from digifiles -map-file=mapfile.xml digilib mapping file (for digifiles mode) + -access=free adds free access tag (use access=mpiwg for restricted access) "; logger("INFO", "makemeta-lib $version"); @@ -153,6 +154,9 @@ logger('DEBUG', "map_file_name: $map_fil my $mapping_doc; my $mapping_root; +# access type +my $access_type = (exists $$args{'access'}) ? $$args{'access'} : ""; + # index.meta namespace (not really implemented!) my $namespace = ""; @@ -276,7 +280,7 @@ sub find_permanent_dir { my $online_base = '/mpiwg/online/permanent'; my $src_dir = find_online_dir($input_node, $online_base, 'pageimg'); my $dest_id = sstrip($input_node->findvalue("fm:$online_id_field")); - if (! $dest_id) { + if ((! $dest_id)||(! $src_dir)) { logger('ERROR', "no ID field for online permanent entry"); $errcnt++; return; @@ -455,7 +459,16 @@ sub process_fm_entry { # derived-from if ($derived_from) { create_text_path('derived-from/archive-path', $derived_from, $index_root, $namespace); - } + } + # access + if ($access_type) { + if ($access_type eq "free") { + create_element_path('access-conditions/access@type=free', $index_root, $namespace); + } else { + my $acc_tag = create_element_path('access-conditions/access@type=institution', $index_root, $namespace); + create_text_path('name', $access_type, $acc_tag, $namespace); + } + } # convert bib entries my $cnt = convert_bib($input_node, $index_root, $index_doc);