Ignore:
Timestamp:
2011-03-28T10:54:36+13:00 (13 years ago)
Author:
sjm84
Message:

Phase four of commiting the files changed to extend the DSpace exporting capabilities to include more than just dublin core metadata

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/doc.pm

    r23562 r23827  
    842842}
    843843
     844sub get_metadata_hashmap {
     845    my $self = shift (@_);
     846    my ($section, $opt_namespace) = @_;
     847   
     848    my $section_ptr = $self->_lookup_section($section);
     849    if (!defined $section_ptr) {
     850            print STDERR "doc::get_metadata couldn't find section ",
     851            $section, "\n";
     852            return;
     853        }
     854
     855    my $metadata_hashmap = {};
     856    foreach my $data (@{$section_ptr->{'metadata'}}) {
     857            my $metaname = $data->[0];
     858         
     859            if ((!defined $opt_namespace) || ($metaname =~ m/^$opt_namespace\./)) {
     860                if (!defined $metadata_hashmap->{$metaname}) {
     861                    $metadata_hashmap->{$metaname} = [];
     862                  }
     863                my $metaval_list = $metadata_hashmap->{$metaname};
     864                push(@$metaval_list, $data->[1]);
     865              }
     866          }
     867   
     868    return $metadata_hashmap;
     869}
     870
    844871# returns a list of the form [[field,value],[field,value],...]
    845872sub get_all_metadata {
Note: See TracChangeset for help on using the changeset viewer.