Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/pazpar2
authorJason Skomorowski <jason@indexdata.com>
Tue, 29 Sep 2009 18:56:44 +0000 (14:56 -0400)
committerJason Skomorowski <jason@indexdata.com>
Tue, 29 Sep 2009 18:56:44 +0000 (14:56 -0400)
22 files changed:
NEWS
doc/pazpar2_conf.xml
etc/marc21.xsl
etc/pazpar2.cfg.dist
js/pz2.js
src/client.h
src/connection.c
src/logic.c
src/marcmap.c
src/marcmap.h
src/pazpar2.c
src/pazpar2.h
src/pazpar2_config.c
src/pazpar2_config.h
src/settings.c
src/settings.h
test/test_http_33.res [new file with mode: 0644]
test/test_http_34.res [new file with mode: 0644]
test/test_http_35.res [new file with mode: 0644]
test/test_http_36.res [new file with mode: 0644]
test/test_http_urls
test/test_icu.sh

diff --git a/NEWS b/NEWS
index 086446a..0f907e9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,7 +12,7 @@ must use Content-Type=text/xml.
 
 Timeout values may be given per-service. That's element 'timeout' 
 which takes three attribute values (a subset may be given): 'session',
-'z3950_connect', 'z3950_session'. Option -T is no longer supported
+'z3950_operation', 'z3950_session'. Option -T is no longer supported
 - used to specify session timeout.
 
 Option -t tests the Pazpar2 configuration and returns exit code
index 7777636..d425733 100644 (file)
          Specifies timeout parameters for this service.
          The <literal>timeout</literal>
          element supports the following attributes: 
-         <literal>session</literal>, <literal>z3950_connect</literal>,
+         <literal>session</literal>, <literal>z3950_operation</literal>,
          <literal>z3950_session</literal> which specifies
-         'session timeout', 'Z39.50 connect timeout', 'Z39.50 session timeout'
-         respectively.
+         'session timeout', 'Z39.50 operation timeout',
+         'Z39.50 session timeout' respectively. The Z39.50 operation
+         timeout is the time Pazpar2 will wait for an active Z39.50/SRU
+         operation before it gives up (times out). The Z39.50 session
+         time out is the time Pazpar2 will keep the session alive for
+         an idle session (no operation).
+        </para>
+        <para>
+         The following is recommended but not required:
+         z3950_operation (30) &lt; session (60) &lt; z3950_session (180) .
+         The default values are given in parantheses.
         </para>
        </listitem>
        </varlistentry>
index 23f41d3..478e7f4 100644 (file)
@@ -25,7 +25,7 @@
     <xsl:variable name="medium">
       <xsl:choose>
        <xsl:when test="$title_medium">
-         <xsl:value-of select="substring-after(substring-before($title_medium,']'),'[')"/>
+         <xsl:value-of select="translate($title_medium, ' []/', '')"/>
        </xsl:when>
        <xsl:when test="$fulltext_a">
          <xsl:text>electronic resource</xsl:text>
index 616d611..5b08a8d 100644 (file)
@@ -31,7 +31,7 @@
     </mergekey>
     
     <service>
-      <timeout session="60" z3950_connect="15" z3950_session="180"/>
+      <timeout session="60" z3950_operation="30" z3950_session="180"/>
 
       <!-- we try to keep same order as in marc21.xsl -->
       <metadata name="id" brief="yes"/>
index f290eec..affff33 100644 (file)
--- a/js/pz2.js
+++ b/js/pz2.js
@@ -324,37 +324,9 @@ pz2.prototype =
                         Number( data.getElementsByTagName("activeclients")[0]
                                     .childNodes[0].nodeValue );
                     context.activeClients = activeClients;
