X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;ds=sidebyside;f=include%2Fyaz%2B%2B%2Fproxy.h;h=077a57dd6a9ceb3a47cd053a74706b800d2214d8;hb=1b73b30c27af204acc67f4d2deae1765fd3caf21;hp=657b7ef673a00ddc60c6f34ac99b38c912718dc9;hpb=7df9354855b031f0505b84e0c20d2dcc000a54be;p=yazpp-moved-to-github.git diff --git a/include/yaz++/proxy.h b/include/yaz++/proxy.h index 657b7ef..077a57d 100644 --- a/include/yaz++/proxy.h +++ b/include/yaz++/proxy.h @@ -1,8 +1,8 @@ /* - * Copyright (c) 1998-2003, Index Data. + * Copyright (c) 1998-2004, Index Data. * See the file LICENSE for details. * - * $Id: proxy.h,v 1.24 2003-12-22 15:16:23 adam Exp $ + * $Id: proxy.h,v 1.34 2004-01-14 12:14:13 adam Exp $ */ #include @@ -10,7 +10,7 @@ #include #include #include -#if HAVE_XML2 +#if HAVE_XSLT #include #include #endif @@ -58,13 +58,16 @@ public: int check_query(ODR odr, const char *name, Z_Query *query, char **addinfo); int check_syntax(ODR odr, const char *name, - Odr_oid *syntax, char **addinfo); + Odr_oid *syntax, Z_RecordComposition *comp, + char **addinfo, char **stylesheet, char **schema); char *get_explain(ODR odr, const char *name, const char *db, int *len); private: void operator=(const Yaz_ProxyConfig &conf); int mycmp(const char *hay, const char *item, size_t len); -#if HAVE_XML2 +#if HAVE_XSLT + int check_schema(xmlNodePtr ptr, Z_RecordComposition *comp, + const char *schema_identifier); xmlDocPtr m_docPtr; xmlNodePtr m_proxyPtr; void return_target_info(xmlNodePtr ptr, const char **url, @@ -175,7 +178,8 @@ class YAZ_EXPORT Yaz_cql2rpn { Yaz_cql2rpn(); ~Yaz_cql2rpn(); void set_pqf_file(const char *fname); - int query_transform(const char *cql, Z_RPNQuery **rpnquery, ODR o); + int query_transform(const char *cql, Z_RPNQuery **rpnquery, ODR o, + char **addinfop); private: cql_transform_t m_transform; }; @@ -234,7 +238,10 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { int m_request_no; int m_invalid_session; int m_marcxml_flag; + char *m_stylesheet_schema; + char *m_schema; void convert_to_marcxml(Z_NamePlusRecordList *p); + void convert_xsl(Z_NamePlusRecordList *p); Z_APDU *m_initRequest_apdu; NMEM m_initRequest_mem; Z_APDU *m_apdu_invalid_session; @@ -247,13 +254,14 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { Z_APDU *m_s2z_init_apdu; Z_APDU *m_s2z_search_apdu; Z_APDU *m_s2z_present_apdu; + char *m_s2z_stylesheet; char *m_soap_ns; - int send_to_srw_client_error(int error); + int send_to_srw_client_error(int error, const char *add); int send_to_srw_client_ok(int hits, Z_Records *records, int start); int send_http_response(int code); int send_srw_response(Z_SRW_PDU *srw_pdu); - int send_srw_explain(); - + int send_srw_explain_response(Z_SRW_diagnostic *diagnostics, + int num_diagnostics); int z_to_srw_diag(ODR o, Z_SRW_searchRetrieveResponse *srw_res, Z_DefaultDiagFormat *ddf); int m_http_keepalive; @@ -261,6 +269,7 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { Yaz_cql2rpn m_cql2rpn; struct timeval m_time_tv; void logtime(); + Z_ElementSetNames *mk_esn_from_schema(ODR o, const char *schema); public: Yaz_Proxy(IYaz_PDU_Observable *the_PDU_Observable, Yaz_Proxy *parent = 0); @@ -274,6 +283,7 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { void failNotify(); void timeoutNotify(); void connectNotify(); + void markInvalid(); const char *option(const char *name, const char *value); void set_default_target(const char *target); void set_proxy_authentication (const char *auth);