From f769e0395476e212ad2757538e546503edfda838 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 14 Jun 2011 12:59:42 +0200 Subject: [PATCH] zoom: Handle authentication element --- etc/config-zoom.xml | 2 +- src/filter_zoom.cpp | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/etc/config-zoom.xml b/etc/config-zoom.xml index 05002a2..12275f9 100644 --- a/etc/config-zoom.xml +++ b/etc/config-zoom.xml @@ -16,11 +16,11 @@ z-local localhost:9999/db01 iso-8859-1 - 1 F MARC21 MARC-8 tmarc.xsl + a/b u=1016 2=3 3=3 s=al s=pw t=l,r 6=1 u=1003 2=3 s=al s=pw t=l,r 6=1 u=4 2=3 3=3 s=al s=pw t=l,r 6=1 diff --git a/src/filter_zoom.cpp b/src/filter_zoom.cpp index a42d9f5..68252b2 100644 --- a/src/filter_zoom.cpp +++ b/src/filter_zoom.cpp @@ -42,6 +42,7 @@ namespace yf = mp::filter; namespace metaproxy_1 { namespace filter { struct Zoom::Searchable : boost::noncopyable { + std::string authentication; std::string database; std::string target; std::string query_encoding; @@ -297,7 +298,12 @@ void yf::Zoom::Impl::parse_torus(const xmlNode *ptr1) { if (ptr3->type != XML_ELEMENT_NODE) continue; - if (!strcmp((const char *) ptr3->name, "id")) + if (!strcmp((const char *) ptr3->name, + "authentication")) + { + s->authentication = mp::xml::get_text(ptr3); + } + else if (!strcmp((const char *) ptr3->name, "id")) { s->database = mp::xml::get_text(ptr3); } @@ -466,6 +472,9 @@ yf::Zoom::BackendPtr yf::Zoom::Frontend::get_backend_from_databases( if (sptr->query_encoding.length()) b->set_option("rpnCharset", sptr->query_encoding.c_str()); + if (sptr->authentication.length()) + b->set_option("user", sptr->authentication.c_str()); + std::string url; if (sptr->sru.length()) { -- 1.7.10.4