-                    var stat = {
-                        "activeclients": activeClients,
-                        "hits": 
-                            Number( data.getElementsByTagName("hits")[0]
-                                        .childNodes[0].nodeValue ),
-                        "records": 
-                            Number( data.getElementsByTagName("records")[0]
-                                        .childNodes[0].nodeValue ),
-                        "clients": 
-                            Number( data.getElementsByTagName("clients")[0]
-                                        .childNodes[0].nodeValue ),
-                        "initializing": 
-                            Number( data.getElementsByTagName("initializing")[0]
-                                        .childNodes[0].nodeValue ),
-                        "searching": 
-                            Number( data.getElementsByTagName("searching")[0]
-                                        .childNodes[0].nodeValue ),
-                        "presenting": 
-                            Number( data.getElementsByTagName("presenting")[0]
-                                        .childNodes[0].nodeValue ),
-                        "idle": 
-                            Number( data.getElementsByTagName("idle")[0]
-                                        .childNodes[0].nodeValue ),
-                        "failed": 
-                            Number( data.getElementsByTagName("failed")[0]
-                                        .childNodes[0].nodeValue ),
-                        "error": 
-                            Number( data.getElementsByTagName("error")[0]
-                                        .childNodes[0].nodeValue )
-                    };
-                    
+
+                   var stat = Element_parseChildNodes(data.documentElement);
+
                     context.statCounter++;
                    var delay = context.statTime 
                         + context.statCounter * context.dumpFactor;
index babaca5..c16c369 100644 (file)
@@ -72,7 +72,7 @@ void client_destroy(struct client *c);
 void client_set_connection(struct client *cl, struct connection *con);
 void client_disconnect(struct client *cl);
 int client_prep_connection(struct client *cl,
-                           int connect_timeout, int session_timeout);
+                           int operation_timeout, int session_timeout);
 void client_start_search(struct client *cl);
 void client_set_session(struct client *cl, struct session *se);
 int client_is_active(struct client *cl);
index cda779c..7b0a027 100644 (file)
@@ -63,7 +63,7 @@ struct connection {
         Conn_Connecting,
         Conn_Open
     } state;
-    int connect_timeout;
+    int operation_timeout;
     int session_timeout;
     struct connection *next; // next for same host or next in free list
 };
@@ -134,7 +134,7 @@ void connection_destroy(struct connection *co)
 // Creates a new connection for client, associated with the host of 
 // client's database
 static struct connection *connection_create(struct client *cl,
-                                            int connect_timeout,
+                                            int operation_timeout,
                                             int session_timeout)
 {
     struct connection *new;
@@ -156,7 +156,7 @@ static struct connection *connection_create(struct client *cl,
     client_set_connection(cl, new);
     new->link = 0;
     new->state = Conn_Resolving;
-    new->connect_timeout = connect_timeout;
+    new->operation_timeout = operation_timeout;
     new->session_timeout = session_timeout;
     if (host->ipport)
         connection_connect(new);
@@ -188,6 +188,7 @@ static void non_block_events(struct connection *co)
                     yaz_log(YLOG_LOG, "Error %s from %s",
                             error, client_get_url(cl));
                 }
+                iochan_settimeout(iochan, co->session_timeout);
                 client_set_state(cl, Client_Idle);
             }
             break;
@@ -199,13 +200,13 @@ static void non_block_events(struct connection *co)
             break;
         case ZOOM_EVENT_SEND_APDU:
             client_set_state(co->client, Client_Working);
+            iochan_settimeout(iochan, co->operation_timeout);
             break;
         case ZOOM_EVENT_RECV_APDU:
             break;
         case ZOOM_EVENT_CONNECT:
             yaz_log(YLOG_LOG, "Connected to %s", client_get_url(cl));
             co->state = Conn_Open;
-            iochan_settimeout(iochan, co->session_timeout);
             break;
         case ZOOM_EVENT_RECV_SEARCH:
             client_search_response(cl);
@@ -389,7 +390,7 @@ static int connection_connect(struct connection *con)
     con->link = link;
     con->iochan = iochan_create(0, connection_handler, 0);
     con->state = Conn_Connecting;
-    iochan_settimeout(con->iochan, con->connect_timeout);
+    iochan_settimeout(con->iochan, con->operation_timeout);
     iochan_setdata(con->iochan, con);
     iochan_setsocketfun(con->iochan, socketfun);
     iochan_setmaskfun(con->iochan, maskfun);
