print "Location: $root/../../en-US/skin/default/xml/rdetail.xml?r=$id\n\n"
if ($type eq 'record');
return 302;
- } else {
+ } elsif (OpenILS::WWW::SuperCat::Feed->exists($format)) {
my $feed = create_record_feed(
$format => [ $id ],
$base,
$feed->root($root);
$feed->creator($host);
$feed->update_ts(gmtime_ISO8601());
+ $feed->link( unapi => $base);
print "Content-type: ". $feed->type ."; charset=utf-8\n\n";
print entityize($feed->toString) . "\n";
use OpenSRF::Utils::SettingsClient;
use CGI;
+sub exists {
+ my $class = shift;
+ my $type = shift;
+
+ return 1 if UNIVERSAL::can("OpenILS::WWW::SuperCat::Feed::$type" => 'new');
+ return 0;
+}
+
sub new {
my $class = shift;
my $type = shift;
$self->{item_xpath} = '/marc:collection';
return $self;
}
+sub link {
+ my $self = shift;
+ my $type = shift;
+ my $id = shift;
+
+ if ($type eq 'unapi') {
+ $self->_create_node(
+ 'marc:collection',
+ 'http://www.w3.org/1999/xhtml',
+ 'xhtml:link',
+ undef,
+ { rel => 'meta', href => $id, title => "unapi" }
+ );
+ $linkid++;
+ }
+}
+
package OpenILS::WWW::SuperCat::Feed::marcxml::item;
use base 'OpenILS::WWW::SuperCat::Feed::marcxml';
my $type = shift;
my $id = shift;
- if ($type eq 'unapi' || $type eq 'opac') {
+ if ($type eq 'opac') {
$self->_create_node(
'marc:record',
'http://www.w3.org/1999/xhtml',
{ rel => 'otherFormat', href => $id, title => "Dynamic Details" }
);
$linkid++;
+ } elsif ($type eq 'unapi-id') {
+ $self->_create_node(
+ 'marc:record',
+ 'http://www.w3.org/1999/xhtml',
+ 'xhtml:abbr',
+ undef,
+ { title => $id, class => "unapi-id" }
+ );
+ $linkid++;
}
}
<head>
<meta http-equiv="Content-Type" content="text/html" charset="utf-8"/>
<link href="{$base_dir}/htmlcard.css" rel="stylesheet" type="text/css" />
+ <xsl:apply-templates select="/marc:collection/xhtml:link"/>
</head>
<body>
<xsl:apply-templates select="//marc:record"/>
<xsl:apply-templates select="marc:datafield[@tag!='082' and @tag!='092' and @tag!='010']"/>
<span class="bottom">
<xsl:apply-templates select="xhtml:link[@rel='otherFormat' and contains(@href,'format=')]"/>
+ <xsl:apply-templates select="xhtml:abbr[@class='unapi-id']"/>
<xsl:apply-templates select="marc:controlfield[@tag='001']"/>
<xsl:apply-templates select="marc:datafield[@tag='082' or @tag='092' or @tag='010']"/>
</span>
<br/>
</xsl:template>
- <xsl:template match="xhtml:link">
- <a>
- <xsl:attribute name="href">
- <xsl:value-of select="@href"/>
+ <xsl:template match="xhtml:abbr">
+ <abbr>
+ <xsl:attribute name="title">
+ <xsl:value-of select="@title"/>
</xsl:attribute>
- <xsl:value-of select="@title"/>
- </a>
- <br/>
+ <xsl:attribute name="class">
+ <xsl:value-of select="@class"/>
+ </xsl:attribute>
+ <xsl:value-of select="."/>
+ </abbr>
+ </xsl:template>
+
+ <xsl:template match="xhtml:link">
+ <xsl:choose>
+ <xsl:when test="@title='unapi'">
+ <link>
+ <xsl:attribute name="title">
+ <xsl:value-of select="@title"/>
+ </xsl:attribute>
+ <xsl:attribute name="rel">
+ <xsl:value-of select="@rel"/>
+ </xsl:attribute>
+ <xsl:attribute name="href">
+ <xsl:value-of select="@href"/>
+ </xsl:attribute>
+ <xsl:value-of select="."/>
+ </link>
+ </xsl:when>
+ <xsl:when test="@rel='otherFormat' and contains(@href,'format=')">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="@href"/>
+ </xsl:attribute>
+ <xsl:value-of select="@title"/>
+ </a>
+ <br/>
+ </xsl:when>
+ </xsl:choose>
</xsl:template>
<xsl:template match="hold:volumes">