From 8842f97622f6897d2ea7f71be513592e97e28553 Mon Sep 17 00:00:00 2001 From: Felix Lohmeier Date: Fri, 5 Mar 2021 17:15:51 +0100 Subject: [PATCH] =?UTF-8?q?Pr=C3=BCfung=20NRPRE=20f=C3=BCr=20MTM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bibliotheca/Taskfile.yml | 6 +- bibliotheca/config/main/abschluss.json | 19 ---- bibliotheca/config/main/nrpre.json | 114 +++++++++++++++++++++ bibliotheca/config/main/zeitschriften.json | 46 --------- 4 files changed, 118 insertions(+), 67 deletions(-) create mode 100644 bibliotheca/config/main/nrpre.json diff --git a/bibliotheca/Taskfile.yml b/bibliotheca/Taskfile.yml index a4c6ab8..68b57bf 100644 --- a/bibliotheca/Taskfile.yml +++ b/bibliotheca/Taskfile.yml @@ -109,7 +109,7 @@ tasks: "$CLIENT" -P {{.PORT}} {{.PROJECT}} --apply config/main/sortieren.json > {{.LOG}} - > # spec_Z_01: E-Books löschen (Bautzen) "$CLIENT" -P {{.PORT}} {{.PROJECT}} --apply config/main/ebooks.json > {{.LOG}} - - > # spec_Z_02: Zeitschriften und Teile von MTM löschen; siehe auch Spezifikation in CBS-Titeldaten Bibliotheca + - > # spec_Z_02: Zeitschriften und Reihen löschen; siehe auch Spezifikation in CBS-Titeldaten Bibliotheca "$CLIENT" -P {{.PORT}} {{.PROJECT}} --apply config/main/zeitschriften.json > {{.LOG}} - > # Bibliothekskürzel aus Import-Dateiname "$CLIENT" -P {{.PORT}} {{.PROJECT}} --apply config/main/file.json > {{.LOG}} @@ -198,8 +198,10 @@ tasks: "$CLIENT" -P {{.PORT}} {{.PROJECT}} --apply config/main/3210.json > {{.LOG}} - > # spec_B_T_48: Lokale Systematik in 67XX (Exemplarsatz!) für BB, BZ, GC "$CLIENT" -P {{.PORT}} {{.PROJECT}} --apply config/main/67XX.json > {{.LOG}} + - > # spec_B_T_32: MTM Überordnungen löschen, wenn keine Unterordnung mit BANDB/BANDN über NRPRE darauf verweist; siehe auch Spezifikation in CBS-Titeldaten Bibliotheca + "$CLIENT" -P {{.PORT}} {{.PROJECT}} --apply config/main/nrpre.json > {{.LOG}} # Die folgende Transformationsregel muss direkt vor dem Export stehen - - > # Abschließend Titel ohne Exemplare löschen; Mehrteilige Monografien sollen stehen bleiben, daher nur: wenn BANDB und BANDN nicht leer + - > # Abschließend Titel ohne Exemplare löschen "$CLIENT" -P {{.PORT}} {{.PROJECT}} --apply config/main/abschluss.json > {{.LOG}} - > # Export der PICA3-Spalten als CSV; Spalte 2199 muss vorne stehen, weil später für Sortierung benötigt mkdir -p output && diff --git a/bibliotheca/config/main/abschluss.json b/bibliotheca/config/main/abschluss.json index d285c3e..028ca9f 100644 --- a/bibliotheca/config/main/abschluss.json +++ b/bibliotheca/config/main/abschluss.json @@ -40,25 +40,6 @@ ], "selectBlank": false, "selectError": false - }, - { - "type": "list", - "name": "M|BANDB", - "expression": "grel:or(isNonBlank(cells['M|BANDB'].value), isNonBlank(cells['M|BANDN'].value))", - "columnName": "M|BANDB", - "invert": false, - "omitBlank": false, - "omitError": false, - "selection": [ - { - "v": { - "v": false, - "l": "false" - } - } - ], - "selectBlank": false, - "selectError": false } ], "mode": "row-based" diff --git a/bibliotheca/config/main/nrpre.json b/bibliotheca/config/main/nrpre.json new file mode 100644 index 0000000..05add1b --- /dev/null +++ b/bibliotheca/config/main/nrpre.json @@ -0,0 +1,114 @@ +[ + { + "op": "core/column-addition", + "engineConfig": { + "facets": [ + { + "type": "list", + "name": "M|BANDB", + "expression": "grel:or(isNonBlank(cells['M|BANDB'].value), isNonBlank(cells['M|BANDN'].value))", + "columnName": "M|BANDB", + "invert": false, + "omitBlank": false, + "omitError": false, + "selection": [ + { + "v": { + "v": true, + "l": "true" + } + } + ], + "selectBlank": false, + "selectError": false + }, + { + "type": "list", + "name": "M|NRPRE", + "expression": "isBlank(value)", + "columnName": "M|NRPRE", + "invert": false, + "omitBlank": false, + "omitError": false, + "selection": [ + { + "v": { + "v": false, + "l": "false" + } + } + ], + "selectBlank": false, + "selectError": false + } + ], + "mode": "row-based" + }, + "baseColumnName": "M|NRPRE", + "expression": "grel:forEach(value.cross('bibliotheca','M|MEDNR'),r,if(and(r.cells['File'].value == cells['File'].value, r.cells['M|ART'].value == 'G'), cells['M|NRPRE'].value, null)).join(',')", + "onError": "set-to-blank", + "newColumnName": "ueber", + "columnInsertIndex": 72, + "description": "Create column ueber at index 72 based on column M|NRPRE using expression grel:forEach(value.cross('bibliotheca','M|MEDNR'),r,if(and(r.cells['File'].value == cells['File'].value, r.cells['M|ART'].value == 'G'), cells['M|NRPRE'].value, null)).join(',')" + }, + { + "op": "core/column-addition", + "engineConfig": { + "facets": [], + "mode": "row-based" + }, + "baseColumnName": "M|MEDNR", + "expression": "grel:forEach(value.cross('bibliotheca','ueber'),r,if(r.cells['File'].value == cells['File'].value,r.cells['M|MEDNR'].value,null)).join(',')", + "onError": "set-to-blank", + "newColumnName": "unter", + "columnInsertIndex": 1, + "description": "Create column unter at index 1 based on column M|MEDNR using expression grel:forEach(value.cross('bibliotheca','ueber'),r,if(r.cells['File'].value == cells['File'].value,r.cells['M|MEDNR'].value,null)).join(',')" + }, + { + "op": "core/row-removal", + "engineConfig": { + "facets": [ + { + "type": "list", + "name": "M|ART", + "expression": "value", + "columnName": "M|ART", + "invert": false, + "omitBlank": false, + "omitError": false, + "selection": [ + { + "v": { + "v": "G", + "l": "G" + } + } + ], + "selectBlank": false, + "selectError": false + }, + { + "type": "list", + "name": "unter", + "expression": "isBlank(value)", + "columnName": "unter", + "invert": false, + "omitBlank": false, + "omitError": false, + "selection": [ + { + "v": { + "v": true, + "l": "true" + } + } + ], + "selectBlank": false, + "selectError": false + } + ], + "mode": "row-based" + }, + "description": "Remove rows" + } +] diff --git a/bibliotheca/config/main/zeitschriften.json b/bibliotheca/config/main/zeitschriften.json index 15a0bda..5409c6c 100644 --- a/bibliotheca/config/main/zeitschriften.json +++ b/bibliotheca/config/main/zeitschriften.json @@ -115,51 +115,5 @@ ], "mode": "row-based" } - }, - { - "op": "core/row-removal", - "engineConfig": { - "facets": [ - { - "type": "list", - "name": "M|ART", - "expression": "value", - "columnName": "M|ART", - "invert": false, - "omitBlank": false, - "omitError": false, - "selection": [ - { - "v": { - "v": "G", - "l": "G" - } - } - ], - "selectBlank": false, - "selectError": false - }, - { - "type": "list", - "name": "M|MEDNR", - "expression": "grel:forEach(value.cross('bibliotheca','M|NRPRE'),r,if(and(r.cells['File'].value == cells['File'].value, or(isNonBlank(r.cells['M|BANDB'].value),isNonBlank(r.cells['M|BANDN'].value))),'vorhanden','fehlt')).inArray('vorhanden')", - "columnName": "M|MEDNR", - "invert": false, - "omitBlank": false, - "omitError": false, - "selection": [ - { - "v": { - "v": false, - "l": "false" - } - } - ], - "selectBlank": false, - "selectError": true - } - ], - "mode": "row-based" - } } ]