Ignore:
Timestamp:
2008-02-12T15:18:32+13:00 (16 years ago)
Author:
davidb
Message:

local variable $top_section to tidy up setting metadata code

File:
1 edited

Legend:

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

    r14117 r14962  
    194194    # create a new document
    195195    my $doc_obj = new doc ($filename, "indexed_doc");
     196    my $top_section = $doc_obj->get_top_section();
     197
    196198    $doc_obj->set_OIDtype ($processor->{'OIDtype'}, $processor->{'OIDmetadata'});   
    197     $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Plugin", "$self->{'plugin_type'}");
    198     $doc_obj->add_metadata($doc_obj->get_top_section(), "Source", &ghtml::dmsafe($file)); # set the filename as Source metadata to be consistent with other plugins
    199     $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "FileSize", (-s $filename));
     199    $doc_obj->add_utf8_metadata($top_section, "Plugin", "$self->{'plugin_type'}");
     200    $doc_obj->add_metadata($top_section, "Source", $file); # set the filename as Source metadata to be consistent with other plugins
     201    $doc_obj->add_utf8_metadata($top_section, "FileSize", (-s $filename));
    200202
    201203    # URL metadata (even invalid ones) are used to support internal
     
    203205
    204206    my $web_url = "http://$file";
    205     $doc_obj->add_metadata($doc_obj->get_top_section(), "URL", $web_url);
     207    $doc_obj->add_metadata($top_section, "URL", $web_url);
    206208
    207209
Note: See TracChangeset for help on using the changeset viewer.