Changeset 22663

Show
Ignore:
Timestamp:
18.08.2010 10:50:18 (9 years ago)
Author:
mdewsnip
Message:

Changed "srclink_file" metadata to always contain the filename, instead of referencing another metadata element. This is so the C++ code can escape underscores in the filename values correctly.

Location:
main/trunk/greenstone2/perllib/plugins
Files:
10 modified

Legend:

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

    r22652 r22663  
    11401140     
    11411141    $doc_obj->associate_file($filename, $assocfilename, undef, $cursection); 
    1142     $doc_obj->add_utf8_metadata ($cursection, "srclink_file", "[SourceFile]"); 
     1142    $doc_obj->add_utf8_metadata ($cursection, "srclink_file", $doc_obj->get_sourcefile()); 
    11431143} 
    11441144 
  • main/trunk/greenstone2/perllib/plugins/ConvertBinaryFile.pm

    r22654 r22663  
    486486    my $srclink_filename = "doc.$doc_ext"; 
    487487    if ($self->{'keep_original_filename'} == 1) { 
    488     $srclink_filename = "[SourceFile]"; 
     488    $srclink_filename = $doc_obj->get_sourcefile(); 
    489489    } 
    490490    $doc_obj->add_utf8_metadata ($cursection, "srcicon",  "_icon".$doc_ext."_");  
  • main/trunk/greenstone2/perllib/plugins/ImageConverter.pm

    r22658 r22663  
    243243    } 
    244244 
    245     $doc_obj->add_metadata ($section, "srclink_file", "[Image]");  
     245    $doc_obj->add_metadata ($section, "srclink_file", $url_to_filename_no_path); 
    246246    $doc_obj->add_metadata ($section, "srcicon", "<img src=\"_httpprefix_/collect/[collection]/index/assoc/$assocfilemeta/[srclink_file]\" width=\"[ImageWidth]\" height=\"[ImageHeight]\">"); 
    247247 
  • main/trunk/greenstone2/perllib/plugins/ImagePlugin.pm

    r22658 r22663  
    131131    $doc_obj->associate_file($filename_full_path, $assoc_file, "", $section); 
    132132 
    133     $doc_obj->add_metadata ($section, "srclink_file", "[SourceFile]");  
     133    $doc_obj->add_metadata ($section, "srclink_file", $doc_obj->get_sourcefile());  
    134134    # We don't know the size of the image, but the browser should display it at full size 
    135135    $doc_obj->add_metadata ($section, "srcicon", "<img src=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/[srclink_file]\">"); 
  • main/trunk/greenstone2/perllib/plugins/MP3Plugin.pm

    r22655 r22663  
    267267     
    268268    $doc_obj->add_metadata ($section, "srcicon", "_iconmp3_"); 
    269     $doc_obj->add_metadata ($section, "srclink_file", "[srcurl]");  
     269    $doc_obj->add_metadata ($section, "srclink_file", $assoc_url); 
    270270    my $applet_metadata = $self->{'applet_metadata'}; 
    271271    if (defined $applet_metadata && $applet_metadata ) { 
  • main/trunk/greenstone2/perllib/plugins/MediainfoOGVPlugin.pm

    r22656 r22663  
    145145    $doc_obj->add_utf8_metadata ($section, $assoc_field, $doc_obj->get_source()); # Source metadata is already in utf8 
    146146 
    147     $doc_obj->add_metadata ($section, "srclink_file", "[SourceFile]");  
     147    $doc_obj->add_metadata ($section, "srclink_file", $doc_obj->get_sourcefile()); 
    148148    $doc_obj->add_metadata ($section, "srcicon", "_iconogg_"); 
    149149 
  • main/trunk/greenstone2/perllib/plugins/OggVorbisPlugin.pm

    r22655 r22663  
    137137 
    138138    $doc_obj->add_metadata ($top_section, "FileFormat", "OggVorbis"); 
    139     $doc_obj->add_metadata ($top_section, "srclink_file", "[SourceFile]");  
     139    $doc_obj->add_metadata ($top_section, "srclink_file", $doc_obj->get_sourcefile()); 
    140140    $doc_obj->add_metadata ($top_section, "srcicon", "_iconogg_"); 
    141141 
  • main/trunk/greenstone2/perllib/plugins/OpenDocumentPlugin.pm

    r22655 r22663  
    262262 
    263263    #setup to doclink thingi 
    264     $doc_obj->add_metadata ("", "srclink_file", "[SourceFile]");  
     264    $doc_obj->add_metadata ("", "srclink_file", $doc_obj->get_sourcefile()); 
    265265    $doc_obj->add_utf8_metadata ("", "srcicon",  "<img border=\"0\" align=\"absmiddle\" src=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/thumbnail.png\" alt=\"View the Open document\" title=\"View the Open document\">");  
    266266    $self->set_Source_metadata($doc_obj, $file_only); 
  • main/trunk/greenstone2/perllib/plugins/RealMediaPlugin.pm

    r22655 r22663  
    108108    $doc_obj->add_metadata($top_section, "FileFormat", "RealMedia"); 
    109109 
    110     $doc_obj->add_metadata ($top_section, "srclink_file", "[SourceFile]");  
     110    $doc_obj->add_metadata ($top_section, "srclink_file", $doc_obj->get_sourcefile()); 
    111111    $doc_obj->add_metadata($top_section, "srcicon", "_iconrmvideo_"); 
    112112 
  • main/trunk/greenstone2/perllib/plugins/UnknownPlugin.pm

    r22655 r22663  
    145145    $doc_obj->add_metadata ($section, "MimeType", $mime_type); 
    146146    $doc_obj->add_utf8_metadata ($section, $assoc_field, $doc_obj->get_source()); # Source metadata is already in utf8  
    147     $doc_obj->add_metadata ($section, "srclink_file", "[SourceFile]");  
     147    $doc_obj->add_metadata ($section, "srclink_file", $doc_obj->get_sourcefile()); 
    148148    $doc_obj->add_metadata ($section, "srcicon", "_".$self->{'srcicon'}."_"); 
    149149