projects
/
metaproxy-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Configure and build docbook doc as part of make.
[metaproxy-moved-to-github.git]
/
src
/
filter_query_rewrite.cpp
diff --git
a/src/filter_query_rewrite.cpp
b/src/filter_query_rewrite.cpp
index
b030fac
..
e431b27
100644
(file)
--- a/
src/filter_query_rewrite.cpp
+++ b/
src/filter_query_rewrite.cpp
@@
-1,5
+1,5
@@
-/* $Id: filter_query_rewrite.cpp,v 1.4 2006-03-15 14:55:17 adam Exp $
- Copyright (c) 2005, Index Data.
+/* $Id: filter_query_rewrite.cpp,v 1.6 2006-03-16 10:40:59 adam Exp $
+ Copyright (c) 2005-2006, Index Data.
%LICENSE%
*/
%LICENSE%
*/
@@
-9,9
+9,6
@@
#include "filter.hpp"
#include "package.hpp"
#include "filter.hpp"
#include "package.hpp"
-//#include <boost/thread/mutex.hpp>
-#include <boost/regex.hpp>
-
#include "util.hpp"
#include "filter_query_rewrite.hpp"
#include "util.hpp"
#include "filter_query_rewrite.hpp"
@@
-22,15
+19,16
@@
#include <libxslt/xsltutils.h>
#include <libxslt/transform.h>
#include <libxslt/xsltutils.h>
#include <libxslt/transform.h>
-namespace yf = yp2::filter;
+namespace mp = metaproxy_1;
+namespace yf = mp::filter;
-namespace yp2 {
+namespace metaproxy_1 {
namespace filter {
class QueryRewrite::Rep {
public:
Rep();
~Rep();
namespace filter {
class QueryRewrite::Rep {
public:
Rep();
~Rep();
- void process(yp2::Package &package) const;
+ void process(mp::Package &package) const;
void configure(const xmlNode * ptr);
private:
xsltStylesheetPtr m_stylesheet;
void configure(const xmlNode * ptr);
private:
xsltStylesheetPtr m_stylesheet;
@@
-57,17
+55,17
@@
yf::QueryRewrite::~QueryRewrite()
{ // must have a destructor because of boost::scoped_ptr
}
{ // must have a destructor because of boost::scoped_ptr
}
-void yf::QueryRewrite::process(yp2::Package &package) const
+void yf::QueryRewrite::process(mp::Package &package) const
{
m_p->process(package);
}
{
m_p->process(package);
}
-void yp2::filter::QueryRewrite::configure(const xmlNode *ptr)
+void mp::filter::QueryRewrite::configure(const xmlNode *ptr)
{
m_p->configure(ptr);
}
{
m_p->configure(ptr);
}
-void yf::QueryRewrite::Rep::process(yp2::Package &package) const
+void yf::QueryRewrite::Rep::process(mp::Package &package) const
{
Z_GDU *gdu = package.request().get();
{
Z_GDU *gdu = package.request().get();
@@
-78,7
+76,7
@@
void yf::QueryRewrite::Rep::process(yp2::Package &package) const
{
int error_code = 0;
const char *addinfo = 0;
{
int error_code = 0;
const char *addinfo = 0;
- yp2::odr odr;
+ mp::odr odr;
Z_SearchRequest *req = apdu_req->u.searchRequest;
xmlDocPtr doc_input = 0;
Z_SearchRequest *req = apdu_req->u.searchRequest;
xmlDocPtr doc_input = 0;
@@
-123,7
+121,7
@@
void yf::QueryRewrite::Rep::process(yp2::Package &package) const
package.move();
}
package.move();
}
-void yp2::filter::QueryRewrite::Rep::configure(const xmlNode *ptr)
+void mp::filter::QueryRewrite::Rep::configure(const xmlNode *ptr)
{
for (ptr = ptr->children; ptr; ptr = ptr->next)
{
{
for (ptr = ptr->children; ptr; ptr = ptr->next)
{
@@
-133,15
+131,15
@@
void yp2::filter::QueryRewrite::Rep::configure(const xmlNode *ptr)
{
if (m_stylesheet)
{
{
if (m_stylesheet)
{
- throw yp2::filter::FilterException
+ throw mp::filter::FilterException
("Only one xslt element allowed in query_rewrite filter");
}
("Only one xslt element allowed in query_rewrite filter");
}
- std::string fname = yp2::xml::get_text(ptr);
+ std::string fname = mp::xml::get_text(ptr);
m_stylesheet = xsltParseStylesheetFile(BAD_CAST fname.c_str());
if (!m_stylesheet)
{
m_stylesheet = xsltParseStylesheetFile(BAD_CAST fname.c_str());
if (!m_stylesheet)
{
- throw yp2::filter::FilterException
+ throw mp::filter::FilterException
("Failed to read stylesheet "
+ fname
+ " in query_rewrite filter");
("Failed to read stylesheet "
+ fname
+ " in query_rewrite filter");
@@
-149,7
+147,7
@@
void yp2::filter::QueryRewrite::Rep::configure(const xmlNode *ptr)
}
else
{
}
else
{
- throw yp2::filter::FilterException
+ throw mp::filter::FilterException
("Bad element "
+ std::string((const char *) ptr->name)
+ " in query_rewrite filter");
("Bad element "
+ std::string((const char *) ptr->name)
+ " in query_rewrite filter");
@@
-157,13
+155,13
@@
void yp2::filter::QueryRewrite::Rep::configure(const xmlNode *ptr)
}
}
}
}
-static yp2::filter::Base* filter_creator()
+static mp::filter::Base* filter_creator()
{
{
- return new yp2::filter::QueryRewrite;
+ return new mp::filter::QueryRewrite;
}
extern "C" {
}
extern "C" {
- struct yp2_filter_struct yp2_filter_query_rewrite = {
+ struct metaproxy_1_filter_struct metaproxy_1_filter_query_rewrite = {
0,
"query-rewrite",
filter_creator
0,
"query-rewrite",
filter_creator