/* This file is part of Metaproxy.
- Copyright (C) 2005-2012 Index Data
+ Copyright (C) 2005-2013 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
#include <yaz/zgdu.h>
#include <yaz/diagbib1.h>
#include <yaz/srw.h>
-
+#include <yaz/tpath.h>
namespace mp = metaproxy_1;
namespace yf = metaproxy_1::filter;
Impl();
~Impl();
void process(metaproxy_1::Package & package);
- void configure(const xmlNode * ptr);
+ void configure(const xmlNode *ptr, const char *path);
private:
yazpp_1::Yaz_cql2rpn m_cql2rpn;
};
void yf::CQLtoRPN::configure(const xmlNode *xmlnode, bool test_only,
const char *path)
{
- m_p->configure(xmlnode);
+ m_p->configure(xmlnode, path);
}
void yf::CQLtoRPN::process(mp::Package &package) const
{
}
-void yf::CQLtoRPN::Impl::configure(const xmlNode *xmlnode)
+void yf::CQLtoRPN::Impl::configure(const xmlNode *xmlnode, const char *path)
{
/*
"for filter cql_rpn");
}
+
+ char fullpath[1024];
+ if (!yaz_filepath_resolve(fname.c_str(), path, 0, fullpath))
+ {
+ throw mp::filter::FilterException("Could not open " + fname);
+ }
int error = 0;
- if (!m_cql2rpn.parse_spec_file(fname.c_str(), &error))
+ if (!m_cql2rpn.parse_spec_file(fullpath, &error))
{
throw mp::filter::FilterException("Bad or missing "
"CQL to RPN configuration "
}
extern "C" {
- struct metaproxy_1_filter_struct metaproxy_1_filter_cql_to_rpn = {
+ struct metaproxy_1_filter_struct metaproxy_1_filter_cql_rpn = {
0,
"cql_rpn",
filter_creator