Ignore:
Timestamp:
2012-01-20T16:22:35+13:00 (12 years ago)
Author:
ak19
Message:

First commit to do with Greenstone's support for RSS. Committing Dr Bainbridge's code which was already working for windows. This has now been tested on Linux, where it can be got to work with changes to zextra.dm and base.dm and if the rss-items.rdf file generated by the update to BasePlugout is moved to the index folder). The next set of commits will make the way rssaction.cpp accesses the rss-items.rdf file independent of where the GS server is located, with changes to the protocol class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugouts/BasePlugout.pm

    r24829 r24958  
    805805    ##print STDERR "*** To set in db: \n\t$doc_db\n\t$oid\n\t$doc_db_text\n";
    806806
     807    if (($oid_files->{'index-status'} eq "I") || ($oid_files->{'index-status'} eq "R")) {
     808    my $top_section = $doc_obj->get_top_section();
     809
     810    my $dc_titles = $doc_obj->get_metadata($top_section,"dls.Title");
     811    my $dc_title = join("; ", @$dc_titles);
     812
     813    if ($oid_files->{'index-status'} eq "R") {
     814        $dc_title .= " (Updated)";
     815    }
     816
     817    my $rss_filename = &util::filename_cat($output_dir,"rss-items.rdf");
     818    if (open(RSSOUT,">>$rss_filename")) {
     819        print RSSOUT "<item>\n";
     820        print RSSOUT "   <title>$dc_title</title>\n";
     821        print RSSOUT "   <link>_httpdomain__httpcollection_/document/$oid</link>\n";
     822        print RSSOUT "</item>\n";
     823        close(RSSOUT);
     824    }
     825    else {
     826        print STDERR "**** Failed to open $rss_filename\n!$\n";
     827    }
     828
     829
     830    }
     831
    807832    $oid_files->{'doc-file'} = [ $oid_files->{'doc-file'} ];
    808833    $oid_files->{'index-status'} = [ $oid_files->{'index-status'} ];
Note: See TracChangeset for help on using the changeset viewer.