Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/pazpar2
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 12 Jun 2014 17:17:45 +0000 (19:17 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 12 Jun 2014 17:17:45 +0000 (19:17 +0200)
doc/common
doc/pazpar2_conf.xml
etc/xsl/Makefile.am
etc/xsl/cf1.res.xml [new file with mode: 0644]
etc/xsl/cf1.xml [new file with mode: 0644]
js/pz2.js
src/connection.c
src/settings.c
src/settings.h

index b864825..f6a5ec8 160000 (submodule)
@@ -1 +1 @@
-Subproject commit b864825869c7e4c3061952b64afc99a7268be4f8
+Subproject commit f6a5ec8c243e2a6829a2917cb30c849612d6fd01
index eea4f75..4e82022 100644 (file)
     </varlistentry>
 
     <varlistentry>
+     <term>pz:redis</term>
+     <listitem>
+      <para>
+       If set and non-empty,
+       <ulink url="&url.redis;">redis</ulink> will
+       configured and enabled for the target.
+       The value of this setting is exactly as the redis option for
+       ZOOM C of YAZ.
+      </para>
+      <para>
+       This setting is honored in Pazpar2 1.6.43 or later. Pazpar2 must
+       be using YAZ version 5.2.0 or later.
+      </para>
+     </listitem>
+    </varlistentry>
+
+    <varlistentry>
      <term>pz:nativesyntax</term>
      <listitem>
       <para>
index e2db1fb..ce95cd4 100644 (file)
@@ -3,6 +3,7 @@ TESTS = $(check_SCRIPTS)
 check_SCRIPTS = test_xsl.sh
 
 dist-hook:
+       rm -f ${srcdir}/*.log.xml
        cp ${srcdir}/*.xml $(distdir)
        cp ${srcdir}/*.xsl $(distdir)
 
diff --git a/etc/xsl/cf1.res.xml b/etc/xsl/cf1.res.xml
new file mode 100644 (file)
index 0000000..6a243c0
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pz:record xmlns:pz="http://www.indexdata.com/pazpar2/1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:siebel="http://loc.gov/siebel/elements/1.0/">
+  <pz:metadata type="medium"/>
+  <pz:metadata type="publication-date">2013 </pz:metadata>
+  <pz:metadata type="date">2013 </pz:metadata>
+  <pz:metadata type="electronic-url">http://agricola.nal.usda.gov/cgi-bin/Pwebrecon.cgi?v1=1&amp;ti=1,1&amp;SAB1=mankind&amp;BOOL1=all%20of%20these&amp;FLD1=Keyword%20Anywhere%20%28GKEY%29&amp;GRP1=AND%20with%20next%20set&amp;SAB2=&amp;BOOL2=any%20of%20these&amp;FLD2=Subject%20%28SKEY%29&amp;GRP2=AND%20with%20next%20set&amp;SAB3=&amp;BOOL3=as%20a%20phrase&amp;FLD3=Title%20%28TKEY%29&amp;GRP3=AND%20with%20next%20set&amp;SAB4=&amp;BOOL4=as%20a%20phrase&amp;FLD4=Author%20Name%20%28NKEY%29&amp;CNT=25&amp;PID=j4FOGuOTymu6tJsbPHH3Q3yGIH7DxM&amp;SEQ=20140519072849&amp;SID=1</pz:metadata>
+  <pz:metadata type="title">Biotechnological applications of microalgae : biodiesel and value added products</pz:metadata>
+  <pz:metadata type="title-complete">Biotechnological applications of microalgae : biodiesel and value added products</pz:metadata>
+  <pz:metadata type="author"/>
+  <pz:metadata type="due" empty="PAZPAR2_NULL_VALUE"/>
+  <pz:metadata type="locallocation" empty="PAZPAR2_NULL_VALUE">Stacks</pz:metadata>
+  <pz:metadata type="callnumber" empty="PAZPAR2_NULL_VALUE">TP248.27.A46 B56 2013</pz:metadata>
+  <pz:metadata type="available" empty="PAZPAR_NULL_VALUE">Available</pz:metadata>
+  <pz:metadata type="publicnote" empty="PAZPAR2_NULL_VALUE"/>
+</pz:record>
diff --git a/etc/xsl/cf1.xml b/etc/xsl/cf1.xml
new file mode 100644 (file)
index 0000000..603f643
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<record>
+  <date>2013 </date>
+  <url>http://agricola.nal.usda.gov/cgi-bin/Pwebrecon.cgi?v1=1&amp;ti=1,1&amp;SAB1=mankind&amp;BOOL1=all%20of%20these&amp;FLD1=Keyword%20Anywhere%20%28GKEY%29&amp;GRP1=AND%20with%20next%20set&amp;SAB2=&amp;BOOL2=any%20of%20these&amp;FLD2=Subject%20%28SKEY%29&amp;GRP2=AND%20with%20next%20set&amp;SAB3=&amp;BOOL3=as%20a%20phrase&amp;FLD3=Title%20%28TKEY%29&amp;GRP3=AND%20with%20next%20set&amp;SAB4=&amp;BOOL4=as%20a%20phrase&amp;FLD4=Author%20Name%20%28NKEY%29&amp;CNT=25&amp;PID=j4FOGuOTymu6tJsbPHH3Q3yGIH7DxM&amp;SEQ=20140519072849&amp;SID=1</url>
+  <title>Biotechnological applications of microalgae : biodiesel and value added products</title>
+  <author></author>
+  <item>
+    <location>Stacks</location>
+    <callno>TP248.27.A46 B56 2013</callno>
+    <available>Available</available>
+  </item>
+</record>
index 59c501d..fb6264c 100644 (file)
--- a/js/pz2.js
+++ b/js/pz2.js
@@ -769,7 +769,7 @@ pz2.prototype =
 ** AJAX HELPER CLASS ***********************************************************
 ********************************************************************************
 */
-var pzHttpRequest = function (url, errorHandler, cookieDomain) {
+var pzHttpRequest = function (url, errorHandler, cookieDomain, windowId) {
         this.maxUrlLength = 2048;
         this.request = null;
         this.url = url;
@@ -779,6 +779,7 @@ var pzHttpRequest = function (url, errorHandler, cookieDomain) {
         this.isXDR = false;
         this.domainRegex = /https?:\/\/([^:/]+).*/;
         this.cookieDomain = cookieDomain || null;
+        this.windowId = windowId || window.name;
 
         var xhr = new XMLHttpRequest();
         var domain = this._getDomainFromUrl(url);
@@ -906,9 +907,9 @@ pzHttpRequest.prototype =
         //session cookie, resend it
         var domain = this._getDomainFromUrl(url);
         if (domain && this._isCrossDomain(domain) &&
-            this.getCookie(domain+":SESSID")) {
+            this.getCookie(domain+":"+this.windowId+":SESSID")) {
           //rewrite the URL
-          var sessparam = ';jsessionid=' + this.getCookie(domain+":SESSID");
+          var sessparam = ';jsessionid=' + this.getCookie(domain+":"+this.windowId+":SESSID");
           var q = url.indexOf('?');
           if (q == -1) {
             url += sessparam;            
@@ -1020,7 +1021,7 @@ pzHttpRequest.prototype =
                   var jsessionId = this.request.responseXML
                     .documentElement.getAttribute('jsessionId');
                   if (jsessionId)                  
-                    this.setCookie(domain+":SESSID", jsessionId);
+                    this.setCookie(domain+":"+this.windowId+":SESSID", jsessionId);
                 }
                 this.callback(this.request.responseXML);
             } else {
index 41e693c..402bfcc 100644 (file)
@@ -421,6 +421,7 @@ static int connection_connect(struct connection *con, iochan_man_t iochan_man)
     struct session_database *sdb = client_get_database(con->client);
     const char *apdulog = session_setting_oneval(sdb, PZ_APDULOG);
     const char *memcached = session_setting_oneval(sdb, PZ_MEMCACHED);
+    const char *redis = session_setting_oneval(sdb, PZ_REDIS);
 
     assert(con);
 
@@ -432,6 +433,8 @@ static int connection_connect(struct connection *con, iochan_man_t iochan_man)
         ZOOM_options_set(zoptions, "charset", charset);
     if (memcached && *memcached)
         ZOOM_options_set(zoptions, "memcached", memcached);
+    if (redis && *redis)
+        ZOOM_options_set(zoptions, "redis", redis);
 
     assert(host->ipport);
     if (host->proxy)
index e8d6125..a17d094 100644 (file)
@@ -85,6 +85,7 @@ static char *hard_settings[] = {
     "pz:authentication_mode",
     "pz:native_score",
     "pz:memcached",
+    "pz:redis",
     0
 };
 
index 3f306a0..de43d28 100644 (file)
@@ -58,6 +58,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #define PZ_AUTHENTICATION_MODE  35
 #define PZ_NATIVE_SCORE         36
 #define PZ_MEMCACHED            37
+#define PZ_REDIS                38
 #define PZ_MAX_EOF              39
 
 struct setting