1 /* This file is part of Metaproxy.
2 Copyright (C) Index Data
4 Metaproxy is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
9 Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef YP2_SDU_UTIL_HPP
20 #define YP2_SDU_UTIL_HPP
22 #include <metaproxy/util.hpp>
23 #include <metaproxy/package.hpp>
32 std::ostream& operator<<(std::ostream& os, Z_SRW_PDU& srw_pdu);
37 namespace metaproxy_1 {
42 // std::string sru_protocol(const Z_HTTP_Request &http_req);
43 // std::string debug_http(const Z_HTTP_Request &http_req);
44 // void http_response(mp::Package &package,
45 // const std::string &content,
46 // int http_code = 200);
48 bool build_sru_debug_package(metaproxy_1::Package &package);
50 SRUServerInfo get_sru_server_info(metaproxy_1::Package &package);
51 // Z_SRW_explainRequest
54 // bool build_simple_explain(metaproxy_1::Package &package,
55 // metaproxy_1::odr &odr_en,
56 // Z_SRW_PDU *sru_pdu_res,
57 // SRUServerInfo sruinfo,
58 // Z_SRW_explainRequest const *er_req = 0);
60 bool build_sru_explain(metaproxy_1::Package &package,
61 metaproxy_1::odr &odr_en,
62 Z_SRW_PDU *sru_pdu_res,
63 SRUServerInfo sruinfo,
64 const xmlNode *explain = 0,
65 Z_SRW_explainRequest const *er_req = 0);
67 bool build_sru_response(metaproxy_1::Package &package,
68 metaproxy_1::odr &odr_en,
70 const Z_SRW_PDU *sru_pdu_res,
72 const char *stylesheet);
74 Z_SRW_PDU * decode_sru_request(metaproxy_1::Package &package,
75 metaproxy_1::odr &odr_de,
76 metaproxy_1::odr &odr_en,
77 Z_SRW_diagnostic **diagnostic,
82 bool check_sru_query_exists(metaproxy_1::Package &package,
83 metaproxy_1::odr &odr_en,
84 Z_SRW_PDU *sru_pdu_res,
85 Z_SRW_searchRetrieveRequest
88 Z_ElementSetNames * build_esn_from_schema(metaproxy_1::odr &odr_en,
109 // enum SRU_protocol_type { SRU_NONE, SRU_GET, SRU_POST, SRU_SOAP};
110 // typedef const int SRU_query_type;
111 // union SRW_query {char * cql; char * xcql; char * pqf;};
113 // //bool decode(const Z_HTTP_Request &http_req);
114 // SRU_protocol_type protocol(const Z_HTTP_Request &http_req) const;
116 // SRU_protocol_type m_protocol;
117 // std::string m_charset;
118 // std::string m_stylesheet;
127 * c-file-style: "Stroustrup"
128 * indent-tabs-mode: nil
130 * vim: shiftwidth=4 tabstop=8 expandtab