Added setting sru_version which allows SRU version to be set
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 2 Sep 2008 10:28:30 +0000 (12:28 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 2 Sep 2008 10:28:30 +0000 (12:28 +0200)
doc/pazpar2_conf.xml
etc/sru-test.xml
src/connection.c
src/settings.c
src/settings.h

index e6e4a90..44a9935 100644 (file)
        </para>
       </listitem>
     </varlistentry>
+
+    <varlistentry>
+      <term>pz:sru_version</term>
+      <listitem>
+        <para>
+         This allows SRU version to be specified. If unset Pazpar2
+         will the default of YAZ (currently 1.2). Should be set
+         to 1.1 or 1.2.
+       </para>
+      </listitem>
+    </varlistentry>
    </variablelist>
   </refsect2>
 
index 9cc3f99..1020e1a 100644 (file)
@@ -3,6 +3,7 @@
   <!-- Simple test against a local SRU server (could be yaz-ztest) -->
 
   <set name="pz:sru" value="get"/> <!-- must be get, post or soap -->
+  <set name="pz:sru_version" value="1.2"/>
   <set name="pz:name" value="Local Test"/>
 
   <!-- mapping for unqualified search -->
index 32bafb5..f2b48e4 100644 (file)
@@ -350,8 +350,9 @@ int connection_connect(struct connection *con)
     ZOOM_connection link = 0;
     struct host *host = connection_get_host(con);
     ZOOM_options zoptions = ZOOM_options_create();
-    char *auth;
-    char *sru;
+    const char *auth;
+    const char *sru;
+    const char *sru_version = 0;
     char ipport[512] = "";
 
     struct session_database *sdb = client_get_database(con->client);
@@ -374,10 +375,13 @@ int connection_connect(struct connection *con)
     if (apdulog && *apdulog)
         ZOOM_options_set(zoptions, "apdulog", apdulog);
 
-    if ((auth = (char*) session_setting_oneval(sdb, PZ_AUTHENTICATION)))
+    if ((auth = session_setting_oneval(sdb, PZ_AUTHENTICATION)))
         ZOOM_options_set(zoptions, "user", auth);
-    if ((sru = (char*) session_setting_oneval(sdb, PZ_SRU)) && *sru)
+    if ((sru = session_setting_oneval(sdb, PZ_SRU)) && *sru)
         ZOOM_options_set(zoptions, "sru", sru);
+    if ((sru_version = session_setting_oneval(sdb, PZ_SRU_VERSION)) 
+        && *sru_version)
+        ZOOM_options_set(zoptions, "sru_version", sru_version);
 
     if (!(link = ZOOM_connection_create(zoptions)))
     {
index 694cddf..8ab368a 100644 (file)
@@ -64,6 +64,7 @@ static char *hard_settings[] = {
     "pz:zproxy",
     "pz:apdulog",
     "pz:sru",
+    "pz:sru_version",
     0
 };
 
index 08411ac..ca0af1f 100644 (file)
@@ -36,6 +36,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #define PZ_ZPROXY        13
 #define PZ_APDULOG       14
 #define PZ_SRU           15
+#define PZ_SRU_VERSION   16
 
 struct setting
 {