Changeset 245


Ignore:
Timestamp:
1999-04-26T11:54:33+12:00 (25 years ago)
Author:
sjboddie
Message:

Small changes to allow metadata to be passed to plugins from
mgbuilder.pm - now may pass classifytype metadata

Location:
trunk/gsdl/perllib/plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/ArcPlug.pm

    r230 r245  
    4747    # process each file
    4848    foreach $subfile (@$file_list) {
    49         # note: metadata is not carried on to the next level
     49####        # note: metadata is not carried on to the next level - why ??? - I changed this - Stefan.
    5050        my $tmp = &util::filename_cat ($file, $subfile->[0]);
    5151        next if $tmp eq $file;
    52         &plugin::read ($pluginfo, $base_dir, $tmp, {}, $processor);
     52        &plugin::read ($pluginfo, $base_dir, $tmp, $metadata, $processor);
    5353    }
    5454   
  • trunk/gsdl/perllib/plugins/GMLPlug.pm

    r139 r245  
    121121    $doc_obj->delete_metadata($doc_obj->get_top_section(), "gsdlassocfile");
    122122
     123    # add metadata
     124    foreach $field (keys(%$metadata)) {
     125    # $metadata->{$field} may be an array reference
     126    if (ref ($metadata->{$field}) eq "ARRAY") {
     127        map {
     128        $doc_obj->add_metadata ($doc_obj->get_top_section(), $field, $_);
     129        } @{$metadata->{$field}};
     130    } else {
     131        $doc_obj->add_metadata ($doc_obj->get_top_section(), $field, $metadata->{$field});
     132    }
     133    }
     134
     135
    123136    # assume the document has an OID
    124137
Note: See TracChangeset for help on using the changeset viewer.