#!/bin/sh # this is a script that is called whenever an HTML file is loaded # arg1 is the original URL # checks to see if there is an annotation file for the URL, and if so incorporates it echo "Content_type: text/html" echo ARG=$1 ME=/home/pjbrown TEMP=$ME/web_tmp/File_copy.xml # call it .xml to avoid recursion # check if already running to prevent endless recursion MARKER=$ME/tmp/pjb_html_helper if test -f $MARKER; then rm -f $MARKER # current tactic # if pjb file, then make a copy to avoid recursion! if test X`expr substr "$1" 1 31` = "Xfile:$ME/public_html/"; then FILENAME=`expr substr "$1" 6 9999` cp $FILENAME $TEMP echo "Recursion! Made a copy to stop it" ARG=file:$TEMP USE_TEMP=true # todo We really should add a BASE to this file, or put $TEMP in the same dir as filename else echo Todo recursion for $1 >&2 BROWSER=lynx # but not there! BROWSER=vi xterm -e $BROWSER "$1" exit 1 fi #else # it seems that the shell requires at least one command after "else" # hence if all the commands are commented out, yjen "else" must be too #touch $MARKER fi PATH=.:/usr/ucb:/opt/jdk1.2.1/bin:/home/pjbrown/sunbin:/home/pjbrown/bin:/usr/java/bin:/usr/bin:/usr/local/bin:/bin:/usr/X11R6/bin:/usr/local/jdk/bin:/usr/X11R6/bin:/usr/local/jdk/bin:$PATH export PATH # special set up because HOSTTYPE is not set on apache at exeter if test x"$SERVER_NAME" = x"www.dcs.ex.ac.uk"; then HOSTTYPE=sun4; export HOSTTYPE fi echo $0 called for $ARG ANNDIR=$ME/annotation_experiments/guide_layers if test x$USE_TEMP = xtrue; then $ANNDIR/web_experiment/to_web -u "$ARG" rm -f $TEMPFILE else CHECKER=$ANNDIR/web_experiment/check_for_annotation cd $ANNDIR/helper touch $MARKER HELPER=yes # used by $CHECKER, etc. export HELPER $CHECKER "$ARG" rm -f $MARKER fi