From c07ab9012d58ce2df5466c989922fdde56b9505c Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 11 Nov 2005 19:33:27 +0000 Subject: [PATCH] adjust authority stuff; separate title and subtitle git-svn-id: svn://svn.open-ils.org/ILS/trunk@2006 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../Application/Storage/Publisher/authority.pm | 11 +++++++++-- Open-ILS/src/perlmods/OpenILS/Utils/ModsParser.pm | 7 ++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/authority.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/authority.pm index 07914a6667..860a8f5cad 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/authority.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/authority.pm @@ -26,7 +26,14 @@ sub find_authority_marc { my $subfield = $args{subfield}; my $tag_where = "AND f.tag LIKE '$tag'"; + if (ref $tag) { + $tag_where = "AND f.tag IN ('".join("','",@$tag)."')"; + } + my $sf_where = "AND f.subfield = '$subfield'"; + if (ref $subfield) { + $sf_where = "AND f.subfield IN ('".join("','",@$subfield)."')"; + } my $search_table = authority::full_rec->table; my $marc_table = authority::record_entry->table; @@ -104,7 +111,7 @@ sub find_see_from_controlled { ->run( term => $term, tag => '4%', subfield => $sf ); for my $m ( @marc ) { my $doc = $parser->parse_string($m); - my @nodes = $doc->documentElement->findnodes('//*[substring(@tag,1,1)="1"]/*'); + my @nodes = $doc->documentElement->findnodes('//*[substring(@tag,1,1)="1"]/*[@code="a" or @code="d" or @code="x"]'); my $list = [ map { $_->textContent } @nodes ]; $client->respond( $list ) if (_empty_check($$list[0], "metabib::${class}_field_entry")); } @@ -133,7 +140,7 @@ sub find_see_also_from_controlled { ->run( term => $term, tag => '5%', subfield => $sf ); for my $m ( @marc ) { my $doc = $parser->parse_string($m); - my @nodes = $doc->documentElement->findnodes('//*[substring(@tag,1,1)="1"]/*'); + my @nodes = $doc->documentElement->findnodes('//*[substring(@tag,1,1)="1"]/*[@code="a" or @code="d" or @code="x"]'); my $list = [ map { $_->textContent } @nodes ]; $client->respond( $list ) if (_empty_check($$list[0], "metabib::${class}_field_entry")); } diff --git a/Open-ILS/src/perlmods/OpenILS/Utils/ModsParser.pm b/Open-ILS/src/perlmods/OpenILS/Utils/ModsParser.pm index 083bc3e03a..794986c59a 100644 --- a/Open-ILS/src/perlmods/OpenILS/Utils/ModsParser.pm +++ b/Open-ILS/src/perlmods/OpenILS/Utils/ModsParser.pm @@ -162,7 +162,12 @@ sub modsdoc_to_values { my @value = $self->get_field_value( $mods, $xpathset->{$class}->{$type} ); for my $arr (@value) { if( ref($arr) ) { - $data->{$class}->{$type} = join(" ", @$arr); + $data->{$class}->{$type} = shift @$arr; + $data->{$class}->{$type} = shift @$arr if (lc($data->{$class}->{$type}) =~ /^the|an?/o); + for my $t (@$arr) { + $data->{$class}->{$type} .= ' : ' if ($data->{$class}->{$type} =~ /\w\s*$/o); + $data->{$class}->{$type} .= " $t"; + } } else { $data->{$class}->{$type} = $arr; } -- 2.43.2