<?xml version="1.0"?>
-<!-- $Id: voyager.xml,v 1.4 2004-08-10 11:45:00 adam Exp $ -->
-<proxy xmlns="http://indexdata.dk/yazproxy/schema/0.8/"
+<!-- $Id: voyager.xml,v 1.5 2005-02-22 10:08:19 adam Exp $ -->
+<proxy xmlns="http://indexdata.dk/yazproxy/schema/0.9/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://indexdata.dk/yazproxy/schema/0.8/ yazproxy.xsd"
+ xsi:schemaLocation="http://indexdata.dk/yazproxy/schema/0.9/ yazproxy.xsd"
>
<!-- define default target and name it voyager -->
<target default="1" name="voyager">
<name>mods3</name>
<name>mods</name>
</syntax>
+
+ <syntax type="xml" marcxml="1" backendtype="opac"
+ identifier="info:srw/schema/1/opacxml-v1.0"
+ >
+ <title>OPACXML</title>
+ <name>opacxml</name>
+ </syntax>
<syntax type="*" error="238"/>
-/* $Id: proxy.h,v 1.13 2005-02-21 14:27:32 adam Exp $
+/* $Id: proxy.h,v 1.14 2005-02-22 10:08:19 adam Exp $
Copyright (c) 1998-2005, Index Data.
This file is part of the yaz-proxy.
class Yaz_ProxyConfig;
class Yaz_ProxyClient;
+enum YAZ_Proxy_MARCXML_mode {
+ none,
+ marcxml,
+};
+
/// Information Retrieval Proxy Server.
class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc {
private:
Yaz_ProxyConfig *check_reconfigure();
int m_request_no;
int m_invalid_session;
- int m_marcxml_flag;
+ YAZ_Proxy_MARCXML_mode m_marcxml_mode;
void *m_stylesheet_xsp; // Really libxslt's xsltStylesheetPtr
int m_stylesheet_offset;
Z_APDU *m_stylesheet_apdu;
-/* $Id: yaz-proxy.cpp,v 1.23 2005-02-21 14:27:32 adam Exp $
+/* $Id: yaz-proxy.cpp,v 1.24 2005-02-22 10:08:20 adam Exp $
Copyright (c) 1998-2005, Index Data.
This file is part of the yaz-proxy.
m_referenceId = 0;
m_referenceId_mem = nmem_create();
m_config = 0;
- m_marcxml_flag = 0;
+ m_marcxml_mode = none;
m_stylesheet_xsp = 0;
m_stylesheet_nprl = 0;
m_s2z_stylesheet = 0;
if (npr->which == Z_NamePlusRecord_databaseRecord)
{
Z_External *r = npr->u.databaseRecord;
- if (r->which == Z_External_octet)
+ if (r->which == Z_External_OPAC)
+ {
+ WRBUF w = wrbuf_alloc();
+
+ yaz_display_OPAC(w, r->u.opac, 0);
+ npr->u.databaseRecord = z_ext_record(
+ odr_encode(), VAL_TEXT_XML,
+ wrbuf_buf(w), wrbuf_len(w)
+ );
+ wrbuf_free(w, 1);
+ }
+ else if (r->which == Z_External_octet)
{
int rlen;
char *result;
r->u.octet_aligned->len,
&result, &rlen))
{
- npr->u.databaseRecord = z_ext_record(odr_encode(),
- VAL_TEXT_XML,
- result, rlen);
+ npr->u.databaseRecord =
+ z_ext_record(odr_encode(), VAL_TEXT_XML, result, rlen);
}
}
}
#endif
)
convert_to_frontend_type(p->u.databaseOrSurDiagnostics);
- if (m_marcxml_flag)
+ if (m_marcxml_mode == marcxml)
convert_to_marcxml(p->u.databaseOrSurDiagnostics,
m_backend_charset);
if (convert_xsl(p->u.databaseOrSurDiagnostics, apdu))
#endif
)
convert_to_frontend_type(p->u.databaseOrSurDiagnostics);
- if (m_marcxml_flag)
+ if (m_marcxml_mode == marcxml)
convert_to_marcxml(p->u.databaseOrSurDiagnostics,
m_backend_charset);
if (convert_xsl(p->u.databaseOrSurDiagnostics, apdu))
Z_APDU *Yaz_Proxy::handle_syntax_validation(Z_APDU *apdu)
{
- m_marcxml_flag = 0;
+ m_marcxml_mode = none;
if (apdu->which == Z_APDU_searchRequest)
{
Z_SearchRequest *sr = apdu->u.searchRequest;
{
sr->smallSetElementSetNames = 0;
sr->mediumSetElementSetNames = 0;
+ m_marcxml_mode = marcxml;
if (m_backend_type)
{
sr->preferredRecordSyntax =
yaz_oidval_to_z3950oid(odr_encode(), CLASS_RECSYN,
VAL_USMARC);
- m_marcxml_flag = 1;
}
else if (err)
{
if (err == -1)
{
pr->recordComposition = 0;
+ m_marcxml_mode = marcxml;
if (m_backend_type)
{
pr->preferredRecordSyntax =
yaz_oidval_to_z3950oid(odr_encode(), CLASS_RECSYN,
VAL_USMARC);
- m_marcxml_flag = 1;
}
else if (err)
{