From ba37ce207c47ac1fa27bb46df7dc54f72740bb96 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 3 Jan 1996 15:19:35 +0000 Subject: [PATCH] Improved history. Better working scan. New maintanance function to print contact info, etc. --- www/Makefile | 9 +++- www/history.egw | 50 +++++++++++++++++++++ www/mquery.egw | 9 ++-- www/msearch.egw | 3 +- www/mtargets.egw | 25 ++++++++--- www/query.egw | 33 +++++++------- www/search.egw | 117 +++++++++++++++++++++++++------------------------ www/showfull.egw | 22 +--------- www/targets.egw | 34 ++++++++++----- www/z39util.tcl | 125 ++++++++++++++++++++++++++++++++++++++++++++++++----- www/ztargets.conf | 6 +-- 11 files changed, 298 insertions(+), 135 deletions(-) create mode 100644 www/history.egw diff --git a/www/Makefile b/www/Makefile index 83a69fb..7b2a2b5 100644 --- a/www/Makefile +++ b/www/Makefile @@ -2,7 +2,12 @@ # Europagate, 1995 # # $Log: Makefile,v $ -# Revision 1.19 1996/01/02 10:52:25 adam +# Revision 1.20 1996/01/03 15:19:35 adam +# Improved history. +# Better working scan. +# New maintanance function to print contact info, etc. +# +# Revision 1.19 1996/01/02 10:52:25 adam # In images Alt=... are defined. # # Revision 1.18 1995/12/20 16:31:30 adam @@ -83,7 +88,7 @@ OLIB=../lib/util.a ../lib/libres+log.a TCLLIB=/usr/local/lib/libtcl7.4.a # WSCRIPTS=egwscript targets.egw query.egw search.egw showfull.egw z39util.tcl \ - mtargets.egw mquery.egw msearch.egw + mtargets.egw mquery.egw msearch.egw history.egw HSCRIPTS=egwindex.html CONFFILES=ztargets.conf TPROG1=egwcgi diff --git a/www/history.egw b/www/history.egw new file mode 100644 index 0000000..64f13c7 --- /dev/null +++ b/www/history.egw @@ -0,0 +1,50 @@ + + + WWW/Z39.50 Gateway History + + +{ +# $Id: history.egw,v 1.1 1996/01/03 15:19:36 adam Exp $ + + if {[info commands saveState] == ""} { + source z39util.tcl + } + + z39history + + if {$useIcons} { + html {Europagate} + } else { + html {Europagate | } + } + html {} + } else { + html {">New Target} "\n" + } +} +{ + catch maintenance + if {!$debug} return + html "
\n" + html "

Debug information

