1 /* $Id: sru_util.hpp,v 1.9 2007-05-09 21:23:09 adam Exp $
2 Copyright (c) 2005-2007, Index Data.
4 This file is part of Metaproxy.
6 Metaproxy is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
11 Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with Metaproxy; see the file LICENSE. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #ifndef YP2_SDU_UTIL_HPP
23 #define YP2_SDU_UTIL_HPP
26 #include "package.hpp"
28 //#include <yaz/zgdu.h>
29 //#include <yaz/z-core.h>
37 std::ostream& operator<<(std::ostream& os, Z_SRW_PDU& srw_pdu);
42 namespace metaproxy_1 {
47 // std::string sru_protocol(const Z_HTTP_Request &http_req);
48 // std::string debug_http(const Z_HTTP_Request &http_req);
49 // void http_response(mp::Package &package,
50 // const std::string &content,
51 // int http_code = 200);
53 bool build_sru_debug_package(metaproxy_1::Package &package);
55 SRUServerInfo get_sru_server_info(metaproxy_1::Package &package);
56 // Z_SRW_explainRequest
59 // bool build_simple_explain(metaproxy_1::Package &package,
60 // metaproxy_1::odr &odr_en,
61 // Z_SRW_PDU *sru_pdu_res,
62 // SRUServerInfo sruinfo,
63 // Z_SRW_explainRequest const *er_req = 0);
65 bool build_sru_explain(metaproxy_1::Package &package,
66 metaproxy_1::odr &odr_en,
67 Z_SRW_PDU *sru_pdu_res,
68 SRUServerInfo sruinfo,
69 const xmlNode *explain = 0,
70 Z_SRW_explainRequest const *er_req = 0);
72 bool build_sru_response(metaproxy_1::Package &package,
73 metaproxy_1::odr &odr_en,
75 const Z_SRW_PDU *sru_pdu_res,
77 const char *stylesheet);
79 Z_SRW_PDU * decode_sru_request(metaproxy_1::Package &package,
80 metaproxy_1::odr &odr_de,
81 metaproxy_1::odr &odr_en,
82 Z_SRW_PDU *sru_pdu_res,
87 bool check_sru_query_exists(metaproxy_1::Package &package,
88 metaproxy_1::odr &odr_en,
89 Z_SRW_PDU *sru_pdu_res,
90 Z_SRW_searchRetrieveRequest
93 Z_ElementSetNames * build_esn_from_schema(metaproxy_1::odr &odr_en,
100 : database("Default")
103 std::string database;
114 // enum SRU_protocol_type { SRU_NONE, SRU_GET, SRU_POST, SRU_SOAP};
115 // typedef const int SRU_query_type;
116 // union SRW_query {char * cql; char * xcql; char * pqf;};
118 // //bool decode(const Z_HTTP_Request &http_req);
119 // SRU_protocol_type protocol(const Z_HTTP_Request &http_req) const;
121 // SRU_protocol_type m_protocol;
122 // std::string m_charset;
123 // std::string m_stylesheet;
132 * indent-tabs-mode: nil
133 * c-file-style: "stroustrup"
135 * vim: shiftwidth=4 tabstop=8 expandtab