90 |
$self->{db} = new WebPAC::Store( |
$self->{db} = new WebPAC::Store( |
91 |
path => $db_path, |
path => $db_path, |
92 |
read_only => 1, |
read_only => 1, |
93 |
|
database => $est_cfg->{database}, |
94 |
); |
); |
95 |
|
|
96 |
$self->{out} = new WebPAC::Output::TT( |
$self->{out} = new WebPAC::Output::TT( |
192 |
|
|
193 |
for my $i ( 0 .. $#results ) { |
for my $i ( 0 .. $#results ) { |
194 |
|
|
195 |
my $mfn = $1 if ( $results[$i]->{'@uri'} =~ m#/(\d+)$#); |
my ($id, $prefix); |
196 |
|
if ( $results[$i]->{'@uri'} =~ m!/([^/]+)#(\d+)$!) { |
197 |
|
($prefix,$id) = ($1,$2); |
198 |
|
} else { |
199 |
|
$log->warn("can't decode prefix#id from " . $results[$i]->{'@uri'}); |
200 |
|
next; |
201 |
|
} |
202 |
|
|
203 |
#$log->debug("load_ds( $mfn )"); |
#$log->debug("load_ds( id => $id, prefix => '$prefix' )"); |
204 |
|
|
205 |
$t = time(); |
$t = time(); |
206 |
|
|
207 |
my $ds = $self->{db}->load_ds( $mfn ) || $log->error("can't load_ds( $mfn )") && next; |
my $ds = $self->{db}->load_ds( id => $id, prefix => $prefix ) || $log->error("can't load_ds( id => $id, prefix => '$prefix' )") && next; |
208 |
|
|
209 |
$times->{db} += time() - $t; |
$times->{db} += time() - $t; |
210 |
|
|
258 |
my $log = $self->{log}; |
my $log = $self->{log}; |
259 |
$log->debug("args: " . Dumper( $args )); |
$log->debug("args: " . Dumper( $args )); |
260 |
|
|
261 |
foreach my $f (qw/mfn template/) { |
foreach my $f (qw/mfn template prefix/) { |
262 |
$log->die("need $f") unless ($args->{$f}); |
$log->die("need $f") unless ($args->{$f}); |
263 |
} |
} |
264 |
|
|
265 |
my $mfn = $args->{mfn}; |
my $mfn = $args->{mfn}; |
266 |
|
|
267 |
my $ds = $self->{db}->load_ds( $mfn ) || $log->error("can't load_ds( $mfn )") && next; |
my $ds = $self->{db}->load_ds( id => $mfn, prefix => 'FIXME' ) || $log->error("can't load_ds( $mfn )") && next; |
268 |
|
|
269 |
my $html = $self->{out}->apply( |
my $html = $self->{out}->apply( |
270 |
template => $args->{template}, |
template => $args->{template}, |