/* This file is part of Metaproxy.
- Copyright (C) 2005-2008 Index Data
+ Copyright (C) 2005-2012 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 "config.hpp"
-#include "util.hpp"
+#include <metaproxy/util.hpp>
-#include "filter.hpp"
-#include "package.hpp"
+#include <metaproxy/filter.hpp>
+#include <metaproxy/package.hpp>
#include "filter_cql_to_rpn.hpp"
// define Pimpl wrapper forwarding to Impl
-
+
yf::CQLtoRPN::CQLtoRPN() : m_p(new Impl)
{
}
{ // must have a destructor because of boost::scoped_ptr
}
-void yf::CQLtoRPN::configure(const xmlNode *xmlnode, bool test_only)
+void yf::CQLtoRPN::configure(const xmlNode *xmlnode, bool test_only,
+ const char *path)
{
m_p->configure(xmlnode);
}
}
yf::CQLtoRPN::Impl::~Impl()
-{
+{
}
void yf::CQLtoRPN::Impl::configure(const xmlNode *xmlnode)
<conversion file="pqf.properties"/>
</filter>
*/
-
+
std::string fname;
for (xmlnode = xmlnode->children; xmlnode; xmlnode = xmlnode->next)
{
}
else
{
- throw mp::filter::FilterException("Bad element "
+ throw mp::filter::FilterException("Bad element "
+ std::string((const char *)
xmlnode->name));
}
char *addinfo = 0;
Z_RPNQuery *rpnquery = 0;
mp::odr odr;
-
+
int r = m_cql2rpn.query_transform(sr->query->u.type_104->u.cql,
&rpnquery, odr,
&addinfo);
if (r == -3)
{
- Z_APDU *f_apdu =
+ Z_APDU *f_apdu =
odr.create_searchResponse(
- apdu_req,
+ apdu_req,
YAZ_BIB1_TEMPORARY_SYSTEM_ERROR,
"Missing CQL to RPN configuration");
package.response() = f_apdu;
{
int error_code = yaz_diag_srw_to_bib1(r);
- Z_APDU *f_apdu =
+ Z_APDU *f_apdu =
odr.create_searchResponse(apdu_req, error_code, addinfo);
package.response() = f_apdu;
return;
}
else
{ // conversion OK
-
+
sr->query->which = Z_Query_type_1;
sr->query->u.type_1 = rpnquery;
package.request() = gdu;
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
- * c-file-style: "stroustrup"
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
*/
+