<record>
<piggyback>1</piggyback>
<queryEncoding>UTF-8</queryEncoding>
+ <udb>jstor-local</udb>
+ <cclmap_term>s=al</cclmap_term>
+ <cclmap_ti>1=title s=pw t=l,r</cclmap_ti>
+ <sru>get</sru>
+ <transform>dc.xsl</transform>
+ <zurl>dfr.jstor.org/sru</zurl>
+ </record>
+ <record>
+ <piggyback>1</piggyback>
+ <queryEncoding>UTF-8</queryEncoding>
<udb>cf-local</udb>
<cclmap_term>1=1016 s=al</cclmap_term>
<cclmap_ti>1=4 s=pw t=l,r</cclmap_ti>
<fieldmap cql="dc.subject" ccl="su"/>
<fieldmap cql="bath.isbn" ccl="isbn"/>
<fieldmap cql="bath.issn" ccl="issn"/>
- <fieldmap cql="bash.isbn" ccl="isbn"/><!-- ### deprecated erroneous synonym -->
- <fieldmap cql="bash.issn" ccl="issn"/><!-- ### deprecated erroneous synonym -->
<fieldmap cql="dc.date" ccl="date"/>
- <!--
- I got some of the following CCL qualifier names from
- http://catalog.pburglib.org/polaris/Help/PWbasicsearch6.html
- These are marked with the comment POLARIS.
- The others, I just made up.
- (Mike, Wed Jun 15 22:50:18 BST 2011)
- -->
- <fieldmap cql="rec.identifier" ccl="ocn"/><!-- POLARIS -->
- <fieldmap cql="net.path" ccl="db"/>
- <fieldmap cql="dc.language" ccl="la"/><!-- POLARIS -->
- <fieldmap cql="dc.format" ccl="tom"/><!-- POLARIS -->
- <fieldmap cql="id.fullText" ccl="fullText"/>
- <fieldmap cql="id.peerReviewed" ccl="peerReviewed"/>
- <fieldmap cql="dc.description" ccl="desc"/>
- <fieldmap cql="dc.source" ccl="src"/>
- <fieldmap cql="dc.publisher" ccl="pub"/><!-- POLARIS -->
- <fieldmap cql="id.seriesTitle" ccl="series-ti"/>
-
<cclmap>
<qual name="ocn">
<attr type="1" value="12"/>
<message>F</message>
</filter>
<filter type="sru_z3950"/>
- <filter type="record_transform">
- <retrievalinfo xmlns="http://indexdata.com/yaz" version="1.0">
- <retrieval syntax="xml" name="usi">
- <backend syntax="xml" name="pz2">
- <xslt stylesheet="pz22usi.xsl"/>
- </backend>
- </retrieval>
- <retrieval syntax="xml"/>
- <retrieval syntax="json"/>
- <retrieval syntax="usmarc"/>
- </retrievalinfo>
- </filter>
<filter type="session_shared"/>
<filter type="log">
<message>B</message>
if (m_backend && m_backend->m_frontend_database == database)
return m_backend;
+ const char *sru_proxy = 0;
std::string db_args;
std::string torus_db;
size_t db_arg_pos = database.find(',');
{
// A CF target
b->set_option("user", sptr->cfAuth.c_str());
- if (authentication.length() && db_args.length() == 0)
+ if (db_args.length() == 0)
{
- // no database (auth) args specified already.. and the
- // Torus authentication has it.. Generate the args that CF
- // understands..
- size_t found = authentication.find('/');
- if (found != std::string::npos)
+ if (authentication.length())
+ {
+ // no database (auth) args specified already.. and the
+ // Torus authentication has it.. Generate the args that CF
+ // understands..
+ size_t found = authentication.find('/');
+ if (found != std::string::npos)
+ {
+ db_args += "user=" + mp::util::uri_encode(authentication.substr(0, found))
+ + "&password=" + mp::util::uri_encode(authentication.substr(found+1));
+ }
+ else
+ db_args += "user=" + mp::util::uri_encode(authentication);
+ }
+ if (sptr->cfProxy.length())
{
- db_args += "user=" + mp::util::uri_encode(authentication.substr(0, found))
- + "&password=" + mp::util::uri_encode(authentication.substr(found+1));
+ if (db_args.length())
+ db_args += "&";
+ db_args += "proxy=" + mp::util::uri_encode(sptr->cfProxy);
}
- else
- db_args += "user=" + mp::util::uri_encode(authentication);
+ }
+ if (sptr->cfSubDb.length())
+ {
+ if (db_args.length())
+ db_args += "&";
+ db_args += "subdatabase=" + mp::util::uri_encode(sptr->cfSubDb);
}
}
else
param_user = value;
else if (!strcmp(name, "password"))
param_password = value;
+ else if (!strcmp(name, "proxy"))
+ sru_proxy = value;
else
{
BackendPtr notfound;
b->set_option("user", authentication.c_str());
}
}
- if (sptr->cfProxy.length())
- {
- if (db_args.length())
- db_args += "&";
- db_args += "proxy=" + mp::util::uri_encode(sptr->cfProxy);
- }
- if (sptr->cfSubDb.length())
- {
- if (db_args.length())
- db_args += "&";
- db_args += "subdatabase=" + mp::util::uri_encode(sptr->cfSubDb);
- }
+
+ if (sru_proxy)
+ b->set_option("proxy", sru_proxy);
std::string url;
if (sptr->sru.length())
const char *file_include_path);
void parse_xml_filters(xmlDocPtr doc, const xmlNode *node,
- bool test_only);
+ bool test_only, const char *file_include_path);
void parse_xml_routes(xmlDocPtr doc, const xmlNode *node,
- bool test_only);
+ bool test_only, const char *file_include_path);
bool m_xinclude;
private:
void mp::RouterFleXML::Rep::parse_xml_filters(xmlDocPtr doc,
const xmlNode *node,
- bool test_only)
+ bool test_only,
+ const char *file_include_path)
{
unsigned int filter_nr = 0;
while(node && mp::xml::check_element_mp(node, "filter"))
void mp::RouterFleXML::Rep::parse_xml_routes(xmlDocPtr doc,
const xmlNode *node,
- bool test_only)
+ bool test_only,
+ const char *file_include_path)
{
mp::xml::check_element_mp(node, "route");
{
parse_xml_filters(doc, mp::xml::jump_to_children(node,
XML_ELEMENT_NODE),
- test_only);
+ test_only, file_include_path);
node = mp::xml::jump_to_next(node, XML_ELEMENT_NODE);
}
mp::xml::check_element_mp(node, "routes");
parse_xml_routes(doc, mp::xml::jump_to_children(node, XML_ELEMENT_NODE),
- test_only);
+ test_only, file_include_path);
node = mp::xml::jump_to_next(node, XML_ELEMENT_NODE);
if (node)
xmlFreeDoc(doc);
}
}
+ catch ( std::runtime_error &e) {
+ std::cout << "std::runtime error: " << e.what() << std::endl;
+ BOOST_CHECK(false);
+ }
catch ( ... ) {
- BOOST_CHECK (false);
+ std::cout << "unknown exception" << std::endl;
+ BOOST_CHECK(false);
}
}
break;
}
}
- boost::regex::flag_type b_mode = boost::regex::perl;
- if (mode.find_first_of('i') != std::string::npos)
- b_mode |= boost::regex::icase;
- boost::regex e(pattern, b_mode);
-
- boost::match_flag_type match_mode = boost::format_first_only;
- if (mode.find_first_of('g') != std::string::npos)
- match_mode = boost::format_all;
- result += regex_replace(text, e, replacement, match_mode);
+ if (pattern.length() == 0)
+ result += text;
+ else
+ {
+ boost::regex::flag_type b_mode = boost::regex::perl;
+ if (mode.find_first_of('i') != std::string::npos)
+ b_mode |= boost::regex::icase;
+ boost::regex e(pattern, b_mode);
+ boost::match_flag_type match_mode = boost::format_first_only;
+ if (mode.find_first_of('g') != std::string::npos)
+ match_mode = boost::format_all;
+ result += regex_replace(text, e, replacement, match_mode);
+ }
}
}
return result;