From d44d78934717fa8e3e6544273edc7b84c817a517 Mon Sep 17 00:00:00 2001 From: Peter Weber Date: Tue, 11 May 2021 14:54:54 +0200 Subject: [PATCH] documents: store identifiers * Closes #1885. * Improves json schema reference definitions. * Closes #1873, last bullet point of https://github.com/rero/rero-ils/issues/1873#issuecomment-832002648. * Fixes startDate and endDate in the editor to accept integers between -9999 and 2050. Co-Authored-by: Peter Weber --- .../document_classification-v0.0.1.json | 112 +++---- ...document_content_media_carrier-v0.0.1.json | 292 +++++++++--------- ...ment_contribution_organisation-v0.0.1.json | 40 ++- ...contribution_organisation_link-v0.0.1.json | 4 +- .../document_contribution_person-v0.0.1.json | 2 +- .../document_document_relation-v0.0.1.json | 104 ++++--- .../documents/document_genre_form-v0.0.1.json | 72 +---- .../documents/document_identifier-v0.0.1.json | 133 ++++++-- .../document_provision_activity-v0.0.1.json | 29 +- .../documents/document_subjects-v0.0.1.json | 88 ++++-- .../document_temporal_coverage-v0.0.1.json | 28 +- .../v7/documents/document-v0.0.1.json | 6 +- 12 files changed, 497 insertions(+), 413 deletions(-) diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_classification-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_classification-v0.0.1.json index c030adb536..4b2299d6cc 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_classification-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_classification-v0.0.1.json @@ -38,13 +38,13 @@ } }, "classificationPortion": { - "$ref": "#/ref_classificationPortion" + "$ref": "#/definitions/classificationPortion" }, "subdivision": { - "$ref": "#/ref_subdivision" + "$ref": "#/definitions/subdivision" }, "assigner": { - "$ref": "#/ref_assigner" + "$ref": "#/definitions/assigner" } } }, @@ -79,13 +79,13 @@ } }, "classificationPortion": { - "$ref": "#/ref_classificationPortion" + "$ref": "#/definitions/classificationPortion" }, "subdivision": { - "$ref": "#/ref_subdivision" + "$ref": "#/definitions/subdivision" }, "assigner": { - "$ref": "#/ref_assigner" + "$ref": "#/definitions/assigner" } } }, @@ -120,13 +120,13 @@ } }, "classificationPortion": { - "$ref": "#/ref_classificationPortion" + "$ref": "#/definitions/classificationPortion" }, "subdivision": { - "$ref": "#/ref_subdivision" + "$ref": "#/definitions/subdivision" }, "assigner": { - "$ref": "#/ref_assigner" + "$ref": "#/definitions/assigner" } } }, @@ -162,16 +162,16 @@ } }, "classificationPortion": { - "$ref": "#/ref_classificationPortion" + "$ref": "#/definitions/classificationPortion" }, "subdivision": { - "$ref": "#/ref_subdivision" + "$ref": "#/definitions/subdivision" }, "edition": { - "$ref": "#/ref_edition" + "$ref": "#/definitions/edition" }, "assigner": { - "$ref": "#/ref_assigner" + "$ref": "#/definitions/assigner" } } }, @@ -207,16 +207,16 @@ } }, "classificationPortion": { - "$ref": "#/ref_classificationPortion" + "$ref": "#/definitions/classificationPortion" }, "subdivision": { - "$ref": "#/ref_subdivision" + "$ref": "#/definitions/subdivision" }, "edition": { - "$ref": "#/ref_edition" + "$ref": "#/definitions/edition" }, "assigner": { - "$ref": "#/ref_assigner" + "$ref": "#/definitions/assigner" } } }, @@ -251,13 +251,13 @@ } }, "classificationPortion": { - "$ref": "#/ref_classificationPortion" + "$ref": "#/definitions/classificationPortion" }, "subdivision": { - "$ref": "#/ref_subdivision" + "$ref": "#/definitions/subdivision" }, "assigner": { - "$ref": "#/ref_assigner" + "$ref": "#/definitions/assigner" } } }, @@ -292,13 +292,13 @@ } }, "classificationPortion": { - "$ref": "#/ref_classificationPortion" + "$ref": "#/definitions/classificationPortion" }, "subdivision": { - "$ref": "#/ref_subdivision" + "$ref": "#/definitions/subdivision" }, "assigner": { - "$ref": "#/ref_assigner" + "$ref": "#/definitions/assigner" } } }, @@ -387,13 +387,13 @@ } }, "classificationPortion": { - "$ref": "#/ref_classificationPortion" + "$ref": "#/definitions/classificationPortion" }, "subdivision": { - "$ref": "#/ref_subdivision" + "$ref": "#/definitions/subdivision" }, "assigner": { - "$ref": "#/ref_assigner" + "$ref": "#/definitions/assigner" } } } @@ -403,37 +403,39 @@ "hide": true } }, - "ref_classificationPortion": { - "title": "Notation", - "description": "Short alphanumeric string that serves as an identifier for a class", - "type": "string", - "minLength": 1, - "form": { - "placeholder": "Example: 001.012" - } - }, - "ref_subdivision": { - "title": "Subdivisions", - "minItems": 0, - "type": "array", - "items": { - "title": "Subdivision", + "definitions": { + "classificationPortion": { + "title": "Notation", + "description": "Short alphanumeric string that serves as an identifier for a class", + "type": "string", + "minLength": 1, + "form": { + "placeholder": "Example: 001.012" + } + }, + "subdivision": { + "title": "Subdivisions", + "minItems": 0, + "type": "array", + "items": { + "title": "Subdivision", + "type": "string", + "minLength": 1 + } + }, + "edition": { + "title": "Edition", + "description": "Used for imported records only. Edition of the classification, identified by a number, a date, or another textual designation.", + "type": "string", + "minLength": 1, + "form": { + "placeholder": "Example: Abridged edition, 22" + } + }, + "assigner": { + "title": "Used for imported records only. Assigning agency.", "type": "string", "minLength": 1 } - }, - "ref_edition": { - "title": "Edition", - "description": "Used for imported records only. Edition of the classification, identified by a number, a date, or another textual designation.", - "type": "string", - "minLength": 1, - "form": { - "placeholder": "Example: Abridged edition, 22" - } - }, - "ref_assigner": { - "title": "Used for imported records only. Assigning agency.", - "type": "string", - "minLength": 1 } } diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_content_media_carrier-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_content_media_carrier-v0.0.1.json index 7a2b3cf06b..1f81ba8af3 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_content_media_carrier-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_content_media_carrier-v0.0.1.json @@ -18,7 +18,7 @@ ], "properties": { "contentType": { - "$ref": "#/contentType" + "$ref": "#/definitions/contentType" } } }, @@ -36,7 +36,7 @@ ], "properties": { "contentType": { - "$ref": "#/contentType" + "$ref": "#/definitions/contentType" }, "mediaType": { "title": "rdamt:1001", @@ -127,7 +127,7 @@ ], "properties": { "contentType": { - "$ref": "#/contentType" + "$ref": "#/definitions/contentType" }, "mediaType": { "title": "rdamt:1002", @@ -223,7 +223,7 @@ ], "properties": { "contentType": { - "$ref": "#/contentType" + "$ref": "#/definitions/contentType" }, "mediaType": { "title": "rdamt:1003", @@ -314,7 +314,7 @@ ], "properties": { "contentType": { - "$ref": "#/contentType" + "$ref": "#/definitions/contentType" }, "mediaType": { "title": "rdamt:1004", @@ -370,7 +370,7 @@ ], "properties": { "contentType": { - "$ref": "#/contentType" + "$ref": "#/definitions/contentType" }, "mediaType": { "title": "rdamt:1005", @@ -466,7 +466,7 @@ ], "properties": { "contentType": { - "$ref": "#/contentType" + "$ref": "#/definitions/contentType" }, "mediaType": { "title": "rdamt:1006", @@ -527,7 +527,7 @@ ], "properties": { "contentType": { - "$ref": "#/contentType" + "$ref": "#/definitions/contentType" }, "mediaType": { "title": "rdamt:1007", @@ -608,7 +608,7 @@ ], "properties": { "contentType": { - "$ref": "#/contentType" + "$ref": "#/definitions/contentType" }, "mediaType": { "title": "rdamt:1008", @@ -679,7 +679,7 @@ ], "properties": { "contentType": { - "$ref": "#/contentType" + "$ref": "#/definitions/contentType" }, "mediaType": { "title": "other", @@ -722,141 +722,143 @@ "hide": true } }, - "contentType": { - "title": "Content type", - "description": "Fundamental form of communication in which the content is expressed and the human sense through which it is intended to be perceived (MARC 336).", - "type": "array", - "minItems": 1, - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "rdaco:1002", - "rdaco:1003", - "rdaco:1004", - "rdaco:1005", - "rdaco:1007", - "rdaco:1001", - "rdaco:1006", - "rdaco:1023", - "rdaco:1022", - "rdaco:1014", - "rdaco:1015", - "rdaco:1011", - "rdaco:1009", - "rdaco:1017", - "rdaco:1021", - "rdaco:1019", - "rdaco:1010", - "rdaco:1016", - "rdaco:1008", - "rdaco:1012", - "rdaco:1020", - "rdaco:1018", - "rdaco:1013", - "other" - ], - "form": { - "Type": "selectWithSort", - "options": [ - { - "label": "rdaco:1002", - "value": "rdaco:1002" - }, - { - "label": "rdaco:1003", - "value": "rdaco:1003" - }, - { - "label": "rdaco:1004", - "value": "rdaco:1004" - }, - { - "label": "rdaco:1005", - "value": "rdaco:1005" - }, - { - "label": "rdaco:1007", - "value": "rdaco:1007" - }, - { - "label": "rdaco:1001", - "value": "rdaco:1001" - }, - { - "label": "rdaco:1006", - "value": "rdaco:1006" - }, - { - "label": "rdaco:1023", - "value": "rdaco:1023" - }, - { - "label": "rdaco:1022", - "value": "rdaco:1022" - }, - { - "label": "rdaco:1014", - "value": "rdaco:1014" - }, - { - "label": "rdaco:1015", - "value": "rdaco:1015" - }, - { - "label": "rdaco:1011", - "value": "rdaco:1011" - }, - { - "label": "rdaco:1009", - "value": "rdaco:1009" - }, - { - "label": "rdaco:1017", - "value": "rdaco:1017" - }, - { - "label": "rdaco:1021", - "value": "rdaco:1021" - }, - { - "label": "rdaco:1019", - "value": "rdaco:1019" - }, - { - "label": "rdaco:1010", - "value": "rdaco:1010" - }, - { - "label": "rdaco:1016", - "value": "rdaco:1016" - }, - { - "label": "rdaco:1008", - "value": "rdaco:1008" - }, - { - "label": "rdaco:1012", - "value": "rdaco:1012" - }, - { - "label": "rdaco:1020", - "value": "rdaco:1020" - }, - { - "label": "rdaco:1018", - "value": "rdaco:1018" - }, - { - "label": "rdaco:1013", - "value": "rdaco:1013" - }, - { - "label": "other", - "value": "other" - } - ] + "definitions": { + "contentType": { + "title": "Content type", + "description": "Fundamental form of communication in which the content is expressed and the human sense through which it is intended to be perceived (MARC 336).", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "rdaco:1002", + "rdaco:1003", + "rdaco:1004", + "rdaco:1005", + "rdaco:1007", + "rdaco:1001", + "rdaco:1006", + "rdaco:1023", + "rdaco:1022", + "rdaco:1014", + "rdaco:1015", + "rdaco:1011", + "rdaco:1009", + "rdaco:1017", + "rdaco:1021", + "rdaco:1019", + "rdaco:1010", + "rdaco:1016", + "rdaco:1008", + "rdaco:1012", + "rdaco:1020", + "rdaco:1018", + "rdaco:1013", + "other" + ], + "form": { + "Type": "selectWithSort", + "options": [ + { + "label": "rdaco:1002", + "value": "rdaco:1002" + }, + { + "label": "rdaco:1003", + "value": "rdaco:1003" + }, + { + "label": "rdaco:1004", + "value": "rdaco:1004" + }, + { + "label": "rdaco:1005", + "value": "rdaco:1005" + }, + { + "label": "rdaco:1007", + "value": "rdaco:1007" + }, + { + "label": "rdaco:1001", + "value": "rdaco:1001" + }, + { + "label": "rdaco:1006", + "value": "rdaco:1006" + }, + { + "label": "rdaco:1023", + "value": "rdaco:1023" + }, + { + "label": "rdaco:1022", + "value": "rdaco:1022" + }, + { + "label": "rdaco:1014", + "value": "rdaco:1014" + }, + { + "label": "rdaco:1015", + "value": "rdaco:1015" + }, + { + "label": "rdaco:1011", + "value": "rdaco:1011" + }, + { + "label": "rdaco:1009", + "value": "rdaco:1009" + }, + { + "label": "rdaco:1017", + "value": "rdaco:1017" + }, + { + "label": "rdaco:1021", + "value": "rdaco:1021" + }, + { + "label": "rdaco:1019", + "value": "rdaco:1019" + }, + { + "label": "rdaco:1010", + "value": "rdaco:1010" + }, + { + "label": "rdaco:1016", + "value": "rdaco:1016" + }, + { + "label": "rdaco:1008", + "value": "rdaco:1008" + }, + { + "label": "rdaco:1012", + "value": "rdaco:1012" + }, + { + "label": "rdaco:1020", + "value": "rdaco:1020" + }, + { + "label": "rdaco:1018", + "value": "rdaco:1018" + }, + { + "label": "rdaco:1013", + "value": "rdaco:1013" + }, + { + "label": "other", + "value": "other" + } + ] + } } } } -} \ No newline at end of file +} diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_contribution_organisation-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_contribution_organisation-v0.0.1.json index 43a6b9784a..1c1f0b080a 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_contribution_organisation-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_contribution_organisation-v0.0.1.json @@ -1,5 +1,5 @@ { - "title": "Organisation", + "title": "Corporate body", "type": "object", "additionalProperties": false, "propertiesOrder": [ @@ -105,7 +105,43 @@ } }, "identifiedBy": { - "$ref": "https://ils.rero.ch/schemas/documents/document_identifier-v0.0.1.json" + "allOf": [ + { + "$ref": "https://ils.rero.ch/schemas/documents/document_identifier-v0.0.1.json#/identifier_contribution" + }, + { + "properties": { + "type": { + "form": { + "options": [ + { + "value": "bf:Local", + "label": "bf:local" + }, + { + "value": "IdRef", + "label": "IdRef" + }, + { + "value": "GND", + "label": "GND" + }, + { + "value": "RERO", + "label": "RERO" + } + ], + "templateOptions": { + "itemCssClass": "col-lg-4" + }, + "expressionProperties": { + "templateOptions.required": "true" + } + } + } + } + } + ] } }, "form": { diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_contribution_organisation_link-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_contribution_organisation_link-v0.0.1.json index 074d43c282..25ad65b7af 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_contribution_organisation_link-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_contribution_organisation_link-v0.0.1.json @@ -1,5 +1,5 @@ { - "title": "Link to organisation entity", + "title": "Link to corporate body entity", "type": "object", "additionalProperties": false, "propertiesOrder": [ @@ -26,7 +26,7 @@ } }, "$ref": { - "title": "Organisation", + "title": "Corporate body", "type": "string", "pattern": "^https://mef.rero.ch/api/gnd|idref|rero/.*?$", "form": { diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_contribution_person-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_contribution_person-v0.0.1.json index abc6447582..a58e553b1f 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_contribution_person-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_contribution_person-v0.0.1.json @@ -101,7 +101,7 @@ } }, "identifiedBy": { - "$ref": "https://ils.rero.ch/schemas/documents/document_identifier-v0.0.1.json" + "$ref": "https://ils.rero.ch/schemas/documents/document_identifier-v0.0.1.json#/identifier_contribution" } }, "form": { diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_document_relation-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_document_relation-v0.0.1.json index a6da784b0d..72c29ea9a1 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_document_relation-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_document_relation-v0.0.1.json @@ -10,10 +10,10 @@ "additionalProperties": false, "oneOf": [ { - "$ref": "#/ref_document" + "$ref": "#/definitions/document" }, { - "$ref": "#/ref_label" + "$ref": "#/definitions/label" } ] }, @@ -32,10 +32,10 @@ "additionalProperties": false, "oneOf": [ { - "$ref": "#/ref_document" + "$ref": "#/definitions/document" }, { - "$ref": "#/ref_label" + "$ref": "#/definitions/label" } ] }, @@ -54,10 +54,10 @@ "additionalProperties": false, "oneOf": [ { - "$ref": "#/ref_document" + "$ref": "#/definitions/document" }, { - "$ref": "#/ref_label" + "$ref": "#/definitions/label" } ] }, @@ -76,10 +76,10 @@ "additionalProperties": false, "oneOf": [ { - "$ref": "#/ref_document" + "$ref": "#/definitions/document" }, { - "$ref": "#/ref_label" + "$ref": "#/definitions/label" } ] }, @@ -98,10 +98,10 @@ "additionalProperties": false, "oneOf": [ { - "$ref": "#/ref_document" + "$ref": "#/definitions/document" }, { - "$ref": "#/ref_label" + "$ref": "#/definitions/label" } ] }, @@ -120,10 +120,10 @@ "additionalProperties": false, "oneOf": [ { - "$ref": "#/ref_document" + "$ref": "#/definitions/document" }, { - "$ref": "#/ref_label" + "$ref": "#/definitions/label" } ] }, @@ -142,10 +142,10 @@ "additionalProperties": false, "oneOf": [ { - "$ref": "#/ref_document" + "$ref": "#/definitions/document" }, { - "$ref": "#/ref_label" + "$ref": "#/definitions/label" } ] }, @@ -164,10 +164,10 @@ "additionalProperties": false, "oneOf": [ { - "$ref": "#/ref_document" + "$ref": "#/definitions/document" }, { - "$ref": "#/ref_label" + "$ref": "#/definitions/label" } ] }, @@ -175,43 +175,45 @@ "hide": true } }, - "ref_document": { - "title": "Document link", - "type": "object", - "propertiesOrder": [ - "$ref" - ], - "required": [ - "$ref" - ], - "properties": { - "$ref": { - "type": "string", - "pattern": "^https://ils.rero.ch/api/documents/.*?$", - "form": { - "validation": { - "messages": { - "patternMessage": "Should be in the following format: https://ils.rero.ch/api/documents/." - } - }, - "placeholder": "Example: https://ils.rero.ch/api/documents/66" + "definitions": { + "document": { + "title": "Document link", + "type": "object", + "propertiesOrder": [ + "$ref" + ], + "required": [ + "$ref" + ], + "properties": { + "$ref": { + "type": "string", + "pattern": "^https://ils.rero.ch/api/documents/.*?$", + "form": { + "validation": { + "messages": { + "patternMessage": "Should be in the following format: https://ils.rero.ch/api/documents/." + } + }, + "placeholder": "Example: https://ils.rero.ch/api/documents/66" + } } } - } - }, - "ref_label": { - "title": "Label", - "type": "object", - "propertiesOrder": [ - "label" - ], - "required": [ - "label" - ], - "properties": { - "label": { - "type": "string", - "minLength": 1 + }, + "label": { + "title": "Label", + "type": "object", + "propertiesOrder": [ + "label" + ], + "required": [ + "label" + ], + "properties": { + "label": { + "type": "string", + "minLength": 1 + } } } } diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_genre_form-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_genre_form-v0.0.1.json index c04e6cff4e..4693be80fc 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_genre_form-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_genre_form-v0.0.1.json @@ -79,7 +79,7 @@ "minLength": 1 }, "identifiedBy": { - "$ref": "#/identifiedBy" + "$ref": "https://ils.rero.ch/schemas/documents/document_identifier-v0.0.1.json#/identifier" } } } @@ -88,75 +88,5 @@ "form": { "hide": true } - }, - "identifiedBy": { - "title": "Identifier", - "type": "object", - "additionalProperties": false, - "propertiesOrder": [ - "type", - "value", - "source" - ], - "properties": { - "type": { - "title": "Type", - "type": "string", - "enum": [ - "bf:Local", - "rero-rameau", - "gnd" - ], - "form": { - "options": [ - { - "value": "bf:Local", - "label": "bf:local" - }, - { - "value": "rero-rameau", - "label": "rero-rameau" - }, - { - "value": "gnd", - "label": "gnd" - } - ], - "templateOptions": { - "itemCssClass": "col-lg-4" - } - } - }, - "source": { - "title": "Source", - "type": "string", - "minLength": 1, - "form": { - "hide": true, - "templateOptions": { - "itemCssClass": "col-lg-4" - } - } - }, - "value": { - "title": "Value", - "type": "string", - "minLength": 1, - "form": { - "templateOptions": { - "itemCssClass": "col" - }, - "expressionProperties": { - "templateOptions.required": "true" - } - } - } - }, - "form": { - "hide": true, - "templateOptions": { - "containerCssClass": "row" - } - } } } diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_identifier-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_identifier-v0.0.1.json index 1488de2990..74225b0e71 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_identifier-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_identifier-v0.0.1.json @@ -1,14 +1,60 @@ { - "title": "Identifier", - "type": "object", - "additionalProperties": false, - "propertiesOrder": [ - "type", - "value", - "source" - ], - "properties": { - "type": { + "identifier": { + "title": "Identifier", + "type": "object", + "additionalProperties": false, + "propertiesOrder": [ + "type", + "value", + "source" + ], + "properties": { + "type": { + "$ref": "#/definitions/type_main" + }, + "value": { + "$ref": "#/definitions/value" + }, + "source": { + "$ref": "#/definitions/source" + } + }, + "form": { + "hide": true, + "templateOptions": { + "containerCssClass": "row" + } + } + }, + "identifier_contribution": { + "title": "Identifier", + "type": "object", + "additionalProperties": false, + "propertiesOrder": [ + "type", + "value", + "source" + ], + "properties": { + "type": { + "$ref": "#/definitions/type_contribution" + }, + "value": { + "$ref": "#/definitions/value" + }, + "source": { + "$ref": "#/definitions/source" + } + }, + "form": { + "hide": true, + "templateOptions": { + "containerCssClass": "row" + } + } + }, + "definitions": { + "type_main": { "title": "Type", "type": "string", "form": { @@ -16,7 +62,24 @@ { "value": "bf:Local", "label": "bf:local" + }, + { + "value": "IdRef", + "label": "IdRef" + }, + { + "value": "GND", + "label": "GND" + }, + { + "value": "RERO", + "label": "RERO" + }, + { + "value": "RERO-RAMEAU", + "label": "RERO-RAMEAU" } + ], "templateOptions": { "itemCssClass": "col-lg-4" @@ -26,14 +89,33 @@ } } }, - "source": { - "title": "Source", + "type_contribution": { + "title": "Type", "type": "string", - "minLength": 1, "form": { - "hide": true, + "options": [ + { + "value": "bf:Local", + "label": "bf:local" + }, + { + "value": "IdRef", + "label": "IdRef" + }, + { + "value": "GND", + "label": "GND" + }, + { + "value": "RERO", + "label": "RERO" + } + ], "templateOptions": { "itemCssClass": "col-lg-4" + }, + "expressionProperties": { + "templateOptions.required": "true" } } }, @@ -43,18 +125,27 @@ "minLength": 1, "form": { "templateOptions": { - "itemCssClass": "col" + "itemCssClass": "col-lg-4" }, "expressionProperties": { "templateOptions.required": "true" } } - } - }, - "form": { - "hide": true, - "templateOptions": { - "containerCssClass": "row" + }, + "source": { + "title": "Source", + "description": "Source in case of a local identifier", + "type": "string", + "minLength": 1, + "form": { + "templateOptions": { + "itemCssClass": "col-lg-4" + }, + "expressionProperties": { + "templateOptions.required": "true" + }, + "hideExpression": "field.parent.model && field.parent.model.type !== 'bf:Local'" + } } } } diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_provision_activity-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_provision_activity-v0.0.1.json index 8eee96c9da..b7d7c204c6 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_provision_activity-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_provision_activity-v0.0.1.json @@ -30,8 +30,7 @@ "original_date", "note", "place", - "statement", - "$ref" + "statement" ], "required": [ "type" @@ -87,7 +86,8 @@ "type", "country", "canton", - "$ref" + "$ref", + "identifiedBy" ], "properties": { "type": { @@ -111,18 +111,21 @@ "$ref": "https://ils.rero.ch/schemas/common/cantons-v0.0.1.json#/canton" }, "$ref": { - "title": "Organisation", + "title": "Place", "type": "string", - "pattern": "^https://mef.rero.ch/api/gnd|idref|rero/.*?$", + "pattern": "^https://mef.rero.ch/api/places/gnd|idref|rero/.*?$", "form": { "remoteTypeahead": { - "type": "mef-organisations", + "type": "mef-places", "enableGroupField": true }, "templateOptions": { "itemCssClass": "col-lg-12" } } + }, + "identifiedBy": { + "$ref": "https://ils.rero.ch/schemas/documents/document_identifier-v0.0.1.json#/identifier_contribution" } }, "form": { @@ -269,20 +272,6 @@ "itemCssClass": "col-lg-4" } } - }, - "$ref": { - "title": "Place", - "type": "string", - "pattern": "^https://mef.rero.ch/api/places/gnd|idref|rero/.*?$", - "form": { - "remoteTypeahead": { - "type": "mef-places", - "enableGroupField": true - }, - "templateOptions": { - "itemCssClass": "col-lg-12" - } - } } }, "form": { diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_subjects-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_subjects-v0.0.1.json index 2e92afca4e..d953c04349 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_subjects-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_subjects-v0.0.1.json @@ -37,17 +37,22 @@ "label": "bf:Person", "value": "bf:Person" } - ] + ], + "templateOptions": { + "wrappers": [ + "hide" + ] + } } }, "preferred_name": { - "$ref": "#/preferred_name" + "$ref": "#/definitions/preferred_name" }, "identifiedBy": { - "$ref": "https://ils.rero.ch/schemas/documents/document_identifier-v0.0.1.json" + "$ref": "https://ils.rero.ch/schemas/documents/document_identifier-v0.0.1.json#/identifier" }, "source": { - "$ref": "#/source" + "$ref": "#/definitions/source" } } }, @@ -91,7 +96,7 @@ } }, "preferred_name": { - "$ref": "#/preferred_name" + "$ref": "#/definitions/preferred_name" }, "conference": { "title": "Conference", @@ -100,10 +105,10 @@ "default": false }, "identifiedBy": { - "$ref": "https://ils.rero.ch/schemas/documents/document_identifier-v0.0.1.json" + "$ref": "https://ils.rero.ch/schemas/documents/document_identifier-v0.0.1.json#/identifier" }, "source": { - "$ref": "#/source" + "$ref": "#/definitions/source" } } }, @@ -159,10 +164,10 @@ } }, "identifiedBy": { - "$ref": "https://ils.rero.ch/schemas/documents/document_identifier-v0.0.1.json" + "$ref": "https://ils.rero.ch/schemas/documents/document_identifier-v0.0.1.json#/identifier" }, "source": { - "$ref": "#/source" + "$ref": "#/definitions/source" } } }, @@ -209,10 +214,10 @@ "minLength": 1 }, "identifiedBy": { - "$ref": "https://ils.rero.ch/schemas/documents/document_identifier-v0.0.1.json" + "$ref": "https://ils.rero.ch/schemas/documents/document_identifier-v0.0.1.json#/identifier" }, "source": { - "$ref": "#/source" + "$ref": "#/definitions/source" } } }, @@ -254,13 +259,13 @@ } }, "preferred_name": { - "$ref": "#/preferred_name" + "$ref": "#/definitions/preferred_name" }, "identifiedBy": { - "$ref": "https://ils.rero.ch/schemas/documents/document_identifier-v0.0.1.json" + "$ref": "https://ils.rero.ch/schemas/documents/document_identifier-v0.0.1.json#/identifier" }, "source": { - "$ref": "#/source" + "$ref": "#/definitions/source" } } }, @@ -307,10 +312,10 @@ "minLength": 1 }, "identifiedBy": { - "$ref": "https://ils.rero.ch/schemas/documents/document_identifier-v0.0.1.json" + "$ref": "https://ils.rero.ch/schemas/documents/document_identifier-v0.0.1.json#/identifier" }, "source": { - "$ref": "#/source" + "$ref": "#/definitions/source" } } } @@ -323,18 +328,45 @@ } } }, - "preferred_name": { - "title": "Preferred name", - "type": "string", - "minLength": 2 - }, - "source": { - "title": "Source", - "description": "Source of the subject, for instance MeSH, rero or IdRef.", - "type": "string", - "minLength": 1, - "form": { - "hide": true + "definitions": { + "preferred_name": { + "title": "Preferred name", + "type": "string", + "minLength": 2 + }, + "source": { + "title": "Source", + "description": "Source of the subject.", + "type": "string", + "default": "IdRef", + "form": { + "options": [ + { + "value": "GND", + "label": "GND" + }, + { + "value": "IdRef", + "label": "IdRef" + }, + { + "value": "RERO-RAMEAU", + "label": "RERO-RAMEAU" + }, + { + "value": "Factum", + "label": "Factum" + }, + { + "value": "RAMEAU proposal", + "label": "RAMEAU proposal" + } + ], + "templateOptions": { + "itemCssClass": "col-lg-6" + }, + "hide": true + } } } } diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_temporal_coverage-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_temporal_coverage-v0.0.1.json index d47ce2d56e..2415263b4b 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_temporal_coverage-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_temporal_coverage-v0.0.1.json @@ -46,7 +46,7 @@ } }, "period_code": { - "$ref": "#/period_code" + "$ref": "#/definitions/period_code" } } }, @@ -98,7 +98,7 @@ } }, "period_code": { - "$ref": "#/period_code" + "$ref": "#/definitions/period_code" } } } @@ -108,17 +108,19 @@ "hide": true } }, - "period_code": { - "title": "Period codes", - "minItems": 0, - "type": "array", - "items": { - "title": "Period code", - "description": "Enter a 4 character code from the MARC time period table.", - "type": "string", - "pattern": "^([a-z][0-9-]){2}$", - "form": { - "placeholder": "Example: x1x4" + "definitions": { + "period_code": { + "title": "Period codes", + "minItems": 0, + "type": "array", + "items": { + "title": "Period code", + "description": "Enter a 4 character code from the MARC time period table.", + "type": "string", + "pattern": "^([a-z][0-9-]){2}$", + "form": { + "placeholder": "Example: x1x4" + } } } } diff --git a/rero_ils/modules/documents/mappings/v7/documents/document-v0.0.1.json b/rero_ils/modules/documents/mappings/v7/documents/document-v0.0.1.json index a4a85d2940..f2bd70d376 100644 --- a/rero_ils/modules/documents/mappings/v7/documents/document-v0.0.1.json +++ b/rero_ils/modules/documents/mappings/v7/documents/document-v0.0.1.json @@ -449,13 +449,11 @@ } }, "startDate": { - "type": "date", - "format": "yyyy", + "type": "integer", "index": false }, "endDate": { - "type": "date", - "format": "yyyy", + "type": "integer", "index": false }, "type": {