Added support for correlationInfo Note and ID for Record Update via
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 31 May 2007 07:38:13 +0000 (07:38 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 31 May 2007 07:38:13 +0000 (07:38 +0000)
ZOOM C.

NEWS
doc/zoom.xml
src/zoom-c.c

diff --git a/NEWS b/NEWS
index 037eb15..10d1c16 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+Added support for correlationInfo Note and ID for Record Update via
+ZOOM C.
+
 Added yaz-client command querycharset which specifies character set for
 query terms for Z39.50 RPN queries and Z39.50 Scan Requests
 (termListAndStartPoint).
index 3f08dbe..80ae27d 100644 (file)
@@ -20,7 +20,7 @@ ZOOM_options_set_int(opt, name, value)
 ZOOM_connection_scan1 (ZOOM_connection c, ZOOM_query startterm)
 ZOOM_query_cql2rpn(ZOOM_query s, const char *str, ZOOM_connection conn)
 -->
-<!-- $Id: zoom.xml,v 1.57 2007-05-01 22:23:30 mike Exp $ -->
+<!-- $Id: zoom.xml,v 1.58 2007-05-31 07:38:14 adam Exp $ -->
  <chapter id="zoom"><title>ZOOM</title>
   <para>
     &zoom; is an acronym for 'Z39.50 Object-Orientation Model' and is
@@ -1165,6 +1165,16 @@ ZOOM_query_cql2rpn(ZOOM_query s, const char *str, ZOOM_connection conn)
        <entry>Database from connection object</entry>
        <entry>Default</entry>
        </row>
+       <row>
+       <entry>correlationInfo.note</entry>
+       <entry>Correlation Info Note (string)</entry>
+       <entry>none (omitted)</entry>
+       </row>
+       <row>
+       <entry>correlationInfo.id</entry>
+       <entry>Correlation Info ID (integer)</entry>
+       <entry>none (omitted)</entry>
+       </row>
       </tbody>
      </tgroup>
     </table>
index fa6e729..57ff141 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2007, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: zoom-c.c,v 1.131 2007-05-23 11:54:47 adam Exp $
+ * $Id: zoom-c.c,v 1.132 2007-05-31 07:38:14 adam Exp $
  */
 /**
  * \file zoom-c.c
@@ -1341,7 +1341,7 @@ static zoom_ret ZOOM_connection_send_init(ZOOM_connection c)
                     odr_prepend(c->odr_out, "ZOOM-C",
                                 ireq->implementationName));
     
-    version = odr_strdup(c->odr_out, "$Revision: 1.131 $");
+    version = odr_strdup(c->odr_out, "$Revision: 1.132 $");
     if (strlen(version) > 10)   /* check for unexpanded CVS strings */
         version[strlen(version)-2] = '\0';
     ireq->implementationVersion = 
@@ -3114,6 +3114,11 @@ static Z_APDU *create_update_package(ZOOM_package p)
     const char *recordIdNumber = ZOOM_options_get(p->options, "recordIdNumber");
     const char *record_buf = ZOOM_options_get(p->options, "record");
     const char *syntax_str = ZOOM_options_get(p->options, "syntax");
+
+    const char *correlationInfo_note =
+        ZOOM_options_get(p->options, "correlationInfo.note");
+    const char *correlationInfo_id =
+        ZOOM_options_get(p->options, "correlationInfo.id");
     int action_no = -1;
     Odr_oid *syntax_oid = 0;
 
@@ -3211,7 +3216,18 @@ static Z_APDU *create_update_package(ZOOM_package p)
         else
             notToKeep->elements[0]->u.opaque = 0;
         notToKeep->elements[0]->supplementalId = 0;
-        notToKeep->elements[0]->correlationInfo = 0;
+        if (correlationInfo_note || correlationInfo_id)
+        {
+            Z_IUCorrelationInfo *ci;
+            ci = notToKeep->elements[0]->correlationInfo =
+                odr_malloc(p->odr_out, sizeof(*ci));
+            ci->note = correlationInfo_note ?
+                odr_strdup(p->odr_out, correlationInfo_note) : 0;
+            ci->id = correlationInfo_id ?
+                odr_intdup(p->odr_out, atoi(correlationInfo_id)) : 0;
+        }
+        else
+            notToKeep->elements[0]->correlationInfo = 0;
         notToKeep->elements[0]->record =
             z_ext_record_oid(p->odr_out, syntax_oid,
                              record_buf, strlen(record_buf));