X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Ffilter_record_transform.cpp;h=23c45241ead4dbe4d55c8b5992c503bc1e0e6086;hb=637a685d61a9ff0e3f398a59da426979815c4d68;hp=4570ac534349477bf49eed3f3cef7003c18ffd2a;hpb=b70b9ec78f0ab1c3ed3b432de986159129a0e4ed;p=metaproxy-moved-to-github.git diff --git a/src/filter_record_transform.cpp b/src/filter_record_transform.cpp index 4570ac5..23c4524 100644 --- a/src/filter_record_transform.cpp +++ b/src/filter_record_transform.cpp @@ -1,7 +1,22 @@ -/* $Id: filter_record_transform.cpp,v 1.8 2007-01-25 14:05:54 adam Exp $ +/* $Id: filter_record_transform.cpp,v 1.12 2007-05-09 21:23:09 adam Exp $ Copyright (c) 2005-2007, Index Data. - See the LICENSE file for details +This file is part of Metaproxy. + +Metaproxy is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Metaproxy; see the file LICENSE. If not, write to the +Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ #include "config.hpp" @@ -141,7 +156,7 @@ void yf::RecordTransform::Impl::process(mp::Package &package) const } const char *match_schema = 0; - int *match_syntax = 0; + Odr_oid *match_syntax = 0; const char *backend_schema = 0; Odr_oid *backend_syntax = 0; @@ -178,7 +193,7 @@ void yf::RecordTransform::Impl::process(mp::Package &package) const else if (ret_code == 2) { char oidbuf[OID_STR_MAX]; - oid_to_dotstring(input_syntax, oidbuf); + oid_oid_to_dotstring(input_syntax, oidbuf); details = odr_strdup(odr_en, oidbuf); apdu = odr_en.create_presentResponse( @@ -189,16 +204,12 @@ void yf::RecordTransform::Impl::process(mp::Package &package) const return; } - - // now re-coding the z3950 backend present request - // z3950'fy record syntax - if (backend_syntax) // TODO: this seems not to work - why ?? - pr_req->preferredRecordSyntax = backend_syntax; + if (backend_syntax) + pr_req->preferredRecordSyntax = odr_oiddup(odr_en, backend_syntax); else - pr_req->preferredRecordSyntax - = yaz_oidval_to_z3950oid(odr_en, CLASS_RECSYN, VAL_NONE); + pr_req->preferredRecordSyntax = 0; // z3950'fy record schema @@ -284,9 +295,8 @@ void yf::RecordTransform::Impl::process(mp::Package &package) const output_record); if (ret_trans == 0) { - struct oident *ident = oid_getentbyoid(match_syntax); npr->u.databaseRecord = - z_ext_record(odr_en, ident->value, + z_ext_record_oid(odr_en, match_syntax, wrbuf_buf(output_record), wrbuf_len(output_record)); } @@ -299,7 +309,7 @@ void yf::RecordTransform::Impl::process(mp::Package &package) const YAZ_BIB1_SYSTEM_ERROR_IN_PRESENTING_RECORDS, yaz_record_conv_get_error(rc)); } - wrbuf_free(output_record, 1); + wrbuf_destroy(output_record); } } }