geonetwork-ui 2.4.0-dev.cec60ff1 → 2.4.0-dev.e079151e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/libs/api/metadata-converter/src/index.mjs +2 -1
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/atomic-operations.mjs +2 -1
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.mjs +1 -1
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.mjs +5 -5
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +30 -2
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/utils/geometry.mjs +31 -0
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +23 -1
- package/esm2022/libs/api/metadata-converter/src/lib/xml-utils.mjs +6 -1
- package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +12 -1
- package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
- package/esm2022/libs/common/domain/src/lib/repository/records-repository.interface.mjs +1 -1
- package/esm2022/libs/data-access/gn4/src/openapi/api/records.api.service.mjs +2 -6
- package/esm2022/libs/feature/editor/src/lib/+state/editor.actions.mjs +2 -1
- package/esm2022/libs/feature/editor/src/lib/+state/editor.effects.mjs +3 -3
- package/esm2022/libs/feature/editor/src/lib/+state/editor.facade.mjs +7 -2
- package/esm2022/libs/feature/editor/src/lib/+state/editor.models.mjs +1 -1
- package/esm2022/libs/feature/editor/src/lib/+state/editor.reducer.mjs +7 -3
- package/esm2022/libs/feature/editor/src/lib/+state/editor.selectors.mjs +16 -6
- package/esm2022/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.mjs +138 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.mjs +21 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +19 -9
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/index.mjs +1 -2
- package/esm2022/libs/feature/editor/src/lib/components/record-form/record-form.component.mjs +12 -7
- package/esm2022/libs/feature/editor/src/lib/expressions.mjs +1 -1
- package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +153 -60
- package/esm2022/libs/feature/editor/src/lib/models/editor-config.model.mjs +2 -0
- package/esm2022/libs/feature/editor/src/lib/models/index.mjs +2 -1
- package/esm2022/libs/feature/editor/src/lib/services/editor.service.mjs +4 -3
- package/esm2022/libs/feature/map/src/lib/utils/map-utils.service.mjs +3 -4
- package/esm2022/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.mjs +42 -23
- package/esm2022/libs/feature/record/src/lib/data-view-share/data-view-share.component.mjs +13 -5
- package/esm2022/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.mjs +49 -15
- package/esm2022/libs/feature/search/src/lib/results-table/results-table-container.component.mjs +9 -3
- package/esm2022/libs/ui/elements/src/lib/api-card/api-card.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.mjs +5 -11
- package/esm2022/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +5 -2
- package/esm2022/libs/ui/elements/src/lib/user-preview/user-preview.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/image-input/image-input.component.mjs +11 -5
- package/esm2022/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.mjs +29 -0
- package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +15 -7
- package/esm2022/libs/ui/widgets/src/index.mjs +2 -1
- package/esm2022/libs/ui/widgets/src/lib/popover/popover.component.mjs +68 -0
- package/esm2022/translations/de.json +58 -32
- package/esm2022/translations/en.json +34 -8
- package/esm2022/translations/es.json +31 -5
- package/esm2022/translations/fr.json +34 -8
- package/esm2022/translations/it.json +32 -6
- package/esm2022/translations/nl.json +31 -5
- package/esm2022/translations/pt.json +31 -5
- package/fesm2022/geonetwork-ui.mjs +937 -236
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/index.d.ts +1 -0
- package/libs/api/metadata-converter/src/index.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/atomic-operations.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts +1 -0
- package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts +8 -1
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/utils/geometry.d.ts +5 -0
- package/libs/api/metadata-converter/src/lib/iso19139/utils/geometry.d.ts.map +1 -0
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts +3 -1
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/xml-utils.d.ts +1 -0
- package/libs/api/metadata-converter/src/lib/xml-utils.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts +1 -0
- package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +2 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts +9 -0
- package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts.map +1 -1
- package/libs/data-access/gn4/src/openapi/api/records.api.service.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.actions.d.ts +5 -0
- package/libs/feature/editor/src/lib/+state/editor.actions.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.facade.d.ts +4 -4
- package/libs/feature/editor/src/lib/+state/editor.facade.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.models.d.ts +8 -0
- package/libs/feature/editor/src/lib/+state/editor.models.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.reducer.d.ts +4 -3
- package/libs/feature/editor/src/lib/+state/editor.reducer.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.selectors.d.ts +4 -8
- package/libs/feature/editor/src/lib/+state/editor.selectors.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.d.ts +27 -0
- package/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.d.ts +11 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts +6 -2
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/index.d.ts +0 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/index.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/record-form.component.d.ts +5 -7
- package/libs/feature/editor/src/lib/components/record-form/record-form.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/expressions.d.ts +1 -1
- package/libs/feature/editor/src/lib/expressions.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/fields.config.d.ts +39 -2
- package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/models/editor-config.model.d.ts +36 -0
- package/libs/feature/editor/src/lib/models/editor-config.model.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/models/index.d.ts +1 -0
- package/libs/feature/editor/src/lib/models/index.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/services/editor.service.d.ts +2 -2
- package/libs/feature/editor/src/lib/services/editor.service.d.ts.map +1 -1
- package/libs/feature/map/src/lib/utils/map-utils.service.d.ts.map +1 -1
- package/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.d.ts +4 -1
- package/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/data-view-share/data-view-share.component.d.ts +4 -1
- package/libs/feature/record/src/lib/data-view-share/data-view-share.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.d.ts +4 -1
- package/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.d.ts.map +1 -1
- package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts +3 -1
- package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/downloads-list/downloads-list.component.d.ts +1 -1
- package/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.d.ts +0 -3
- package/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts +1 -1
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts +7 -6
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/image-input/image-input.component.d.ts +4 -2
- package/libs/ui/inputs/src/lib/image-input/image-input.component.d.ts.map +1 -1
- package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts +11 -0
- package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts.map +1 -0
- package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +4 -2
- package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
- package/libs/ui/widgets/src/index.d.ts +1 -0
- package/libs/ui/widgets/src/index.d.ts.map +1 -1
- package/libs/ui/widgets/src/lib/popover/popover.component.d.ts +19 -0
- package/libs/ui/widgets/src/lib/popover/popover.component.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/libs/api/metadata-converter/src/index.ts +1 -0
- package/src/libs/api/metadata-converter/src/lib/fixtures/geo2france.records.ts +5 -1
- package/src/libs/api/metadata-converter/src/lib/fixtures/geocat-ch.records.ts +37 -12
- package/src/libs/api/metadata-converter/src/lib/fixtures/metawal.records.ts +5 -1
- package/src/libs/api/metadata-converter/src/lib/gn4/atomic-operations.ts +1 -0
- package/src/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.ts +1 -0
- package/src/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.ts +4 -2
- package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +72 -2
- package/src/libs/api/metadata-converter/src/lib/iso19139/utils/geometry.ts +39 -0
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +70 -1
- package/src/libs/api/metadata-converter/src/lib/xml-utils.ts +8 -0
- package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +20 -0
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +2 -1
- package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +12 -0
- package/src/libs/common/fixtures/src/index.ts +2 -0
- package/src/libs/common/fixtures/src/lib/editor/editor.fixtures.ts +156 -0
- package/src/libs/common/fixtures/src/lib/editor/index.ts +1 -0
- package/src/libs/data-access/gn4/src/openapi/api/records.api.service.ts +1 -5
- package/src/libs/data-access/gn4/src/spec.yaml +0 -8
- package/src/libs/feature/editor/src/lib/+state/editor.actions.ts +5 -0
- package/src/libs/feature/editor/src/lib/+state/editor.effects.ts +2 -2
- package/src/libs/feature/editor/src/lib/+state/editor.facade.ts +9 -1
- package/src/libs/feature/editor/src/lib/+state/editor.models.ts +11 -0
- package/src/libs/feature/editor/src/lib/+state/editor.reducer.ts +11 -5
- package/src/libs/feature/editor/src/lib/+state/editor.selectors.ts +22 -8
- package/src/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.html +3 -1
- package/src/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.ts +117 -21
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.css +0 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.html +5 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.ts +22 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +15 -9
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +15 -2
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/index.ts +0 -1
- package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.html +51 -11
- package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.ts +16 -8
- package/src/libs/feature/editor/src/lib/expressions.ts +1 -1
- package/src/libs/feature/editor/src/lib/fields.config.ts +186 -61
- package/src/libs/feature/editor/src/lib/models/editor-config.model.ts +53 -0
- package/src/libs/feature/editor/src/lib/models/index.ts +1 -0
- package/src/libs/feature/editor/src/lib/services/editor.service.ts +8 -4
- package/src/libs/feature/map/src/lib/utils/map-utils.service.ts +2 -3
- package/src/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.ts +36 -19
- package/src/libs/feature/record/src/lib/data-view-share/data-view-share.component.html +6 -2
- package/src/libs/feature/record/src/lib/data-view-share/data-view-share.component.ts +11 -0
- package/src/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.ts +59 -12
- package/src/libs/feature/search/src/lib/results-table/results-table-container.component.html +1 -0
- package/src/libs/feature/search/src/lib/results-table/results-table-container.component.ts +5 -0
- package/src/libs/ui/elements/src/lib/api-card/api-card.component.html +29 -29
- package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.html +14 -20
- package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.ts +0 -10
- package/src/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.html +1 -1
- package/src/libs/ui/elements/src/lib/ui-elements.module.ts +2 -1
- package/src/libs/ui/elements/src/lib/user-preview/user-preview.component.html +1 -1
- package/src/libs/ui/inputs/src/lib/image-input/image-input.component.html +1 -1
- package/src/libs/ui/inputs/src/lib/image-input/image-input.component.ts +7 -2
- package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.css +31 -0
- package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.html +15 -0
- package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.ts +38 -0
- package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.css +0 -0
- package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.html +17 -0
- package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.ts +22 -0
- package/src/libs/ui/search/src/lib/results-table/results-table.component.html +9 -0
- package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +26 -12
- package/src/libs/ui/widgets/src/index.ts +1 -0
- package/src/libs/ui/widgets/src/lib/popover/popover.component.css +0 -0
- package/src/libs/ui/widgets/src/lib/popover/popover.component.html +3 -0
- package/src/libs/ui/widgets/src/lib/popover/popover.component.ts +85 -0
- package/tailwind.base.css +2 -1
- package/translations/de.json +58 -32
- package/translations/en.json +34 -8
- package/translations/es.json +31 -5
- package/translations/fr.json +34 -8
- package/translations/it.json +32 -6
- package/translations/nl.json +31 -5
- package/translations/pt.json +31 -5
- package/translations/sk.json +32 -6
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.model.mjs +0 -2
- package/esm2022/libs/feature/editor/src/lib/models/fields.model.mjs +0 -2
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.model.d.ts +0 -26
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.model.d.ts.map +0 -1
- package/libs/feature/editor/src/lib/models/fields.model.d.ts +0 -15
- package/libs/feature/editor/src/lib/models/fields.model.d.ts.map +0 -1
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.model.ts +0 -43
- package/src/libs/feature/editor/src/lib/models/fields.model.ts +0 -29
|
@@ -94,7 +94,7 @@ export const GEOCAT_CH_DATASET_RECORD: DatasetRecord = {
|
|
|
94
94
|
id: 'geonetwork.thesaurus.external.theme.gemet',
|
|
95
95
|
name: 'GEMET',
|
|
96
96
|
url: new URL(
|
|
97
|
-
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/
|
|
97
|
+
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/external.theme.gemet'
|
|
98
98
|
),
|
|
99
99
|
},
|
|
100
100
|
type: 'theme',
|
|
@@ -105,7 +105,7 @@ export const GEOCAT_CH_DATASET_RECORD: DatasetRecord = {
|
|
|
105
105
|
id: 'geonetwork.thesaurus.external.theme.gemet',
|
|
106
106
|
name: 'GEMET',
|
|
107
107
|
url: new URL(
|
|
108
|
-
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/
|
|
108
|
+
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/external.theme.gemet'
|
|
109
109
|
),
|
|
110
110
|
},
|
|
111
111
|
type: 'theme',
|
|
@@ -116,7 +116,7 @@ export const GEOCAT_CH_DATASET_RECORD: DatasetRecord = {
|
|
|
116
116
|
id: 'geonetwork.thesaurus.external.theme.gemet',
|
|
117
117
|
name: 'GEMET',
|
|
118
118
|
url: new URL(
|
|
119
|
-
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/
|
|
119
|
+
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/external.theme.gemet'
|
|
120
120
|
),
|
|
121
121
|
},
|
|
122
122
|
type: 'theme',
|
|
@@ -127,7 +127,7 @@ export const GEOCAT_CH_DATASET_RECORD: DatasetRecord = {
|
|
|
127
127
|
id: 'geonetwork.thesaurus.external.theme.gemet',
|
|
128
128
|
name: 'GEMET',
|
|
129
129
|
url: new URL(
|
|
130
|
-
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/
|
|
130
|
+
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/external.theme.gemet'
|
|
131
131
|
),
|
|
132
132
|
},
|
|
133
133
|
type: 'theme',
|
|
@@ -138,7 +138,7 @@ export const GEOCAT_CH_DATASET_RECORD: DatasetRecord = {
|
|
|
138
138
|
id: 'geonetwork.thesaurus.external.theme.gemet',
|
|
139
139
|
name: 'GEMET',
|
|
140
140
|
url: new URL(
|
|
141
|
-
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/
|
|
141
|
+
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/external.theme.gemet'
|
|
142
142
|
),
|
|
143
143
|
},
|
|
144
144
|
type: 'theme',
|
|
@@ -149,7 +149,7 @@ export const GEOCAT_CH_DATASET_RECORD: DatasetRecord = {
|
|
|
149
149
|
id: 'geonetwork.thesaurus.external.theme.gemet',
|
|
150
150
|
name: 'GEMET',
|
|
151
151
|
url: new URL(
|
|
152
|
-
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/
|
|
152
|
+
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/external.theme.gemet'
|
|
153
153
|
),
|
|
154
154
|
},
|
|
155
155
|
type: 'theme',
|
|
@@ -160,7 +160,7 @@ export const GEOCAT_CH_DATASET_RECORD: DatasetRecord = {
|
|
|
160
160
|
id: 'geonetwork.thesaurus.external.theme.gemet',
|
|
161
161
|
name: 'GEMET',
|
|
162
162
|
url: new URL(
|
|
163
|
-
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/
|
|
163
|
+
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/external.theme.gemet'
|
|
164
164
|
),
|
|
165
165
|
},
|
|
166
166
|
type: 'theme',
|
|
@@ -171,7 +171,7 @@ export const GEOCAT_CH_DATASET_RECORD: DatasetRecord = {
|
|
|
171
171
|
id: 'geonetwork.thesaurus.external.theme.gemet',
|
|
172
172
|
name: 'GEMET',
|
|
173
173
|
url: new URL(
|
|
174
|
-
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/
|
|
174
|
+
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/external.theme.gemet'
|
|
175
175
|
),
|
|
176
176
|
},
|
|
177
177
|
type: 'theme',
|
|
@@ -182,7 +182,7 @@ export const GEOCAT_CH_DATASET_RECORD: DatasetRecord = {
|
|
|
182
182
|
id: 'geonetwork.thesaurus.external.theme.gemet',
|
|
183
183
|
name: 'GEMET',
|
|
184
184
|
url: new URL(
|
|
185
|
-
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/
|
|
185
|
+
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/external.theme.gemet'
|
|
186
186
|
),
|
|
187
187
|
},
|
|
188
188
|
type: 'theme',
|
|
@@ -193,7 +193,7 @@ export const GEOCAT_CH_DATASET_RECORD: DatasetRecord = {
|
|
|
193
193
|
id: 'geonetwork.thesaurus.external.theme.inspire-theme',
|
|
194
194
|
name: 'GEMET - INSPIRE themes, version 1.0',
|
|
195
195
|
url: new URL(
|
|
196
|
-
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/
|
|
196
|
+
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/external.theme.inspire-theme'
|
|
197
197
|
),
|
|
198
198
|
},
|
|
199
199
|
type: 'theme',
|
|
@@ -204,7 +204,7 @@ export const GEOCAT_CH_DATASET_RECORD: DatasetRecord = {
|
|
|
204
204
|
id: 'geonetwork.thesaurus.external.theme.inspire-theme',
|
|
205
205
|
name: 'GEMET - INSPIRE themes, version 1.0',
|
|
206
206
|
url: new URL(
|
|
207
|
-
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/
|
|
207
|
+
'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/registries/vocabularies/external.theme.inspire-theme'
|
|
208
208
|
),
|
|
209
209
|
},
|
|
210
210
|
type: 'theme',
|
|
@@ -332,7 +332,32 @@ Die Quelle ist zu bezeichnen: „Quelle: Stadt Zürich“.`,
|
|
|
332
332
|
securityConstraints: [],
|
|
333
333
|
otherConstraints: [],
|
|
334
334
|
// data quality?
|
|
335
|
-
spatialExtents: [
|
|
335
|
+
spatialExtents: [
|
|
336
|
+
{
|
|
337
|
+
description: 'AK',
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
bbox: [
|
|
341
|
+
6.75599105586694, 45.7887442565203, 10.5418236945627, 47.5175655551557,
|
|
342
|
+
],
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
geometry: {
|
|
346
|
+
type: 'MultiPolygon',
|
|
347
|
+
coordinates: [
|
|
348
|
+
[
|
|
349
|
+
[
|
|
350
|
+
[6.777075, 45.827119, 0],
|
|
351
|
+
[6.755991, 47.517566, 0],
|
|
352
|
+
[10.541824, 47.477984, 0],
|
|
353
|
+
[10.446252, 45.788744, 0],
|
|
354
|
+
[6.777075, 45.827119, 0],
|
|
355
|
+
],
|
|
356
|
+
],
|
|
357
|
+
],
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
],
|
|
336
361
|
temporalExtents: [],
|
|
337
362
|
status: 'completed',
|
|
338
363
|
updateFrequency: 'asNeeded',
|
|
@@ -388,7 +388,11 @@ Depuis, ce sont les Districts routiers qui assurent la tenue à jour de ces info
|
|
|
388
388
|
name: 'Direction Asset Management (SPW - Mobilité et Infrastructures - Direction Asset Management)',
|
|
389
389
|
},
|
|
390
390
|
securityConstraints: [],
|
|
391
|
-
spatialExtents: [
|
|
391
|
+
spatialExtents: [
|
|
392
|
+
{
|
|
393
|
+
bbox: [2.75, 49.45, 6.5, 50.85],
|
|
394
|
+
},
|
|
395
|
+
],
|
|
392
396
|
spatialRepresentation: 'vector',
|
|
393
397
|
status: 'ongoing',
|
|
394
398
|
temporalExtents: [],
|
|
@@ -120,6 +120,7 @@ export const mapKeywords = (thesauri: Thesaurus[], language: string) => {
|
|
|
120
120
|
keywords.push({
|
|
121
121
|
label: selectTranslatedValue<string>(keyword, language),
|
|
122
122
|
type: getKeywordTypeFromKeywordTypeCode(rawThesaurus.theme),
|
|
123
|
+
...(keyword.link && { key: keyword.link }),
|
|
123
124
|
...(thesaurus && { thesaurus }),
|
|
124
125
|
})
|
|
125
126
|
}
|
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
readResourcePublished,
|
|
35
35
|
readResourceUpdated,
|
|
36
36
|
readSecurityConstraints,
|
|
37
|
+
readSpatialExtents,
|
|
37
38
|
readSpatialRepresentation,
|
|
38
39
|
readStatus,
|
|
39
40
|
readTemporalExtents,
|
|
@@ -60,6 +61,7 @@ import {
|
|
|
60
61
|
writeResourcePublished,
|
|
61
62
|
writeResourceUpdated,
|
|
62
63
|
writeSecurityConstraints,
|
|
64
|
+
writeSpatialExtents,
|
|
63
65
|
writeSpatialRepresentation,
|
|
64
66
|
writeStatus,
|
|
65
67
|
writeTemporalExtents,
|
|
@@ -101,8 +103,8 @@ export class Iso19139Converter extends BaseConverter<string> {
|
|
|
101
103
|
distributions: readDistributions,
|
|
102
104
|
onlineResources: readOnlineResources,
|
|
103
105
|
temporalExtents: readTemporalExtents,
|
|
106
|
+
spatialExtents: readSpatialExtents,
|
|
104
107
|
// TODO
|
|
105
|
-
spatialExtents: () => [],
|
|
106
108
|
extras: () => undefined,
|
|
107
109
|
landingPage: () => undefined,
|
|
108
110
|
languages: () => [],
|
|
@@ -139,8 +141,8 @@ export class Iso19139Converter extends BaseConverter<string> {
|
|
|
139
141
|
distributions: writeDistributions,
|
|
140
142
|
onlineResources: writeOnlineResources,
|
|
141
143
|
temporalExtents: writeTemporalExtents,
|
|
144
|
+
spatialExtents: () => writeSpatialExtents,
|
|
142
145
|
// TODO
|
|
143
|
-
spatialExtents: () => undefined,
|
|
144
146
|
extras: () => undefined,
|
|
145
147
|
landingPage: () => undefined,
|
|
146
148
|
languages: () => undefined,
|
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
UpdateFrequency,
|
|
14
14
|
UpdateFrequencyCustom,
|
|
15
15
|
} from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
16
|
+
import { ThesaurusModel } from '../../../../../../libs/common/domain/src/lib/model/thesaurus'
|
|
17
|
+
import { Geometry } from 'geojson'
|
|
16
18
|
import { matchMimeType, matchProtocol } from '../common/distribution.mapper'
|
|
17
19
|
import {
|
|
18
20
|
ChainableFunction,
|
|
@@ -26,21 +28,22 @@ import {
|
|
|
26
28
|
pipe,
|
|
27
29
|
} from '../function-utils'
|
|
28
30
|
import {
|
|
29
|
-
XmlElement,
|
|
30
31
|
findChildElement,
|
|
31
32
|
findChildrenElement,
|
|
32
33
|
findNestedElement,
|
|
33
34
|
findNestedElements,
|
|
34
35
|
findParent,
|
|
36
|
+
firstChildElement,
|
|
35
37
|
readAttribute,
|
|
36
38
|
readText,
|
|
39
|
+
XmlElement,
|
|
37
40
|
} from '../xml-utils'
|
|
41
|
+
import { readGeometry } from './utils/geometry'
|
|
38
42
|
import { fullNameToParts } from './utils/individual-name'
|
|
39
43
|
import { getKeywordTypeFromKeywordTypeCode } from './utils/keyword.mapper'
|
|
40
44
|
import { getRoleFromRoleCode } from './utils/role.mapper'
|
|
41
45
|
import { getStatusFromStatusCode } from './utils/status.mapper'
|
|
42
46
|
import { getUpdateFrequencyFromFrequencyCode } from './utils/update-frequency.mapper'
|
|
43
|
-
import { ThesaurusModel } from '../../../../../../libs/common/domain/src/lib/model/thesaurus'
|
|
44
47
|
|
|
45
48
|
export function extractCharacterString(): ChainableFunction<
|
|
46
49
|
XmlElement,
|
|
@@ -66,6 +69,14 @@ export function extractDateTime(): ChainableFunction<XmlElement, Date> {
|
|
|
66
69
|
)
|
|
67
70
|
}
|
|
68
71
|
|
|
72
|
+
export function extractDecimal(): ChainableFunction<XmlElement, number> {
|
|
73
|
+
return pipe(
|
|
74
|
+
findChildElement('gco:Decimal', false),
|
|
75
|
+
readText(),
|
|
76
|
+
map((numberStr) => (numberStr ? Number(numberStr) : null))
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
69
80
|
export function extractUrl(): ChainableFunction<XmlElement, URL> {
|
|
70
81
|
const getUrl = pipe(findChildElement('gmd:URL', false), readText())
|
|
71
82
|
const getCharacterString = pipe(
|
|
@@ -895,3 +906,62 @@ export function readTemporalExtents(rootEl: XmlElement) {
|
|
|
895
906
|
})
|
|
896
907
|
)(rootEl)
|
|
897
908
|
}
|
|
909
|
+
|
|
910
|
+
export function readSpatialExtents(rootEl: XmlElement) {
|
|
911
|
+
const extractGeometry = (rootEl: XmlElement): Geometry => {
|
|
912
|
+
if (!rootEl) return null
|
|
913
|
+
return pipe(
|
|
914
|
+
findChildElement('gmd:polygon', false),
|
|
915
|
+
firstChildElement,
|
|
916
|
+
map((el) => readGeometry(el))
|
|
917
|
+
)(rootEl)
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
const extractBBox = (
|
|
921
|
+
rootEl: XmlElement
|
|
922
|
+
): [number, number, number, number] => {
|
|
923
|
+
if (!rootEl) return null
|
|
924
|
+
return pipe(
|
|
925
|
+
combine(
|
|
926
|
+
pipe(findChildElement('gmd:westBoundLongitude'), extractDecimal()),
|
|
927
|
+
pipe(findChildElement('gmd:southBoundLatitude'), extractDecimal()),
|
|
928
|
+
pipe(findChildElement('gmd:eastBoundLongitude'), extractDecimal()),
|
|
929
|
+
pipe(findChildElement('gmd:northBoundLatitude'), extractDecimal())
|
|
930
|
+
)
|
|
931
|
+
)(rootEl)
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
const extractDescription = (rootEl: XmlElement): string => {
|
|
935
|
+
if (!rootEl) return null
|
|
936
|
+
return pipe(
|
|
937
|
+
findNestedElement(
|
|
938
|
+
'gmd:geographicIdentifier',
|
|
939
|
+
'gmd:MD_Identifier',
|
|
940
|
+
'gmd:code'
|
|
941
|
+
),
|
|
942
|
+
extractCharacterString()
|
|
943
|
+
)(rootEl)
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
return pipe(
|
|
947
|
+
findIdentification(),
|
|
948
|
+
findNestedElements('gmd:extent', 'gmd:EX_Extent', 'gmd:geographicElement'),
|
|
949
|
+
mapArray(
|
|
950
|
+
combine(
|
|
951
|
+
pipe(findChildElement('gmd:EX_BoundingPolygon'), extractGeometry),
|
|
952
|
+
pipe(findChildElement('gmd:EX_GeographicBoundingBox'), extractBBox),
|
|
953
|
+
pipe(
|
|
954
|
+
findChildElement('gmd:EX_GeographicDescription'),
|
|
955
|
+
extractDescription
|
|
956
|
+
)
|
|
957
|
+
)
|
|
958
|
+
),
|
|
959
|
+
mapArray(([geometry, bbox, description]) => {
|
|
960
|
+
return {
|
|
961
|
+
...(geometry && { geometry }),
|
|
962
|
+
...(bbox && { bbox }),
|
|
963
|
+
...(description && { description }),
|
|
964
|
+
}
|
|
965
|
+
})
|
|
966
|
+
)(rootEl)
|
|
967
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { XmlElement } from '@rgrove/parse-xml'
|
|
2
|
+
import { Geometry } from 'geojson'
|
|
3
|
+
import GML32 from 'ol/format/GML32'
|
|
4
|
+
import GeoJSON from 'ol/format/GeoJSON'
|
|
5
|
+
import { parse } from 'ol/xml'
|
|
6
|
+
import {
|
|
7
|
+
createDocument,
|
|
8
|
+
getRootElement,
|
|
9
|
+
parseXmlString,
|
|
10
|
+
xmlToString,
|
|
11
|
+
} from '../../xml-utils'
|
|
12
|
+
|
|
13
|
+
export function readGeometry(el: XmlElement): Geometry {
|
|
14
|
+
const xmlDoc = createDocument(el)
|
|
15
|
+
xmlDoc.root.attributes['xmlns'] = 'http://www.opengis.net/gml/3.2'
|
|
16
|
+
const gmlString = xmlToString(xmlDoc)
|
|
17
|
+
const doc = parse(gmlString)
|
|
18
|
+
// we need an intermediate node to be able to parse the GML
|
|
19
|
+
const node = document.createElement('pre')
|
|
20
|
+
node.appendChild(doc.documentElement)
|
|
21
|
+
const gml32Format = new GML32()
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
const geometry = gml32Format.readGeometryFromNode(node)
|
|
25
|
+
const geojsonFormat = new GeoJSON()
|
|
26
|
+
return geojsonFormat.writeGeometryObject(geometry)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function writeGeometry(geometryObject: Geometry): XmlElement {
|
|
30
|
+
const geojsonFormat = new GeoJSON()
|
|
31
|
+
const geometry = geojsonFormat.readGeometry(geometryObject)
|
|
32
|
+
const gml32Format = new GML32()
|
|
33
|
+
const node = gml32Format.writeGeometryNode(geometry)
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
const element = node.firstElementChild as HTMLElement
|
|
37
|
+
const gmlString = new XMLSerializer().serializeToString(element)
|
|
38
|
+
return getRootElement(parseXmlString(gmlString))
|
|
39
|
+
}
|
|
@@ -14,7 +14,9 @@ import {
|
|
|
14
14
|
UpdateFrequencyCode,
|
|
15
15
|
UpdateFrequencyCustom,
|
|
16
16
|
} from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
17
|
+
import { ThesaurusModel } from '../../../../../../libs/common/domain/src/lib/model/thesaurus'
|
|
17
18
|
import format from 'date-fns/format'
|
|
19
|
+
import { Geometry } from 'geojson'
|
|
18
20
|
import {
|
|
19
21
|
ChainableFunction,
|
|
20
22
|
fallback,
|
|
@@ -44,8 +46,8 @@ import {
|
|
|
44
46
|
setTextContent,
|
|
45
47
|
} from '../xml-utils'
|
|
46
48
|
import { readKind } from './read-parts'
|
|
49
|
+
import { writeGeometry } from './utils/geometry'
|
|
47
50
|
import { namePartsToFull } from './utils/individual-name'
|
|
48
|
-
import { ThesaurusModel } from '../../../../../../libs/common/domain/src/lib/model/thesaurus'
|
|
49
51
|
|
|
50
52
|
export function writeCharacterString(
|
|
51
53
|
text: string
|
|
@@ -101,6 +103,14 @@ export function writeDate(
|
|
|
101
103
|
)
|
|
102
104
|
}
|
|
103
105
|
|
|
106
|
+
export function writeDecimal(
|
|
107
|
+
decimal: number
|
|
108
|
+
): ChainableFunction<XmlElement, XmlElement> {
|
|
109
|
+
return tap(
|
|
110
|
+
pipe(findChildOrCreate('gco:Decimal'), setTextContent(decimal.toString()))
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
|
|
104
114
|
export function getProgressCode(status: RecordStatus): string {
|
|
105
115
|
switch (status) {
|
|
106
116
|
case 'completed':
|
|
@@ -1184,3 +1194,62 @@ export function writeTemporalExtents(
|
|
|
1184
1194
|
)
|
|
1185
1195
|
)(rootEl)
|
|
1186
1196
|
}
|
|
1197
|
+
|
|
1198
|
+
export function writeSpatialExtents(record: DatasetRecord, rootEl: XmlElement) {
|
|
1199
|
+
const appendBoundingPolygon = (geometry?: Geometry) => {
|
|
1200
|
+
if (!geometry) return null
|
|
1201
|
+
return pipe(
|
|
1202
|
+
createElement('gmd:EX_BoundingPolygon'),
|
|
1203
|
+
appendChildren(
|
|
1204
|
+
pipe(
|
|
1205
|
+
createElement('gmd:polygon'),
|
|
1206
|
+
appendChildren(() => writeGeometry(geometry))
|
|
1207
|
+
)
|
|
1208
|
+
)
|
|
1209
|
+
)
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
const appendGeographicBoundingBox = (
|
|
1213
|
+
bbox?: [number, number, number, number]
|
|
1214
|
+
) => {
|
|
1215
|
+
if (!bbox) return null
|
|
1216
|
+
return pipe(
|
|
1217
|
+
createElement('gmd:EX_GeographicBoundingBox'),
|
|
1218
|
+
appendChildren(
|
|
1219
|
+
pipe(createElement('gmd:westBoundLongitude'), writeDecimal(bbox[0])),
|
|
1220
|
+
pipe(createElement('gmd:eastBoundLongitude'), writeDecimal(bbox[2])),
|
|
1221
|
+
pipe(createElement('gmd:southBoundLatitude'), writeDecimal(bbox[1])),
|
|
1222
|
+
pipe(createElement('gmd:northBoundLatitude'), writeDecimal(bbox[3]))
|
|
1223
|
+
)
|
|
1224
|
+
)
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
const appendGeographicDescription = (description?: string) => {
|
|
1228
|
+
if (!description) return null
|
|
1229
|
+
return pipe(
|
|
1230
|
+
createElement('gmd:EX_GeographicDescription'),
|
|
1231
|
+
createChild('gmd:geographicIdentifier'),
|
|
1232
|
+
createChild('gmd:MD_Identifier'),
|
|
1233
|
+
createChild('gmd:code'),
|
|
1234
|
+
writeCharacterString(description)
|
|
1235
|
+
)
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
pipe(
|
|
1239
|
+
findOrCreateIdentification(),
|
|
1240
|
+
findNestedChildOrCreate('gmd:extent', 'gmd:EX_Extent'),
|
|
1241
|
+
removeChildrenByName('gmd:geographicElement'),
|
|
1242
|
+
appendChildren(
|
|
1243
|
+
...record.spatialExtents.map((extent) =>
|
|
1244
|
+
pipe(
|
|
1245
|
+
createElement('gmd:geographicElement'),
|
|
1246
|
+
appendChildren(
|
|
1247
|
+
appendBoundingPolygon(extent.geometry),
|
|
1248
|
+
appendGeographicBoundingBox(extent.bbox),
|
|
1249
|
+
appendGeographicDescription(extent.description)
|
|
1250
|
+
)
|
|
1251
|
+
)
|
|
1252
|
+
)
|
|
1253
|
+
)
|
|
1254
|
+
)(rootEl)
|
|
1255
|
+
}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
XmlText,
|
|
7
7
|
} from '@rgrove/parse-xml'
|
|
8
8
|
import { ChainableFunction, fallback } from './function-utils'
|
|
9
|
+
|
|
9
10
|
export { XmlDocument, XmlElement } from '@rgrove/parse-xml'
|
|
10
11
|
|
|
11
12
|
export class XmlParseError extends Error {
|
|
@@ -115,6 +116,10 @@ export function allChildrenElement(element: XmlElement): Array<XmlElement> {
|
|
|
115
116
|
] as Array<XmlElement>
|
|
116
117
|
}
|
|
117
118
|
|
|
119
|
+
export function firstChildElement(element: XmlElement): XmlElement {
|
|
120
|
+
return allChildrenElement(element)[0] ?? null
|
|
121
|
+
}
|
|
122
|
+
|
|
118
123
|
/**
|
|
119
124
|
* Will return all matching elements nested according to the given
|
|
120
125
|
* names (similar to a path), starting form the input element;
|
|
@@ -228,6 +233,7 @@ export function xmlToString(
|
|
|
228
233
|
${padding}<${el.name}${attrs}/>
|
|
229
234
|
${parentPadding}`
|
|
230
235
|
}
|
|
236
|
+
|
|
231
237
|
return `
|
|
232
238
|
${padding}<${el.name}${attrs}>${children}</${el.name}>
|
|
233
239
|
${parentPadding}`
|
|
@@ -307,11 +313,13 @@ function getTreeRoot(element: XmlElement): XmlElement {
|
|
|
307
313
|
|
|
308
314
|
// stays on the parent element
|
|
309
315
|
// if the given elements are part of a subtree, will add the root of subtree
|
|
316
|
+
// will filter out falsy elements
|
|
310
317
|
export function appendChildren(
|
|
311
318
|
...childrenFns: Array<ChainableFunction<void, XmlElement>>
|
|
312
319
|
): ChainableFunction<XmlElement, XmlElement> {
|
|
313
320
|
return (element) => {
|
|
314
321
|
if (!element) return null
|
|
322
|
+
childrenFns = childrenFns.filter((fn) => fn)
|
|
315
323
|
element.children.push(...childrenFns.map((fn) => fn()).map(getTreeRoot))
|
|
316
324
|
element.children.forEach((el) => (el.parent = element))
|
|
317
325
|
return element
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
} from '../../../../../../libs/common/domain/src/lib/model/search'
|
|
25
25
|
import { catchError, map, tap } from 'rxjs/operators'
|
|
26
26
|
import {
|
|
27
|
+
BaseConverter,
|
|
27
28
|
findConverterForDocument,
|
|
28
29
|
Gn4Converter,
|
|
29
30
|
Gn4SearchResults,
|
|
@@ -230,6 +231,25 @@ export class Gn4Repository implements RecordsRepositoryInterface {
|
|
|
230
231
|
)
|
|
231
232
|
}
|
|
232
233
|
|
|
234
|
+
openRecordForDuplication(
|
|
235
|
+
uniqueIdentifier: string
|
|
236
|
+
): Observable<[CatalogRecord, string, false] | null> {
|
|
237
|
+
return this.loadRecordAsXml(uniqueIdentifier).pipe(
|
|
238
|
+
switchMap(async (recordAsXml) => {
|
|
239
|
+
const converter = findConverterForDocument(recordAsXml)
|
|
240
|
+
const record = await converter.readRecord(recordAsXml)
|
|
241
|
+
record.uniqueIdentifier = `TEMP-ID-${Date.now()}`
|
|
242
|
+
record.title = `${record.title} (Copy)`
|
|
243
|
+
const xml = await converter.writeRecord(record, recordAsXml)
|
|
244
|
+
window.localStorage.setItem(
|
|
245
|
+
this.getLocalStorageKeyForRecord(record.uniqueIdentifier),
|
|
246
|
+
xml
|
|
247
|
+
)
|
|
248
|
+
return [record, xml, false] as [CatalogRecord, string, false]
|
|
249
|
+
})
|
|
250
|
+
)
|
|
251
|
+
}
|
|
252
|
+
|
|
233
253
|
private serializeRecordToXml(
|
|
234
254
|
record: CatalogRecord,
|
|
235
255
|
referenceRecordSource?: string
|
|
@@ -30,6 +30,18 @@ export abstract class RecordsRepositoryInterface {
|
|
|
30
30
|
uniqueIdentifier: string
|
|
31
31
|
): Observable<[CatalogRecord, string, boolean] | null>
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* This emits once:
|
|
35
|
+
* - record object with a new unique identifier and suffixed title
|
|
36
|
+
* - serialized representation of the record as text
|
|
37
|
+
* - false, as the duplicated record is always a draft
|
|
38
|
+
* @param uniqueIdentifier
|
|
39
|
+
* @returns Observable<[CatalogRecord, string, false] | null>
|
|
40
|
+
*/
|
|
41
|
+
abstract openRecordForDuplication(
|
|
42
|
+
uniqueIdentifier: string
|
|
43
|
+
): Observable<[CatalogRecord, string, false] | null>
|
|
44
|
+
|
|
33
45
|
/**
|
|
34
46
|
* @param record
|
|
35
47
|
* @param referenceRecordSource
|