LP#1674364 - Use database bib id for cover art lookup
authorJosh Stompro <stompro@stompro.org>
Mon, 4 Mar 2019 17:16:56 +0000 (11:16 -0600)
committerChris Sharp <csharp@georgialibraries.org>
Wed, 19 Aug 2020 15:36:30 +0000 (11:36 -0400)
Export the 901c as the URN:BIBID identifier to allow the
ATOM2XHTML.xsl to construct a cover art img link using it.

Testing Notes:

I used a bookbag to test this out.
1. Create a public bookbag of items and grab the bookbag id.
2. View the source of these links on your system to see the current output.
 /opac/extras/feed/bookbag/atom/<bookbagid>
 /opac/extras/feed/bookbag/html-full/<bookbagid>
   Make note that the jacket img link uses the ISBN to lookup cover art.

Make changes.
1. Restart supercat to re-load xsl transfor files.
  osrf_control -l --service open-ils.supercat --restart
2. View the source and output of these links on your system to see the changes.
 /opac/extras/feed/bookbag/atom/<bookbagid>
 /opac/extras/feed/bookbag/html-full/<bookbagid>
   The cover art images should show up now in the html-full, and the
   URN:BIBID: identifier should be populated in the atom file.

Signed-off-by: Josh Stompro <stompro@stompro.org>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/xsl/ATOM2XHTML.xsl
Open-ILS/xsl/MARC21slim2ATOM.xsl

index 73bc6a1..d7dae64 100644 (file)
@@ -8,6 +8,7 @@ Copyright (c) 2006 GPLS.
 
 Author: Michael Fagan, parts by Joel Tesler; modifications by Mike Rylander / GPLS
 Changelog:
+        2019-03-04: Use URN:BIBID for cover art lookup.
        2005-11-28: Updated to work with OpenSearch 1.1 Draft 2 (rather than Draft 1)
        2005-10-19: Changlog added (unknown update)
 Description: Converts an OpenSearch feed into XHTML.
@@ -326,6 +327,8 @@ To-do list:
                                        <xsl:text>/opac/extras/ac/jacket/small/</xsl:text>
                                </xsl:otherwise>
                        </xsl:choose>
+                       <xsl:variable name="bibid"><xsl:value-of select="substring-after(.,'BIBID:')"/></xsl:variable>
+                       <xsl:value-of select="concat('/opac/extras/ac/jacket/small/r/',$bibid)"/>
                </xsl:attribute>                
        </xsl:template>
     -->
index 925e603..cc0806d 100644 (file)
@@ -4,6 +4,7 @@
        <xsl:output method="xml" indent="yes"/>
        
        <!--Added ISBN and deleted attributes 6/04 jer-->
+       <!--Added BIBID to facilitate covert art lookup 2019-03-04 jrs-->
        
        <xsl:template match="/">
                        <xsl:apply-templates/>
                                        <xsl:value-of select="."/>
                                </dc:identifier>
                        </xsl:for-each>
-            
-            
+
+                       <xsl:for-each select="marc:datafield[@tag=901]">
+                               <dc:identifier>
+                                       <xsl:text>URN:BIBID:</xsl:text>
+                                       <xsl:value-of select="marc:subfield[@code='c']"/>
+                               </dc:identifier>
+                       </xsl:for-each>
+
                        <xsl:for-each select="marc:datafield[@tag=506]">
                                <rights>
                                        <xsl:value-of select="marc:subfield[@code='a']"/>