From: Adam Dickmeiss Date: Wed, 10 Oct 2012 11:51:01 +0000 (+0200) Subject: zoom: new config element passthru X-Git-Tag: v1.3.49~2 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=bed9f4c782f6f411e40bbbeb517f48dbddf6de49;p=metaproxy-moved-to-github.git zoom: new config element passthru This defines an element that is passed verbatim to the backend - in pz2 mode. --- diff --git a/etc/config-zoom.xml b/etc/config-zoom.xml index b472d4f..ea44457 100644 --- a/etc/config-zoom.xml +++ b/etc/config-zoom.xml @@ -14,6 +14,7 @@ xsldir="." element_transform="pz2" element_raw="raw" + element_passthru="F" explain_xsl="torus2zeerex.xsl" record_xsl="pz2dc.xsl" > diff --git a/src/filter_zoom.cpp b/src/filter_zoom.cpp index 95a444b..95e2b36 100644 --- a/src/filter_zoom.cpp +++ b/src/filter_zoom.cpp @@ -227,6 +227,7 @@ namespace metaproxy_1 { CCL_bibset bibset; std::string element_transform; std::string element_raw; + std::string element_passthru; std::string proxy; xsltStylesheetPtr explain_xsp; xsltStylesheetPtr record_xsp; @@ -473,7 +474,8 @@ void yf::Zoom::Impl::release_frontend(mp::Package &package) } yf::Zoom::Impl::Impl() : - apdu_log(false), element_transform("pz2") , element_raw("raw"), + apdu_log(false), element_transform("pz2") , element_raw("raw") , + element_passthru("F"), zoom_timeout("40"), proxy_timeout(1) { bibset = ccl_qual_mk(); @@ -700,6 +702,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, "element_passthru")) + element_passthru = mp::xml::get_text(attr->children); else if (!strcmp((const char *) attr->name, "proxy")) proxy = mp::xml::get_text(attr->children); else if (!strcmp((const char *) attr->name, "explain_xsl")) @@ -1503,9 +1507,15 @@ void yf::Zoom::Frontend::prepare_elements(BackendPtr b, if (enable_pz2_retrieval) { - element_set_name = 0; - if (b->sptr->element_set.length()) - element_set_name = b->sptr->element_set.c_str(); + if (element_set_name && !strcmp(element_set_name, + m_p->element_passthru.c_str())) + ; + else + { + element_set_name = 0; + if (b->sptr->element_set.length()) + element_set_name = b->sptr->element_set.c_str(); + } } b->set_option("elementSetName", element_set_name); diff --git a/xml/schema/filter_zoom.rnc b/xml/schema/filter_zoom.rnc index 8d440e2..28696cf 100644 --- a/xml/schema/filter_zoom.rnc +++ b/xml/schema/filter_zoom.rnc @@ -14,6 +14,7 @@ filter_zoom = attribute xsldir { xsd:string }?, attribute element_transform { xsd:string }?, attribute element_raw { xsd:string }?, + attribute element_passthru { xsd:string }?, attribute proxy { xsd:string }?, attribute explain_xsl { xsd:string }?, attribute record_xsl { xsd:string }?,