#log4perl.logger.WebPAC.Store.load_ds=DEBUG
#log4perl.logger.WebPAC.Lookup=DEBUG
-log4perl.logger.WebPAC.Lookup.lookup=DEBUG
+#log4perl.logger.WebPAC.Lookup.lookup=DEBUG
#log4perl.logger.WebPAC.Input=DEBUG
#log4perl.logger.WebPAC.Input.ISIS=DEBUG
#log4perl.logger.WebPAC.Input.ISIS.fetch=DEBUG
#log4perl.logger.WebPAC.Input.ISIS.open=DEBUG
-log4perl.logger.WebPAC.Normalize=DEBUG
+#log4perl.logger.WebPAC.Normalize=DEBUG
+log4perl.logger.WebPAC.Normalize.new=DEBUG
#log4perl.logger.WebPAC.Normalize.XML=DEBUG
#log4perl.logger.WebPAC.Normalize.data_structure=DEBUG
#log4perl.logger.WebPAC.Normalize.fill_in_to_arr=DEBUG
</Set_2>
<Parts>
- <isis>lookup{[tip-naslovi:v946^1]}</isis>
+ <isis>lookup{naslov:[tip-naslovi:v946^1]}</isis>
</Parts>
<CallNo>
$log->logconfess("lookup config file isn't ARRAY but ", sub { Dumper( $self->{'lookup_def'} ) }) if ($self->{'lookup_def'} !~ /ARRAY/o);
- $self->{'is_lookup_regex'} ||= 'lookup{\[[^\{\}]+\]}';
+ $self->{'is_lookup_regex'} ||= 'lookup{[^\{\}]+}';
$self->{'save_lookup_regex'} ||= 'lookup{([^\{\}]+)}';
if ($tmp =~ $self->{'LOOKUP_REGEX'}) {
my @in = ( $tmp );
- $log->debug("lookup for: ",$tmp);
-
my @out;
while (my $f = shift @in) {
if ($f =~ $self->{'LOOKUP_REGEX_SAVE'}) {
push @out, $f;
}
}
+ $log->debug("lookup for: ",$tmp, " returned: ", join(", ",@out));
+
$log->logconfess("return is array and it's not expected!") unless wantarray;
+
return @out;
} else {
return $tmp;
$log->warn("no prefix defined. please check that!") unless ($self->{'prefix'});
+ $log->debug("using lookup regex: ", $self->{lookup_regex}) if ($r && $l);
+
$self ? return $self : return undef;
}
foreach my $type (@types) {
# append to previous line?
- $log->debug("type: $type ",sub { join(" ",@v) }, $row->{'append'} || 'no append');
+ $log->debug("type: $type ",sub { join(" ",@v) }, " ", $row->{'append'} || 'no append');
if ($tag->{'append'}) {
# I will delimit appended part with
# do we have lookups?
if ($self->{'lookup'}) {
if ($self->{'lookup'}->can('lookup')) {
- return $self->{'lookup'}->lookup($format);
+ my @lookup = $self->{lookup}->lookup($format);
+ $log->debug('lookup $format', join(", ", @lookup));
+ return @lookup;
} else {
$log->warn("Have lookup object but can't invoke lookup method");
}
ForceContent => 1,
);
- $log->debug("import xml is ",sub { Dumper($self->{'import_xml'}) });
+ $log->debug("import xml is ",sub { Dumper($self->{'import_xml'}) }, $self->{lookup} ? " using lookups" : "lookups disabled");
return $self;
}
ok(my $maxmfn = $isis->open(
filename => $isis_file,
code_page => '852', # database encoding
+ lookup => $lookup,
), "Input::ISIS->open");
ok(my $path = tempdir( CLEANUP => 1 ), "path");