fixing the freshmeat feed link; moving to rss v2 from atom for feeds, to make feed...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 20 Mar 2008 01:40:07 +0000 (01:40 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 20 Mar 2008 01:40:07 +0000 (01:40 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@9092 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm
Open-ILS/web/opac/skin/default/js/myopac.js

index 2450ab7..4c2368a 100644 (file)
@@ -746,8 +746,8 @@ sub bookbag_feed {
        $feed->creator($host);
        $feed->update_ts(gmtime_ISO8601());
 
-       $feed->link(rss => $base . "/rss2-full/$id" => 'application/rss+xml');
-       $feed->link(alternate => $base . "/atom-full/$id" => 'application/atom+xml');
+       $feed->link(alternate => $base . "/rss2-full/$id" => 'application/rss+xml');
+       $feed->link(atom => $base . "/atom-full/$id" => 'application/atom+xml');
        $feed->link(html => $base . "/html-full/$id" => 'text/html');
        $feed->link(unapi => $unapi);
 
@@ -782,7 +782,7 @@ sub changes_feed {
 
        my $url = $cgi->url(-path_info=>$add_path);
        my $root = (split 'feed', $url)[0];
-       my $base = (split 'freshmeat', $url)[0] . 'freshmeat';
+       my $base = (split 'freshmeat', $url)[0] . '/freshmeat';
        my $unapi = (split 'feed', $url)[0] . 'unapi';
 
        my $path = $cgi->path_info;
@@ -815,8 +815,8 @@ sub changes_feed {
        $feed->creator($host);
        $feed->update_ts(gmtime_ISO8601());
 
-       $feed->link(rss => $base . "/rss2-full/$rtype/$axis/$limit/$date" => 'application/rss+xml');
-       $feed->link(alternate => $base . "/atom-full/$rtype/$axis/$limit/$date" => 'application/atom+xml');
+       $feed->link(alternate => $base . "/rss2-full/$rtype/$axis/$limit/$date" => 'application/rss+xml');
+       $feed->link(atom => $base . "/atom-full/$rtype/$axis/$limit/$date" => 'application/atom+xml');
        $feed->link(html => $base . "/html-full/$rtype/$axis/$limit/$date" => 'text/html');
        $feed->link(unapi => $unapi);
 
@@ -1112,13 +1112,13 @@ sub opensearch_feed {
        );
 
        $feed->link(
-               rss =>
+               alternate =>
                $base .  "/$version/$org/rss2-full/$class?searchTerms=$terms&searchSort=$sort&searchSortDir=$sortdir&searchLang=$lang" =>
                'application/rss+xml'
        );
 
        $feed->link(
-               alternate =>
+               atom =>
                $base .  "/$version/$org/atom-full/$class?searchTerms=$terms&searchSort=$sort&searchSortDir=$sortdir&searchLang=$lang" =>
                'application/atom+xml'
        );
index 44a5f74..9ad6c2c 100644 (file)
@@ -235,7 +235,7 @@ sub new {
        my $self = $class->SUPER::build('<feed xmlns:atom="http://www.w3.org/2005/Atom"/>');
        $self->{doc}->documentElement->setNamespace('http://www.w3.org/2005/Atom', undef);
        $self->{doc}->documentElement->setNamespace('http://www.w3.org/2005/Atom', 'atom');
-       $self->{type} = 'application/xml';
+       $self->{type} = 'application/atom+xml';
        $self->{item_xpath} = '/atom:feed';
        return $self;
 }
@@ -299,7 +299,7 @@ sub new {
        $self->{doc}->documentElement->setNamespace('http://www.w3.org/2005/Atom', 'atom');
        $self->{item_xpath} = '/atom:entry';
        $self->{holdings_xpath} = '/atom:entry';
-       $self->{type} = 'application/xml';
+       $self->{type} = 'application/atom+xml';
        return $self;
 }
 
@@ -312,7 +312,7 @@ use base 'OpenILS::WWW::SuperCat::Feed';
 sub new {
        my $class = shift;
        my $self = $class->SUPER::build('<rss version="2.0"><channel/></rss>');
-       $self->{type} = 'application/xml';
+       $self->{type} = 'application/rss+xml';
        $self->{item_xpath} = '/rss/channel';
        return $self;
 }
@@ -361,7 +361,7 @@ sub new {
        my $class = shift;
        my $xml = shift;
        my $self = $class->SUPER::build($xml);
-       $self->{type} = 'application/xml';
+       $self->{type} = 'application/rss+xml';
        $self->{item_xpath} = '/item';
        $self->{holdings_xpath} = '/item';
        return $self;
index 5dbb4b9..b4b2388 100644 (file)
@@ -980,7 +980,7 @@ function myOPACShowBookbags(force) {
                        unHideMe(link);
 
                        link = $n(row, 'myopac_bb_published_atom');
-                       link.setAttribute('href', buildExtrasLink( 'feed/bookbag/atom-full/'+cont.id(), false));  
+                       link.setAttribute('href', buildExtrasLink( 'feed/bookbag/rss2-full/'+cont.id(), false));  
                        link.setAttribute('target', '_blank' );
                        unHideMe(link);