X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Ffilter_zoom.cpp;h=5f647dafee49341b2d0331ec91de2c7cb2f86da6;hb=cf16212cc3ea5a38f40b49779814eaeba57e69c0;hp=e8863ffb1d3fbf71580535d175cb840f63256ad6;hpb=d2a1afba74f86ba46a8b2783235f45ebeb92c76f;p=metaproxy-moved-to-github.git diff --git a/src/filter_zoom.cpp b/src/filter_zoom.cpp index e8863ff..5f647da 100644 --- a/src/filter_zoom.cpp +++ b/src/filter_zoom.cpp @@ -153,6 +153,7 @@ namespace metaproxy_1 { CCL_bibset bibset; std::string element_transform; std::string element_raw; + std::string proxy; std::map s_map; }; } @@ -549,6 +550,8 @@ void yf::Zoom::Impl::configure(const xmlNode *ptr, bool test_only, element_transform = mp::xml::get_text(attr->children); else if (!strcmp((const char *) attr->name, "element_raw")) element_raw = mp::xml::get_text(attr->children); + else if (!strcmp((const char *) attr->name, "proxy")) + proxy = mp::xml::get_text(attr->children); else throw mp::filter::FilterException( "Bad attribute " + std::string((const char *) @@ -644,7 +647,7 @@ yf::Zoom::BackendPtr yf::Zoom::Frontend::get_backend_from_databases( sptr = it->second; else { - xmlDoc *doc = mp::get_searchable(m_p->torus_url, torus_db); + xmlDoc *doc = mp::get_searchable(m_p->torus_url, torus_db, m_p->proxy); if (!doc) { *error = YAZ_BIB1_DATABASE_DOES_NOT_EXIST; @@ -661,8 +664,17 @@ yf::Zoom::BackendPtr yf::Zoom::Frontend::get_backend_from_databases( if (ptr->type == XML_ELEMENT_NODE && !strcmp((const char *) ptr->name, "record")) { + if (sptr) + { + *error = YAZ_BIB1_UNSPECIFIED_ERROR; + *addinfo = (char*) odr_malloc(odr, 40 + database.length()), + sprintf(*addinfo, "multiple records for udb=%s", + database.c_str()); + xmlFreeDoc(doc); + BackendPtr b; + return b; + } sptr = m_p->parse_torus_record(ptr); - break; } } }