X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fsru_util.hpp;h=38eabb9b7c0a442d069db70c85eb34c04fee0097;hb=414a181466c1f86c049758a2f99e195af6287951;hp=da8598dad604a6098683a4f971aae06157e7aef5;hpb=098f68aa472b0827a0dfdfda38a338cde577ef98;p=metaproxy-moved-to-github.git diff --git a/src/sru_util.hpp b/src/sru_util.hpp index da8598d..38eabb9 100644 --- a/src/sru_util.hpp +++ b/src/sru_util.hpp @@ -1,25 +1,35 @@ -/* $Id: sru_util.hpp,v 1.4 2006-12-28 13:26:06 marc Exp $ -- Copyright (c) 2005-2006, Index Data. +/* This file is part of Metaproxy. + Copyright (C) Index Data - See the LICENSE file for details - */ +Metaproxy is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ #ifndef YP2_SDU_UTIL_HPP #define YP2_SDU_UTIL_HPP -#include "util.hpp" -#include "package.hpp" +#include +#include -//#include -//#include #include #include #include -namespace std +namespace std { - std::ostream& operator<<(std::ostream& os, Z_SRW_PDU& srw_pdu); + std::ostream& operator<<(std::ostream& os, Z_SRW_PDU& srw_pdu); } @@ -27,45 +37,72 @@ namespace std namespace metaproxy_1 { namespace util { + class SRUServerInfo; + // std::string sru_protocol(const Z_HTTP_Request &http_req); // std::string debug_http(const Z_HTTP_Request &http_req); - // void http_response(mp::Package &package, - // const std::string &content, + // void http_response(mp::Package &package, + // const std::string &content, // int http_code = 200); bool build_sru_debug_package(metaproxy_1::Package &package); - bool build_simple_explain(metaproxy_1::Package &package, - metaproxy_1::odr &odr_en, - Z_SRW_PDU *sru_pdu_res, - Z_SRW_explainRequest const *er_req); - - bool build_sru_response(metaproxy_1::Package &package, + SRUServerInfo get_sru_server_info(metaproxy_1::Package &package); + // Z_SRW_explainRequest + //const *er_req); + +// bool build_simple_explain(metaproxy_1::Package &package, +// metaproxy_1::odr &odr_en, +// Z_SRW_PDU *sru_pdu_res, +// SRUServerInfo sruinfo, +// Z_SRW_explainRequest const *er_req = 0); + + bool 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); + + 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_SRW_PDU * decode_sru_request(metaproxy_1::Package &package, + const char *stylesheet); + + Z_SRW_PDU * decode_sru_request(metaproxy_1::Package &package, metaproxy_1::odr &odr_de, metaproxy_1::odr &odr_en, Z_SRW_PDU *sru_pdu_res, - Z_SOAP *&soap, - char *charset, - char *stylesheet); + Z_SOAP **soap, + char *charset); 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); - - Z_ElementSetNames * build_esn_from_schema(metaproxy_1::odr &odr_en, + + Z_ElementSetNames * build_esn_from_schema(metaproxy_1::odr &odr_en, const char *schema); - -// class SRU + class SRUServerInfo + { + public: + SRUServerInfo () + : database("Default") + {} + public: + std::string database; + std::string host; + std::string port; + }; + + + + +// class SRU // { // public: // enum SRU_protocol_type { SRU_NONE, SRU_GET, SRU_POST, SRU_SOAP}; @@ -77,17 +114,18 @@ namespace metaproxy_1 { // private: // SRU_protocol_type m_protocol; // std::string m_charset; -// std::string m_stylesheet; +// std::string m_stylesheet; // }; - } + } } #endif /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil - * c-file-style: "stroustrup" * End: * vim: shiftwidth=4 tabstop=8 expandtab */ +