« blib/lib/Keystone/Resolver/plugins/ServiceType/bookstore.pm
↑ Summary
blib/lib/Keystone/Resolver/Descriptor.pm »
| 1 | # $Id: citation.pm,v 1.2 2007-01-26 13:53:49 mike Exp $ | ||
| 2 | |||
| 3 | package Keystone::Resolver::plugins::ServiceType::citation; | ||
| 4 | |||
| 5 | use strict; | ||
| 6 | use warnings; | ||
| 7 | |||
| 8 | |||
| 9 | sub handle { | ||
| 10 | my $class = shift(); | ||
| 11 | my($openURL, $service) = @_; | ||
| 12 | |||
| 13 | my $style = $service->tag(); | ||
| 14 | eval { | ||
| 15 | require "Keystone/Resolver/plugins/Citation/$style.pm"; | ||
| 16 | }; if ($@) { | ||
| 17 | $openURL->warn("can't load citation-style plugin '$style': $@"); | ||
| 18 | return (undef, "citation style '$style' not defined"); | ||
| 19 | } | ||
| 20 | |||
| 21 | my($citation, $mimeType) = | ||
| 22 | "Keystone::Resolver::plugins::Citation::$style"->citation($openURL); | ||
| 23 | |||
| 24 | return ($citation, undef, undef, $mimeType); | ||
| 25 | } | ||
| 26 | |||
| 27 | |||
| 28 | 1; |