projects
/
ZOOM-Perl-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b81a873
)
record_get() hackery for OPAC/XML records now works for complex $type.
author
mike
<mike>
Mon, 9 Jun 2008 13:49:32 +0000
(13:49 +0000)
committer
mike
<mike>
Mon, 9 Jun 2008 13:49:32 +0000
(13:49 +0000)
lib/Net/Z3950/ZOOM.pm
patch
|
blob
|
history
diff --git
a/lib/Net/Z3950/ZOOM.pm
b/lib/Net/Z3950/ZOOM.pm
index
b8e3fda
..
ed8d02f
100644
(file)
--- a/
lib/Net/Z3950/ZOOM.pm
+++ b/
lib/Net/Z3950/ZOOM.pm
@@
-1,4
+1,4
@@
-# $Id: ZOOM.pm,v 1.37 2008-05-14 13:29:57 mike Exp $
+# $Id: ZOOM.pm,v 1.38 2008-06-09 13:49:32 mike Exp $
package Net::Z3950::ZOOM;
package Net::Z3950::ZOOM;
@@
-153,12
+153,20
@@
sub event_str {
sub record_get {
my($rec, $type) = @_;
sub record_get {
my($rec, $type) = @_;
+ my $simpletype = $type;
+ $simpletype =~ s/;.*//;
+ warn "record_get('$rec', '$simpletype' -> '$type')\n";
if (grep { $type eq $_ } qw(database syntax schema)) {
return record_get_string($rec, $type);
} else {
my $val = record_get_binary($rec, $type);
if (grep { $type eq $_ } qw(database syntax schema)) {
return record_get_string($rec, $type);
} else {
my $val = record_get_binary($rec, $type);
- if ($type eq "opac" && !defined $val) {
- $val = record_get_binary($rec, "xml");
+ if ($simpletype eq "opac" && !defined $val) {
+ my $newtype = $type;
+ if ($newtype !~ s/.*?;/xml;/) {
+ $newtype = "xml";
+ }
+ warn "fallback('$rec', '$newtype')\n";
+ $val = record_get_binary($rec, $newtype);
}
return $val;
}
}
return $val;
}