From 449eeb0f81dda62a41a67fa4a877a2d82802039a Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 21 Apr 2008 15:41:45 +0000 Subject: [PATCH] added support for for truncation attribute to z39 queries. Thanks, James! git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@9394 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm b/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm index e2dd3f9c27..7908069b52 100755 --- a/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm @@ -284,13 +284,13 @@ sub compile_query { # "structure attribute" # ------------------------------------------------------------------- for( keys %$hash ) { -# $str .= '@attr ' . -# $services{$service}->{attrs}->{$_}->{format} . '=' . -# $services{$service}->{attrs}->{$_}->{code} . " \"" . $$hash{$_} . "\" "; - $str .= - '@attr 1=' . $services{$service}->{attrs}->{$_}->{code} . # add the use attribute - ' @attr 4=' . $services{$service}->{attrs}->{$_}->{format} . # add the structure attribute - " \"" . $$hash{$_} . "\" "; # add the search term + next unless ( exists $services{$service}->{attrs}->{$_} ); + $str .= '@attr 1=' . $services{$service}->{attrs}->{$_}->{code} . # add the use attribute + ' @attr 4=' . $services{$service}->{attrs}->{$_}->{format}; # add the structure attribute + if (exists $services{$service}->{attrs}->{$_}->{truncation}){ + $str .= ' @attr 5=' . $services{$service}->{attrs}->{$_}->{truncation}; + } + $str .= " \"" . $$hash{$_} . "\" "; # add the search term } return $str; } -- 2.11.0