From 8ef113887b3528d9631e213cad34e80acf1dd458 Mon Sep 17 00:00:00 2001 From: Felix Lohmeier Date: Wed, 22 Jul 2020 23:38:39 +0200 Subject: [PATCH] =?UTF-8?q?Zugangsdatum=20und=20Selektionsschl=C3=BCssel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/ba-sachsen.sh | 3 +- config/bibliotheca-02.sh | 67 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 67 insertions(+), 3 deletions(-) diff --git a/config/ba-sachsen.sh b/config/ba-sachsen.sh index a7b0cc2..089af66 100644 --- a/config/ba-sachsen.sh +++ b/config/ba-sachsen.sh @@ -391,7 +391,8 @@ if(row.index - row.record.fromRowIndex == 0, }}{{ if(isNonBlank(cells['7100f'].value), with(with(rowIndex - row.record.fromRowIndex + 1, i, '00'[0,2-i.length()] + i),exnr, -'209A/' + exnr + ' B' + cells['7100B'].value + 'f' + cells['7100f'].value + forNonBlank(cells['7100a'].value, v, 'a' + v, '') + 'x00' + '\n' +'208@/' + exnr + ' a' + cells['E0XX'].value + 'bn' + cells['E0XXb'].value + '\n' ++ '209A/' + exnr + ' B' + cells['7100B'].value + 'f' + cells['7100f'].value + forNonBlank(cells['7100a'].value, v, 'a' + v, '') + 'x00' + '\n' ), '') }} TEMPLATE diff --git a/config/bibliotheca-02.sh b/config/bibliotheca-02.sh index 67a7d10..2585070 100644 --- a/config/bibliotheca-02.sh +++ b/config/bibliotheca-02.sh @@ -335,7 +335,6 @@ echo # ---------------------------------- 07 2199 --------------------------------- # # spec_B_T_49 -# TODO: Titeldaten ohne Exemplare echo "Nummern aus Datenkonversion 2199..." if curl -fs \ --data project="${projects[$p]}" \ @@ -489,6 +488,68 @@ else fi echo +# --------------------------------- 12 E0XX ---------------------------------- # + +# spec_B_E_10 +echo "Zugangsdatum E0XX..." +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": "E|ZUDAT", + "expression": "grel:forNonBlank(value,v,v[0,2] + '-' + v[3,5] + '-' + v[8,10],'22-07-20')", + "onError": "set-to-blank", + "newColumnName": "E0XX", + "columnInsertIndex": 3 + } + ] +JSON +then + log "transformed ${p} (${projects[$p]})" +else + error "transform ${p} (${projects[$p]}) failed!" +fi +echo + +# --------------------------------- 12 E0XXb ---------------------------------- # + +# spec_B_E_14 +echo "Selektionsschlüssel E0XXb..." +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": "E|ZWGST", + "expression": "grel:value.toLowercase()", + "onError": "set-to-blank", + "newColumnName": "E0XXb", + "columnInsertIndex": 3 + } + ] +JSON +then + log "transformed ${p} (${projects[$p]})" +else + error "transform ${p} (${projects[$p]}) failed!" +fi +echo + # ================================== EXPORT ================================== # # Export der PICA3-Spalten als CSV @@ -503,7 +564,9 @@ with( '2000', '7100B', '7100f', - '7100a' + '7100a', + 'E0XX', + 'E0XXb' ], columns, if(