</head>
<body>
{
-# $Id: history.egw,v 1.2 1996/01/09 16:16:47 adam Exp $
+# $Id: history.egw,v 1.3 1996/01/12 10:03:16 adam Exp $
if {[info commands saveState] == ""} {
source z39util.tcl
html $e {: } $env($e) {<br>} \n
}
html "form: " [wform] " <br>\n"
- html "target: " $host " <br>\n"
- html "databases: " $databases " <br>\n"
- html "setNo: " $setNo " <br>\n"
- html "nextSetNo: " $nextSetNo " <br>\n"
- html "initSet: " $initSet " <br>\n"
- html "scanLine: " $scanLine " <br>\n"
- html "scanTerm: " $scanTerm " <br>\n"
}
</body></html>
</head>
<body>
{
-# $Id: query.egw,v 1.26 1996/01/08 08:42:15 adam Exp $
+# $Id: query.egw,v 1.27 1996/01/12 10:03:17 adam Exp $
if {[info commands saveState] == ""} {
source z39util.tcl
}
set databases [lindex $targets($host) 1]
-# if {[catch {set prevHost $hist([expr $setNo - 1],host)}]} {
-# set databaseDefault [lindex $databases 0]
-# set oSetNo 0
-# } else {
-# set oSetNo [expr $setNo - 1]
-# set databaseDefault $hist($oSetNo,database)
-# }
if {$initSet == ""} {
set databaseDefault [lindex $databases 0]
set oSetNo 0
set fields [lindex $targets($host) 2]
for {set no 1} {$no < 4} {incr no} {
html {<select name="menu} $no {">} \n
+ set template {}
if {$oSetNo > 0} {
- html {<option> } $hist($oSetNo,form,menu$no) \n
+ set template [join $hist($oSetNo,form,menu$no)]
+ }
+ if {[string length $template] > 0} {
+ html {<option> } $template "\n"
}
foreach f $fields {
set name [lindex $f 0]
- if {$oSetNo > 0} {
- if {$hist($oSetNo,form,menu$no) == $name} continue
- }
+ if {$template == $name} continue
html {<option> } $name \n
}
html "</select>\n"
html {<input type="text" name="entry} $no {"}
+ set template {}
if {$scanLine == $no} {
- html { value="} [join $scanTerm " "] {"}
+ set template [join $scanTerm " "]
} elseif {[info exists hist($oSetNo,form,entry$no)]} {
- html { value="} [join $hist($oSetNo,form,entry$no) " "] {"}
+ set template [join $hist($oSetNo,form,entry$no) " "]
+ }
+ if {[string length $template] > 0} {
+ html { value="} $template {"}
}
html { size=35> }
if {[lsearch [z39 options] scan] >= 0} {
html {<input type="checkbox" name="scan} $no {" value="1" scan>}
}
+ html "<br>\n"
if {$no < 3} {
html {<select name="logic} $no {">} \n
+ set template {}
if {$oSetNo > 0} {
- html "<option> " [join $hist($oSetNo,form,logic$no) " "] \n
+ set template [join $hist($oSetNo,form,logic$no) " "]
+ }
+ if {[string length $template] > 0} {
+ html "<option> " $template \n
}
foreach op {And Or {And not}} {
- if {$oSetNo > 0} {
- if {$hist($oSetNo,form,logic$no) == $op} continue
- }
+ if {$template == $op} continue
html "<option> " [join $op " "] \n
}
html "</select>\n"
<html>
{
-# $Id: search.egw,v 1.26 1996/01/09 16:16:48 adam Exp $
+# $Id: search.egw,v 1.27 1996/01/12 10:03:19 adam Exp $
-proc start-scan {scanNo cache dir} {
+proc start-scan {scanNo cache dir initSet} {
global sessionId
global sessionParms
global sessionWait
html "<head><title> WWW/Z39.50 Gateway Scan " $host " </title>\n"
html "</head><body>\n"
-
+
+ set databases [lindex $targets($host) 1]
+
+ if {$initSet == ""} {
+ set databaseDefault [lindex $databases 0]
+ set oSetNo 0
+ } else {
+ set oSetNo $initSet
+ set databaseDefault $hist($oSetNo,database)
+ }
+
+ html {<form action="http:} $env(SCRIPT_NAME)
+ html / $sessionId {/search.egw/} $setNo {+1" method=get>} \n
+ set nodb [llength $databases]
+ if {$nodb > 1} {
+ if {$nodb > 2} {
+ html "Databases:<br>\n"
+ }
+ set i 0
+ foreach d $databases {
+ html {<input type="checkbox" name="base" value="} $d
+ if {[lsearch $databaseDefault $d] == -1} {
+ html {"> } $d \n
+ } else {
+ html {" checked> } $d \n
+ }
+ }
+ html "<br>\n"
+ if {$nodb > 2} {
+ html {<input type="checkbox" name="baseall" value="}
+ html [concat $databases] {"> All <br>} \n
+ }
+ html "Input your search criteria:<br>\n"
+ }
+ set fields [lindex $targets($host) 2]
+ set no 1
+ html {<select name="menu} $no {">} \n
+ set template {}
+ if {$oSetNo > 0} {
+ set template [join $hist($oSetNo,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 {"}
+ html { size=35> }
+ html {<input type=submit name=submit value="Scan">}
+ html "\n"
+ html {</form>}
if {$hist($setNo,$scanNo,scanTerm) == ""} {
- displayError "Empty query" \
- "You must specify at least one search word"
wabort
return
}
if {[z39scan $setNo $scanNo 0 $lines $pos $cache] != "1"} {
return
}
- button-europagate
-
- html {<a href="http:} $env(SCRIPT_NAME)
- html / $sessionId {/search.egw/} $setNo + [expr $scanNo - 1] + b {">}
- if {$useIcons} {
- html {<img src="/egwgif/button-previous-terms.gif" }
- html {alt="Next Terms" border=0></a>}
- } else {
- html {Previous Terms</a> | }
- }
-
- html {<a href="http:} $env(SCRIPT_NAME)
- html / $sessionId {/search.egw/} $setNo + [expr $scanNo + 1] + f {">}
- if {$useIcons} {
- html {<img src="/egwgif/button-next-terms.gif" }
- html {alt="Next Terms" border=0></a>}
- } else {
- html {Next Terms</a> | }
- }
- html {</a>}
- button-new-query 0 $setNo
html "<br><p>\n"
display-scan $setNo $scanNo 0
if {$hist($setNo,maxPresent) == ""} {
set hist($setNo,maxPresent) 30
}
- for {set i 1} {$i <= 3} {incr i} {
- if {[wform scan$i] != ""} {
- set scanNo 1000
- set hist($setNo,scan) $i
- set termPlusAttr [build-scan $hist($setNo,host) $i]
- set hist($setNo,$scanNo,scanTerm) [lindex $termPlusAttr 0]
- set hist($setNo,scanAttr) [lindex $termPlusAttr 1]
- start-scan $scanNo 0 {}
- html "</body></html>\n"
- wabort
- return
+ set i [lindex $sessionParms 1]
+ if {$i == ""} {
+ for {set j 1} {$j <= 3} {incr j} {
+ if {[wform scan$j] != ""} {
+ set i $j
+ break
+ }
}
}
+ if {$i != ""} {
+ set scanNo 1000
+ set hist($setNo,scan) $i
+ set termPlusAttr [build-scan $hist($setNo,host) $i]
+ set hist($setNo,$scanNo,scanTerm) [lindex $termPlusAttr 0]
+ set hist($setNo,scanAttr) [lindex $termPlusAttr 1]
+ start-scan $scanNo 0 {} $setNo
+ html "</body></html>\n"
+ wabort
+ return
+ }
set query [build-query $hist($setNo,host) 3]
if {"x$query" == "x"} {
html "<head><title> WWW/Z39.50 Gateway Search</title>\n<body>\n"
if {$scanNo == ""} {
set scanNo 1000
}
- start-scan $scanNo 1 $dir
+ start-scan $scanNo 1 $dir $setNo
html "</body></html>\n"
wabort
}
<html>
{
-# $Id: targets.egw,v 1.14 1996/01/09 16:16:49 adam Exp $
+# $Id: targets.egw,v 1.15 1996/01/12 10:03:20 adam Exp $
source ztargets.conf
if {[info commands saveState] == ""} {
source z39util.tcl
foreach t $tn {
if {[string index $t 0] == "."} continue
html {<dt><a href="http:} $env(SCRIPT_NAME) /
- html "$sessionId/query.egw/$t" {"> } [lindex $targets($t) 0] " </a>\n"
+ html "$sessionId/query.egw;/$t" {"> } [lindex $targets($t) 0] " </a>\n"
set desc [lindex $targets($t) 4]
if {$desc != ""} {
html "<dd><em>$desc</em>\n"
#
-# $Id: z39util.tcl,v 1.19 1996/01/09 16:16:49 adam Exp $
+# $Id: z39util.tcl,v 1.20 1996/01/12 10:05:42 adam Exp $
#
proc saveState {} {
uplevel #0 {
set term [wform entry$i]
if {$term != ""} {
- set field [wform menu$i]
+ set field [join [wform menu$i]]
+ set attr {Title}
foreach x [lindex $targets($t) 2] {
if {[lindex $x 0] == $field} {
set attr [lindex $x 1]
set op {}
set q {}
for {set i 1} {$i <= $ilines} {incr i} {
- set term [wform entry$i]
+ set term [join [wform entry$i]]
if {[string length $term] > 0} {
- set field [wform menu$i]
+ set field [join [wform menu$i]]
foreach x [lindex $targets($t) 2] {
if {[lindex $x 0] == $field} {
set attr [lindex $x 1]
global useIcons
global env
global sessionId
+ global nextSetNo
html {<a href="http:} $env(SCRIPT_NAME)
- html / $sessionId {/history.egw}
+ html / $sessionId {/history.egw;}
+ catch { html "/" $nextSetNo}
if {$useIcons} {
html {"><img src="/egwgif/button-view-history.gif" alt="View History" }
html {border=0></a>}