blib/lib/Keystone/Resolver/plugins/ID/urn/isbn.pm untested

filter: Statementstmt 0.0% 0 / 11 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 17 CC 2 SCAR 13.9
CC
2
Cov
0%
data
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 4.0
1 # $Id: isbn.pm,v 1.2 2007-01-26 13:53:48 mike Exp $
2  
3 package Keystone::Resolver::plugins::ID::urn::isbn;
4  
5 use strict;
6 use warnings;
7  
8  
9 sub data {
10 my $class = shift();
11 my($openurl, $isbn) = @_;
12  
13 ### There are a number of different approaches we could take here,
14 # including:
15 # 1. Resolve the ISBN to a unique page, e.g. from Amazon.
16 # 2. Look up the ISBN in a catalogue service such as the Library
17 # of Congress's Z39.50 server, and populate the referent with
18 # the metadata obtained that way.
19 # 3. Just shove the ISBN into the metadata, if it's not there
20 # already.
21 # 4. Any or all of the above, as specified either by a run-time
22 # option or a "config" element in the resource database.
23 # Unsuprisingly, we go for option 3, at least for now.
24  
25 my $extraMetaData = {};
26 $extraMetaData->{isbn} = $isbn
27 if !defined $openurl->rft("isbn");
28  
29 return (undef, undef, $extraMetaData);
30 }
31  
32  
33 1;