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
|
Rev | Line | |
---|
[20983] | 1 | #!/bin/bash
|
---|
| 2 |
|
---|
| 3 | if [ $# != 2 ] ; then
|
---|
| 4 | echo "Usage: imageis-query-by-id.sh col id"
|
---|
| 5 | exit
|
---|
| 6 | fi
|
---|
| 7 |
|
---|
| 8 | col=$1
|
---|
| 9 | id=$2
|
---|
| 10 |
|
---|
| 11 | docid=$col:$id
|
---|
| 12 |
|
---|
| 13 | echo "Generating query_id.xml"
|
---|
| 14 | cat "$IMAGEISHOME/templates/query_id.xml" \
|
---|
| 15 | | sed "s@\*\*docid\*\*@$docid@g" \
|
---|
| 16 | > "/tmp/vsupload/query_id.xml"
|
---|
| 17 |
|
---|
| 18 | echo "Querying by $docid"
|
---|
| 19 |
|
---|
| 20 | java -jar "$IMAGEISHOME/ImageIS.jar" "/tmp/vsupload/query_id.xml"
|
---|
| 21 |
|
---|
| 22 | if [ $? == "0" ] ; then
|
---|
| 23 | /bin/rm "/tmp/vsupload/query_id.xml"
|
---|
| 24 | fi
|
---|
| 25 |
|
---|
| 26 | if [ ! -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
|
---|
| 30 | elif [ -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"
|
---|
| 33 | else
|
---|
| 34 | cat image_cbs_result.xml
|
---|
| 35 | /bin/rm image_cbs_result.xml
|
---|
| 36 | fi
|
---|
| 37 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.