making the dumpac mo betta
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 8 Nov 2006 20:53:40 +0000 (20:53 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 8 Nov 2006 20:53:40 +0000 (20:53 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6570 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm
Open-ILS/xsl/ATOM2XHTML.xsl

index 8fa5593..4c6f76e 100644 (file)
@@ -904,7 +904,7 @@ sub opensearch_feed {
                $offset -= 1;
        }
 
-       my ($version,$org,$type,$class,$terms,$sort,$sortdir,$lang);
+       my ($version,$org,$type,$class,$terms,$sort,$sortdir,$lang) = ('','','','','','','','');
        (undef,$version,$org,$type,$class,$terms,$sort,$sortdir,$lang) = split '/', $path;
 
        $lang = $cgi->param('searchLang') if $cgi->param('searchLang');
@@ -944,6 +944,7 @@ sub opensearch_feed {
        $terms = decode_utf8($terms);
        $terms =~ s/\+/ /go;
        $terms =~ s/'//go;
+       $terms =~ s/^\s+//go;
        my $term_copy = $terms;
 
        my $complex_terms = 0;
@@ -1074,43 +1075,43 @@ sub opensearch_feed {
 
        $feed->link(
                next =>
-               $base . "/$version/$org/$type/$class?searchTerms=$terms&startIndex=" . int($offset + $limit + 1) . "&count=" . $limit =>
+               $base . "/$version/$org/$type/$class?searchTerms=$terms&searchSort=$sort&searchSortDir=$sortdir&searchLang=$lang&startIndex=" . int($offset + $limit + 1) . "&count=" . $limit =>
                'application/opensearch+xml'
        ) if ($offset + $limit < $recs->{count});
 
        $feed->link(
                previous =>
-               $base . "/$version/$org/$type/$class?searchTerms=$terms&startIndex=" . int(($offset - $limit) + 1) . "&count=" . $limit =>
+               $base . "/$version/$org/$type/$class?searchTerms=$terms&searchSort=$sort&searchSortDir=$sortdir&searchLang=$lang&startIndex=" . int(($offset - $limit) + 1) . "&count=" . $limit =>
                'application/opensearch+xml'
        ) if ($offset);
 
        $feed->link(
                self =>
-               $base .  "/$version/$org/$type/$class?searchTerms=$terms" =>
+               $base .  "/$version/$org/$type/$class?searchTerms=$terms&searchSort=$sort&searchSortDir=$sortdir&searchLang=$lang" =>
                'application/opensearch+xml'
        );
 
        $feed->link(
                rss =>
-               $base .  "/$version/$org/rss2-full/$class?searchTerms=$terms" =>
+               $base .  "/$version/$org/rss2-full/$class?searchTerms=$terms&searchSort=$sort&searchSortDir=$sortdir&searchLang=$lang" =>
                'application/rss+xml'
        );
 
        $feed->link(
                alternate =>
-               $base .  "/$version/$org/atom-full/$class?searchTerms=$terms" =>
+               $base .  "/$version/$org/atom-full/$class?searchTerms=$terms&searchSort=$sort&searchSortDir=$sortdir&searchLang=$lang" =>
                'application/atom+xml'
        );
 
        $feed->link(
                'html' =>
-               $base .  "/$version/$org/html/$class?searchTerms=$terms" =>
+               $base .  "/$version/$org/html/$class?searchTerms=$terms&searchSort=$sort&searchSortDir=$sortdir&searchLang=$lang" =>
                'text/html'
        );
 
        $feed->link(
                'html-full' =>
-               $base .  "/$version/$org/html-full/$class?searchTerms=$terms" =>
+               $base .  "/$version/$org/html-full/$class?searchTerms=$terms&searchSort=$sort&searchSortDir=$sortdir&searchLang=$lang" =>
                'text/html'
        );
 
index 04c4925..76f8a6a 100644 (file)
@@ -65,6 +65,27 @@ sub class {
        return $self->{class};
 }
 
+sub Sort {
+       my $self = shift;
+       my $search = shift;
+       $self->{sort} = $search if ($search);
+       return $self->{sort};
+}
+
+sub SortDir {
+       my $self = shift;
+       my $search = shift;
+       $self->{sort_dir} = $search if ($search);
+       return $self->{sort_dir};
+}
+
+sub lang {
+       my $self = shift;
+       my $search = shift;
+       $self->{lang} = $search if ($search);
+       return $self->{lang};
+}
+
 sub lib {
        my $self = shift;
        my $lib = shift;
@@ -592,6 +613,9 @@ sub toString {
        my $base = $self->base || '';
        my $root = $self->root || '';
        my $search = $self->search || '';
+       my $sort = $self->Sort || '';
+       my $sort_dir = $self->SortDir || '';
+       my $lang = $self->lang || '';
        my $lib = $self->lib || '-';
 
        $self->composeDoc;
@@ -612,6 +636,9 @@ sub toString {
                base_dir => "'$root'",
                lib => "'$lib'",
                searchTerms => "'$search'",
+               searchSort => "'$sort'",
+               searchSortDir => "'$sort_dir'",
+               searchLang => "'$lang'",
        );
 
        return $new_doc->toString(1); 
index ff6e2b4..2b5bcf2 100644 (file)
@@ -266,7 +266,7 @@ To-do list:
                                                </p>
                                        </xsl:when>
                                        <xsl:when test="(opensearch:startIndex&gt;1 or opensearchOld&gt;1) and not($totalresults=0)"><xsl:value-of select="$t-nomoreresults" /></xsl:when>
-                                       <xsl:otherwise><!-- <p><xsl:value-of select="$t-noresults" /></p> --></xsl:otherwise>
+                                       <xsl:otherwise><p><xsl:value-of select="$t-noresults" /></p></xsl:otherwise>
                                </xsl:choose>
 
                                <!-- display the copyright -->
@@ -415,6 +415,7 @@ To-do list:
                                                        <xsl:value-of select="@href" />
                                                </xsl:attribute>
                                        </xsl:for-each>
+                                       <!--
                                        <xsl:choose>
                                                <xsl:when test="string-length(substring-after($url, 'http://'))&gt;100">
                                                        <xsl:value-of select="concat(substring(substring-after($url, 'http://'),1,100),'&#8230;')" />
@@ -423,6 +424,8 @@ To-do list:
                                                        <xsl:value-of select="substring-after($url, 'http://')" />
                                                </xsl:otherwise>
                                        </xsl:choose>
+                                       -->
+                                       <xsl:text>unAPI</xsl:text>
                                </abbr>
                        </dd>
                </xsl:if>