# Makefile for www gateway utility
# Europagate, 1995
#
-# $Id: Makefile,v 1.25 1996/01/24 14:14:18 adam Exp $
+# $Id: Makefile,v 1.26 1996/01/24 16:59:27 adam Exp $
#
SHELL=/bin/sh
#
all: $(TPROG1) $(TPROG2)
-$(TPROG1): $(P1)
+$(TPROG1): $(P1) $(OLIB)
$(CC) $(CFLAGS) -o $(TPROG1) $(P1) $(OLIB) $(ZLIB)
-$(TPROG2): $(P2)
+$(TPROG2): $(P2) $(OLIB)
$(CC) $(CFLAGS) -o $(TPROG2) $(P2) $(OLIB) $(LIBIRTCL) \
$(NETLIB) $(TCLLIB) -lm
-$(TPROG3): $(P3)
+$(TPROG3): $(P3) $(OLIB)
$(CC) $(CFLAGS) -o $(TPROG3) $(P3) $(OLIB) $(ZLIB)
install: install.prog install.script
</head>
<body>
{
-# $Id: query.egw,v 1.30 1996/01/24 14:14:19 adam Exp $
+# $Id: query.egw,v 1.31 1996/01/24 16:59:28 adam Exp $
if {[info commands saveState] == ""} {
source z39util.tcl
html "<h2>Search in " [lindex $targets($host) 0] "</h2><br>\n"
z39 callback ok-response
z39 failback fail-response
- if {$host != $oldHost} {
+ set thisHost [splitHostSpec $host]
+ if {$thisHost != $oldHost} {
catch {z39 disconnect}
set sessionWait 0
- if {[catch {z39 connect $host}]} {
- displayError "Cannot connect to target ${host}" {}
+ if {[catch {z39 connect $thisHost}]} {
+ displayError "Cannot connect to target ${thisHost}" {}
html "</body></html>\n"
z39 disconnect
egw_abort
} elseif {$sessionWait == 0} {
if {[catch {egw_wait sessionWait 35}]} {
- displayError "Cannot connect to target ${host}" {}
+ displayError "Cannot connect to target ${thisHost}" {}
html "</body></html>\n"
z39 disconnect
egw_abort
}
if {$sessionWait != 1} {
- displayError "Cannot connect to target ${host}" {}
+ displayError "Cannot connect to target ${thisHost}" {}
html "</body></html>\n"
z39 disconnect
egw_abort
set sessionWait 0
z39 idAuthentication $hist($setNo,idAuthentication)
if {[catch {z39 init}]} {
- displayError "Cannot initialize target ${host}" {}
+ displayError "Cannot initialize target ${thisHost}" {}
html "</body></html>\n"
egw_abort
}
if {[catch {egw_wait sessionWait 60}]} {
- displayError "Cannot initialize target ${host}" {}
+ displayError "Cannot initialize target ${thisHost}" {}
html "</body></html>\n"
egw_abort
}
if {$sessionWait != "1"} {
- displayError "Cannot initialize target ${host}" {}
+ displayError "Cannot initialize target ${thisHost}" {}
html "</body></html>\n"
egw_abort
}
if {![z39 initResult]} {
- displayError "Connection rejected by target ${host}" \
+ displayError "Connection rejected by target ${thisHost}" \
[z39 userInformationField]
z39 disconnect
html "</body></html>\n"
if {[string length $template] > 0} {
html { value="} $template {"}
}
- html { size=45> }
+ html { size=43> }
if {0 && [lsearch [z39 options] scan] >= 0} {
- html {<input type="checkbox" name="scan} $no {" value="1" scan>}
+ html {<input type="checkbox" name="scan} $no {" value="1" scan>}
}
if {$no < 3} {
html {<select name="logic} $no {">} \n
</head>
<body>
{
-# $Id: tdefine.egw,v 1.1 1996/01/24 14:14:19 adam Exp $
+# $Id: tdefine.egw,v 1.2 1996/01/24 16:59:28 adam Exp $
if {[info commands saveState] == ""} {
source z39util.tcl
set ok 1
if {[string length $name] == 0} {
- html "You didn't specify a target name. You <em>must</em> specify"
- html " a target name<br>\n"
+ html "You didn't specify a target name. A target name <em>must</em> "
+ html "be specified.<br>\n"
set ok 0
}
if {[string length $host] == 0} {
- html "You didn't specify a target name. You <em>must</em> specify"
- html " a host name<br>\n"
+ html "You didn't specify a target name. A host <em>must</em> "
+ html "be specified.<br>\n"
set ok 0
}
if {[string length $databases] == 0} {
- html "You didn't specify any database(s). You <em>must</em> specify"
- html " at least one database</br>\n"
+ html "You didn't specify any database(s). At least one database "
+ html "<em>must</em> be specified.<br>\n"
set ok 0
}
catch {unset item}
html " search fields must be present<br>\n"
set ok 0
}
+ set hostSpec [mergeHostSpec $host $databases]
if {$ok} {
global targets
- set targets($host) [list \
+ set targets($hostSpec) [list \
[join $name] \
$databases \
$attrList \
</head>
<body>
{
-# $Id: tform.egw,v 1.1 1996/01/24 14:14:20 adam Exp $
+# $Id: tform.egw,v 1.2 1996/01/24 16:59:29 adam Exp $
if {[info commands saveState] == ""} {
source z39util.tcl
html "<dl>"
html "\n<dt>Target name\n"
html {<dd><input type="text" size=20 maxlength=20 name="name">}
+ html "\n<br><font size=2>This name serves as a short nickname of "
+ html "the target</font>"
html "\n<dt>Description\n"
- html {<dd><textarea rows=3 cols=50 name="description"></textarea>}
+ html {<dd><textarea rows=3 cols=55 name="description"></textarea>}
+ html "\n<br><font size=2>A description of the server and what data "
+ html "it provides.</font>"
html "\n<dt>Host and port\n"
- html {<dd><input type="text" size=50 name="host">}
+ html {<dd><input type="text" size=55 name="host">}
html "\n<br><font size=2>For example myhost.com:210</font>"
html "\n<dt>Authentication\n"
- html {<dd><input type="text" size=50 name="authentication">}
- html "\n<br><font size=2>Some targets require authentacation strings, "
+ html {<dd><input type="text" size=55 name="authentication">}
+ html "\n<br><font size=2>Some targets require authentication strings, "
html "i.e. passwords. Leave this field empty if no authentication "
html "string is required.</font>"
html "\n<dt>Databases\n"
- html {<dd><textarea rows=3 cols=50 name="databases"></textarea>}
+ html {<dd><textarea rows=3 cols=55 name="databases"></textarea>}
html "\n<br><font size=2>Separate each database by blanks</font>"
html "\n<dt>Search fields\n"
- html {<dd><textarea rows=8 cols=50 name="fields">}
+ html {<dd><textarea rows=8 cols=55 name="fields">}
html "Title 1=4\n"
html "Author 1=1003\n"
html "Abstract 1=62\n"
#
-# $Id: z39util.tcl,v 1.24 1996/01/24 14:14:20 adam Exp $
+# $Id: z39util.tcl,v 1.25 1996/01/24 16:59:29 adam Exp $
#
proc saveState {} {
uplevel #0 {
if {$p} {
html ": "
}
- html {<em>}
+ html { <a href="http:} $env(SCRIPT_NAME) /
+ html $sessionId {/showfull.egw/} $setNo + $tno + $no + full {">}
set nope 1
foreach v $title {
html $v
if {$nope} {
html {No title}
}
- html {</em> }
+ html {</a> }
foreach v $cover {
html $v
}
- html {<br>}
- foreach v $location {
- html " $v"
- }
- foreach v $publisher {
- html " $v"
- }
- foreach v $year {
- html " $v"
+ if {0} {
+ html {<br>}
+ foreach v $location {
+ html " $v"
+ }
+ foreach v $publisher {
+ html " $v"
+ }
+ foreach v $year {
+ html " $v"
+ }
}
- html { -- <a href="http:} $env(SCRIPT_NAME) /
- html $sessionId {/showfull.egw/} $setNo + $tno + $no + full {">}
- html "<em>view full</em></a>"
}
html "<br>\n"
}
}
switch $op {
And
- { set q "@and $q ${attr} ${term}" }
+ { set q "@and $q ${attr} \"${term}\"" }
Or
- { set q "@or $q ${attr} ${term}" }
+ { set q "@or $q ${attr} \"${term}\"" }
{And not}
- { set q "@not $q ${attr} ${term}" }
+ { set q "@not $q ${attr} \"${term}\"" }
{}
- { set q "${attr} ${term}" }
+ { set q "${attr} \"${term}\"" }
}
set op [egw_form logic$i]
}
set zs $zz.s$scanNo.$setNo
$zz callback ok-response
$zz failback fail-response
- if {$oldHost != $host} {
+ set thisHost [splitHostSpec $host]
+ if {$oldHost != $thisHost} {
catch [list $zz disconnect]
set sessionWait 0
- if {[catch [list $zz connect $host]]} {
- displayError "Cannot connect to target" $host
+ if {[catch [list $zz connect $thisHost]]} {
+ displayError "Cannot connect to target" $thisHost
return 0
} elseif {$sessionWait == 0} {
if {[catch {egw_wait sessionWait 300}]} {
$zz disconnect
- displayError "Cannot connect to target" $host
+ displayError "Cannot connect to target" $thisHost
return 0
}
if {$sessionWait != 1} {
- displayError "Cannot connect to target" $host
+ displayError "Cannot connect to target" $thisHost
return 0
}
}
$zz idAuthentication $idAuth
set sessionWait 0
if {[catch {$zz init}]} {
- displayError "Cannot initialize target" $host
+ displayError "Cannot initialize target" $thisHost
$zz disconnect
return 0
}
if {[catch {egw_wait sessionWait 60}]} {
- displayError "Cannot initialize target" $host
+ displayError "Cannot initialize target" $thisHost
$zz disconnect
return 0
}
if {$sessionWait != "1"} {
- displayError "Cannot initialize target" $host
+ displayError "Cannot initialize target" $thisHost
$zz disconnect
return 0
}
if {![$zz initResult]} {
set u [$zz userInformationField]
$zz disconnect
- displayError "Cannot initialize target $host" $u
+ displayError "Cannot initialize target $thisHost" $u
return 0
}
} else {
}
$zz callback ok-response
$zz failback fail-response
- if {$oldHost != $host} {
+ set thisHost [splitHostSpec $host]
+ if {$oldHost != $thisHost} {
catch [list $zz disconnect]
set sessionWait 0
- if {[catch [list $zz connect $host]]} {
- displayError "Cannot connect to target" $host
+ if {[catch [list $zz connect $thisHost]]} {
+ displayError "Cannot connect to target" $thisHost
return 0
} elseif {$sessionWait == 0} {
if {[catch {egw_wait sessionWait 300}]} {
$zz disconnect
- displayError "Cannot connect to target" $host
+ displayError "Cannot connect to target" $thisHost
return 0
}
if {$sessionWait != 1} {
- displayError "Cannot connect to target" $host
+ displayError "Cannot connect to target" $thisHost
return 0
}
}
$zz idAuthentication $idAuth
set sessionWait 0
if {[catch {$zz init}]} {
- displayError "Cannot initialize target" $host
+ displayError "Cannot initialize target" $thisHost
$zz disconnect
return 0
}
if {[catch {egw_wait sessionWait 60}]} {
- displayError "Cannot initialize target" $host
+ displayError "Cannot initialize target" $thisHost
$zz disconnect
return 0
}
if {$sessionWait != "1"} {
- displayError "Cannot initialize target" $host
+ displayError "Cannot initialize target" $thisHost
$zz disconnect
return 0
}
if {![$zz initResult]} {
set u [$zz userInformationField]
$zz disconnect
- displayError "Cannot initialize target $host" $u
+ displayError "Cannot initialize target $thisHost" $u
return 0
}
} else {
$zz.$setNo mediumSetPresentNumber 0
}
set sessionWait 0
+ egw_log debug "search: $query"
$zz.$setNo search $query
if {[catch {egw_wait sessionWait 600}]} {
if {[catch {set oldHost [z39$i connect]}]} {
set oldHost ""
}
- if {$oldHost != $host} {
+ set thisHost [splitHostSpec $host]
+ if {$oldHost != $thisHost} {
catch {z39$i disconnect}
}
z39$i callback [list connect-m-response $i]
for {set i 1} {$i <= $not} {incr i} {
set oldHost [z39$i connect]
set host $hist($setNo,$i,host)
- if {$oldHost == $host} {
+ set thisHost [splitHostSpec $host]
+ if {$oldHost == $thisHost} {
set zstatus($i) 1
continue
}
z39$i idAuthentication $hist($setNo,$i,idAuthentication)
- html "Connecting to target " $host " <br>\n"
+ html "Connecting to target " $thisHost " <br>\n"
set zstatus($i) -1
- if {![catch {z39$i connect $host}]} {
+ if {![catch {z39$i connect $thisHost}]} {
incr zleft
}
}
}
set zleft 0
for {set i 1} {$i <= $not} {incr i} {
- html "host " $hist($setNo,$i,host) ": "
+ html "host " [splitHostSpec $hist($setNo,$i,host)] ": "
if {$zstatus($i) >= 1} {
html "ok <br>\n"
ir-set z39$i.$setNo z39$i
html {<em> This and the following pages are under construction and }
html {will continue to be so until the end of January 1996.</em>}
}
+
+proc splitHostSpec {host} {
+ set i [string last . $host]
+ if {$i > 1} {
+ incr i -1
+ return [string range $host 0 $i]
+ }
+ return $host
+}
+
+proc mergeHostSpec {host databases} {
+ return ${host}.[join $databases -]
+}
-# $Id: ztargets.conf,v 1.18 1996/01/24 14:14:21 adam Exp $
+# $Id: ztargets.conf,v 1.19 1996/01/24 16:59:29 adam Exp $
set commonFields {
{ Title {@attr 1=4} }
- { Author {@attr 1=1003} }
+ { Author {@attr 1=1} }
{ Abstract {@attr 1=62} }
{ Date {@attr 1=30} }
{ {Doc ID} {@attr 1=1032} }
{ All {@attr 1=1016} }
}
-set targets(myriad.middlebury.edu) {
+set targets(myriad.middlebury.edu.MIDCAT) {
Midcat
MIDCAT
{ { Title {@attr 1=4} }
1
}
-set targets(rlg.stanford.edu) [list \
+set targets(rlg.stanford.edu.BKS-AMC-MAP-MDF-REC-SCO-SER-VIM-BIB) [list \
rlg \
{BKS AMC MAP MDF REC SCO SER VIM BIB} \
$commonFields \
1
]
-set targets(z3950.bibsys.no:2100) [list \
+set targets(z3950.bibsys.no:2100.BIBSYS) [list \
BIBSYS \
BIBSYS \
$commonFields \
0 \
]
-set targets(dtbsun.dtv.dk:4501) [list \
+set targets(dtbsun.dtv.dk:4501.DEM) [list \
Aleph \
DEM \
$commonFields \
0 \
]
-set targets(dallas.ucd.ie:7777) {
+set targets(dallas.ucd.ie:7777.danbib) {
DanBib
danbib
{
0
}
-set targets(dtbsun.dtv.dk:9999) {
+set targets(dtbsun.dtv.dk:9999.usgs-esdd-cd_rom-uah-www_dk) {
Zebra
{usgs esdd cd_rom iah www_dk}
{
1
}
-set targets(z3950.research.att.com.xx) [list \
+set targets(z3950.research.att.com.Default) [list \
{AT&T Server} \
Default \
$commonFields \
1 \
]
-set targets(dranet.dra.com) [list \
+set targets(dranet.dra.com.drewdb) [list \
{Dranet} \
drewdb \
$commonFields \