mp::odr &odr_en, Z_Query *z_query,
const Z_SRW_searchRetrieveRequest *req
) const;
-
+
bool z3950_init_request(
mp::Package &package,
mp::odr &odr_en,
}
// assigning explain node to database name - no check yet
m_database_explain.insert(std::make_pair(database, explainnode));
- }
+ }
}
}
if (z3950_gdu && z3950_gdu->which == Z_GDU_Z3950
&& z3950_gdu->u.z3950->which == Z_APDU_initResponse
&& *z3950_gdu->u.z3950->u.initResponse->result)
- return true;
+ return true;
yaz_add_srw_diagnostic(odr_en,
&(sru_pdu_res->u.response->diagnostics),
if (!mp_util::set_databases_from_zurl(odr_en, zurl,
- &z_searchRequest->num_databaseNames,
- &z_searchRequest->databaseNames))
+ &z_searchRequest->num_databaseNames,
+ &z_searchRequest->databaseNames))
{
z_searchRequest->num_databaseNames = 1;
z_searchRequest->databaseNames = (char**)
= odr_strdup(odr_en, const_cast<char *>(sr_req->database));
else
z_searchRequest->databaseNames[0]
- = odr_strdup(odr_en, "Default");
+ = odr_strdup(odr_en, "Default");
}
// z3950'fy query
int
yf::SRUtoZ3950::Impl::z3950_to_srw_diag(mp::odr &odr_en,
- Z_SRW_searchRetrieveResponse *sru_res,
- Z_DefaultDiagFormat *ddf) const
+ Z_SRW_searchRetrieveResponse *sru_res,
+ Z_DefaultDiagFormat *ddf) const
{
int bib1_code = *ddf->condition;
sru_res->num_diagnostics = 1;
// building SRU explain record
std::string explain_xml;
- if (explain == 0){
+ if (explain == 0)
+ {
explain_xml
= mp_util::to_string(
"<explain xmlns=\"" + xmlns_explain + "\">\n"
" </serverInfo>\n"
"</explain>\n");
}
- else {
+ else
+ {
// make new XML DOC with given explain node
xmlDocPtr doc = xmlNewDoc(BAD_CAST "1.0");
xmlDocSetRootElement(doc, (xmlNode*)explain);
z_HTTP_header_add(odr_en,
&http_res->headers, "Content-Type", ctype.c_str());
- // packaging Z_SOAP into HTML response
- static Z_SOAP_Handler soap_handlers[4] = {
- {(char *)YAZ_XMLNS_SRU_v1_1, 0, (Z_SOAP_fun) yaz_srw_codec},
- {(char *)YAZ_XMLNS_SRU_v1_0, 0, (Z_SOAP_fun) yaz_srw_codec},
- {(char *)YAZ_XMLNS_UPDATE_v0_9, 0, (Z_SOAP_fun) yaz_ucp_codec},
- {0, 0, 0}
- };
+ // packaging Z_SOAP into HTML response
+ static Z_SOAP_Handler soap_handlers[4] = {
+ {(char *)YAZ_XMLNS_SRU_v1_1, 0, (Z_SOAP_fun) yaz_srw_codec},
+ {(char *)YAZ_XMLNS_SRU_v1_0, 0, (Z_SOAP_fun) yaz_srw_codec},
+ {(char *)YAZ_XMLNS_UPDATE_v0_9, 0, (Z_SOAP_fun) yaz_ucp_codec},
+ {0, 0, 0}
+ };
- // empty stylesheet means NO stylesheet
- if (stylesheet && *stylesheet == '\0')
- stylesheet = 0;
+ // empty stylesheet means NO stylesheet
+ if (stylesheet && *stylesheet == '\0')
+ stylesheet = 0;
- // encoding SRU package
+ // encoding SRU package
- soap->u.generic->p = (void*) sru_pdu_res;
- //int ret =
- z_soap_codec_enc_xsl(odr_en, &soap,
- &http_res->content_buf, &http_res->content_len,
- soap_handlers, charset, stylesheet);
+ soap->u.generic->p = (void*) sru_pdu_res;
+ //int ret =
+ z_soap_codec_enc_xsl(odr_en, &soap,
+ &http_res->content_buf, &http_res->content_len,
+ soap_handlers, charset, stylesheet);
- package.response() = zgdu_res;
- return true;
+ package.response() = zgdu_res;
+ return true;
}
package.session().close();
return false;
}
if ((sr_req->query_type == Z_SRW_query_type_xcql && !sr_req->query.xcql))
{
- yaz_add_srw_diagnostic(odr_en,
+ yaz_add_srw_diagnostic(odr_en,
&(sru_pdu_res->u.response->diagnostics),
&(sru_pdu_res->u.response->num_diagnostics),
- 10, "XCQL query is empty");
- return false;
+ 10, "XCQL query is empty");
+ return false;
}
if ((sr_req->query_type == Z_SRW_query_type_pqf && !sr_req->query.pqf))
{
{
os << "SRU";
- switch(srw_pdu.which) {
+ switch (srw_pdu.which)
+ {
case Z_SRW_searchRetrieve_request:
os << " " << "searchRetrieveRequest";
{