Ignore:
Timestamp:
2010-03-17T13:01:20+13:00 (12 years ago)
Author:
kjdon
Message:

extended HTMLPlugin's metadata_field_separator option to Word and StructuredHTML plugins

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/StructuredHTMLPlugin.pm

    r19993 r21801  
    365365    return if (!defined $textref);
    366366
     367    my $separator = $self->{'metadata_field_separator'};
     368    if ($separator eq "") {
     369    undef $separator;
     370    }
    367371    # metadata fields to extract/save. 'key' is the (lowercase) name of the
    368372    # html meta, 'value' is the metadata name for greenstone to use
     
    395399        #print $outhandle " extracted \"$tag\" metadata \"$value\"\n"
    396400        #    if ($self->{'verbosity'} > 2);
    397         $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), $tag, $value);
     401        if (defined $separator) {
     402            my @values = split($separator, $value);
     403            foreach my $v (@values) {
     404            $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), $tag, $v) if $v =~ /\S/;
     405            }
     406        }
     407        else {
     408            $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), $tag, $value);
     409        }
    398410        }
    399411    }
Note: See TracChangeset for help on using the changeset viewer.