#!/usr/bin/perl -w use Cwd qw/abs_path/; use CGI::Carp qw(fatalsToBrowser); use CGI::Simple; use lib '../lib'; use WebPAC::DB; use WebPAC::Output::TT; my $abs_path = abs_path($0); $abs_path =~ s#/[^/]*$#/../#; my $db_path = $abs_path . '/db/'; my $db = new WebPAC::DB( path => $db_path, read_only => 1, debug => 1, ); my $out = new WebPAC::Output::TT( include_path => "$abs_path/conf/output/tt", filters => { foo => sub { shift } }, ); my $q = new CGI::Simple; my $self = $q->url( '-path_info'=>1, '-query'=>0, '-full'=>0 ); my $rec = $q->param('rec') || 1; print $q->header; if ($q->path_info =~ m#xml#) { my @ds = $db->load_ds($rec); if (@ds) { print qq{ }, $out->apply( template => 'html_ffzg.tt', data => \@ds, ), qq{ }; exit; } else { print qq{ Record $rec not found! }; } } else { print qq{ WebPAC simple browse interface db_path = $db_path
  none  
no record loaded yet.
}; };