| 1 | # $Id: APP.pm,v 1.2 2007-01-26 13:53:48 mike Exp $ | ||
| 2 | |||
| 3 | package Keystone::Resolver::plugins::Service::APP; | ||
| 4 | |||
| 5 | use strict; | ||
| 6 | use warnings; | ||
| 7 | |||
| 8 | |||
| 9 | # This plug-in demonstrates a semi-complex access method for a service | ||
| 10 | # that does not provide uniform access. The journal _Acta | ||
| 11 | # Palaeontologica Polonica_ is archived on its own web-site, but only | ||
| 12 | # from volume 42 onwards. From volume 47, the full text is provided | ||
| 13 | # rather than just abstracts, and the URLs are different at that | ||
| 14 | # point, too. | ||
| 15 | |||
| 16 | sub uri { | ||
| 17 | my $class = shift(); | ||
| 18 | my($openurl) = @_; | ||
| 19 | |||
| 20 | my($volume, $issue, $spage, $aulast) | ||
| 21 | = map { $openurl->rft($_) } qw(volume issue spage aulast); | ||
| 22 | |||
| 23 | if ($volume < 42) { | ||
| 24 | return (undef, "this service does not support volumes prior to 42"); | ||
| 25 | } elsif ($volume >= 47) { | ||
| 26 | # New form, with full-text PDFs | ||
| 27 | return sprintf("http://app.pan.pl/acta%d/app%d-%03d.pdf", | ||
| 28 | $volume, $volume, $spage); | ||
| 29 | } | ||
| 30 | |||
| 31 | # Old form: abstracts only. Author name is used as locator within | ||
| 32 | # the page, which is surely fragile to character-encoding issues. | ||
| 33 | return "http://app.pan.pl/acta$volume-$issue.htm#$aulast"; | ||
| 34 | } | ||
| 35 | |||
| 36 | |||
| 37 | 1; |