diff --git a/tasks/02-bibliotheca-main.sh b/tasks/02-bibliotheca-main.sh index 433084b..53da0ca 100755 --- a/tasks/02-bibliotheca-main.sh +++ b/tasks/02-bibliotheca-main.sh @@ -567,50 +567,44 @@ echo # ----------------------------------- 0500 ----------------------------------- # # spec_B_T_56 -# TODO: Regeln für ART=GH, ART=L # TODO: Differenzierung nach MEDGR echo "Gattung und Status 0500..." read -r -d '' expression << EXPRESSION if( - value == 'M', + or( + value == 'M', + value == 'L' + ), 'Aan', - if( - value == 'U', - 'Asn', - if( - value == 'A', - 'Ban', - if( - value == 'V', - 'Ban', - if( - and( - value == 'P', - forNonBlank(cells['M|MEDGR'].value,v,if(v == 'SPIEL', true, false),false) - ), - 'Ban', - if( - value == 'P', - 'Lax', - if( - value == 'G', - 'Acn', - if( - value == 'S', - 'AFn', - if( - value == 'Z', - 'Abn', - null - ) - ) - ) - ) - ) - ) - ) - ) -) +if( + value == 'U', + 'Asn', +if( + or( + value == 'A', + value == 'V' + ), + 'Ban', +if( + and( + value == 'P', + forNonBlank(cells['M|MEDGR'].value,v,if(v == 'SPIEL', true, false),false) + ), + 'Ban', +if( + value == 'P', + 'Lax', +if( + value == 'G', + 'Acn', +if( + value == 'S', + 'AFn', +if( + value == 'Z', + 'Abn', +null +)))))))) EXPRESSION if curl -fs \ --data project="${projects[$p]}" \ @@ -639,6 +633,51 @@ else fi echo +# ----------------------------------- 1140 ----------------------------------- # + +# spec_B_T_53 +# TODO: Differenzierung nach MEDGR +echo "Veröffentlichungsart 1140..." +read -r -d '' expression << EXPRESSION +if( + value == 'A', + 'muto', +if( + value == 'V', + 'vide', +if( + value == 'L', + 'lo', +null +))) +EXPRESSION +if curl -fs \ + --data project="${projects[$p]}" \ + --data-urlencode "operations@-" \ + "${endpoint}/command/core/apply-operations$(refine_csrf)" > /dev/null \ + << JSON + [ + { + "op": "core/column-addition", + "engineConfig": { + "facets": [], + "mode": "row-based" + }, + "baseColumnName": "M|ART", + "expression": $(echo "grel:${expression}" | ${jq} -s -R '.'), + "onError": "set-to-blank", + "newColumnName": "1140", + "columnInsertIndex": 3 + } + ] +JSON +then + log "transformed ${p} (${projects[$p]})" +else + error "transform ${p} (${projects[$p]}) failed!" +fi +echo + # ----------------------------------- 4000 ----------------------------------- # # spec_B_T_17 @@ -730,6 +769,7 @@ with( '2199', '0100', '0500', + '1140', '2000', '4000', '7100B', diff --git a/tasks/03-ba-sachsen.sh b/tasks/03-ba-sachsen.sh index cf3237c..181d067 100755 --- a/tasks/03-ba-sachsen.sh +++ b/tasks/03-ba-sachsen.sh @@ -475,6 +475,7 @@ if(row.index - row.record.fromRowIndex == 0, '' + '\n' + forNonBlank(cells['0500'].value, v, '002@' + ' 0' + v + '\n', '') + forNonBlank(cells['0100'].value, v, '003@' + ' 0' + v + '\n', '') ++ forNonBlank(cells['1140'].value, v, '013H@' + ' a' + v + '\n', '') + forNonBlank(cells['2000'].value, v, forEach(v.split('␟'),x,'004A' + ' 0' + x + '\n').join(''), '') + forNonBlank(cells['2199'].value, v, '006Y' + ' 0' + v + '\n', '') + forNonBlank(cells['4000'].value, v, '021A' + ' a' + v + '\n', '')