#!/bin/bash if [ $# != 2 ] ; then echo "Usage: imageis-query-by-id.sh col id" exit fi col=$1 id=$2 docid=$col:$id echo "Generating query_id.xml" cat "$IMAGEISHOME/templates/query_id.xml" \ | sed "s@\*\*docid\*\*@$docid@g" \ > "/tmp/vsupload/query_id.xml" echo "Querying by $docid" java -jar "$IMAGEISHOME/ImageIS.jar" "/tmp/vsupload/query_id.xml" if [ $? == "0" ] ; then /bin/rm "/tmp/vsupload/query_id.xml" fi if [ ! -f image_cbs_result.xml ] ; then echo "Failed to generate image_cbs_result.xml" echo "Check catalina.out for server-side error messages" exit 1 elif [ -z image_cbs_result.xml ] ; then echo "Server returned zero sized file image_cbs_result.xml" echo "Check that the doc-id used is valid" else cat image_cbs_result.xml /bin/rm image_cbs_result.xml fi