AC_CHECK_FUNCS([localtime_r])
## YAZPP checks
-YAZPP_INIT([threads],[1.1.4])
+YAZPP_INIT([threads],[1.2.1])
if test -z "$YAZPPLIB"; then
AC_MSG_ERROR([YAZ++ development libraries missing])
fi
Standards-Version: 3.6.2
Maintainer: Adam Dickmeiss <adam@indexdata.dk>
Priority: extra
-Build-Depends: debhelper (>= 4), libyaz4-dev, libyazpp4-dev (>= 1.2.0), libxslt1-dev, libboost-dev, libboost-thread-dev, libboost-test-dev, libgnutls-dev
+Build-Depends: debhelper (>= 4), libyaz4-dev, libyazpp4-dev (>= 1.2.1), libxslt1-dev, libboost-dev, libboost-thread-dev, libboost-test-dev, libgnutls-dev
Package: metaproxy
Section: net
--- /dev/null
+etc/metaproxy/filters-enabled
+etc/metaproxy/filters-available
--- /dev/null
+<?xml version="1.0"?>
+<metaproxy xmlns="http://indexdata.com/metaproxy" version="1.0">
+ <dlpath>/usr/lib/metaproxy/modules</dlpath>
+ <start route="start"/>
+ <filters>
+ <filter id="frontend" type="frontend_net">
+ <threads>50</threads>
+ <port>@:9000</port>
+ </filter>
+ </filters>
+ <routes>
+ <route id="start">
+ <filter refid="frontend"/>
+ <filter type="log">
+ <message>log</message>
+ </filter>
+ <include src="filters-enabled/*.xml"/>
+ <filter type="bounce"/>
+ </route>
+ </routes>
+</metaproxy>
+
dh_installexamples
mv debian/tmp/usr/share/doc/metaproxy debian/tmp/usr/share/doc/metaproxy-doc
mkdir -p debian/tmp/etc/metaproxy
- cp debian/tmp/usr/share/metaproxy/etc/config.debian.xml debian/tmp/etc/metaproxy/metaproxy.xml
+ cp debian/metaproxy.xml debian/tmp/etc/metaproxy/metaproxy.xml
dh_install
# dh_installmenu
# dh_installdebconf
$(srcdir)/config3.xml \
$(srcdir)/config4.xml \
$(srcdir)/config5.xml \
- $(srcdir)/retrieval-info.xml \
- $(srcdir)/config.debian.xml
+ $(srcdir)/retrieval-info.xml
config = example.simple-auth example.target-auth pqf2pqf.xsl explain.xml
+++ /dev/null
-<?xml version="1.0"?>
-<metaproxy xmlns="http://indexdata.com/metaproxy" version="1.0">
- <!-- Z39.50 proxy which relays to target specified in Init otherinfo
- (VAL_RPOXY). If no target is given, it relays to target
- z3950.indexdata.dk -->
- <dlpath>/usr/lib/metaproxy/modules</dlpath>
- <start route="start"/>
- <filters>
- <filter id="frontend" type="frontend_net">
- <threads>50</threads>
- <port>@:9000</port>
- </filter>
- <filter id="backend" type="z3950_client">
- <timeout>30</timeout>
- <default_target>z3950.indexdata.dk</default_target>
- </filter>
- </filters>
- <routes>
- <route id="start">
- <filter refid="frontend"/>
- <filter type="log">
- <message>log</message>
- </filter>
- <filter refid="backend"/>
- <filter type="bounce"/>
- </route>
- </routes>
-</metaproxy>
-
if (doc)
{
mp::FactoryStatic factory;
- mp::RouterFleXML router(doc, factory, false);
+ mp::RouterFleXML router(doc, factory, false, 0);
mp::Package pack;
yaz_log(YLOG_FATAL, "XInclude processing failed");
return 1;
}
+ WRBUF base_path = wrbuf_alloc();
+ const char *last_p = strrchr(fname,
+#ifdef WIN32
+ '\\'
+#else
+ '/'
+#endif
+ );
+ if (last_p)
+ wrbuf_write(base_path, fname, last_p - fname);
+
mp::FactoryStatic factory;
- mp::RouterFleXML router(doc, factory, false);
+ mp::RouterFleXML router(doc, factory, false, wrbuf_cstr(base_path));
+ wrbuf_destroy(base_path);
yaz_sc_running(s);
#include <map>
#include <list>
#include <yaz/log.h>
+#include <yaz/xml_include.h>
#include <boost/shared_ptr.hpp>
friend class RouterFleXML::Pos;
Rep();
- void base(xmlDocPtr doc, mp::FactoryFilter &factory, bool test_only);
+ void base(xmlDocPtr doc, mp::FactoryFilter &factory, bool test_only,
+ const char *file_include_path);
typedef std::map<std::string,
boost::shared_ptr<const mp::filter::Base > >
std::string m_dl_path;
- void parse_xml_config_dom(xmlDocPtr doc, bool test_only);
+ void parse_xml_config_dom(xmlDocPtr doc, bool test_only,
+ const char *file_include_path);
void parse_xml_filters(xmlDocPtr doc, const xmlNode *node,
bool test_only);
}
void mp::RouterFleXML::Rep::parse_xml_config_dom(xmlDocPtr doc,
- bool test_only)
+ bool test_only,
+ const char *file_include_path)
{
if (!doc)
throw mp::XMLError("Empty XML Document");
const xmlNode* root = xmlDocGetRootElement(doc);
+
+ if (file_include_path)
+ {
+ int r = yaz_xml_include_simple((xmlNode *) root, file_include_path);
+ if (r)
+ throw mp::XMLError("YAZ XML Include failed");
+ }
mp::xml::check_element_mp(root, "metaproxy");
}
void mp::RouterFleXML::Rep::base(xmlDocPtr doc, mp::FactoryFilter &factory,
- bool test_only)
+ bool test_only, const char *file_include_path)
{
m_factory = &factory;
- parse_xml_config_dom(doc, test_only);
+ parse_xml_config_dom(doc, test_only, file_include_path);
m_start_route = "start";
}
mp::RouterFleXML::RouterFleXML(xmlDocPtr doc, mp::FactoryFilter &factory,
- bool test_only)
+ bool test_only, const char *file_include_path)
: m_p(new Rep)
{
- m_p->base(doc, factory, test_only);
+ m_p->base(doc, factory, test_only, file_include_path);
}
mp::RouterFleXML::RouterFleXML(std::string xmlconf, mp::FactoryFilter &factory,
throw mp::XMLError("xmlParseMemory failed");
else
{
- m_p->base(doc, factory, test_only);
+ m_p->base(doc, factory, test_only, 0);
xmlFreeDoc(doc);
}
}
RouterFleXML(std::string xmlconf, metaproxy_1::FactoryFilter &factory,
bool test_only);
RouterFleXML(xmlDocPtr doc, metaproxy_1::FactoryFilter &factory,
- bool test_only);
+ bool test_only, const char *file_include_path);
~RouterFleXML();