@@ -408,7 +409,7 @@ const char *connection_get_url(struct connection *co)
 
 // Ensure that client has a connection associated
 int client_prep_connection(struct client *cl,
-                           int connect_timeout, int session_timeout)
+                           int operation_timeout, int session_timeout)
 {
     struct connection *co;
     struct session *se = client_get_session(cl);
@@ -419,6 +420,9 @@ int client_prep_connection(struct client *cl,
     if (zproxy && zproxy[0] == '\0')
         zproxy = 0;
 
+    if (!host)
+        return 0;
+
     co = client_get_connection(cl);
 
     yaz_log(YLOG_DEBUG, "Client prep %s", client_get_url(cl));
@@ -444,15 +448,15 @@ int client_prep_connection(struct client *cl,
             connection_release(co);
             client_set_connection(cl, co);
             co->client = cl;
+            co->operation_timeout = operation_timeout;
+            co->session_timeout = session_timeout;
             /* tells ZOOM to reconnect if necessary. Disabled becuase
                the ZOOM_connection_connect flushes the task queue */
-            co->connect_timeout = connect_timeout;
-            co->session_timeout = session_timeout;
             ZOOM_connection_connect(co->link, 0, 0);
         }
         else
         {
-            co = connection_create(cl, connect_timeout, session_timeout);
+            co = connection_create(cl, operation_timeout, session_timeout);
         }
     }
 
index d559670..8c2d070 100644 (file)
@@ -350,17 +350,21 @@ static int prepare_map(struct session *se, struct session_database *sdb)
         nmem_strsplit(se->session_nmem, ",", s, &stylesheets, &num);
         for (i = 0; i < num; i++)
         {
+            WRBUF fname = conf_get_fname(se->service, stylesheets[i]);
+            
             (*m) = nmem_malloc(se->session_nmem, sizeof(**m));
             (*m)->next = 0;
+            
             // XSLT
             if (!strcmp(&stylesheets[i][strlen(stylesheets[i])-4], ".xsl")) 
             {    
                 (*m)->marcmap = NULL;
-                if (!((*m)->stylesheet = conf_load_stylesheet(se->service, stylesheets[i])))
+                if (!((*m)->stylesheet =
+                      xsltParseStylesheetFile((xmlChar *) wrbuf_cstr(fname))))
                 {
                     yaz_log(YLOG_FATAL|YLOG_ERRNO, "Unable to load stylesheet: %s",
                             stylesheets[i]);
+                    wrbuf_destroy(fname);
                     return -1;
                 }
             }
@@ -368,14 +372,15 @@ static int prepare_map(struct session *se, struct session_database *sdb)
             else if (!strcmp(&stylesheets[i][strlen(stylesheets[i])-5], ".mmap"))
             {
                 (*m)->stylesheet = NULL;
-               if (!((*m)->marcmap = marcmap_load(stylesheets[i], se->session_nmem)))
+                if (!((*m)->marcmap = marcmap_load(wrbuf_cstr(fname), se->session_nmem)))
                 {
                     yaz_log(YLOG_FATAL|YLOG_ERRNO, "Unable to load marcmap: %s",
                             stylesheets[i]);
+                    wrbuf_destroy(fname);
                     return -1;
                 }
             }
-
+            wrbuf_destroy(fname);
             m = &(*m)->next;
         }
     }
