From f33e9f453cafd768594ff5fdada87e000bb909ae Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 12 Sep 2012 14:13:20 +0200 Subject: [PATCH] sru_z3950: relay surrogate diagnostics --- src/filter_sru_to_z3950.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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)) -- 1.7.10.4