source: gs3-extensions/pharos/trunk/cmdline-api-srcpack/bin/script/imageis-query-by-id.sh@ 20983

Last change on this file since 20983 was 20983, checked in by davidb, 14 years ago

Initial files for Phrasos extension to Greenstone3

File size: 800 bytes
Line 
1#!/bin/bash
2
3if [ $# != 2 ] ; then
4 echo "Usage: imageis-query-by-id.sh col id"
5 exit
6fi
7
8col=$1
9id=$2
10
11docid=$col:$id
12
13echo "Generating query_id.xml"
14cat "$IMAGEISHOME/templates/query_id.xml" \
15 | sed "s@\*\*docid\*\*@$docid@g" \
16 > "/tmp/vsupload/query_id.xml"
17
18echo "Querying by $docid"
19
20java -jar "$IMAGEISHOME/ImageIS.jar" "/tmp/vsupload/query_id.xml"
21
22if [ $? == "0" ] ; then
23 /bin/rm "/tmp/vsupload/query_id.xml"
24fi
25
26if [ ! -f image_cbs_result.xml ] ; then
27 echo "Failed to generate image_cbs_result.xml"
28 echo "Check catalina.out for server-side error messages"
29 exit 1
30elif [ -z image_cbs_result.xml ] ; then
31 echo "Server returned zero sized file image_cbs_result.xml"
32 echo "Check that the doc-id used is valid"
33else
34 cat image_cbs_result.xml
35 /bin/rm image_cbs_result.xml
36fi
37
Note: See TracBrowser for help on using the repository browser.