Changeset 21760 for main/trunk


Ignore:
Timestamp:
2010-03-03T11:09:07+13:00 (14 years ago)
Author:
kjdon
Message:

srclink now generated dynamically at runtime. instead of storing srclink metadata, we store srclink_file metadata, which can be a value (doc.doc) or a metadata format element (eg [SourceFile]).

Location:
main/trunk/greenstone2/perllib/plugins
Files:
9 edited

Legend:

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

    r21742 r21760  
    498498    # We use set instead of add here because we only want one value
    499499    $doc_obj->set_utf8_metadata_element($cursection, "FileFormat", $file_type);
    500     my $doclink = "<a href=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/doc.$doc_ext\">";
     500    my $srclink_filename = "doc.$doc_ext";
     501    #my $doclink = "<a href=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/doc.$doc_ext\">";
    501502    if ($self->{'keep_original_filename'} == 1) {
    502     $doclink = "<a href=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/[SourceFile]\">";
    503     }
    504     $doc_obj->add_utf8_metadata ($cursection, "srclink",  $doclink);
     503    $srclink_filename = "[SourceFile]";
     504    #$doclink = "<a href=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/[SourceFile]\">";
     505    }
     506    #$doc_obj->add_utf8_metadata ($cursection, "srclink",  $doclink);
    505507    $doc_obj->add_utf8_metadata ($cursection, "srcicon",  "_icon".$doc_ext."_");
    506     $doc_obj->add_utf8_metadata ($cursection, "/srclink", "</a>");
    507 
     508    #$doc_obj->add_utf8_metadata ($cursection, "/srclink", "</a>");
     509    $doc_obj->add_utf8_metadata ($cursection, "srclink_file", $srclink_filename);
    508510    return 1;
    509511}
  • main/trunk/greenstone2/perllib/plugins/ConvertToRogPlugin.pm

    r21742 r21760  
    444444    $doc_obj->associate_file($filename, "doc.$doc_ext", undef, $cursection);
    445445
    446     my $doclink = "<a href=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/doc.$doc_ext\">";
    447     $doc_obj->add_utf8_metadata ($cursection, "srclink",  $doclink);
     446    #my $doclink = "<a href=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/doc.$doc_ext\">";
     447    #$doc_obj->add_utf8_metadata ($cursection, "srclink",  $doclink);
     448    $doc_obj->add_metadata ($section, "srclink_file", "doc.$doc_ext");
    448449    $doc_obj->add_utf8_metadata ($cursection, "srcicon",  "_icon".$doc_ext."_");
    449     $doc_obj->add_utf8_metadata ($cursection, "/srclink", "</a>");
     450    #$doc_obj->add_utf8_metadata ($cursection, "/srclink", "</a>");
    450451    return $ret_val;
    451452}
  • main/trunk/greenstone2/perllib/plugins/ImageConverter.pm

    r21722 r21760  
    244244
    245245
    246     $doc_obj->add_metadata ($section, "srclink", "<a href=\"_httpprefix_/collect/[collection]/index/assoc/$assocfilemeta/[Image]\">");
    247     $doc_obj->add_metadata ($section, "/srclink", "</a>");
     246    #$doc_obj->add_metadata ($section, "srclink", "<a href=\"_httpprefix_/collect/[collection]/index/assoc/$assocfilemeta/[Image]\">");
     247    #$doc_obj->add_metadata ($section, "/srclink", "</a>");
     248    $doc_obj->add_metadata ($section, "srclink_file", "[Image]");
    248249    $doc_obj->add_metadata ($section, "srcicon", "<img src=\"_httpprefix_/collect/[collection]/index/assoc/$assocfilemeta/[Image]\" width=\"[ImageWidth]\" height=\"[ImageHeight]\">");
    249250
  • main/trunk/greenstone2/perllib/plugins/ImagePlugin.pm

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

    r18320 r21760  
    266266    $doc_obj->add_metadata ($section, "FileFormat", "MP3");
    267267   
    268     $doc_obj->add_metadata ($section, "srclink",
    269                 "<a href=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/[srcurl]\">");
     268    #$doc_obj->add_metadata ($section, "srclink",
     269#               "<a href=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/[srcurl]\">");
    270270    $doc_obj->add_metadata ($section, "srcicon", "_iconmp3_");
    271     $doc_obj->add_metadata ($section, "/srclink", "</a>");
    272 
     271    #$doc_obj->add_metadata ($section, "/srclink", "</a>");
     272    $doc_obj->add_metadata ($section, "srclink_file", "[srcurl]");
    273273    my $applet_metadata = $self->{'applet_metadata'};
    274274    if (defined $applet_metadata && $applet_metadata ) {
  • main/trunk/greenstone2/perllib/plugins/OggVorbisPlugin.pm

    r21746 r21760  
    137137
    138138    $doc_obj->add_metadata ($top_section, "FileFormat", "OggVorbis");
    139     $doc_obj->add_metadata ($top_section, "srclink", "<a href=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/[SourceFile]\">");
    140     $doc_obj->add_metadata ($top_section, "/srclink", "</a>");
     139    #$doc_obj->add_metadata ($top_section, "srclink", "<a href=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/[SourceFile]\">");
     140    #$doc_obj->add_metadata ($top_section, "/srclink", "</a>");
     141    $doc_obj->add_metadata ($section, "srclink_file", "[SourceFile]");
    141142    $doc_obj->add_metadata ($top_section, "srcicon", "_iconogg_");
    142143
  • main/trunk/greenstone2/perllib/plugins/OpenDocumentPlugin.pm

    r21742 r21760  
    262262
    263263    #setup to doclink thingi
    264     my $doclink = "<a href=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/$file_only\">";
    265     $doc_obj->add_utf8_metadata ("", "srclink",  $doclink);
     264    #my $doclink = "<a href=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/$file_only\">";
     265    #$doc_obj->add_utf8_metadata ("", "srclink",  $doclink);
     266    $doc_obj->add_metadata ($section, "srclink_file", "[SourceFile]");
    266267    $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\">");
    267     $doc_obj->add_utf8_metadata ("", "/srclink", "</a>");
     268    #$doc_obj->add_utf8_metadata ("", "/srclink", "</a>");
    268269    $self->set_Source_metadata($doc_obj, $file_only);
    269270     $doc_obj->set_utf8_metadata_element("", "FileSize", (-s $filename));
  • main/trunk/greenstone2/perllib/plugins/RealMediaPlugin.pm

    r21746 r21760  
    108108    $doc_obj->add_metadata($top_section, "FileFormat", "RealMedia");
    109109
    110     $doc_obj->add_metadata($top_section, "srclink", "<a href=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/[SourceFile]\">");
    111     $doc_obj->add_metadata($top_section, "/srclink", "</a>");
     110    #$doc_obj->add_metadata($top_section, "srclink", "<a href=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/[SourceFile]\">");
     111    #$doc_obj->add_metadata($top_section, "/srclink", "</a>");
     112    $doc_obj->add_metadata ($top_section, "srclink_file", "[SourceFile]");
    112113    $doc_obj->add_metadata($top_section, "srcicon", "_iconrmvideo_");
    113114
  • main/trunk/greenstone2/perllib/plugins/UnknownPlugin.pm

    r18689 r21760  
    146146    $doc_obj->add_utf8_metadata ($section, $assoc_field, $doc_obj->get_source()); # Source metadata is already in utf8
    147147
    148     $doc_obj->add_metadata ($section, "srclink",
    149                 "<a href=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/[SourceFile]\">");
     148    #$doc_obj->add_metadata ($section, "srclink",
     149#               "<a href=\"_httpprefix_/collect/[collection]/index/assoc/[assocfilepath]/[SourceFile]\">");
     150    $doc_obj->add_metadata ($section, "srclink_file", "[SourceFile]");
    150151    $doc_obj->add_metadata ($section, "srcicon", "_".$self->{'srcicon'}."_");
    151     $doc_obj->add_metadata ($section, "/srclink", "</a>");
     152    #$doc_obj->add_metadata ($section, "/srclink", "</a>");
    152153   
    153154    # we have no text - add dummy text and NoText metadata
Note: See TracChangeset for help on using the changeset viewer.