\n" + html "sessionId: $sessionId
\n" + html "sessionParms: $sessionParms
\n" + foreach e {SERVER_NAME PATH_INFO SCRIPT_NAME} { + html $e {: } $env($e) {
} \n + } + html "form: " [wform] "
\n" + html "target: " $host "
\n" + html "databases: " $databases "
\n" + html "setNo: " $setNo "
\n" + html "nextSetNo: " $nextSetNo "
\n" + html "initSet: " $initSet "
\n" + html "scanLine: " $scanLine "
\n" + html "scanTerm: " $scanTerm "
\n" +} + + + diff --git a/www/mquery.egw b/www/mquery.egw index db1f8eb..548026a 100644 --- a/www/mquery.egw +++ b/www/mquery.egw @@ -4,7 +4,7 @@ { -# $Id: mquery.egw,v 1.6 1995/12/21 15:49:51 adam Exp $ +# $Id: mquery.egw,v 1.7 1996/01/03 15:19:37 adam Exp $ if {[info commands saveState] == ""} { source z39util.tcl @@ -84,12 +84,9 @@ html {"> New target } } } -
-This page is maintained by Peter Wad Hansen . -Last modified 29. september 1995.
- This and the following pages are under construction -and will continue to be so until the end of December 1995. { + catch maintenance + if {!$debug} return html "
\n" html "

Debug information

\n" html "sessionId: $sessionId
\n" diff --git a/www/msearch.egw b/www/msearch.egw index dfc71e9..ca59fef 100644 --- a/www/msearch.egw +++ b/www/msearch.egw @@ -1,6 +1,6 @@ { -# $Id: msearch.egw,v 1.7 1995/12/22 14:21:15 adam Exp $ +# $Id: msearch.egw,v 1.8 1996/01/03 15:19:38 adam Exp $ if {[info commands saveState] == ""} { source z39util.tcl @@ -82,6 +82,7 @@ } { + if {!$debug} return html "
\n" html "

Debug information

\n" html "sessionId: $sessionId
\n" diff --git a/www/mtargets.egw b/www/mtargets.egw index e8e495e..5d0bacd 100644 --- a/www/mtargets.egw +++ b/www/mtargets.egw @@ -1,6 +1,6 @@ { -# $Id: mtargets.egw,v 1.7 1995/12/21 15:49:51 adam Exp $ +# $Id: mtargets.egw,v 1.8 1996/01/03 15:19:38 adam Exp $ set setNo 1 source /usr/local/etc/httpd/conf/ztargets.conf if {[info commands saveState] == ""} { @@ -11,7 +11,23 @@ Europagate, WWW/Z39.50 Gateway +{ + if {![info exists debug]} { + if {[lindex $sessionParms 0] == "1"} { + set debug 1 + } else { + set debug 0 + } + } + if {![info exists useIcons]} { + if {[lindex $sessionParms 1] == "1"} { + set useIcons 0 + } else { + set useIcons 1 + } + } +}
EUROPAGATE
@@ -39,12 +55,9 @@ } -
-This page is maintained by Peter Wad Hansen . -Last modified 25. september 1995.
- This and the following pages are under construction and will continue -to be so until the end of December 1995. { + catch maintenance + if {!$debug} return html "
\n" html "

Debug information

\n" html "sessionId: $sessionId
\n" diff --git a/www/query.egw b/www/query.egw index 618955e..d1a122c 100644 --- a/www/query.egw +++ b/www/query.egw @@ -4,7 +4,7 @@ { -# $Id: query.egw,v 1.23 1996/01/03 08:59:41 adam Exp $ +# $Id: query.egw,v 1.24 1996/01/03 15:19:39 adam Exp $ if {[info commands saveState] == ""} { source z39util.tcl @@ -27,7 +27,7 @@ proc ok-response {} { set host [lindex $sessionParms 0] set initSet [lindex $sessionParms 1] set scanLine [lindex $sessionParms 2] - set scanTerm [lindex $sessionParms 3] + set scanTerm [lrange $sessionParms 3 end] if {[catch {set setNo $nextSetNo}]} { set nextSetNo 1 @@ -45,7 +45,6 @@ proc ok-response {} { } html "

Search in " [lindex $targets($host) 0] "

\n" - z39 callback ok-response z39 failback fail-response if {$host != $oldHost} { @@ -154,20 +153,22 @@ proc ok-response {} { html "\n" html {} \n html {} if {$no < 3} { html {\n" } @@ -186,26 +187,22 @@ proc ok-response {} { } else { html 20 } - html {" size=3>} + html {" size=4>} }

{ - html {Europagate} - html {New Target} -} + button-europagate -


