Re: [greenstone-devel] accumulated metadata in HTMLPlug

From Katherine Don
DateFri, 17 Dec 2004 14:22:56 +1300
Subject Re: [greenstone-devel] accumulated metadata in HTMLPlug
In-Reply-To (41C1E5EC-1000907-gmx-net)
Hi Jens

this looks fine - there is no reason why it shouldn't do this - it has
obviously just been overlooked until now.
I'll add the fix in and it will be available in the next release.

Thanks for the patch :-)

Cheers,
Katherine

jens wille wrote:
> hi!
>
> i was wondering if it could be possible to assign multiple metadata
> values in HTMLPlug just as with metadata.xml's "mode=accumulate". so
> i just modified HTMLPlug.pm a bit and it worked fine - as far as i
> can tell.
>
> basically, i use add_utf8_metadata instead of
> set_utf8_metadata_element in process sub if we're in "merge" mode -
> so i just wanted to ask if there are any objections against doing
> this, i.e. replacing set_utf8_metadata_element by add_utf8_metadata.
>
> or are there even objections against assigning multiple metadata
> values in HTMLPlug at all? it's just because you didn't implement it
> yet, and that just leaves me a bit doubtful ;-)
>
> anyway, here are my changes to HTMLPlug.pm:
>
> ------------------------------- snip -------------------------------
>
> /usr/local/gsdl/perllib/plugins> diff HTMLPlug.pm HTMLPlug.pm~
> 224,227c224,225
> < } elsif ($tag =~ /^Metadata name=$quot(.*?)$quot(?:
> mode=$quot(.*?)$quot)/s) {
> < # allow multiple metadata values: mode="accumulate"
> < my $metaname = $1;
> < my $accumulate = $2 && $2 eq 'accumulate' ? 1 : 0;
> ---
> > } elsif ($tag =~ /^Metadata name=$quot(.*?)$quot/s) {
> > my $metaname = $1;
> 239,240c237
> < if ($accumulate) { $doc_obj->add_utf8_metadata($cursection,
> $metaname, $metavalue); }
> < else { $doc_obj->set_utf8_metadata_element($cursection,
> $metaname, $metavalue); }
> ---
> > $doc_obj->set_utf8_metadata_element($cursection, $metaname,
> $metavalue);
>
> ------------------------------- snip -------------------------------
>
> regards
>
> jens
>
> _______________________________________________
> greenstone-devel mailing list
> greenstone-devel&#64;list.scms.waikato.ac.nz
> https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-devel
>