-
Notifications
You must be signed in to change notification settings - Fork 0
/
htb_alephx_store_set
executable file
·58 lines (49 loc) · 1.51 KB
/
htb_alephx_store_set
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/perl
use strict;
use FindBin;
use lib $FindBin::Bin;
use HierarchyToolbox;
use Getopt::Long;
use File::Basename;
sub usage {
my $PROG=File::Basename::basename($0);
print STDERR<<EOD;
$PROG - 31.12.2007 (c) andres.vonarx\@unibas.ch
usage: $PROG [options]
Retrieve bibliographic records thru Aleph X-Services and store them into
a file. The output format is non-standard XML. It can be converted into
standard MARC21 XML using alephxml_marcxml.xsl.
options:
--help show this text and quit
--version show version information and quit
--ccl="query" CCL query (mandatory)
--file=filename output file (mandatory)
--host=hostname Aleph server (default: aleph.unibas.ch)
--alephlib=library Aleph library (default: dsv01)
--quiet do not output any messages
example:
\$ $PROG --ccl='wrd=(zen internet) and wsl=A100' --file=out.xml
\$ saxon out.xml alephxml_marcxml.xsl > marc.xml
EOD
exit;
}
my $opt;
GetOptions(
'help' => \$opt->{help},
'version' => \$opt->{help},
'ccl=s' => \$opt->{ccl},
'file=s' => \$opt->{file},
'host=s' => \$opt->{host},
'alephlib=s'=> \$opt->{alephlib},
'quiet' => \$opt->{quiet},
) or usage;
($opt->{help}) and usage;
($opt->{ccl}) or usage;
($opt->{file}) or usage;
alephx_store_set(
ccl => $opt->{ccl},
outfile => $opt->{file},
alephlib => $opt->{alephlib},
host => $opt->{host},
debug => ($opt->{quiet} ? 0 : 1),
);