Changeset 13420


Ignore:
Timestamp:
2006-12-05T16:25:07+13:00 (17 years ago)
Author:
kjdon
Message:

added a option to add a table of metadata as the documnet text, rather than the dummy string 'this document has no text'

File:
1 edited

Legend:

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

    r13269 r13420  
    5656    'type' => "string",
    5757    'deft' => "",
    58     'reqd' => "no" } ];
     58    'reqd' => "no" },
     59      { 'name' => "add_metadata_as_text",
     60    'desc' => "{NULPlug.add_metadata_as_text}",
     61    'type' => "flag" },
     62      { 'name' => "remove_namespace_for_text",
     63    'desc' => "{NULPlug.remove_namespace_for_text}",
     64    'type' => "flag" }
     65      ];
    5966
    6067my $options = { 'name'     => "NULPlug",
     
    121128    $doc_obj->add_metadata ($doc_obj->get_top_section(), $assoc_field, $file);
    122129   
    123     #create an empty text string so we don't break downstream plugins
    124     my $text = &gsprintf::lookup_string("{BasPlug.dummy_text}",1);
    125    
    126130    # include any metadata passed in from previous plugins
    127131    my $section = $doc_obj->get_top_section();
    128132    $self->extra_metadata ($doc_obj, $section, $metadata);
    129133   
     134    # format the metadata passed in (presumably from metadata.xml)
     135    my $text = "";
     136    if ($self->{'add_metadata_as_text'}) {
     137    $text = &metadatautil::format_metadata_as_table($metadata, $self->{'remove_namespace_for_text'});
     138    } else {
     139    #create an empty text string so we don't break downstream plugins
     140    $text = &gsprintf::lookup_string("{BasPlug.dummy_text}",1);
     141    }
    130142    $self->title_fallback($doc_obj,$section,$file);
    131143   
Note: See TracChangeset for help on using the changeset viewer.