X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Ffilter_record_transform.cpp;h=87fdf87dab1400ab9c3c856c5b6570c9ecd596f4;hb=6ce31309381822f3fe2a5364be1cd73a7472d62f;hp=8708521f84538a3e738c5e7837e170b4e5e679da;hpb=d0123337d70b0fb97b578cc57467bb94980f1014;p=metaproxy-moved-to-github.git diff --git a/src/filter_record_transform.cpp b/src/filter_record_transform.cpp index 8708521..87fdf87 100644 --- a/src/filter_record_transform.cpp +++ b/src/filter_record_transform.cpp @@ -1,5 +1,5 @@ /* This file is part of Metaproxy. - Copyright (C) 2005-2009 Index Data + Copyright (C) 2005-2011 Index Data Metaproxy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -17,19 +17,15 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.hpp" -#include "filter.hpp" #include "filter_record_transform.hpp" -#include "package.hpp" -#include "util.hpp" +#include +#include #include "gduutil.hpp" -#include "xmlutil.hpp" #include #include #include -//#include - #include namespace mp = metaproxy_1; @@ -43,7 +39,7 @@ namespace metaproxy_1 { Impl(); ~Impl(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * xml_node); + void configure(const xmlNode * xml_node, const char *path); private: yaz_retrieval_t m_retrieval; }; @@ -60,9 +56,10 @@ yf::RecordTransform::~RecordTransform() { // must have a destructor because of boost::scoped_ptr } -void yf::RecordTransform::configure(const xmlNode *xmlnode, bool test_only) +void yf::RecordTransform::configure(const xmlNode *xmlnode, bool test_only, + const char *path) { - m_p->configure(xmlnode); + m_p->configure(xmlnode, path); } void yf::RecordTransform::process(mp::Package &package) const @@ -87,11 +84,10 @@ yf::RecordTransform::Impl::~Impl() yaz_retrieval_destroy(m_retrieval); } -void yf::RecordTransform::Impl::configure(const xmlNode *xml_node) +void yf::RecordTransform::Impl::configure(const xmlNode *xml_node, + const char *path) { - //const char *srcdir = getenv("srcdir"); - //if (srcdir) - // yaz_retrieval_set_path(m_retrieval, srcdir); + yaz_retrieval_set_path(m_retrieval, path); if (!xml_node) throw mp::XMLError("RecordTransform filter config: empty XML DOM"); @@ -237,7 +233,6 @@ void yf::RecordTransform::Impl::process(mp::Package &package) const || !gdu_res->u.z3950->u.presentResponse) { - std::cout << "record-transform: error back present\n"; package.session().close(); return; }