/[webpac2]/trunk/lib/WebPAC/Normalize.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/WebPAC/Normalize.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 31 by dpavlin, Sun Jul 24 15:03:11 2005 UTC revision 64 by dpavlin, Tue Nov 15 16:56:44 2005 UTC
# Line 171  sub data_structure { Line 171  sub data_structure {
171  #print "field $field [",$self->{'tag'},"] = ",Dumper($self->{'import_xml'}->{'indexer'}->{$field}->{$self->{'tag'}});  #print "field $field [",$self->{'tag'},"] = ",Dumper($self->{'import_xml'}->{'indexer'}->{$field}->{$self->{'tag'}});
172    
173                  foreach my $tag (@{$self->{'import_xml'}->{'indexer'}->{$field}->{$self->{'tag'}}}) {                  foreach my $tag (@{$self->{'import_xml'}->{'indexer'}->{$field}->{$self->{'tag'}}}) {
174                          my $format = $tag->{'value'} || $tag->{'content'};                          my $format;
175    
176                            $log->logdie("expected tag HASH and got $tag") unless (ref($tag) eq 'HASH');
177                            $format = $tag->{'value'} || $tag->{'content'};
178    
179                          $log->debug("format: $format");                          $log->debug("format: $format");
180    
# Line 254  sub data_structure { Line 257  sub data_structure {
257    
258          }          }
259    
260            $log->logdie("there is no current_filename defined! Do you have filename tag in conf/normalize/?.xml") unless ($self->{'current_filename'});
261    
262          $self->{'db'}->save_ds(          $self->{'db'}->save_ds(
263                  ds => \@ds,                  ds => \@ds,
264                  current_filename => $self->{'current_filename'},                  current_filename => $self->{'current_filename'},
# Line 535  sub get_data { Line 540  sub get_data {
540                  if ($sf && $$rec->{$f}->[$i]->{$sf}) {                  if ($sf && $$rec->{$f}->[$i]->{$sf}) {
541                          $$found++ if (defined($$found));                          $$found++ if (defined($$found));
542                          return $$rec->{$f}->[$i]->{$sf};                          return $$rec->{$f}->[$i]->{$sf};
543                  } elsif ($$rec->{$f}->[$i]) {                  } elsif (! $sf && $$rec->{$f}->[$i]) {
544                          $$found++ if (defined($$found));                          $$found++ if (defined($$found));
545                          # it still might have subfield, just                          # it still might have subfield, just
546                          # not specified, so we'll dump all                          # not specified, so we'll dump all
# Line 548  sub get_data { Line 553  sub get_data {
553                          } else {                          } else {
554                                  return $$rec->{$f}->[$i];                                  return $$rec->{$f}->[$i];
555                          }                          }
556                    } else {
557                            return '';
558                  }                  }
559          } else {          } else {
560                  return '';                  return '';

Legend:
Removed from v.31  
changed lines
  Added in v.64

  ViewVC Help
Powered by ViewVC 1.1.26