Changeset 9053


Ignore:
Timestamp:
2005-02-16T11:34:40+13:00 (19 years ago)
Author:
kjdon
Message:

changed the description tags metadata handling again. now uses an accumulate attribute to determine whether to set or add the metadata

File:
1 edited

Legend:

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

    r8914 r9053  
    291291        } elsif ($tag =~ /^Metadata name=$quot(.*?)$quot/s) {
    292292            my $metaname = $1;
     293            my $accumulate = $tag =~ /mode=${quot}accumulate${quot}/ ? 1 : 0;
    293294            $comment =~ s/^(.*?)$lt\/Metadata$gt//s;
    294295            my $metavalue = $1;
     
    302303            $metavalue =~ s/<[^>]+>//sg;
    303304            $metavalue =~ s/\s+/ /sg;
    304             $doc_obj->add_utf8_metadata($cursection, $metaname, $metavalue);
     305            if ($accumulate) {
     306            $doc_obj->add_utf8_metadata($cursection, $metaname, $metavalue);
     307            } else {
     308            $doc_obj->set_utf8_metadata_element($cursection, $metaname, $metavalue);   
     309            }
    305310        } elsif ($tag eq "Description" || $tag eq "/Description") {
    306311            # do nothing with containing Description tags
Note: See TracChangeset for help on using the changeset viewer.