#----------------------------------------------------------
package OpenILS::WWW::SuperCat::Feed::mods3;
-use base 'OpenILS::WWW::SuperCat::Feed';
+use base 'OpenILS::WWW::SuperCat::Feed::mods';
sub new {
my $class = shift;
}
package OpenILS::WWW::SuperCat::Feed::mods3::item;
-use base 'OpenILS::WWW::SuperCat::Feed::mods3';
+use base 'OpenILS::WWW::SuperCat::Feed::mods::item';
sub new {
my $class = shift;
return $self;
}
+sub link {
+ my $self = shift;
+ my $type = shift;
+ my $id = shift;
+
+ if ($type eq 'unapi' || $type eq 'opac') {
+ $self->_create_node(
+ 'mods:mods',
+ 'http://www.loc.gov/mods/v3',
+ 'mods:relatedItem',
+ undef,
+ { type => 'otherFormat', id => 'link-'.$linkid }
+ );
+ $self->_create_node(
+ "mods:mods/mods:relatedItem[\@id='link-$linkid']",
+ 'http://www.loc.gov/mods/v3',
+ 'mods:recordIdentifier',
+ $id
+ );
+ $linkid++;
+ }
+}
+
#----------------------------------------------------------
return $self;
}
+sub link {
+ my $self = shift;
+ my $type = shift;
+ my $id = shift;
+
+ if ($type eq 'unapi' || $type eq 'opac') {
+ $self->_create_node(
+ 'marc:record',
+ 'http://www.w3.org/1999/xhtml',
+ 'xhtml:link',
+ undef,
+ { rel => 'otherFormat', href => $id, title => "Dynamic Details" }
+ );
+ $linkid++;
+ }
+}
+
+
#----------------------------------------------------------
package OpenILS::WWW::SuperCat::Feed::html;
$_parser ||= new XML::LibXML;
$_xslt ||= new XML::LibXSLT;
- $xslt_file ||=
+ $xslt_file =
OpenSRF::Utils::SettingsClient
->new
->config_value( dirs => 'xsl' ).$self->{xsl};
return $new_doc->toString(1);
}
+package OpenILS::WWW::SuperCat::Feed::htmlcard::item;
+use base 'OpenILS::WWW::SuperCat::Feed::marcxml::item';
+
package OpenILS::WWW::SuperCat::Feed::htmlholdings;
use base 'OpenILS::WWW::SuperCat::Feed::htmlcard';
return $self;
}
-package OpenILS::WWW::SuperCat::Feed::htmlcard::item;
-use base 'OpenILS::WWW::SuperCat::Feed::marcxml::item';
-
package OpenILS::WWW::SuperCat::Feed::htmlholdings::item;
use base 'OpenILS::WWW::SuperCat::Feed::htmlcard::item';
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:marc="http://www.loc.gov/MARC21/slim"
xmlns:hold="http://open-ils.org/spec/holdings/v1"
<div class="cardimage">
<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="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:attribute>
+ <xsl:value-of select="@title"/>
+ </a>
+ <br/>
+ </xsl:template>
+
<xsl:template match="hold:volumes">
- <xsl:if test="count(hold:volume) > 0">
+ <xsl:if test="count(hold:volume/hold:copies/hold:copy) > 0">
<u>Holdings</u>
</xsl:if>
<ul>