6 Usage: pp2client.sh [OPTIONS]
7 Options: Default values
8 [--prefix=URLPREFIX] http://localhost:9004/search.pz2
17 H=http://localhost:9004/search.pz2
24 if test $# -eq 0; then
29 while test $# -gt 0; do
31 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
42 SERVICE="&service=$optarg"
60 if [ "$TIME" != "" ] ; then
61 /usr/bin/time --format "$OF, init, %e" wget -q -O ${TMP_DIR}$OF.init.xml "$H/?command=init${SERVICE}" 2> ${TMP_DIR}$OF.init.time
63 wget -q -O ${TMP_DIR}$OF.init.xml "$H/?command=init${SERVICE}"
67 if [ "$R" != 0 ]; then
68 if [ "$R" = "4" ]; then
69 echo "wget returned network error. Maybe Pazpar2 is not running at"
73 echo "wget failed. Exit code $R"
76 S=`xsltproc get_session.xsl $OF.init.xml`
77 if [ -n "$SETTINGS" ] ; then
78 if [ "$TIME" != "" ] ; then
79 /usr/bin/time --format "$OF, settings, %e" wget -q -O ${TMP_DIR}$OF.settings.xml "$H?command=settings&session=$S&${SETTINGS}" 2> ${TMP_DIR}$OF.settings.time
81 wget -q -O ${TMP_DIR}$OF.settings.xml "$H?command=settings&session=$S&${SETTINGS}"
85 if [ "$TIME" != "" ] ; then
86 /usr/bin/time --format "$OF, search, %e" wget -q -O ${TMP_DIR}$OF.search.xml "$H?command=search&query=$QUERY&session=$S" 2> ${TMP_DIR}$OF.search.time
88 wget -q -O ${TMP_DIR}$OF.search.xml "$H?command=search&query=$QUERY&session=$S"
91 if [ "$TIME" != "" ] ; then
92 /usr/bin/time --format "$OF, show, %e" wget -q -O ${TMP_DIR}$OF.show.xml "$H?command=show&session=$S&sort=relevance&start=0&num=100&block=1" 2> ${TMP_DIR}$OF.show.time
94 wget -q -O ${TMP_DIR}$OF.show.xml "$H?command=show&session=$S&sort=relevance&start=0&num=100&block=1"
96 wget -q -O ${TMP_DIR}$OF.bytarget.xml "$H?command=bytarget&session=$S"
97 wget -q -O ${TMP_DIR}$OF.stat.xml "$H?command=stat&session=$S"
98 wget -q -O ${TMP_DIR}$OF.info.xml "$H?command=info"