1 package WebPAC::Input::ISIS;
8 use base qw/WebPAC::Common/;
12 WebPAC::Input::ISIS - support for CDS/ISIS database files
20 our $VERSION = '0.09';
25 Open CDS/ISIS, WinISIS or IsisMarc database using C<Biblio::Isis>
26 and read all records to memory.
28 my $isis = new WebPAC::Input::ISIS(
29 path => '/path/to/ISIS/ISIS',
36 Returns new low-level input API object
38 my $isis = new WebPAC::Input::ISIS(
39 path => '/path/to/LIBRI'
41 my ($l,$field_nr) = @_;
42 # do something with $l which is line of input file
53 path to CDS/ISIS database
66 my $log = $self->_get_logger();
68 $log->info("opening ISIS database '$arg->{path}'");
70 $log->debug("using Biblio::Isis");
71 my $isis_db = new Biblio::Isis(
72 isisdb => $arg->{path},
74 hash_filter => $arg->{filter} ? sub { return $arg->{filter}->(@_); } : undef,
75 ignore_empty_subfields => 1,
76 ) or $log->logdie("can't find database $arg->{path}");
78 $self->{_isis_db} = $isis_db;
80 $self ? return $self : return undef;
85 Return record with ID C<$mfn> from database
87 my $rec = $isis->fetch_rec( $mfn, $filter_coderef);
94 my ($mfn, $filter_coderef) = @_;
96 my $rec = $self->{_isis_db}->to_hash({
98 include_subfields => 1,
99 hash_filter => $filter_coderef,
100 # hash_filter => sub {
102 # warn "## in hash_filter ($l,$f)\n";
103 # my $o = $filter_coderef->($l,$f) if ($filter_coderef);
104 # warn "## out hash_filter = $o\n";
114 Return dump of record ID C<$mfn> from database
116 my $rec = $isis->dump_ascii( $mfn );
125 return $self->{_isis_db}->to_ascii( $mfn );
130 Return number of records in database
132 my $size = $isis->size;
138 return $self->{_isis_db}->count;
143 Dobrica Pavlinusic, C<< <dpavlin@rot13.org> >>
145 =head1 COPYRIGHT & LICENSE
147 Copyright 2005 Dobrica Pavlinusic, All Rights Reserved.
149 This program is free software; you can redistribute it and/or modify it
150 under the same terms as Perl itself.
154 1; # End of WebPAC::Input::ISIS