From: Adam Dickmeiss Date: Wed, 12 Sep 2012 12:13:20 +0000 (+0200) Subject: sru_z3950: relay surrogate diagnostics X-Git-Tag: v1.3.45~1 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=f33e9f453cafd768594ff5fdada87e000bb909ae;p=metaproxy-moved-to-github.git sru_z3950: relay surrogate diagnostics --- diff --git a/src/filter_sru_to_z3950.cpp b/src/filter_sru_to_z3950.cpp index 4fdc80b..65481bd 100644 --- a/src/filter_sru_to_z3950.cpp +++ b/src/filter_sru_to_z3950.cpp @@ -780,7 +780,26 @@ bool yf::SRUtoZ3950::Impl::z3950_present_request( sru_res->records[i + num].recordPacking = record_packing; - if (npr->which == Z_NamePlusRecord_databaseRecord && + if (npr->which == Z_NamePlusRecord_surrogateDiagnostic) + { + Z_DiagRec *p = npr->u.surrogateDiagnostic; + if (p->which == Z_DiagRec_defaultFormat) + { + Z_DefaultDiagFormat *df = p->u.defaultFormat; + int c = yaz_diag_bib1_to_srw(*df->condition); + + yaz_mk_sru_surrogate( + odr_en, sru_res->records + i + num, position, + c, df->u.v2Addinfo); + } + else + { + yaz_mk_sru_surrogate( + odr_en, sru_res->records + i + num, position, + YAZ_SRW_RECORD_TEMPORARILY_UNAVAILABLE, 0); + } + } + else if (npr->which == Z_NamePlusRecord_databaseRecord && npr->u.databaseRecord->direct_reference && !oid_oidcmp(npr->u.databaseRecord->direct_reference, yaz_oid_recsyn_xml))