-This page is maintained by Peter Wad Hansen . -Last modified 29. september 1995.
- This and the following pages are under construction -and will continue to be so until the end of December 1995. + button-new-target 1 + button-view-history 0 +} { + catch maintenance + global debug + if {!$debug} return html "
\n" html "

Debug information

\n" html "sessionId: $sessionId
\n" diff --git a/www/search.egw b/www/search.egw index daaf3b7..edf0793 100644 --- a/www/search.egw +++ b/www/search.egw @@ -1,6 +1,6 @@ { -# $Id: search.egw,v 1.22 1996/01/03 08:59:43 adam Exp $ +# $Id: search.egw,v 1.23 1996/01/03 15:19:41 adam Exp $ proc start-scan {scanNo cache dir} { global sessionId @@ -11,6 +11,8 @@ proc start-scan {scanNo cache dir} { global targets global nextSetNo global env + global useIcons + global debug set host $hist($setNo,host) @@ -20,7 +22,6 @@ proc start-scan {scanNo cache dir} { if {$hist($setNo,$scanNo,scanTerm) == ""} { displayError "Empty query" \ "You must specify at least one search word" - html "\n" wabort return } @@ -37,24 +38,55 @@ proc start-scan {scanNo cache dir} { if {[z39scan $setNo $scanNo 0 $lines $pos $cache] != "1"} { return } + button-europagate + html {Backward} "\n" + html / $sessionId {/search.egw/} $setNo + [expr $scanNo - 1] + b {">} + if {$useIcons} { + html {} + } else { + html {Previous Terms | } + } html {Forward
} + html / $sessionId {/search.egw/} $setNo + [expr $scanNo + 1] + f {">} + if {$useIcons} { + html {} + } else { + html {Next Terms | } + } + html {} + button-new-query 0 $setNo + html "

\n" display-scan $setNo $scanNo 0 + html "

\n" + + button-europagate html {Backward} "\n" + html / $sessionId {/search.egw/} $setNo + [expr $scanNo - 1] + b {">} + if {$useIcons} { + html {} + } else { + html {Previous Terms | } + } html {Forward
} + html / $sessionId {/search.egw/} $setNo + [expr $scanNo + 1] + f {">} + if {$useIcons} { + html {} + } else { + html {Next Terms | } + } + html {} + button-new-query 0 $setNo + if {!$debug} return html "


\n" html "

Debug information

\n" html "sessionId: $sessionId
\n" @@ -67,9 +99,7 @@ proc start-scan {scanNo cache dir} { html "databases: " $hist($setNo,database) "
\n" html "selected: " [wform base] "
\n" html "setNo: " $setNo "
\n" - html "nextSetNo: " $nextSetNo "
\n" - - html "\n" + html "nextSetNo: " $nextSetNo "
\n" } proc buttons {setNo setMax startPos after} { @@ -78,20 +108,8 @@ proc buttons {setNo setMax startPos after} { global env global hist - if {!$useIcons && $after && $setMax < [z39.$setNo resultCount]} { - html "

\n" - html "

\n" - html {} - html "
\n" - } - html "

\n" - if {$useIcons} { - html {Europagate} - } + button-europagate if {$setMax < [z39.$setNo resultCount]} { html {Previous Records} " | \n" } } - html {} - } else { - html {">New Query} " | \n" - } + button-new-query 1 $setNo + button-new-target 1 + button-view-history 0 - html {} - } else { - html {">New Target} - } html "

\n" - if {!$useIcons && !$after && $startPos != "" && $startPos != "1"} { - html "

\n" - html {} - html "

\n" - } - } if {[info commands saveState] == ""} { @@ -165,6 +160,8 @@ proc buttons {setNo setMax startPos after} { } else { catch {unset hist($setNo,hits)} } + set hist($setNo,scan) 0 + set hist($setNo,form,menu1) [wform menu1] set hist($setNo,form,menu2) [wform menu2] set hist($setNo,form,menu3) [wform menu3] @@ -175,6 +172,7 @@ proc buttons {setNo setMax startPos after} { set hist($setNo,form,logic1) [wform logic1] set hist($setNo,form,logic2) [wform logic2] + set hist($setNo,form,logic3) {} set host $hist($setNo,host) set databases [lindex $targets($host) 1] @@ -199,11 +197,11 @@ proc buttons {setNo setMax startPos after} { set hist($setNo,$scanNo,scanTerm) [lindex $termPlusAttr 0] set hist($setNo,scanAttr) [lindex $termPlusAttr 1] start-scan $scanNo 0 {} + html "\n" wabort return } } - set hist($setNo,scan) 0 set query [build-query $hist($setNo,host) 3] if {"x$query" == "x"} { html " WWW/Z39.50 Gateway Search\n\n" @@ -221,6 +219,7 @@ proc buttons {setNo setMax startPos after} { set scanNo 1000 } start-scan $scanNo 1 $dir + html "\n" wabort } } @@ -238,9 +237,10 @@ proc buttons {setNo setMax startPos after} { return } set r [z39.$setNo resultCount] - html "

Search result $r hits

\n" - wflush set setOffset [z39.$setNo numberOfRecordsReturned] + html {

Records 1-} $setOffset " out of $r

\n" + wflush + html "