More work!
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 15 May 1996 18:43:37 +0000 (18:43 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 15 May 1996 18:43:37 +0000 (18:43 +0000)
www/Makefile
www/msearch.egw
www/nwi.egw
www/search.egw
www/z39util.tcl
www/ztargets.conf

index 0e2a4fb..168a465 100644 (file)
@@ -1,7 +1,7 @@
 # Makefile for www gateway utility
 # Europagate, 1995
 #
-# $Id: Makefile,v 1.38 1996/04/25 10:22:20 adam Exp $
+# $Id: Makefile,v 1.39 1996/05/15 18:43:37 adam Exp $
 #
 SHELL=/bin/sh
 
@@ -19,9 +19,6 @@ OLIB=../lib/util.a ../lib/libres+log.a
 TCLLIB=/usr/local/lib/libtcl7.5.a
 TCLINC=
 
-WSCRIPTS=egwscript targets.egw query.egw search.egw showfull.egw z39util.tcl \
- mtargets.egw mquery.egw msearch.egw history.egw tform.egw tdefine.egw \
- sameas.egw nwi.egw nwiutil.tcl
 HSCRIPTS=egwindex.html
 CONFFILES=egw.res ztargets.conf
 TPROG1=egwcgi
@@ -110,7 +107,7 @@ install.script:
                echo "Making directory $(HTDOCS)"; \
                mkdir $(HTDOCS); \
        fi        
-       @for x in $(WSCRIPTS); do \
+       @for x in *.egw *.tcl; do \
                echo Installing $$x; \
                cp $$x $(EGWDIR)/$$x; \
        done
index 5544a3c..4e501bd 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
-# $Id: msearch.egw,v 1.21 1996/03/14 11:50:45 adam Exp $
+# $Id: msearch.egw,v 1.22 1996/05/15 18:43:37 adam Exp $
 
     if {[info commands saveState] == ""} {
         source z39util.tcl
         incr nextSetNo
 
         for {set i 1} {$i <= $hist($setNo,0,host)} {incr i} {
-            set hist($setNo,$i,query) [build-query $hist($setNo,$i,host) 3]
+            set hist($setNo,$i,query) [build-query $hist($setNo,$i,host) 6]
         }
 
         set hist($setNo,scan) 0
 
-        set hist($setNo,form,menu1) [egw_form menu1]
-        set hist($setNo,form,menu2) [egw_form menu2]
-        set hist($setNo,form,menu3) [egw_form menu3]
-
-        set hist($setNo,form,entry1) [egw_form entry1]
-        set hist($setNo,form,entry2) [egw_form entry2]
-        set hist($setNo,form,entry3) [egw_form entry3]
-
-        set hist($setNo,form,logic1) [egw_form logic1]
-        set hist($setNo,form,logic2) [egw_form logic2]
-        set hist($setNo,form,logic3) {}
-        
+        for {set i 1} {$i < 6} {incr i} {
+            set hist($setNo,form,menu$i) [egw_form menu$i]
+            set hist($setNo,form,entry$i) [egw_form entry$i]
+            set hist($setNo,form,logic$i) [egw_form logic$i]
+        }
         set hist($setNo,maxPresent) [egw_form hits]
         if {$hist($setNo,maxPresent) == ""} {
             set hist($setNo,maxPresent) 20
index fe69daa..a383ecc 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
-# $Id: nwi.egw,v 1.5 1996/03/15 14:43:44 adam Exp $
+# $Id: nwi.egw,v 1.6 1996/05/15 18:43:37 adam Exp $
     source ztargets.conf
 
     set scriptQuery nwi.egw
@@ -53,6 +53,7 @@
     set curEntry {}
 
     set initSet 0
+
     catch {
         set initSet [lindex $sessionParms 0]
         if {$initSet < 0} {
 
     html {<dt><b>and search the following servers</b><dd>}
 
-    foreach t {
+    set hosts {
+            {mars.dtv.dk:9999/Default} 
             {nwi.ub2.lu.se/sverige}
-            {nwi.ub2.lu.se/new_nor_lib} 
-        } {
+    }
+    foreach t $hosts {
         html {<input type="checkbox" name="host" }
         if {[info exists curTargets]} {
             if {[lsearch -exact $curTargets $t] != -1} {
     }
     html "</select></b><br></dl>\n"
 
+    html {<input type=submit value="Search"><input type=reset value="Reset">}
+
+    html "\n<br><p><hr>\n"
+
+    if {0} {
+    html {<form action="http:} $env(SCRIPT_NAME)
+    html / $sessionId {/msearch.egw/} $setNo {" method=get>} \n
+    }
+
+    html {<b>Advanced search</b><br>}
+
+    set host [lindex $hosts 0]
+    set fields [lindex $targets($host) 2]
+    for {set no 2} {$no < 6} {incr no} {
+
+        html {<select name="menu} $no {">} \n
+        set template {}
+        if {$initSet} {
+            set template [join $hist($initSet,form,menu$no)]
+        }
+        if {[string length $template] > 0} {
+            html {<option> } $template "\n"
+        }
+        foreach f $fields {
+            set name [lindex $f 0]
+            if {$template == $name} continue
+            html {<option> } $name \n
+        }
+        html "</select>\n"
+
+        html {<input type="text" name="entry} $no {" size=35 value="}
+
+        if {$initSet} {
+            if {[info exists hist($initSet,form,entry$no)]} {
+                html [join $hist($initSet,form,entry$no) " "]
+            }
+        }
+        html {">} \n
+        if {$no < 5} {
+            html {<select name="logic} $no {">} \n
+            set template {}
+            if {$initSet} {
+                set template [join $hist($initSet,form,logic$no) " "]
+            }
+            if {[string length $template] > 0} {
+                html "<option> " $template \n
+            }
+            foreach op {And Or {And not}} {
+                if {$template == $op} continue
+                html "<option> " [join $op " "] \n
+            }
+            html "</select>\n"
+        }
+        html "<br>\n"
+    }
+    unset hosts
+    html "</form><br>\n"
     set useIcons 0
     button-main
 
+
     catch maintenance
 }
 
index 88969cd..a4416d7 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 {
-# $Id: search.egw,v 1.39 1996/03/14 11:50:48 adam Exp $
+# $Id: search.egw,v 1.40 1996/05/15 18:43:38 adam Exp $
 
 proc start-scan {scanNo targetNo cache dir initSet} {
     global sessionId
@@ -39,6 +39,9 @@ proc start-scan {scanNo targetNo cache dir initSet} {
             egw_log debug "z39_scan failed"
             return
         }
+        if {!$useIcons} {
+           html "\n | "
+        }
         html {<a href="http:} $env(SCRIPT_NAME)
         html / $sessionId {/search.egw/} $setNo + $targetNo + 
         html [expr $scanNo - 1] + b {">}
@@ -46,9 +49,12 @@ proc start-scan {scanNo targetNo cache dir initSet} {
             html {<img src="/egwgif/button-previous-terms.gif" }
             html {alt="Next Terms" border=0></a>}
         } else {
-            html {Previous Terms</a> | }
+            html {Previous Terms</a>}
         }
 
+        if {!$useIcons} {
+           html "\n | "
+        }
         html {<a href="http:} $env(SCRIPT_NAME)
         html / $sessionId {/search.egw/} $setNo + $targetNo +
         html [expr $scanNo + 1] + f {">}
@@ -56,7 +62,7 @@ proc start-scan {scanNo targetNo cache dir initSet} {
             html {<img src="/egwgif/button-next-terms.gif" }
             html {alt="Next Terms" border=0></a>}
         } else {
-            html {Next Terms</a> | }
+            html {Next Terms</a>}
         }
         html {</a>}
     }
@@ -131,6 +137,9 @@ proc start-scan {scanNo targetNo cache dir initSet} {
 
     button-main
 
+    if {!$useIcons} {
+        html "\n | "
+    }
     html {<a href="http:} $env(SCRIPT_NAME)
     html / $sessionId {/search.egw/} $setNo + $targetNo +
     html [expr $scanNo - 1] + b {">}
@@ -138,9 +147,12 @@ proc start-scan {scanNo targetNo cache dir initSet} {
         html {<img src="/egwgif/button-previous-terms.gif" }
         html {alt="Next Terms" border=0></a>}
     } else {
-        html {Previous Terms</a> | }
+        html {Previous Terms</a>}
     }
 
+    if {!$useIcons} {
+        html "\n | "
+    }
     html {<a href="http:} $env(SCRIPT_NAME)
     html / $sessionId {/search.egw/} $setNo + $targetNo +
     html [expr $scanNo + 1] + f {">}
@@ -148,7 +160,7 @@ proc start-scan {scanNo targetNo cache dir initSet} {
         html {<img src="/egwgif/button-next-terms.gif" }
         html {alt="Next Terms" border=0></a>}
     } else {
-        html {Next Terms</a> | }
+        html {Next Terms</a>}
     }
     html {</a>}
     button-new-query $setNo
index e893729..7ee6cf2 100644 (file)
@@ -1,5 +1,5 @@
 #
-# $Id: z39util.tcl,v 1.43 1996/03/26 16:27:03 adam Exp $
+# $Id: z39util.tcl,v 1.44 1996/05/15 18:43:38 adam Exp $
 #
 proc saveState {} {
     uplevel #0 {
@@ -727,15 +727,16 @@ proc build-query {t ilines} {
                 egw_log debug "attr failed for $t"
                 set attr [lindex [lindex [lindex $targets($t) 2] 0] 1]
             }
+           egw_log debug "op=${op}"
             switch $op {
                 And
-                { set q "@and $q ${attr} \"${term}\"" }
+                { set q "@and $q ${attr} \"${term}\""; egw_log debug AND }
                 Or
-                { set q "@or $q ${attr} \"${term}\"" }
-                {And not}
-                { set q "@not $q ${attr} \"${term}\"" }
+                { set q "@or $q ${attr} \"${term}\""; egw_log debug OR }
                 {}
-                { set q "${attr} \"${term}\"" }
+                { set q "${attr} \"${term}\""; egw_log debug NOPE }
+               default
+                { set q "@not $q ${attr} \"${term}\""; egw_log debug ANDNOT }
             }
             set op [egw_form logic$i]
         }
@@ -1641,7 +1642,10 @@ proc z39history {} {
                 html {">Query</a>: }
             }
             set op {}
-            for {set j 1} {$j <= 3} {incr j} {
+            for {set j 1} {$j <= 10} {incr j} {
+                if {![info exists hist($setNo,form,entry$j)]} {
+                    break
+                }
                 if {[string length $hist($setNo,form,entry$j)] > 0} {
                     html " <b>" [join $op " "] "</b> "
                 set pre [join $hist($setNo,form,menu$j)]
@@ -1847,6 +1851,7 @@ proc mkAssoc {assoc host} {
             wais $assoc
         } else {
             ir $assoc
+            $assoc maximumRecordSize 1000000
         }
     } else {
         if {![string compare [lindex $targets($host) 1] WAIS]} {
@@ -1855,6 +1860,7 @@ proc mkAssoc {assoc host} {
         } else {
             if {[$assoc comstack] == "tcpip"} return
             ir $assoc
+            $assoc maximumRecordSize 1000000
         }
     }
 }
index e2c58e5..062fed8 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: ztargets.conf,v 1.33 1996/04/25 10:22:21 adam Exp $
+# $Id: ztargets.conf,v 1.34 1996/05/15 18:43:40 adam Exp $
 #
 # This file contains the predefined targets in the WWW-Z39.50 gateway
 # Each target is an entry in the associative array "targets". The
@@ -201,7 +201,7 @@ set targets(Tikal.dev.oclc.org/AGRICOLA) [list \
 set targets(nwi.ub2.lu.se/sverige) {
     Sweden
     WAIS \
-    { { Free-text {@attr 1=4} } }
+    { { {All Fields} {@attr 1=4} } }
     {}
     {Nordic Web Index - Sweden}
     1
@@ -209,12 +209,16 @@ set targets(nwi.ub2.lu.se/sverige) {
 }
 
 
-set targets(nwi.ub2.lu.se/new_nor_lib) {
-    Norway
-    WAIS
-    { { Free-text {@attr 1=4} } }
+set targets(mars.dtv.dk:9999/Default) {
+    Denmark
+    USMARC
+    { { {All Fields} {@attr 1=1016 @attr 4=105} }
+    { {Title} {@attr 1=4 @attr 4=105} }
+    { {URL} {@attr gils 1=2021} }
+    { {Subject} {@attr 1=29 @attr 4=105} }
+    { {URL links} {@attr gils 1=2047} } }
     {}
-    {Nordic Web Index - Norway}
+    {Nordic Web Index - Denmark}
     1
     nwi
 }