Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocrd-page-transform: support --mets-server-url #27

Merged
merged 3 commits into from
Dec 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions ocrd-page-transform
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function main {
# shellcheck source=../core/ocrd/bashlib/lib.bash
source $(ocrd bashlib filename)
ocrd__wrap "$SHAREDIR/ocrd-tool.json" "ocrd-page-transform" "$@"
ocrd__minversion 2.30.0
ocrd__minversion 2.58.1

local xsl="${params[xsl]}"
local xsltparam="${params[xslt-params]}"
Expand Down Expand Up @@ -183,20 +183,24 @@ function main {
process_file "$in_fpath" "$in_id" "$in_pageId" "$xsl" "$xsltparam" "$out_fpath" "$out_id" "$out_file_grp" $pretty

# Add PAGE file to METS
declare -a options
declare -a add_options
if [ -n "$in_pageId" ]; then
options=( -g $in_pageId )
add_options=( -g $in_pageId )
else
options=()
add_options=()
fi
if [[ "${ocrd__argv[overwrite]}" == true ]];then
options+=( --force )
add_options+=( --force )
fi
add_options+=( -G $out_file_grp
-m $out_mimetype
-i "$out_id"
"$out_fpath" )
declare -a workspace_options
if [[ -n "${ocrd__argv[mets_server_url]}" ]];then
workspace_options+=( -U "${ocrd__argv[mets_server_url]}" )
fi
options+=( -G $out_file_grp
-m $out_mimetype
-i "$out_id"
"$out_fpath" )
ocrd workspace add "${options[@]}"
ocrd workspace "${workspace_options[@]}" add "${add_options[@]}"
done
}

Expand Down