normalize:
path: 'conf/normalize/common.pl'
# mapping_path: 'conf/input/dbf/cas2000.yml'
+
+ exhibit:
+ name: 'SMILE Exhibit based ouptput for WebPAC'
+ input:
+ name: 'FFZG - Psihologija'
+ type: marc
+ path: 'ps.marc'
+ encoding: 'cp852'
+ #limit: 100
+ normalize:
+ path: 'conf/normalize/json.pl'
+ output:
+ module: 'JSON'
+ path: 'out/exhibit/ps.js'
+
#log4perl.logger.WebPAC.Output.TT=DEBUG
#log4perl.logger.WebPAC.Output.Estraier=DEBUG
+log4perl.logger.WebPAC.Output.JSON=DEBUG
+#
#log4perl.logger.WebPAC.Search.Estraier=DEBUG
#log4perl.logger.WebPAC.Common=DEBUG
# now WebPAC::Store
#
my $abs_path = abs_path($0);
- $abs_path =~ s#/[^/]*$#/#;
+ $abs_path =~ s#/[^/]*$#/#; #
my $db_path = $config->webpac('db_path');
debug => $debug,
);
+ #
+ # prepare output
+ #
+ my @outputs;
+ if (defined( $db_config->{output} )) {
+ my $module = $db_config->{output}->{module} || $log->logdie("need module in output section of $database");
+ $module = 'WebPAC::Output::' . $module unless $module =~ m/::/;
+ $log->debug("loading output module $module");
+ eval "require $module";
+ my $out = new $module->new( $db_config->{output} );
+ $out->init;
+ push @outputs, $out;
+ }
+
#
# now, iterate through input formats
my $mfn = $row->{'000'}->[0];
- if (! $mfn || $mfn !~ m#^\d+$#) {
+ if (! $mfn || $mfn !~ m{^\d+$}) {
$log->warn("record $pos doesn't have valid MFN but '$mfn', using $pos");
$mfn = $pos;
push @{ $row->{'000'} }, $pos;
$log->info("Created $i instances of MFN $mfn\n") if ($i > 1);
}
+
+ foreach my $out ( @outputs ) {
+ if ( $out->can('add') ) {
+ $out->add( $mfn, $ds );
+ }
+ }
+
}
if ($validate) {