Changeset 37157 for gs3-installations/intermuse/trunk/sites/intermuse/collect/programmes-and-performers/INDEX-IIIF-MANIFEST.sh
- Timestamp:
- 2023-01-18T23:48:08+13:00 (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-installations/intermuse/trunk/sites/intermuse/collect/programmes-and-performers/INDEX-IIIF-MANIFEST.sh
r37124 r37157 1 #!/bin/bash -x1 #!/bin/bash 2 2 3 3 source ../_local_collect_config.sh 4 4 5 5 6 iuri_prefix=http://localhost:4343/greenstone3/library/sites/intermuse/collect/$col 6 # Build up URL through static 'site' URL to collect/<openannotation>.json 7 #iuri_prefix=http://localhost:4343/greenstone3/library/sites/intermuse/collect/$col 7 8 8 # ifilename=${1:-archives/HASH012c.dir/openannotation-list.json}9 ifilename=${1:-amadeus-iiif-manifest.json}9 ## ifilename=${1:-archives/HASH012c.dir/openannotation-list.json} 10 #ifilename=${1:-amadeus-iiif-manifest--with-otherContent.json} 10 11 11 #iuri_tail=${ifilename#archives/}12 12 13 #iuri="${iuri_prefix}${iuri_tail}" 14 iuri="${iuri_prefix}/${ifilename}" 13 ##iuri_tail=${ifilename#archives/} 15 14 15 ##iuri="${iuri_prefix}${iuri_tail}" 16 #iuri="${iuri_prefix}/${ifilename}" 17 18 19 docid="${1:-HASH012cd965c3e83d504f4a78cd}" 20 21 download_url="$gs_library_url/collection/$col/document/$docid" 22 download_url="$download_url?sa=iiif-manifest&ed=1&includeFileAssocOpenAnnotations=true&excerptid-text=iiif-manifest" 23 24 if [ ! -d tmp ] ; then 25 echo "" 26 echo "Making directory 'tmp'" 27 mkdir tmp 28 fi 29 30 # Workaround for JSON parsing error. When using the Greenstone document URL directly 31 # then POSTing to /simpleAnnotationStore/manifests resulted in a JSON error 32 # Issue caused by leading blank space 33 # 34 # Workaround is to download it as collect/tmp/doc-openannotation--with-otherContent.json 35 # and as part of that process, strip out whitespace. 36 # Then a new URL is built to the collect/tmp/doc-openannotation--with-otherContent.json 37 # and that version of the file is POSTed to /simpleAnnotationStore/manifests 38 39 echo "" 40 echo "Downloading openannotation JSON for $docid as workaround to strip out leading blank space" 41 echo "" 42 curl "$download_url" | egrep -v "^\\s*$" > tmp/doc-openannotation--with-otherContent.json 43 44 45 iuri="$gs_library_url/sites/intermuse/collect/$col/tmp/doc-openannotation--with-otherContent.json" 16 46 17 47 internal_url_base="http://localhost:4343/simpleAnnotationStore" … … 21 51 echo "" 22 52 23 echo curl -X POST -d "uri=${iuri}" "$post_url"53 echo curl -X POST -d \"uri=${iuri}\" \"$post_url\" 24 54 curl -X POST -d "uri=${iuri}" "$post_url" 55 56 #if [ $? = 0 ] ; then 57 # /bin/rm tmp/doc-openannotation--with-otherContent.json 58 #fi 25 59 26 60 echo "" … … 31 65 32 66 # The short_id is needed to ... 67 68 69 # {"loaded":{"short_id":"e2465cd7e5174f2720cee110d9b4a06a","uri":"http-greenstone://intermuse/programmes-and-performers/HASH012cd965c3e83d504f4a78cd/manifest"}}+ echo ''
Note:
See TracChangeset
for help on using the changeset viewer.