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:
776 bytes
|
Line | |
---|
1 | #!/bin/bash
|
---|
2 |
|
---|
3 | if [ $# != 2 ] ; then
|
---|
4 | echo "Usage: imageis-add-jpg-file.sh collection file.jpg"
|
---|
5 | exit
|
---|
6 | fi
|
---|
7 |
|
---|
8 | col=$1
|
---|
9 | srcfilename=$2
|
---|
10 |
|
---|
11 | if [ ! -f "$srcfilename" ] ; then
|
---|
12 | echo "Error: failed to find $srcfilename"
|
---|
13 | exit
|
---|
14 | fi
|
---|
15 |
|
---|
16 | filetail=${srcfilename##*/}
|
---|
17 | docid=${filetail%.*}
|
---|
18 |
|
---|
19 | # make sure file extension is lowercase .jpg
|
---|
20 |
|
---|
21 | dstfile=$docid.jpg
|
---|
22 | if [ "x$col" != "x" ] ; then
|
---|
23 | dstfile="$col:$dstfile"
|
---|
24 | fi
|
---|
25 | dstfilename=/tmp/vsupload/$dstfile
|
---|
26 |
|
---|
27 | /bin/cp "$srcfilename" "$dstfilename"
|
---|
28 |
|
---|
29 | echo "Generating add_file.xml"
|
---|
30 | cat "$IMAGEISHOME/templates/add_file.xml" \
|
---|
31 | | sed "s@\*\*imgfile\*\*@$dstfile@g" \
|
---|
32 | > "/tmp/vsupload/add_file.xml"
|
---|
33 |
|
---|
34 | echo "Ingesting $dstfile"
|
---|
35 |
|
---|
36 | java -jar "$IMAGEISHOME/ImageIS.jar" "/tmp/vsupload/add_file.xml"
|
---|
37 |
|
---|
38 | if [ $? == "0" ] ; then
|
---|
39 | /bin/rm "/tmp/vsupload/add_file.xml"
|
---|
40 | fi
|
---|
Note:
See
TracBrowser
for help on using the repository browser.