@@ -566,7 +571,7 @@ enum pazpar2_error_code search(struct session *se,
         else
         {
             no_working++;
-            if (client_prep_connection(cl, se->service->z3950_connect_timeout,
+            if (client_prep_connection(cl, se->service->z3950_operation_timeout,
                     se->service->z3950_session_timeout))
                 client_start_search(cl);
         }
@@ -948,7 +953,7 @@ static const char *get_mergekey(xmlDoc *doc, struct client *cl, int record_no,
     WRBUF norm_wr = wrbuf_alloc();
     xmlNode *n;
 
-    /* create mergekey based on mergekey attribute from XSL (if any) */
+    /* consider mergekey from XSL first */
     xmlChar *mergekey = xmlGetProp(root, (xmlChar *) "mergekey");
     if (mergekey)
     {
@@ -970,53 +975,56 @@ static const char *get_mergekey(xmlDoc *doc, struct client *cl, int record_no,
         pp2_relevance_token_destroy(prt);
         xmlFree(mergekey);
     }
-    /* append (if any) mergekey=yes metadata values */
-    for (n = root->children; n; n = n->next)
+    else
     {
-        if (n->type != XML_ELEMENT_NODE)
-            continue;
-        if (!strcmp((const char *) n->name, "metadata"))
+        /* no mergekey defined in XSL. Look for mergekey metadata instead */
+        for (n = root->children; n; n = n->next)
         {
-            struct conf_metadata *ser_md = 0;
-            int md_field_id = -1;
-            
-            xmlChar *type = xmlGetProp(n, (xmlChar *) "type");
-            
-            if (!type)
+            if (n->type != XML_ELEMENT_NODE)
                 continue;
-                
-            md_field_id 
-                = conf_service_metadata_field_id(service, 
-                                                 (const char *) type);
-            if (md_field_id >= 0)
+            if (!strcmp((const char *) n->name, "metadata"))
             {
-                ser_md = &service->metadata[md_field_id];
-                if (ser_md->mergekey == Metadata_mergekey_yes)
+                struct conf_metadata *ser_md = 0;
+                int md_field_id = -1;
+                
+                xmlChar *type = xmlGetProp(n, (xmlChar *) "type");
+                
+                if (!type)
+                    continue;
+                
+                md_field_id 
+                    = conf_service_metadata_field_id(service, 
+                                                     (const char *) type);
+                if (md_field_id >= 0)
                 {
-                    xmlChar *value = xmlNodeListGetString(doc, n->children, 1);
-                    if (value)
+                    ser_md = &service->metadata[md_field_id];
+                    if (ser_md->mergekey == Metadata_mergekey_yes)
                     {
-                        const char *norm_str;
-                        pp2_relevance_token_t prt =
-                            pp2_relevance_tokenize(
-                                service->mergekey_pct,
-                                (const char *) value);
-                        
-                        while ((norm_str = pp2_relevance_token_next(prt)))
+                        xmlChar *value = xmlNodeListGetString(doc, n->children, 1);
+                        if (value)
                         {
-                            if (*norm_str)
+                            const char *norm_str;
+                            pp2_relevance_token_t prt =
+                                pp2_relevance_tokenize(
+                                    service->mergekey_pct,
+                                    (const char *) value);
+                            
+                            while ((norm_str = pp2_relevance_token_next(prt)))
                             {
-                                if (wrbuf_len(norm_wr))
-                                    wrbuf_puts(norm_wr, " ");
-                                wrbuf_puts(norm_wr, norm_str);
+                                if (*norm_str)
+                                {
+                                    if (wrbuf_len(norm_wr))
+                                        wrbuf_puts(norm_wr, " ");
+                                    wrbuf_puts(norm_wr, norm_str);
+                                }
                             }
+                            xmlFree(value);
+                            pp2_relevance_token_destroy(prt);
                         }
-                        xmlFree(value);
-                        pp2_relevance_token_destroy(prt);
                     }
                 }
+                xmlFree(type);
             }
-            xmlFree(type);
         }
     }
 
@@ -1032,6 +1040,58 @@ static const char *get_mergekey(xmlDoc *doc, struct client *cl, int record_no,
     return mergekey_norm;
 }
 
+/** \brief see if metadata for pz:recordfilter exists 
+    \param root xml root element of normalized record
+    \param sdb session database for client
+    \retval 0 if there is no metadata for pz:recordfilter
+    \retval 1 if there is metadata for pz:recordfilter
+
+    If there is no pz:recordfilter defined, this function returns 1
+    as well.
+*/
+    
+static int check_record_filter(xmlNode *root, struct session_database *sdb)
+{
+    int match = 0;
+    xmlNode *n;
+    const char *s;
+    s = session_setting_oneval(sdb, PZ_RECORDFILTER);
+
+    if (!s || !*s)
+        return 1;
+
+    for (n = root->children; n; n = n->next)
+    {
+        if (n->type != XML_ELEMENT_NODE)
+            continue;
+        if (!strcmp((const char *) n->name, "metadata"))
+        {
+            xmlChar *type = xmlGetProp(n, (xmlChar *) "type");
+            if (type)
+            {
+                size_t len;
+                const char *eq = strchr(s, '=');
+                if (eq)
+                    len = eq - s;
+                else
+                    len = strlen(s);
+                if (len == strlen((const char *)type) &&
+                    !memcmp((const char *) type, s, len))
+                {
+                    xmlChar *value = xmlNodeGetContent(n);
+                    if (value && *value)
+                    {
+                        if (!eq || strstr((const char *) value, eq+1))
+                            match = 1;
+                    }
+                    xmlFree(value);
+                }
+                xmlFree(type);
+            }
+        }
+    }
+    return match;
+}
 
 
 /** \brief ingest XML record
@@ -1043,12 +1103,12 @@ static const char *get_mergekey(xmlDoc *doc, struct client *cl, int record_no,
 struct record *ingest_record(struct client *cl, const char *rec,
                              int record_no)
 {
-    xmlDoc *xdoc = normalize_record(client_get_database(cl),
-                                    client_get_session(cl), rec);
+    struct session_database *sdb = client_get_database(cl);
+    struct session *se = client_get_session(cl);
+    xmlDoc *xdoc = normalize_record(sdb, se, rec);
     xmlNode *root, *n;
     struct record *record;
     struct record_cluster *cluster;
-    struct session *se = client_get_session(cl);
     const char *mergekey_norm;
     xmlChar *type = 0;
     xmlChar *value = 0;
@@ -1059,6 +1119,14 @@ struct record *ingest_record(struct client *cl, const char *rec,
 
     root = xmlDocGetRootElement(xdoc);
 
+    if (!check_record_filter(root, sdb))
+    {
+        yaz_log(YLOG_WARN, "Filtered out record no %d from %s", record_no,
+            sdb->database->url);
+        xmlFreeDoc(xdoc);
+        return 0;
+    }
+
     mergekey_norm = get_mergekey(xdoc, cl, record_no, service, se->nmem);
     if (!mergekey_norm)
     {
@@ -1076,7 +1144,7 @@ struct record *ingest_record(struct client *cl, const char *rec,
                              &se->total_merged);
     if (global_parameters.dump_records)
         yaz_log(YLOG_LOG, "Cluster id %s from %s (#%d)", cluster->recid,
-                client_get_database(cl)->database->url, record_no);
+                sdb->database->url, record_no);
     if (!cluster)
     {
         /* no room for record */
index 31d0a24..850cc76 100644 (file)
@@ -37,7 +37,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include "marcmap.h"
 #include "marchash.h"
 
-struct marcmap *marcmap_load(char *filename, NMEM nmem) {
+struct marcmap *marcmap_load(const char *filename, NMEM nmem)
+{
     struct marcmap *mm;
     struct marcmap *mmhead;
     FILE *fp;
index ba455b1..8e5846c 100644 (file)
@@ -28,7 +28,7 @@ struct marcmap
     struct marcmap *next;
 };
 
-struct marcmap *marcmap_load(char *filename, NMEM nmem);
+struct marcmap *marcmap_load(const char *filename, NMEM nmem);
 xmlDoc *marcmap_apply(struct marcmap *marcmap, xmlDoc *xml_in);
 
 #endif
index 4ada8dd..3f5b1cf 100644 (file)
@@ -59,7 +59,9 @@ static void show_version(void)
 
     printf("Configuration:");
 #if YAZ_HAVE_ICU
-    printf(" icu:?");
+    printf(" icu:enabled");
+#else
+    printf(" icu:disabled");
 #endif
     printf(" yaz:%s", yaz_version_str);
     printf("\n");
@@ -175,7 +177,13 @@ static int sc_main(
     }
     else
     {
-        yaz_log(YLOG_LOG, "Pazpar2 %s started", VERSION);
+        yaz_log(YLOG_LOG, "Pazpar2 " VERSION  " "
+#ifdef PAZPAR2_VERSION_SHA1
+                PAZPAR2_VERSION_SHA1
+#else
+                "-"
+#endif
+                " started");
         if (daemon && !log_file_in_use)
         {
             yaz_log(YLOG_FATAL, "Logfile must be given (option -l) for daemon "
index c111848..76d0fa1 100644 (file)
@@ -88,9 +88,6 @@ struct session_database
 {
     struct database *database;
     struct setting **settings;
-#ifdef RETIRED
-    yaz_marc_t yaz_marc;
-#endif
     struct database_retrievalmap *map;
     struct session_database *next;
 };
index 959bfcb..60f1585 100644 (file)
@@ -26,9 +26,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 #include <libxml/parser.h>
 #include <libxml/tree.h>
-#include <libxslt/xslt.h>
-#include <libxslt/transform.h>
-#include <libxslt/xsltutils.h>
 
 #include <yaz/yaz-util.h>
 #include <yaz/nmem.h>
@@ -131,7 +128,7 @@ static struct conf_service *service_init(struct conf_server *server,
     service->server = server;
     service->session_timeout = 60; /* default session timeout */
     service->z3950_session_timeout = 180;
-    service->z3950_connect_timeout = 15;
+    service->z3950_operation_timeout = 30;
 
     service->relevance_pct = 0;
     service->sort_pct = 0;
@@ -481,14 +478,14 @@ static struct conf_service *service_create_static(struct conf_server *server,
                     return 0;
                 }
             }
-            src = xmlGetProp(n, (xmlChar *) "z3950_connect");
+            src = xmlGetProp(n, (xmlChar *) "z3950_operation");
             if (src)
             {
-                service->z3950_connect_timeout = atoi((const char *) src);
+                service->z3950_operation_timeout = atoi((const char *) src);
                 xmlFree(src);
                 if (service->z3950_session_timeout < 9)
                 {
-                    yaz_log(YLOG_FATAL, "Z39.50 connect timeout out of range");
+                    yaz_log(YLOG_FATAL, "Z39.50 operation timeout out of range");
                     return 0;
                 }
             }
@@ -822,17 +819,13 @@ static struct conf_server *server_create(struct conf_config *config,
     return server;
 }
 
-xsltStylesheet *conf_load_stylesheet(struct conf_service *service,
-                                     const char *fname)
+WRBUF conf_get_fname(struct conf_service *service, const char *fname)
 {
     struct conf_config *config = service->server->config;
     WRBUF w = wrbuf_alloc();
-    xsltStylesheet *s;
 
     conf_dir_path(config, w, fname);
-    s = xsltParseStylesheetFile((xmlChar *) wrbuf_cstr(w));
-    wrbuf_destroy(w);
-    return s;
+    return w;
 }
 
 static struct conf_targetprofiles *parse_targetprofiles(NMEM nmem,
index ddd987b..ab0c46a 100644 (file)
@@ -22,7 +22,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 #include <libxslt/xslt.h>
 #include <libxslt/transform.h>
-#include <libxslt/xsltutils.h>
 
 #include <yaz/nmem.h>
 #include "charsets.h"
@@ -109,7 +108,7 @@ struct conf_service
     NMEM nmem;
     int session_timeout;
     int z3950_session_timeout;
-    int z3950_connect_timeout;
+    int z3950_operation_timeout;
 
     int ref_count;
     /* duplicated from conf_server */
@@ -155,9 +154,6 @@ struct conf_targetprofiles
 
 struct conf_config *config_create(const char *fname, int verbose);
 void config_destroy(struct conf_config *config);
-xsltStylesheet *conf_load_stylesheet(struct conf_service *service,
-                                     const char *fname);
-
 void config_start_databases(struct conf_config *config);
 
 struct conf_service *locate_service(struct conf_server *server,
@@ -173,6 +169,8 @@ int config_start_listeners(struct conf_config *conf,
 
 void config_stop_listeners(struct conf_config *conf);
 
+WRBUF conf_get_fname(struct conf_service *service, const char *fname);
+
 #endif
 
 /*
index a829e6d..155dac7 100644 (file)
@@ -66,6 +66,7 @@ static char *hard_settings[] = {
     "pz:sru_version",
     "pz:pqf_prefix",
     "pz:sort",
+    "pz:recordfilter",
     0
 };
 
index 42ac11a..eb06910 100644 (file)
@@ -39,6 +39,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #define PZ_SRU_VERSION   16
 #define PZ_PQF_PREFIX    17
 #define PZ_SORT                 18
+#define PZ_RECORDFILTER         19
 
 struct setting
 {
diff --git a/test/test_http_33.res b/test/test_http_33.res
new file mode 100644 (file)
index 0000000..5ca42b3
--- /dev/null
@@ -0,0 +1 @@
+<init><status>OK</status><session>5</session><protocol>1</protocol></init>
\ No newline at end of file
diff --git a/test/test_http_34.res b/test/test_http_34.res
new file mode 100644 (file)
index 0000000..523d190
--- /dev/null
@@ -0,0 +1 @@
+<settings><status>OK</status></settings>
\ No newline at end of file
diff --git a/test/test_http_35.res b/test/test_http_35.res
new file mode 100644 (file)
index 0000000..d2e0e58
--- /dev/null
@@ -0,0 +1 @@
+<search><status>OK</status></search>
\ No newline at end of file
diff --git a/test/test_http_36.res b/test/test_http_36.res
new file mode 100644 (file)
index 0000000..3ae8abf
--- /dev/null
@@ -0,0 +1,126 @@
+<show>
+<status>OK</status>
+<activeclients>0</activeclients>
+<merged>8</merged>
+<total>10</total>
+<start>0</start>
+<num>8</num>
+<hit>
+
+<md-title>The use of passwords for controlled access to computer resources</md-title>
+<md-date>1977</md-date>
+<md-author>Wood, Helen M</md-author><location id="z3950.indexdata.com/marc" name="marc">
+<md-title>The use of passwords for controlled access to computer resources</md-title>
+<md-date>1977</md-date>
+<md-author>Wood, Helen M</md-author>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
+<md-test-usersetting-2>test-usersetting-2 data: 
+        YYYYYYYYY</md-test-usersetting-2></location>
+<recid>title the use of passwords for controlled access to computer resources author wood helen m medium book</recid>
+</hit>
+<hit>
+
+<md-title>A plan for community college computer development</md-title>
+<md-date>1971</md-date>
+<md-description>Cover title</md-description><location id="z3950.indexdata.com/marc" name="marc">
+<md-title>A plan for community college computer development</md-title>
+<md-date>1971</md-date>
+<md-description>Cover title</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
+<md-test-usersetting-2>test-usersetting-2 data: 
+        YYYYYYYYY</md-test-usersetting-2></location>
+<recid>title a plan for community college computer development author medium book</recid>
+</hit>
+<hit>
+
+<md-title>Washington metropolitan area rail computer feasibility study;</md-title>
+<md-title-remainder>final report</md-title-remainder>
+<md-date>1971</md-date>
+<md-author>Englund, Carl R</md-author>
+<md-description>&quot;Contract DOT-UT-10003.&quot;</md-description><location id="z3950.indexdata.com/marc" name="marc">
+<md-title>Washington metropolitan area rail computer feasibility study;</md-title>
+<md-title-remainder>final report</md-title-remainder>
+<md-date>1971</md-date>
+<md-author>Englund, Carl R</md-author>
+<md-description>&quot;Contract DOT-UT-10003.&quot;</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
+<md-test-usersetting-2>test-usersetting-2 data: 
+        YYYYYYYYY</md-test-usersetting-2></location>
+<recid>title washington metropolitan area rail computer feasibility study author englund carl r medium book</recid>
+</hit>
+<hit>
+
+<md-title>The Computer Bible</md-title>
+<md-date>1973-1980</md-date>
+<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description><location id="z3950.indexdata.com/marc" name="marc">
+<md-title>The Computer Bible</md-title>
+<md-date>1973-1980</md-date>
+<md-description>Hebrew and Greek; introductions in English</md-description>
+<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
+<md-test-usersetting-2>test-usersetting-2 data: 
+        YYYYYYYYY</md-test-usersetting-2></location>
+<recid>title the computer bible author medium book</recid>
+</hit>
+<hit>
+
+<md-title>Computer science &amp; technology</md-title>
+<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
+<md-date>1977</md-date><location id="z3950.indexdata.com/marc" name="marc">
+<md-title>Computer science &amp; technology</md-title>
+<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
+<md-date>1977</md-date>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
+<md-test-usersetting-2>test-usersetting-2 data: 
+        YYYYYYYYY</md-test-usersetting-2></location>
+<recid>title computer science technology author medium book</recid>
+</hit>
+<hit>
+
+<md-title>The Puget Sound Region</md-title>
+<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
+<md-date>1974</md-date>
+<md-author>Mairs, John W</md-author>
+<md-description>Scale of maps ca. 1:1,000,000</md-description><location id="z3950.indexdata.com/marc" name="marc">
+<md-title>The Puget Sound Region</md-title>
+<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
+<md-date>1974</md-date>
+<md-author>Mairs, John W</md-author>
+<md-description>Scale of maps ca. 1:1,000,000</md-description>
+<md-description>Bibliography: p. 4</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
+<md-test-usersetting-2>test-usersetting-2 data: 
+        YYYYYYYYY</md-test-usersetting-2></location>
+<recid>title the puget sound region author mairs john w medium book</recid>
+</hit>
+<hit>
+
+<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
+<md-title-remainder>the proceedings of a workshop</md-title-remainder>
+<md-date>1974</md-date>
+<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="marc">
+<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
+<md-title-remainder>the proceedings of a workshop</md-title-remainder>
+<md-date>1974</md-date>
+<md-description>Includes bibliographical references and index</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
+<md-test-usersetting-2>test-usersetting-2 data: 
+        YYYYYYYYY</md-test-usersetting-2></location>
+<recid>title computer processing of dynamic images from an anger scintillation camera author medium book</recid>
+</hit>
+<hit>
+
+<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
+<md-title-remainder>proceedings of the workshop</md-title-remainder>
+<md-date>1977</md-date>
+<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="marc">
+<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
+<md-title-remainder>proceedings of the workshop</md-title-remainder>
+<md-date>1977</md-date>
+<md-description>Includes bibliographical references and index</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
+<md-test-usersetting-2>test-usersetting-2 data: 
+        YYYYYYYYY</md-test-usersetting-2></location>
+<recid>title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book</recid>
+</hit>
+</show>
index b2c7e15..47adc23 100644 (file)
@@ -1,4 +1,4 @@
-http://localhost:9763/search.pz2?command=init
+http://localhost:9763/search.pz2?command=init&pz:elements[z3950.indexdata.com%2Fmarc]=F&pz:elements[z3950.indexdata.com%2Fgils]=F
 http://localhost:9763/search.pz2?session=1&command=stat
 http://localhost:9763/search.pz2?session=1&command=ping
 http://localhost:9763/search.pz2?session=1&command=search&query=computer
@@ -36,3 +36,8 @@ http://localhost:9763/search.pz2?session=4&command=settings&pz:name[z3950.indexd
 http://localhost:9763/search.pz2?session=4&command=search&query=computer
 2
 http://localhost:9763/search.pz2?session=4&command=show&start=0&number=1&block=1
+http://localhost:9763/search.pz2?command=init&clear=1
+http://localhost:9763/search.pz2?session=5&command=settings&pz:name[z3950.indexdata.com%2Fmarc]=marc&pz:requestsyntax[z3950.indexdata.com%2Fmarc]=usmarc&pz:nativesyntax[z3950.indexdata.com%2Fmarc]=iso2709&pz:xslt[z3950.indexdata.com%2Fmarc]=marc21.xsl&pz:recordfilter[z3950.indexdata.com%2Fmarc]=date
+http://localhost:9763/search.pz2?session=5&command=search&query=computer
+2
+http://localhost:9763/search.pz2?session=5&command=show&start=0&number=1&block=1
index 9f2f7cb..b6d63df 100755 (executable)
@@ -5,7 +5,7 @@
 srcdir=${srcdir:-"."}
 
 if test -x ../src/pazpar2; then
-    if ../src/pazpar2 -V |grep icu: >/dev/null; then
+    if ../src/pazpar2 -V |grep icu:enabled >/dev/null; then
        exec ${srcdir}/run_pazpar2.sh test_icu
     fi
 fi