projects
/
webpac2
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r11190@llin: dpavlin | 2005-11-27 06:05:22 +0100
[webpac2]
/
run.pl
diff --git
a/run.pl
b/run.pl
index
ae3f131
..
1f8cc59
100755
(executable)
--- a/
run.pl
+++ b/
run.pl
@@
-9,36
+9,45
@@
use lib './lib';
use WebPAC::Lookup;
use WebPAC::Input::ISIS;
use WebPAC::Lookup;
use WebPAC::Input::ISIS;
-use WebPAC::DB;
+use WebPAC::DB
0.02
;
use WebPAC::Normalize::XML;
use WebPAC::Output::TT;
use WebPAC::Output::Estraier;
use WebPAC::Normalize::XML;
use WebPAC::Output::TT;
use WebPAC::Output::Estraier;
+use YAML qw/LoadFile/;
my $limit = shift @ARGV;
my $limit = shift @ARGV;
+my $config = LoadFile('conf/config.yml');
+
+print "config = ",Dumper($config);
+
+my $type = lc($config->{input}->{type});
+
+die "I know only how to handle input type isis, not '$type'!\n" unless ($type eq 'isis');
+
my $abs_path = abs_path($0);
$abs_path =~ s#/[^/]*$#/#;
my $abs_path = abs_path($0);
$abs_path =~ s#/[^/]*$#/#;
-my $isis_file = '/data/isis_data/ps/LIBRI/LIBRI';
-
my $lookup = new WebPAC::Lookup(
my $lookup = new WebPAC::Lookup(
- lookup_file =>
"$abs_path/conf/lookup/isis.pm"
,
+ lookup_file =>
$config->{input}->{lookup}
,
);
);
+
+
my $isis = new WebPAC::Input::ISIS(
my $isis = new WebPAC::Input::ISIS(
- code_page =>
'ISO-8859-2', # application encoding
- limit_mfn => $
limit
,
+ code_page =>
$config->{webpac}->{webpac_encoding},
+ limit_mfn => $
config->{input}->{limit}
,
);
my $maxmfn = $isis->open(
);
my $maxmfn = $isis->open(
- filename => $
isis_file
,
- code_page =>
'852',
# database encoding
+ filename => $
config->{input}->{path}
,
+ code_page =>
$config->{input}->{encoding},
# database encoding
);
my $path = './db/';
my $db = new WebPAC::DB(
);
my $path = './db/';
my $db = new WebPAC::DB(
- path => $
path
,
+ path => $
config->{webpac}->{db_path}
,
);
my $n = new WebPAC::Normalize::XML(
);
my $n = new WebPAC::Normalize::XML(
@@
-49,20
+58,17
@@
my $n = new WebPAC::Normalize::XML(
);
$n->open(
);
$n->open(
- tag =>
'isis'
,
- xml_file =>
"$abs_path/conf/normalize/isis_ffzg.xml"
,
+ tag =>
$config->{normalize}->{tag}
,
+ xml_file =>
$config->{normalize}->{path}
,
);
my $out = new WebPAC::Output::TT(
);
my $out = new WebPAC::Output::TT(
- include_path =>
"$abs_path/conf/output/tt"
,
+ include_path =>
$config->{webpac}->{template_path}
,
filters => { foo => sub { shift } },
);
my $est = new WebPAC::Output::Estraier(
filters => { foo => sub { shift } },
);
my $est = new WebPAC::Output::Estraier(
- url => 'http://localhost:1978/node/webpac2',
- user => 'admin',
- passwd => 'admin',
- database => 'ps',
+ %{ $config->{hyperestraier} }
);
my $total_rows = 0;
);
my $total_rows = 0;
@@
-96,7
+102,7
@@
for ( 0 ... $isis->size ) {
$est->add(
id => $mfn,
ds => $ds,
$est->add(
id => $mfn,
ds => $ds,
- type =>
'search'
,
+ type =>
$config->{hyperestraier}->{type}
,
);
$total_rows++;
);
$total_rows++;