geonetwork-ui 2.2.0-dev.cbcafed5 → 2.2.0-dev.da2c1f8f
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/lib/gn4/atomic-operations.mjs +27 -1
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +64 -61
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.mjs +7 -4
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.mjs +1 -1
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/codelists/keyword.mapper.mjs +14 -0
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/converter.mjs +25 -17
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +55 -23
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +52 -32
- package/esm2022/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.mjs +2 -2
- package/esm2022/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.mjs +10 -3
- package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.mjs +14 -5
- package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.mjs +33 -8
- package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
- package/esm2022/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.mjs +1 -1
- package/esm2022/libs/common/domain/src/lib/platform.service.interface.mjs +1 -1
- package/esm2022/libs/feature/editor/src/index.mjs +6 -1
- package/esm2022/libs/feature/editor/src/lib/+state/editor.actions.mjs +8 -0
- package/esm2022/libs/feature/editor/src/lib/+state/editor.effects.mjs +26 -0
- package/esm2022/libs/feature/editor/src/lib/+state/editor.facade.mjs +30 -0
- package/esm2022/libs/feature/editor/src/lib/+state/editor.models.mjs +2 -0
- package/esm2022/libs/feature/editor/src/lib/+state/editor.reducer.mjs +42 -0
- package/esm2022/libs/feature/editor/src/lib/+state/editor.selectors.mjs +13 -0
- package/esm2022/libs/feature/editor/src/lib/expressions.mjs +13 -0
- package/esm2022/libs/feature/editor/src/lib/feature-editor.module.mjs +16 -4
- package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +34 -0
- package/esm2022/libs/feature/editor/src/lib/models/fields.model.mjs +2 -0
- package/esm2022/libs/feature/editor/src/lib/record-form/record-form.component.mjs +15 -11
- package/esm2022/libs/feature/editor/src/lib/services/editor.service.mjs +22 -44
- package/esm2022/libs/feature/map/src/lib/map-context/map-context.service.mjs +9 -1
- package/esm2022/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.mjs +13 -13
- package/esm2022/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.mjs +3 -3
- package/esm2022/libs/feature/search/src/lib/utils/service/fields.mjs +41 -26
- package/esm2022/libs/feature/search/src/lib/utils/service/fields.service.mjs +11 -9
- package/esm2022/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/max-lines/max-lines.component.mjs +5 -3
- package/esm2022/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +47 -22
- package/esm2022/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.mjs +3 -4
- package/esm2022/libs/ui/elements/src/lib/thumbnail/thumbnail.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +4 -4
- package/esm2022/libs/ui/inputs/src/lib/button/button.component.mjs +9 -9
- package/esm2022/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/form-field/form-field.component.mjs +4 -2
- package/esm2022/libs/ui/inputs/src/lib/form-field/form-field.model.mjs +1 -1
- package/esm2022/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/text-area/text-area.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/ui-inputs.module.mjs +6 -6
- package/esm2022/libs/ui/layout/src/lib/carousel/carousel.component.mjs +3 -3
- package/esm2022/libs/ui/widgets/src/lib/badge/badge.component.mjs +3 -3
- package/esm2022/libs/util/i18n/src/lib/i18n.constants.mjs +18 -1
- package/esm2022/libs/util/shared/src/lib/utils/index.mjs +2 -1
- package/esm2022/libs/util/shared/src/lib/utils/temporal-extent-union.mjs +32 -0
- package/esm2022/translations/de.json +37 -27
- package/esm2022/translations/en.json +32 -22
- package/esm2022/translations/es.json +27 -17
- package/esm2022/translations/fr.json +50 -40
- package/esm2022/translations/it.json +44 -34
- package/esm2022/translations/nl.json +28 -18
- package/esm2022/translations/pt.json +27 -17
- package/fesm2022/geonetwork-ui.mjs +972 -527
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/atomic-operations.d.ts +2 -0
- package/libs/api/metadata-converter/src/lib/gn4/atomic-operations.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts +0 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts +4 -5
- package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/codelists/keyword.mapper.d.ts +3 -0
- package/libs/api/metadata-converter/src/lib/iso19139/codelists/keyword.mapper.d.ts.map +1 -0
- package/libs/api/metadata-converter/src/lib/iso19139/converter.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts +7 -6
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts +4 -3
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.d.ts +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts +9 -2
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +21 -12
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.d.ts +1 -0
- package/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/platform.service.interface.d.ts +1 -1
- package/libs/common/domain/src/lib/platform.service.interface.d.ts.map +1 -1
- package/libs/feature/editor/src/index.d.ts +5 -0
- package/libs/feature/editor/src/index.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.actions.d.ts +23 -0
- package/libs/feature/editor/src/lib/+state/editor.actions.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/+state/editor.effects.d.ts +15 -0
- package/libs/feature/editor/src/lib/+state/editor.effects.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/+state/editor.facade.d.ts +19 -0
- package/libs/feature/editor/src/lib/+state/editor.facade.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/+state/editor.models.d.ts +2 -0
- package/libs/feature/editor/src/lib/+state/editor.models.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/+state/editor.reducer.d.ts +18 -0
- package/libs/feature/editor/src/lib/+state/editor.reducer.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/+state/editor.selectors.d.ts +15 -0
- package/libs/feature/editor/src/lib/+state/editor.selectors.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/expressions.d.ts +4 -0
- package/libs/feature/editor/src/lib/expressions.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/feature-editor.module.d.ts +3 -1
- package/libs/feature/editor/src/lib/feature-editor.module.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/fields.config.d.ts +3 -0
- package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/models/fields.model.d.ts +15 -0
- package/libs/feature/editor/src/lib/models/fields.model.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/record-form/record-form.component.d.ts +10 -5
- package/libs/feature/editor/src/lib/record-form/record-form.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/services/editor.service.d.ts +3 -13
- package/libs/feature/editor/src/lib/services/editor.service.d.ts.map +1 -1
- package/libs/feature/map/src/lib/map-context/map-context.service.d.ts +1 -0
- package/libs/feature/map/src/lib/map-context/map-context.service.d.ts.map +1 -1
- package/libs/feature/search/src/lib/utils/service/fields.d.ts +21 -8
- package/libs/feature/search/src/lib/utils/service/fields.d.ts.map +1 -1
- package/libs/feature/search/src/lib/utils/service/fields.service.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.d.ts +1 -1
- package/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/max-lines/max-lines.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts +16 -6
- package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts +13 -13
- package/libs/ui/inputs/src/lib/button/button.component.d.ts +1 -1
- package/libs/ui/inputs/src/lib/button/button.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/form-field/form-field.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/form-field/form-field.model.d.ts +0 -1
- package/libs/ui/inputs/src/lib/form-field/form-field.model.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/text-area/text-area.component.d.ts +1 -1
- package/libs/ui/inputs/src/lib/text-area/text-area.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts +40 -40
- package/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.d.ts +1 -1
- package/libs/util/i18n/src/lib/i18n.constants.d.ts +17 -0
- package/libs/util/i18n/src/lib/i18n.constants.d.ts.map +1 -1
- package/libs/util/shared/src/lib/utils/index.d.ts +1 -0
- package/libs/util/shared/src/lib/utils/index.d.ts.map +1 -1
- package/libs/util/shared/src/lib/utils/temporal-extent-union.d.ts +5 -0
- package/libs/util/shared/src/lib/utils/temporal-extent-union.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/libs/api/metadata-converter/src/lib/fixtures/generic.records.ts +63 -8
- package/src/libs/api/metadata-converter/src/lib/fixtures/geo2france.records.ts +57 -9
- package/src/libs/api/metadata-converter/src/lib/fixtures/geocat-ch.records.ts +229 -24
- package/src/libs/api/metadata-converter/src/lib/gn4/atomic-operations.ts +29 -0
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +99 -76
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.ts +6 -3
- package/src/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.ts +4 -5
- package/src/libs/api/metadata-converter/src/lib/iso19139/codelists/keyword.mapper.ts +16 -0
- package/src/libs/api/metadata-converter/src/lib/iso19139/converter.ts +30 -21
- package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +120 -63
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +177 -97
- package/src/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +1 -1
- package/src/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.ts +22 -2
- package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.ts +15 -4
- package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +47 -8
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +25 -14
- package/src/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.ts +1 -0
- package/src/libs/common/domain/src/lib/platform.service.interface.ts +1 -4
- package/src/libs/common/fixtures/src/lib/elasticsearch/full-response.ts +1 -1
- package/src/libs/common/fixtures/src/lib/gn4/groups.fixtures.ts +1 -1
- package/src/libs/common/fixtures/src/lib/records.fixtures.ts +52 -10
- package/src/libs/feature/editor/src/index.ts +5 -0
- package/src/libs/feature/editor/src/lib/+state/editor.actions.ts +24 -0
- package/src/libs/feature/editor/src/lib/+state/editor.effects.ts +49 -0
- package/src/libs/feature/editor/src/lib/+state/editor.facade.ts +30 -0
- package/src/libs/feature/editor/src/lib/+state/editor.models.ts +1 -0
- package/src/libs/feature/editor/src/lib/+state/editor.reducer.ts +68 -0
- package/src/libs/feature/editor/src/lib/+state/editor.selectors.ts +39 -0
- package/src/libs/feature/editor/src/lib/expressions.ts +16 -0
- package/src/libs/feature/editor/src/lib/feature-editor.module.ts +11 -0
- package/src/libs/feature/editor/src/lib/fields.config.ts +35 -0
- package/src/libs/feature/editor/src/lib/models/fields.model.ts +29 -0
- package/src/libs/feature/editor/src/lib/record-form/record-form.component.html +9 -7
- package/src/libs/feature/editor/src/lib/record-form/record-form.component.ts +11 -5
- package/src/libs/feature/editor/src/lib/services/editor.service.ts +34 -73
- package/src/libs/feature/map/src/lib/map-context/map-context.service.ts +10 -0
- package/src/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.ts +12 -12
- package/src/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.html +3 -4
- package/src/libs/feature/search/src/lib/utils/service/fields.service.ts +21 -16
- package/src/libs/feature/search/src/lib/utils/service/fields.ts +43 -34
- package/src/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.html +1 -1
- package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.css +5 -0
- package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.html +39 -0
- package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.ts +58 -0
- package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.css +2 -2
- package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.ts +1 -0
- package/src/libs/ui/elements/src/lib/max-lines/max-lines.component.html +5 -1
- package/src/libs/ui/elements/src/lib/max-lines/max-lines.component.ts +1 -0
- package/src/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.html +1 -1
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +169 -52
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.ts +51 -15
- package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.ts +2 -3
- package/src/libs/ui/elements/src/lib/thumbnail/thumbnail.component.html +2 -2
- package/src/libs/ui/elements/src/lib/ui-elements.module.ts +1 -1
- package/src/libs/ui/inputs/src/lib/button/button.component.css +0 -5
- package/src/libs/ui/inputs/src/lib/button/button.component.html +0 -1
- package/src/libs/ui/inputs/src/lib/button/button.component.ts +7 -6
- package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.html +1 -1
- package/src/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.html +3 -1
- package/src/libs/ui/inputs/src/lib/form-field/form-field.component.ts +3 -1
- package/src/libs/ui/inputs/src/lib/form-field/form-field.model.ts +0 -1
- package/src/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.css +3 -0
- package/src/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.html +1 -1
- package/src/libs/ui/inputs/src/lib/text-area/text-area.component.ts +1 -0
- package/src/libs/ui/inputs/src/lib/ui-inputs.module.ts +2 -2
- package/src/libs/ui/layout/src/lib/carousel/carousel.component.html +1 -0
- package/src/libs/ui/widgets/src/lib/badge/badge.component.html +3 -1
- package/src/libs/util/i18n/src/lib/i18n.constants.ts +18 -0
- package/src/libs/util/shared/src/lib/utils/index.ts +1 -0
- package/src/libs/util/shared/src/lib/utils/temporal-extent-union.ts +32 -0
- package/tailwind.base.css +44 -15
- package/translations/de.json +37 -27
- package/translations/en.json +32 -22
- package/translations/es.json +27 -17
- package/translations/fr.json +50 -40
- package/translations/it.json +44 -34
- package/translations/nl.json +28 -18
- package/translations/pt.json +27 -17
- package/translations/sk.json +118 -108
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
getAsUrl,
|
|
5
5
|
getFirstValue,
|
|
6
6
|
mapContact,
|
|
7
|
+
mapKeywords,
|
|
7
8
|
selectFallback,
|
|
8
9
|
selectFallbackFields,
|
|
9
10
|
selectField,
|
|
@@ -17,8 +18,8 @@ import { Injectable } from '@angular/core'
|
|
|
17
18
|
import { getStatusFromStatusCode } from '../iso19139/codelists/status.mapper'
|
|
18
19
|
import { getUpdateFrequencyFromFrequencyCode } from '../iso19139/codelists/update-frequency.mapper'
|
|
19
20
|
import {
|
|
20
|
-
AccessConstraintType,
|
|
21
21
|
CatalogRecord,
|
|
22
|
+
Constraint,
|
|
22
23
|
DatasetDistribution,
|
|
23
24
|
DatasetDistributionType,
|
|
24
25
|
DatasetDownloadDistribution,
|
|
@@ -27,7 +28,8 @@ import {
|
|
|
27
28
|
OnlineLinkResource,
|
|
28
29
|
} from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
29
30
|
import { matchProtocol } from '../common/distribution.mapper'
|
|
30
|
-
import {
|
|
31
|
+
import { Thesaurus } from './types'
|
|
32
|
+
import { LANG_3_TO_2_MAPPER, LangService } from '../../../../../../libs/util/i18n/src'
|
|
31
33
|
|
|
32
34
|
type ESResponseSource = SourceWithUnknownProps
|
|
33
35
|
|
|
@@ -92,8 +94,8 @@ export class Gn4FieldMapper {
|
|
|
92
94
|
},
|
|
93
95
|
cl_topic: (output, source) => ({
|
|
94
96
|
...output,
|
|
95
|
-
|
|
96
|
-
...(output.
|
|
97
|
+
topics: [
|
|
98
|
+
...(output.topics || []),
|
|
97
99
|
...getAsArray(
|
|
98
100
|
selectField<SourceWithUnknownProps[]>(source, 'cl_topic')
|
|
99
101
|
).map((topic) => selectTranslatedValue<string>(topic, this.lang3)),
|
|
@@ -130,6 +132,22 @@ export class Gn4FieldMapper {
|
|
|
130
132
|
...output,
|
|
131
133
|
recordUpdated: toDate(selectField<string>(source, 'changeDate')),
|
|
132
134
|
}),
|
|
135
|
+
publicationDateForResource: (output, source) => ({
|
|
136
|
+
...output,
|
|
137
|
+
recordPublished: toDate(
|
|
138
|
+
selectField<string>(source, 'publicationDateForResource')
|
|
139
|
+
),
|
|
140
|
+
}),
|
|
141
|
+
resourceLanguage: (output, source) => {
|
|
142
|
+
const langList = getAsArray(
|
|
143
|
+
selectField<string>(source, 'resourceLanguage')
|
|
144
|
+
)
|
|
145
|
+
const languages = langList.map((lang) => LANG_3_TO_2_MAPPER[lang])
|
|
146
|
+
return {
|
|
147
|
+
...output,
|
|
148
|
+
languages,
|
|
149
|
+
}
|
|
150
|
+
},
|
|
133
151
|
link: (output, source) => {
|
|
134
152
|
const rawLinks = getAsArray(
|
|
135
153
|
selectField<SourceWithUnknownProps[]>(source, 'link')
|
|
@@ -171,51 +189,56 @@ export class Gn4FieldMapper {
|
|
|
171
189
|
output
|
|
172
190
|
)
|
|
173
191
|
},
|
|
174
|
-
|
|
192
|
+
allKeywords: (output, source) => ({
|
|
175
193
|
...output,
|
|
176
|
-
keywords:
|
|
177
|
-
selectField<
|
|
178
|
-
|
|
194
|
+
keywords: mapKeywords(
|
|
195
|
+
selectField<Thesaurus[]>(source, 'allKeywords'),
|
|
196
|
+
this.lang3
|
|
197
|
+
),
|
|
179
198
|
}),
|
|
180
199
|
inspireTheme: (output, source) => ({
|
|
181
200
|
...output,
|
|
182
|
-
|
|
183
|
-
...(output.
|
|
201
|
+
topics: [
|
|
202
|
+
...(output.topics || []),
|
|
184
203
|
...getAsArray(selectField(source, 'inspireTheme_syn')),
|
|
185
204
|
],
|
|
186
205
|
}),
|
|
187
206
|
MD_ConstraintsUseLimitationObject: (output, source) =>
|
|
188
|
-
this.constraintField(
|
|
207
|
+
this.constraintField(
|
|
208
|
+
'other',
|
|
209
|
+
output,
|
|
210
|
+
getAsArray(selectField(source, 'MD_ConstraintsUseLimitationObject'))
|
|
211
|
+
),
|
|
189
212
|
MD_LegalConstraintsUseLimitationObject: (output, source) =>
|
|
190
213
|
this.constraintField(
|
|
191
|
-
'
|
|
214
|
+
'legal',
|
|
192
215
|
output,
|
|
193
|
-
|
|
216
|
+
getAsArray(
|
|
217
|
+
selectField(source, 'MD_LegalConstraintsUseLimitationObject')
|
|
218
|
+
)
|
|
194
219
|
),
|
|
195
220
|
MD_LegalConstraintsOtherConstraintsObject: (output, source) =>
|
|
196
221
|
this.constraintField(
|
|
197
|
-
'
|
|
222
|
+
'legal',
|
|
198
223
|
output,
|
|
199
|
-
|
|
224
|
+
getAsArray(
|
|
225
|
+
selectField(source, 'MD_LegalConstraintsOtherConstraintsObject')
|
|
226
|
+
)
|
|
200
227
|
),
|
|
201
228
|
MD_SecurityConstraintsUseLimitationObject: (output, source) =>
|
|
202
229
|
this.constraintField(
|
|
203
|
-
'
|
|
230
|
+
'security',
|
|
204
231
|
output,
|
|
205
|
-
|
|
232
|
+
getAsArray(
|
|
233
|
+
selectField(source, 'MD_SecurityConstraintsUseLimitationObject')
|
|
234
|
+
)
|
|
235
|
+
),
|
|
236
|
+
licenseObject: (output, source) =>
|
|
237
|
+
this.constraintField(
|
|
238
|
+
'license',
|
|
239
|
+
output,
|
|
240
|
+
getAsArray(selectField(source, 'licenseObject'))
|
|
206
241
|
),
|
|
207
|
-
licenseObject: (output, source) => ({
|
|
208
|
-
...output,
|
|
209
|
-
licenses: getAsArray(
|
|
210
|
-
selectField<SourceWithUnknownProps[]>(source, 'licenseObject')
|
|
211
|
-
).map((license) => {
|
|
212
|
-
const link = getAsUrl(selectField(license, 'link'))
|
|
213
|
-
return {
|
|
214
|
-
text: selectTranslatedValue<string>(license, this.lang3),
|
|
215
|
-
...(link ? { link } : {}),
|
|
216
|
-
}
|
|
217
|
-
}),
|
|
218
|
-
}),
|
|
219
242
|
lineageObject: (output, source) => ({
|
|
220
243
|
...output,
|
|
221
244
|
lineage: selectTranslatedField(source, 'lineageObject', this.lang3),
|
|
@@ -285,9 +308,9 @@ export class Gn4FieldMapper {
|
|
|
285
308
|
],
|
|
286
309
|
}
|
|
287
310
|
},
|
|
288
|
-
|
|
311
|
+
resourceTemporalExtentDateRange: (output, source) => {
|
|
289
312
|
const ranges = getAsArray(
|
|
290
|
-
selectField(source, '
|
|
313
|
+
selectField(source, 'resourceTemporalExtentDateRange')
|
|
291
314
|
)
|
|
292
315
|
return {
|
|
293
316
|
...output,
|
|
@@ -305,53 +328,53 @@ export class Gn4FieldMapper {
|
|
|
305
328
|
|
|
306
329
|
private genericField = (output) => output
|
|
307
330
|
|
|
308
|
-
private constraintField = (
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
+
private constraintField = (
|
|
332
|
+
type: 'license' | 'legal' | 'security' | 'other',
|
|
333
|
+
output: Partial<CatalogRecord>,
|
|
334
|
+
constraintArray: SourceWithUnknownProps[]
|
|
335
|
+
) => {
|
|
336
|
+
let outputField: string
|
|
337
|
+
switch (type) {
|
|
338
|
+
case 'license':
|
|
339
|
+
outputField = 'licenses'
|
|
340
|
+
break
|
|
341
|
+
case 'legal':
|
|
342
|
+
outputField = 'legalConstraints'
|
|
343
|
+
break
|
|
344
|
+
case 'security':
|
|
345
|
+
outputField = 'securityConstraints'
|
|
346
|
+
break
|
|
347
|
+
case 'other':
|
|
348
|
+
outputField = 'otherConstraints'
|
|
349
|
+
break
|
|
350
|
+
}
|
|
351
|
+
const outputArray: Constraint[] =
|
|
352
|
+
outputField in output ? output[outputField] : []
|
|
353
|
+
outputArray.push(
|
|
354
|
+
...constraintArray.map((item) => {
|
|
355
|
+
const text = selectTranslatedValue(item, this.lang3) as string
|
|
356
|
+
const url = getAsUrl(selectField(item, 'link'))
|
|
357
|
+
return {
|
|
358
|
+
text,
|
|
359
|
+
...(url ? { url } : {}),
|
|
331
360
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
case 'MD_LegalConstraintsUseLimitationObject':
|
|
348
|
-
return 'legal'
|
|
349
|
-
case 'MD_SecurityConstraintsUseLimitationObject':
|
|
350
|
-
return 'security'
|
|
351
|
-
case 'MD_ConstraintsUseLimitationObject':
|
|
352
|
-
default:
|
|
353
|
-
return 'other'
|
|
361
|
+
})
|
|
362
|
+
)
|
|
363
|
+
const result = {
|
|
364
|
+
...output,
|
|
365
|
+
[outputField]: outputArray,
|
|
366
|
+
}
|
|
367
|
+
// avoid legal constraints being duplicates of licenses
|
|
368
|
+
if (
|
|
369
|
+
'legalConstraints' in result &&
|
|
370
|
+
(type === 'legal' || type === 'license')
|
|
371
|
+
) {
|
|
372
|
+
result.legalConstraints = result.legalConstraints.filter(
|
|
373
|
+
(constraint) =>
|
|
374
|
+
!output.licenses?.some((license) => license.text === constraint.text)
|
|
375
|
+
)
|
|
354
376
|
}
|
|
377
|
+
return result
|
|
355
378
|
}
|
|
356
379
|
|
|
357
380
|
getMappingFn(fieldName: string) {
|
|
@@ -24,17 +24,20 @@ export class Gn4MetadataMapper extends MetadataBaseMapper<Gn4Record> {
|
|
|
24
24
|
status: null,
|
|
25
25
|
lineage: null,
|
|
26
26
|
recordUpdated: null,
|
|
27
|
+
recordPublished: null,
|
|
27
28
|
ownerOrganization: null,
|
|
28
29
|
licenses: [],
|
|
30
|
+
legalConstraints: [],
|
|
31
|
+
securityConstraints: [],
|
|
32
|
+
otherConstraints: [],
|
|
29
33
|
contacts: [],
|
|
30
34
|
contactsForResource: [],
|
|
31
|
-
accessConstraints: [],
|
|
32
35
|
keywords: [],
|
|
33
|
-
|
|
34
|
-
useLimitations: [],
|
|
36
|
+
topics: [],
|
|
35
37
|
spatialExtents: [],
|
|
36
38
|
temporalExtents: [],
|
|
37
39
|
overviews: [],
|
|
40
|
+
languages: [],
|
|
38
41
|
}
|
|
39
42
|
const record: CatalogRecord = Object.keys(_source).reduce(
|
|
40
43
|
(prev, fieldName) =>
|
|
@@ -56,15 +56,13 @@ interface SpecificationConformance {
|
|
|
56
56
|
pass: BooleanString
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
type Keyword = MultilingualField
|
|
60
|
-
type Keywords = Keyword[]
|
|
61
59
|
type ThesaurusName = string
|
|
62
|
-
interface Thesaurus {
|
|
60
|
+
export interface Thesaurus {
|
|
63
61
|
id?: string
|
|
64
62
|
title?: string
|
|
65
63
|
theme?: string
|
|
66
64
|
link?: string
|
|
67
|
-
keywords:
|
|
65
|
+
keywords: MultilingualField[]
|
|
68
66
|
}
|
|
69
67
|
|
|
70
68
|
export interface Link {
|
|
@@ -152,6 +150,7 @@ export type MetadataObject = Partial<{
|
|
|
152
150
|
pointOfContactOrg: string
|
|
153
151
|
pointOfContactOrgForResource: string
|
|
154
152
|
popularity: number
|
|
153
|
+
publicationDateForResource: string
|
|
155
154
|
rating: string
|
|
156
155
|
record: string
|
|
157
156
|
recordGroup: string
|
|
@@ -175,7 +174,7 @@ export type MetadataObject = Partial<{
|
|
|
175
174
|
specificationConformance: MaybeArray<SpecificationConformance>
|
|
176
175
|
standardNameObject: MultilingualField
|
|
177
176
|
standardVersionObject: MultilingualField
|
|
178
|
-
tag:
|
|
177
|
+
tag: MultilingualField[]
|
|
179
178
|
tagNumber: string
|
|
180
179
|
userSavedCount: string
|
|
181
180
|
userinfo: string
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { KeywordType } from '../../../../../../../libs/common/domain/src/lib/model/record'
|
|
2
|
+
|
|
3
|
+
export function getKeywordTypeFromKeywordTypeCode(
|
|
4
|
+
typeCode: string
|
|
5
|
+
): KeywordType {
|
|
6
|
+
if (!typeCode) return 'other'
|
|
7
|
+
switch (typeCode) {
|
|
8
|
+
case 'theme':
|
|
9
|
+
case 'place':
|
|
10
|
+
case 'temporal':
|
|
11
|
+
case 'other':
|
|
12
|
+
return typeCode
|
|
13
|
+
default:
|
|
14
|
+
return 'other'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
} from '../xml-utils'
|
|
13
13
|
import {
|
|
14
14
|
writeAbstract,
|
|
15
|
-
writeAccessConstraints,
|
|
16
15
|
writeContacts,
|
|
17
16
|
writeDatasetCreated,
|
|
18
17
|
writeDatasetUpdated,
|
|
@@ -20,22 +19,23 @@ import {
|
|
|
20
19
|
writeGraphicOverviews,
|
|
21
20
|
writeKeywords,
|
|
22
21
|
writeKind,
|
|
22
|
+
writeLegalConstraints,
|
|
23
23
|
writeLicenses,
|
|
24
24
|
writeLineage,
|
|
25
25
|
writeOnlineResources,
|
|
26
|
+
writeOtherConstraints,
|
|
26
27
|
writeOwnerOrganization,
|
|
27
28
|
writeRecordUpdated,
|
|
29
|
+
writeSecurityConstraints,
|
|
28
30
|
writeSpatialRepresentation,
|
|
29
31
|
writeStatus,
|
|
30
|
-
|
|
32
|
+
writeTopics,
|
|
31
33
|
writeTitle,
|
|
32
34
|
writeUniqueIdentifier,
|
|
33
35
|
writeUpdateFrequency,
|
|
34
|
-
writeUseLimitations,
|
|
35
36
|
} from './write-parts'
|
|
36
37
|
import {
|
|
37
38
|
readAbstract,
|
|
38
|
-
readAccessConstraints,
|
|
39
39
|
readContacts,
|
|
40
40
|
readDatasetCreated,
|
|
41
41
|
readDatasetUpdated,
|
|
@@ -43,21 +43,23 @@ import {
|
|
|
43
43
|
readIsoTopics,
|
|
44
44
|
readKeywords,
|
|
45
45
|
readKind,
|
|
46
|
+
readLegalConstraints,
|
|
46
47
|
readLicenses,
|
|
47
48
|
readLineage,
|
|
48
49
|
readOnlineResources,
|
|
50
|
+
readOtherConstraints,
|
|
49
51
|
readOverviews,
|
|
50
52
|
readOwnerOrganization,
|
|
51
53
|
readRecordUpdated,
|
|
54
|
+
readRecordPublished,
|
|
55
|
+
readSecurityConstraints,
|
|
52
56
|
readSpatialExtents,
|
|
53
57
|
readSpatialRepresentation,
|
|
54
58
|
readStatus,
|
|
55
59
|
readTemporalExtents,
|
|
56
|
-
readThemes,
|
|
57
60
|
readTitle,
|
|
58
61
|
readUniqueIdentifier,
|
|
59
62
|
readUpdateFrequency,
|
|
60
|
-
readUseLimitations,
|
|
61
63
|
} from './read-parts'
|
|
62
64
|
import { isEqual } from '../convert-utils'
|
|
63
65
|
|
|
@@ -73,16 +75,15 @@ export function toModel(xml: string): CatalogRecord {
|
|
|
73
75
|
const contacts = readContacts(rootEl)
|
|
74
76
|
const recordUpdated = readRecordUpdated(rootEl)
|
|
75
77
|
const recordCreated = recordUpdated
|
|
78
|
+
const recordPublished = readRecordPublished(rootEl)
|
|
76
79
|
const keywords = readKeywords(rootEl)
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
const
|
|
80
|
+
const topics = readIsoTopics(rootEl)
|
|
81
|
+
const legalConstraints = readLegalConstraints(rootEl)
|
|
82
|
+
const otherConstraints = readOtherConstraints(rootEl)
|
|
83
|
+
const securityConstraints = readSecurityConstraints(rootEl)
|
|
80
84
|
const licenses = readLicenses(rootEl)
|
|
81
85
|
const overviews = readOverviews(rootEl)
|
|
82
86
|
|
|
83
|
-
// not used yet
|
|
84
|
-
const isoTopics = readIsoTopics(rootEl)
|
|
85
|
-
|
|
86
87
|
if (kind === 'dataset') {
|
|
87
88
|
const status = readStatus(rootEl)
|
|
88
89
|
const datasetCreated = readDatasetCreated(rootEl)
|
|
@@ -97,8 +98,10 @@ export function toModel(xml: string): CatalogRecord {
|
|
|
97
98
|
return {
|
|
98
99
|
uniqueIdentifier,
|
|
99
100
|
kind,
|
|
101
|
+
languages: [],
|
|
100
102
|
recordCreated,
|
|
101
103
|
recordUpdated,
|
|
104
|
+
recordPublished,
|
|
102
105
|
status,
|
|
103
106
|
title,
|
|
104
107
|
abstract,
|
|
@@ -106,10 +109,11 @@ export function toModel(xml: string): CatalogRecord {
|
|
|
106
109
|
contacts,
|
|
107
110
|
contactsForResource: [], // FIXME: is that really useful??
|
|
108
111
|
keywords,
|
|
109
|
-
|
|
110
|
-
accessConstraints,
|
|
111
|
-
useLimitations,
|
|
112
|
+
topics,
|
|
112
113
|
licenses,
|
|
114
|
+
legalConstraints,
|
|
115
|
+
securityConstraints,
|
|
116
|
+
otherConstraints,
|
|
113
117
|
...(datasetCreated && { datasetCreated }),
|
|
114
118
|
...(datasetUpdated && { datasetUpdated }),
|
|
115
119
|
lineage,
|
|
@@ -125,17 +129,20 @@ export function toModel(xml: string): CatalogRecord {
|
|
|
125
129
|
return {
|
|
126
130
|
uniqueIdentifier,
|
|
127
131
|
kind,
|
|
132
|
+
languages: [],
|
|
128
133
|
recordCreated,
|
|
129
134
|
recordUpdated,
|
|
135
|
+
recordPublished,
|
|
130
136
|
title,
|
|
131
137
|
abstract,
|
|
132
138
|
ownerOrganization,
|
|
133
139
|
contacts,
|
|
134
140
|
keywords,
|
|
135
|
-
|
|
136
|
-
accessConstraints,
|
|
137
|
-
useLimitations,
|
|
141
|
+
topics,
|
|
138
142
|
licenses,
|
|
143
|
+
legalConstraints,
|
|
144
|
+
securityConstraints,
|
|
145
|
+
otherConstraints,
|
|
139
146
|
overviews,
|
|
140
147
|
onlineResources,
|
|
141
148
|
} as ServiceRecord
|
|
@@ -163,10 +170,12 @@ export function toXml(record: CatalogRecord, originalXml?: string): string {
|
|
|
163
170
|
writeAbstract(record, rootEl)
|
|
164
171
|
fieldChanged('contacts') && writeContacts(record, rootEl)
|
|
165
172
|
fieldChanged('keywords') && writeKeywords(record, rootEl)
|
|
166
|
-
fieldChanged('
|
|
167
|
-
fieldChanged('
|
|
173
|
+
fieldChanged('topics') && writeTopics(record, rootEl)
|
|
174
|
+
fieldChanged('legalConstraints') && writeLegalConstraints(record, rootEl)
|
|
175
|
+
fieldChanged('securityConstraints') &&
|
|
176
|
+
writeSecurityConstraints(record, rootEl)
|
|
168
177
|
fieldChanged('licenses') && writeLicenses(record, rootEl)
|
|
169
|
-
fieldChanged('
|
|
178
|
+
fieldChanged('otherConstraints') && writeOtherConstraints(record, rootEl)
|
|
170
179
|
|
|
171
180
|
if (record.kind === 'dataset') {
|
|
172
181
|
writeStatus(record, rootEl)
|