1 /* This file is part of Metaproxy.
2 Copyright (C) 2005-2009 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
23 #include "package.hpp"
25 //#include <yaz/zgdu.h>
26 //#include <yaz/z-core.h>
34 std::ostream& operator<<(std::ostream& os, Z_SRW_PDU& srw_pdu);
39 namespace metaproxy_1 {
44 // std::string sru_protocol(const Z_HTTP_Request &http_req);
45 // std::string debug_http(const Z_HTTP_Request &http_req);
46 // void http_response(mp::Package &package,
47 // const std::string &content,
48 // int http_code = 200);
50 bool build_sru_debug_package(metaproxy_1::Package &package);
52 SRUServerInfo get_sru_server_info(metaproxy_1::Package &package);
53 // Z_SRW_explainRequest
56 // bool build_simple_explain(metaproxy_1::Package &package,
57 // metaproxy_1::odr &odr_en,
58 // Z_SRW_PDU *sru_pdu_res,
59 // SRUServerInfo sruinfo,
60 // Z_SRW_explainRequest const *er_req = 0);
62 bool build_sru_explain(metaproxy_1::Package &package,
63 metaproxy_1::odr &odr_en,
64 Z_SRW_PDU *sru_pdu_res,
65 SRUServerInfo sruinfo,
66 const xmlNode *explain = 0,
67 Z_SRW_explainRequest const *er_req = 0);
69 bool build_sru_response(metaproxy_1::Package &package,
70 metaproxy_1::odr &odr_en,
72 const Z_SRW_PDU *sru_pdu_res,
74 const char *stylesheet);
76 Z_SRW_PDU * decode_sru_request(metaproxy_1::Package &package,
77 metaproxy_1::odr &odr_de,
78 metaproxy_1::odr &odr_en,
79 Z_SRW_PDU *sru_pdu_res,
84 bool check_sru_query_exists(metaproxy_1::Package &package,
85 metaproxy_1::odr &odr_en,
86 Z_SRW_PDU *sru_pdu_res,
87 Z_SRW_searchRetrieveRequest
90 Z_ElementSetNames * build_esn_from_schema(metaproxy_1::odr &odr_en,
100 std::string database;
111 // enum SRU_protocol_type { SRU_NONE, SRU_GET, SRU_POST, SRU_SOAP};
112 // typedef const int SRU_query_type;
113 // union SRW_query {char * cql; char * xcql; char * pqf;};
115 // //bool decode(const Z_HTTP_Request &http_req);
116 // SRU_protocol_type protocol(const Z_HTTP_Request &http_req) const;
118 // SRU_protocol_type m_protocol;
119 // std::string m_charset;
120 // std::string m_stylesheet;
129 * c-file-style: "Stroustrup"
130 * indent-tabs-mode: nil
132 * vim: shiftwidth=4 tabstop=8 expandtab