+New attribute "backendcharset" for syntax section which specifies
+charset (encoding) for record that is returned by backend. If omitted
+the proxy assumes backend record encoding is MARC-8 (for backwards
+compatibility).
+
New attribute "backendtype" for syntax section which specifies
record syntax to be transmitted to backend. This allows proxy to
offer a record syntax different from that offered by backend.
AC_INIT(configure.in)
-AM_INIT_AUTOMAKE(yazproxy,0.8)
+AM_INIT_AUTOMAKE(yazproxy,0.9)
AC_PROG_CC
AC_PROG_CPP
AM_DISABLE_SHARED
AM_PROG_LIBTOOL
-YAZPP_INIT(threads,0.8)
+YAZPP_INIT(threads,1.0)
YAZ_DOC
AC_CHECK_FUNCS(setrlimit getrlimit gettimeofday)
+yazproxy (0.9-1) unstable; urgency=low
+
+ * Upstream.
+
+ -- Adam Dickmeiss <adam@indexdata.dk> Fri, 13 Aug 2004 13:40:47 +0200
+
yazproxy (0.8-2) unstable; urgency=low
* Fix depends on libyaz++
<?xml version="1.0"?>
<!-- XML Schema for YAZ proxy config file.
- $Id: yazproxy.xsd,v 1.3 2004-08-10 09:02:16 adam Exp $
+ $Id: yazproxy.xsd,v 1.4 2004-08-29 13:01:43 adam Exp $
-->
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
<xs:attribute name="identifier" type="xs:string" />
<xs:attribute name="stylesheet" type="xs:string" />
<xs:attribute name="backendtype" type="xs:string" />
+ <xs:attribute name="backendcharset" type="xs:string" />
</xs:complexType>
</xs:element>
-/* $Id: proxy.h,v 1.5 2004-08-10 09:02:16 adam Exp $
+/* $Id: proxy.h,v 1.6 2004-08-29 13:01:43 adam Exp $
Copyright (c) 1998-2004, Index Data.
This file is part of the yaz-proxy.
int check_syntax(ODR odr, const char *name,
Odr_oid *syntax, Z_RecordComposition *comp,
char **addinfo, char **stylesheet, char **schema,
- char **backend_type);
+ char **backend_type, char **backend_charset);
char *get_explain(ODR odr, const char *name, const char *db,
int *len);
private:
Z_NamePlusRecordList *m_stylesheet_nprl;
char *m_schema;
char *m_backend_type;
+ char *m_backend_charset;
int m_frontend_type;
void convert_to_frontend_type(Z_NamePlusRecordList *p);
- void convert_to_marcxml(Z_NamePlusRecordList *p);
+ void convert_to_marcxml(Z_NamePlusRecordList *p, const char *charset);
int convert_xsl(Z_NamePlusRecordList *p, Z_APDU *apdu);
void convert_xsl_delay();
Z_APDU *m_initRequest_apdu;
-/* $Id: yaz-proxy-config.cpp,v 1.5 2004-08-10 09:02:16 adam Exp $
+/* $Id: yaz-proxy-config.cpp,v 1.6 2004-08-29 13:01:43 adam Exp $
Copyright (c) 1998-2004, Index Data.
This file is part of the yaz-proxy.
Odr_oid *syntax, Z_RecordComposition *comp,
char **addinfo,
char **stylesheet, char **schema,
- char **backend_type)
+ char **backend_type,
+ char **backend_charset)
{
if (stylesheet)
{
xfree (*backend_type);
*backend_type = 0;
}
+ if (backend_charset)
+ {
+ xfree (*backend_charset);
+ *backend_charset = 0;
+ }
#if HAVE_XSLT
int syntax_has_matched = 0;
xmlNodePtr ptr;
const char *match_stylesheet = 0;
const char *match_identifier = 0;
const char *match_backend_type = 0;
+ const char *match_backend_charset = 0;
struct _xmlAttr *attr;
for (attr = ptr->properties; attr; attr = attr->next)
{
attr->children && attr->children->type == XML_TEXT_NODE)
match_backend_type = (const char *)
attr->children->content;
+ if (!strcmp((const char *) attr->name, "backendcharset") &&
+ attr->children && attr->children->type == XML_TEXT_NODE)
+ match_backend_charset = (const char *)
+ attr->children->content;
}
if (match_type)
{
xfree(*backend_type);
*backend_type = xstrdup(match_backend_type);
}
+ if (backend_charset && match_backend_charset)
+ {
+ xfree(*backend_charset);
+ *backend_charset = xstrdup(match_backend_charset);
+ }
if (match_marcxml)
{
return -1;
-/* $Id: yaz-proxy.cpp,v 1.5 2004-08-10 09:02:16 adam Exp $
+/* $Id: yaz-proxy.cpp,v 1.6 2004-08-29 13:01:43 adam Exp $
Copyright (c) 1998-2004, Index Data.
This file is part of the yaz-proxy.
m_s2z_database = 0;
m_schema = 0;
m_backend_type = 0;
+ m_backend_charset = 0;
m_frontend_type = 0;
m_initRequest_apdu = 0;
m_initRequest_mem = 0;
xfree (m_schema);
xfree (m_backend_type);
+ xfree (m_backend_charset);
if (m_s2z_odr_init)
odr_destroy(m_s2z_odr_init);
if (m_s2z_odr_search)
}
}
-void Yaz_Proxy::convert_to_marcxml(Z_NamePlusRecordList *p)
+void Yaz_Proxy::convert_to_marcxml(Z_NamePlusRecordList *p,
+ const char *backend_charset)
{
int i;
+ if (!backend_charset)
+ backend_charset = "MARC-8";
yaz_iconv_t cd = yaz_iconv_open("UTF-8", "MARC-8");
yaz_marc_t mt = yaz_marc_create();
yaz_marc_xml(mt, YAZ_MARC_MARCXML);
if (m_backend_type)
convert_to_frontend_type(p->u.databaseOrSurDiagnostics);
if (m_marcxml_flag)
- convert_to_marcxml(p->u.databaseOrSurDiagnostics);
+ convert_to_marcxml(p->u.databaseOrSurDiagnostics,
+ m_backend_charset);
if (convert_xsl(p->u.databaseOrSurDiagnostics, apdu))
return 0;
if (m_backend_type)
convert_to_frontend_type(p->u.databaseOrSurDiagnostics);
if (m_marcxml_flag)
- convert_to_marcxml(p->u.databaseOrSurDiagnostics);
+ convert_to_marcxml(p->u.databaseOrSurDiagnostics,
+ m_backend_charset);
if (convert_xsl(p->u.databaseOrSurDiagnostics, apdu))
return 0;
}
m_default_target,
sr->preferredRecordSyntax, rc,
&addinfo, &stylesheet_name, &m_schema,
- &m_backend_type);
+ &m_backend_type, &m_backend_charset);
if (stylesheet_name)
{
m_parent->low_socket_close();
pr->preferredRecordSyntax,
pr->recordComposition,
&addinfo, &stylesheet_name, &m_schema,
- &m_backend_type);
+ &m_backend_type, &m_backend_charset);
if (stylesheet_name)
{
m_parent->low_socket_close();