Ignore:
Timestamp:
2006-08-01T09:50:34+12:00 (18 years ago)
Author:
kjdon
Message:

sort_metadata renamed to store_output_info_reference, and modified the sortmeta stuff to use a comma separated list

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugouts/BasPlugout.pm

    r12330 r12363  
    388388}
    389389
    390 sub sort_metadata{
     390sub store_output_info_reference {
    391391    my $self = shift (@_);
    392392    my ($doc_obj) = @_;
    393393
    394     # do the sortmeta thing       
    395     my $metadata = $doc_obj->get_metadata_element($doc_obj->get_top_section(),$self->{'sortmeta'})
    396       if defined $self->{'sortmeta'};
    397    
    398     if ($metadata) {
    399     # do remove prefix/suffix
    400     $metadata =~ s/^$self->{'removeprefix'}// if defined $self->{'removeprefix'};         
    401     $metadata =~ s/$self->{'removesuffix'}$// if defined $self->{'removesuffix'};
    402        
    403     $metadata = &sorttools::format_metadata_for_sorting($self->{'sortmeta'}, $metadata, $doc_obj);
    404     }
    405 
    406394    my $output_info = $self->{'output_info'};
    407    
     395    my $metaname = $self->{'sortmeta'};
     396    if (!defined $metaname || $metaname !~ /\S/) {
     397    $output_info->add_info($doc_obj->get_OID(),$self->{'short_doc_file'}, undef, "");
     398    return;
     399    }
     400   
     401    my $metadata = "";
     402    my $top_section = $doc_obj->get_top_section();
     403   
     404    my @commameta_list = split(/,/, $metaname);
     405    foreach my $cmn (@commameta_list) {
     406    my $meta = $doc_obj->get_metadata_element($top_section, $cmn);
     407    if ($meta) {
     408        # do remove prefix/suffix - this will apply to all values
     409        $meta =~ s/^$self->{'removeprefix'}// if defined $self->{'removeprefix'};         
     410        $meta =~ s/$self->{'removesuffix'}$// if defined $self->{'removesuffix'};
     411        $meta = &sorttools::format_metadata_for_sorting($cmn, $meta, $doc_obj);
     412        $metadata .= $meta if ($meta);
     413    }
     414    }
     415
    408416    # store reference in the output_info     
    409417    $output_info->add_info($doc_obj->get_OID(),$self->{'short_doc_file'}, undef, $metadata);
Note: See TracChangeset for help on using the changeset viewer.