From 371a02c325fb4d7cdfc24a81c38e36077382e648 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 28 Nov 2011 22:19:57 +0100 Subject: [PATCH] zoom: new TARGET profile setting: SRUVersion When set, ZOOM Cs sru_version will be set to its value. --- doc/zoom.xml | 10 ++++++++++ etc/config-zoom.xml | 1 + src/filter_zoom.cpp | 8 ++++++++ xml/schema/filter_zoom.rnc | 1 + 4 files changed, 20 insertions(+) diff --git a/doc/zoom.xml b/doc/zoom.xml index 8797de1..e9f44fd 100644 --- a/doc/zoom.xml +++ b/doc/zoom.xml @@ -470,6 +470,16 @@ + SRUVersion + + Specifies the SRU version to use. It unset, version 1.2 will be + used. Some servers do not support this version, in which case + version 1.1 or even 1.0 could be set it. + + + + + transform Specifies a XSL stylesheet filename to be used if record diff --git a/etc/config-zoom.xml b/etc/config-zoom.xml index f0fa876..9d1c713 100644 --- a/etc/config-zoom.xml +++ b/etc/config-zoom.xml @@ -45,6 +45,7 @@ s=al 1=title s=pw t=l,r get + 1.1 tmarc.xsl localhost:9998/db01 embed diff --git a/src/filter_zoom.cpp b/src/filter_zoom.cpp index 914cde3..3fd7e04 100644 --- a/src/filter_zoom.cpp +++ b/src/filter_zoom.cpp @@ -64,6 +64,7 @@ namespace metaproxy_1 { std::string target; std::string query_encoding; std::string sru; + std::string sru_version; std::string request_syntax; std::string element_set; std::string record_encoding; @@ -425,6 +426,10 @@ yf::Zoom::SearchablePtr yf::Zoom::Impl::parse_torus_record(const xmlNode *ptr) { s->sru = mp::xml::get_text(ptr); } + else if (!strcmp((const char *) ptr->name, "SRUVersion")) + { + s->sru_version = mp::xml::get_text(ptr); + } else if (!strcmp((const char *) ptr->name, "queryEncoding")) { @@ -960,6 +965,9 @@ yf::Zoom::BackendPtr yf::Zoom::Frontend::get_backend_from_databases( { url = "http://" + sptr->target; b->set_option("sru", sptr->sru); + + if (sptr->sru_version.length()) + b->set_option("sru_version", sptr->sru_version); } else { diff --git a/xml/schema/filter_zoom.rnc b/xml/schema/filter_zoom.rnc index 64cd178..3480061 100644 --- a/xml/schema/filter_zoom.rnc +++ b/xml/schema/filter_zoom.rnc @@ -29,6 +29,7 @@ filter_zoom = element mp:recordEncoding { xsd:string }?, element mp:requestSyntax { xsd:string }?, element mp:sru { xsd:string }?, + element mp:SRUVersion { xsd:string }?, element mp:transform { xsd:string }?, element mp:literalTransform { xsd:string }?, element mp:urlRecipe { xsd:string }?, -- 1.7.10.4