# HG changeset patch # User casties # Date 1165860504 -3600 # Node ID af4323868086aabd9994bd1e00436959bf48bd34 # Parent 27f2733299302ed45afd7316104994c3feceaabe added production-comment, derived-from and access handling diff -r 27f273329930 -r af4323868086 makemeta-vlp.pl --- a/makemeta-vlp.pl Mon Dec 11 19:07:43 2006 +0100 +++ b/makemeta-vlp.pl Mon Dec 11 19:08:24 2006 +0100 @@ -10,7 +10,7 @@ $|=1; # program version -my $version = "0.2.3 (27.6.2006 ROC)"; +my $version = "0.2.4 (5.12.2006 ROC)"; my $help = "use: makemeta-vlp [options] file.xml options: @@ -19,6 +19,7 @@ -replace replace existing index files -online-mode mode for creating online/permanent files -archive-mode mode for creating archive/data files + -access=free adds free access tag for online-mode "; logger("INFO", "makemeta-vlp $version"); @@ -27,7 +28,9 @@ # generic mappings at top level my %gen_map = ( - 'Custom2_Language' => 'meta/lang' + 'Custom2_Language' => 'meta/lang', + 'ProductionComment' => 'meta/image-acquisition/production-comment', + 'derivedFrom' => 'derived-from/archive-path' ); # sub type switch tag my %type_map = ( @@ -219,6 +222,9 @@ my $archive_mode = (exists $$args{'archive-mode'}) ? $$args{'archive-mode'} : 0; logger('DEBUG', "archive_mode: $archive_mode"); +# access type +my $access_type = (exists $$args{'access'}) ? $$args{'access'} : ""; + # index.meta namespace (not really implemented!) my $namespace = ""; @@ -266,7 +272,7 @@ sub find_permanent_dir { my ($input_node) = @_; - my $online_base = '/mpiwg/online/permanent'; + my $online_base = $lib_online_dir; my $dest_id = sstrip($input_node->findvalue("fm:$arch_id_field")); if (! $dest_id) { logger('ERROR', "no ID field for online permanent entry"); @@ -407,14 +413,19 @@ create_text_path('meta/acquisition/date', stime(time), $index_root, $namespace); create_text_path('meta/acquisition/provider/provider-id', 'vlp', $index_root, $namespace); create_text_path('meta/acquisition/provider/address', 'Max Planck Institute for the History of Science', $index_root, $namespace); - # image acquisition - create_text_path('meta/image-acquisition/device', 'Flatbed Scanner' , $index_root, $namespace); - create_text_path('meta/image-acquisition/image-type', 'Greyscale' , $index_root, $namespace); - create_text_path('meta/image-acquisition/production-comment', 'Raw scans in \'raw\' folder, cleaned pages in \'pages\' folder.' , $index_root, $namespace); } # media create_text_path('media-type', 'image', $index_root, $namespace); create_text_path('meta/content-type', 'scanned document', $index_root, $namespace); + # access + if ($access_type) { + if ($access_type eq "free") { + create_element_path('meta/access-conditions/access@type=free', $index_root, $namespace); + } else { + my $acc_tag = create_element_path('meta/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);