🎨 ppn2ocr: Extract a function to make a workspace

pull/27/head
Gerber, Mike 5 years ago
parent 18d4ab0ba1
commit 2a4b204fbe

@ -12,10 +12,15 @@ self_dir=`dirname $0`
self_dir=`realpath $self_dir`
workspace=$ppn
make_workspace () {
ppn=$1
workspace=$2
# Make workspace directory
mkdir "$workspace"
cd "$workspace"
pwd
# Get METS from OAI-PMH
oai_identifier="oai%3Adigital.staatsbibliothek-berlin.de%3A$ppn"
oai_url="https://digital.staatsbibliothek-berlin.de/oai?verb=GetRecord&metadataPrefix=mets&identifier=$oai_identifier"
echo "$oai_url"
@ -30,9 +35,13 @@ sed -i 's#file:///goobi/tiff001/sbb/#file:///srv/digisam_images/sbb/#g' mets.xml
# Remove LOCAL file group as we do not have access to the files
ocrd workspace remove-group -rf --keep-files LOCAL
# Validate workspace
ocrd workspace validate mets.xml | grep -v "<notice>Won't download remote image"
}
make_workspace $ppn $ppn
$self_dir/run-docker-hub -I PRESENTATION --skip-validation

Loading…
Cancel
Save