metaproxy 1.22.1
sru_util.hpp
Go to the documentation of this file.
1/* This file is part of Metaproxy.
2 Copyright (C) Index Data
3
4Metaproxy is free software; you can redistribute it and/or modify it under
5the terms of the GNU General Public License as published by the Free
6Software Foundation; either version 2, or (at your option) any later
7version.
8
9Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY
10WARRANTY; without even the implied warranty of MERCHANTABILITY or
11FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program; if not, write to the Free Software
16Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17*/
18
19#ifndef YP2_SDU_UTIL_HPP
20#define YP2_SDU_UTIL_HPP
21
22#include <metaproxy/util.hpp>
23#include <metaproxy/package.hpp>
24
25#include <yaz/srw.h>
26
27#include <iosfwd>
28#include <string>
29
30namespace std
31{
32 std::ostream& operator<<(std::ostream& os, Z_SRW_PDU& srw_pdu);
33
34}
35
36
37namespace metaproxy_1 {
38 namespace util {
39
40 class SRUServerInfo;
41
42 bool build_sru_debug_package(metaproxy_1::Package &package);
43
44 SRUServerInfo get_sru_server_info(metaproxy_1::Package &package);
45 // Z_SRW_explainRequest
46 //const *er_req);
47
48
49 void build_sru_explain(metaproxy_1::Package &package,
50 metaproxy_1::odr &odr_en,
51 Z_SRW_PDU *sru_pdu_res,
52 SRUServerInfo sruinfo,
53 const xmlNode *explain = 0,
54 Z_SRW_explainRequest const *er_req = 0);
55
56 bool build_sru_response(metaproxy_1::Package &package,
57 metaproxy_1::odr &odr_en,
58 Z_SOAP *soap,
59 const Z_SRW_PDU *sru_pdu_res,
60 char *charset,
61 const char *stylesheet);
62
63 Z_SRW_PDU * decode_sru_request(metaproxy_1::Package &package,
64 metaproxy_1::odr &odr_de,
65 metaproxy_1::odr &odr_en,
66 Z_SRW_diagnostic **diagnostic,
67 int *num_diagnostic,
68 Z_SOAP **soap,
69 char *charset);
70
71 bool check_sru_query_exists(metaproxy_1::Package &package,
72 metaproxy_1::odr &odr_en,
73 Z_SRW_PDU *sru_pdu_res,
74 Z_SRW_searchRetrieveRequest
75 const *sr_req);
76
77 Z_ElementSetNames * build_esn_from_schema(metaproxy_1::odr &odr_en,
78 const char *schema);
79
81 {
82 public:
84 : database("Default")
85 {}
86 public:
87 std::string database;
88 std::string host;
89 std::string port;
90 };
91
92
93
94
95// class SRU
96// {
97// public:
98// enum SRU_protocol_type { SRU_NONE, SRU_GET, SRU_POST, SRU_SOAP};
99// typedef const int SRU_query_type;
100// union SRW_query {char * cql; char * xcql; char * pqf;};
101// private:
102// //bool decode(const Z_HTTP_Request &http_req);
103// SRU_protocol_type protocol(const Z_HTTP_Request &http_req) const;
104// private:
105// SRU_protocol_type m_protocol;
106// std::string m_charset;
107// std::string m_stylesheet;
108// };
109 }
110}
111
112#endif
113/*
114 * Local variables:
115 * c-basic-offset: 4
116 * c-file-style: "Stroustrup"
117 * indent-tabs-mode: nil
118 * End:
119 * vim: shiftwidth=4 tabstop=8 expandtab
120 */
121
Z_SRW_PDU * decode_sru_request(metaproxy_1::Package &package, metaproxy_1::odr &odr_de, metaproxy_1::odr &odr_en, Z_SRW_diagnostic **diagnostic, int *num_diagnostic, Z_SOAP **soap, char *charset)
bool build_sru_debug_package(metaproxy_1::Package &package)
SRUServerInfo get_sru_server_info(metaproxy_1::Package &package)
bool build_sru_response(metaproxy_1::Package &package, metaproxy_1::odr &odr_en, Z_SOAP *soap, const Z_SRW_PDU *sru_pdu_res, char *charset, const char *stylesheet)
Z_ElementSetNames * build_esn_from_schema(metaproxy_1::odr &odr_en, const char *schema)
bool check_sru_query_exists(metaproxy_1::Package &package, metaproxy_1::odr &odr_en, Z_SRW_PDU *sru_pdu_res, Z_SRW_searchRetrieveRequest const *sr_req)
void build_sru_explain(metaproxy_1::Package &package, metaproxy_1::odr &odr_en, Z_SRW_PDU *sru_pdu_res, SRUServerInfo sruinfo, const xmlNode *explain=0, Z_SRW_explainRequest const *er_req=0)
Definition sru_util.cpp:89
std::ostream & operator<<(std::ostream &os, Z_GDU &zgdu)
Definition gduutil.cpp:33