geonetwork-ui 2.2.0-dev.4db0b597 → 2.2.0-dev.4fbb1645
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/router/src/lib/default/index.mjs +2 -1
- package/esm2022/libs/feature/router/src/lib/default/router.service.mjs +1 -1
- 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/record-api-form/record-api-form.component.mjs +8 -5
- 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 +979 -531
- 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/router/src/lib/default/index.d.ts +1 -0
- package/libs/feature/router/src/lib/default/index.d.ts.map +1 -1
- package/libs/feature/router/src/lib/default/router.service.d.ts +1 -1
- package/libs/feature/router/src/lib/default/router.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/record-api-form/record-api-form.component.d.ts +3 -1
- package/libs/ui/elements/src/lib/record-api-form/record-api-form.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/router/src/lib/default/index.ts +1 -0
- package/src/libs/feature/router/src/lib/default/router.service.ts +1 -1
- package/src/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.html +5 -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/record-api-form/record-api-form.component.html +4 -4
- package/src/libs/ui/elements/src/lib/record-api-form/record-api-form.component.ts +11 -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
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
AccessConstraintType,
|
|
2
|
+
Constraint,
|
|
4
3
|
DatasetDistribution,
|
|
5
4
|
DatasetSpatialExtent,
|
|
6
5
|
DatasetTemporalExtent,
|
|
7
6
|
GraphicOverview,
|
|
8
7
|
Individual,
|
|
9
|
-
|
|
8
|
+
Keyword,
|
|
9
|
+
KeywordThesaurus,
|
|
10
10
|
Organization,
|
|
11
11
|
RecordKind,
|
|
12
12
|
RecordStatus,
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
} from '../function-utils'
|
|
42
42
|
import { getRoleFromRoleCode } from './codelists/role.mapper'
|
|
43
43
|
import { matchMimeType, matchProtocol } from '../common/distribution.mapper'
|
|
44
|
+
import { getKeywordTypeFromKeywordTypeCode } from './codelists/keyword.mapper'
|
|
44
45
|
|
|
45
46
|
function extractCharacterString(): ChainableFunction<XmlElement, string> {
|
|
46
47
|
return pipe(
|
|
@@ -183,59 +184,69 @@ function extractStatus(): ChainableFunction<XmlElement, RecordStatus> {
|
|
|
183
184
|
}
|
|
184
185
|
|
|
185
186
|
// from gmd:resourceConstraints
|
|
186
|
-
function
|
|
187
|
+
function extractLegalConstraints(): ChainableFunction<
|
|
187
188
|
XmlElement,
|
|
188
|
-
Array<
|
|
189
|
+
Array<Constraint>
|
|
189
190
|
> {
|
|
190
|
-
|
|
191
|
+
return pipe(
|
|
191
192
|
findChildrenElement('gmd:MD_LegalConstraints', false),
|
|
192
193
|
filterArray(
|
|
193
194
|
pipe(
|
|
194
195
|
findChildrenElement('gmd:MD_RestrictionCode'),
|
|
195
196
|
mapArray(readAttribute('codeListValue')),
|
|
196
|
-
map(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
197
|
+
map((values) => values.indexOf('license') === -1)
|
|
198
|
+
)
|
|
199
|
+
),
|
|
200
|
+
mapArray(
|
|
201
|
+
combine(
|
|
202
|
+
findChildrenElement('gmd:otherConstraints'),
|
|
203
|
+
findChildrenElement('gmd:useLimitation')
|
|
201
204
|
)
|
|
202
205
|
),
|
|
203
|
-
mapArray(findChildrenElement('gmd:otherConstraints')),
|
|
204
206
|
flattenArray(),
|
|
205
|
-
|
|
206
|
-
mapArray((
|
|
207
|
+
flattenArray(),
|
|
208
|
+
mapArray(combine(extractCharacterString(), extractUrl())),
|
|
209
|
+
mapArray(([text, url]) => ({
|
|
210
|
+
...(url && { url }),
|
|
207
211
|
text,
|
|
208
|
-
type: 'other' as AccessConstraintType,
|
|
209
212
|
}))
|
|
210
213
|
)
|
|
211
|
-
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// from gmd:resourceConstraints
|
|
217
|
+
function extractSecurityConstraints(): ChainableFunction<
|
|
218
|
+
XmlElement,
|
|
219
|
+
Array<Constraint>
|
|
220
|
+
> {
|
|
221
|
+
return pipe(
|
|
212
222
|
findNestedElements('gmd:MD_SecurityConstraints', 'gmd:useLimitation'),
|
|
213
|
-
|
|
214
|
-
mapArray((
|
|
223
|
+
flattenArray(),
|
|
224
|
+
mapArray(combine(extractCharacterString(), extractUrl())),
|
|
225
|
+
mapArray(([text, url]) => ({
|
|
226
|
+
...(url && { url }),
|
|
215
227
|
text,
|
|
216
|
-
type: 'security' as AccessConstraintType,
|
|
217
228
|
}))
|
|
218
229
|
)
|
|
219
|
-
return pipe(
|
|
220
|
-
combine(getOtherConstraints, getSecurityConstraints),
|
|
221
|
-
flattenArray()
|
|
222
|
-
)
|
|
223
230
|
}
|
|
224
231
|
|
|
225
232
|
// from gmd:resourceConstraints
|
|
226
|
-
function
|
|
233
|
+
function extractOtherConstraints(): ChainableFunction<
|
|
234
|
+
XmlElement,
|
|
235
|
+
Array<Constraint>
|
|
236
|
+
> {
|
|
227
237
|
return pipe(
|
|
228
|
-
|
|
229
|
-
findNestedElements('gmd:MD_Constraints', 'gmd:useLimitation'),
|
|
230
|
-
findNestedElements('gmd:MD_LegalConstraints', 'gmd:useLimitation')
|
|
231
|
-
),
|
|
238
|
+
findNestedElements('gmd:MD_Constraints', 'gmd:useLimitation'),
|
|
232
239
|
flattenArray(),
|
|
233
|
-
mapArray(extractCharacterString())
|
|
240
|
+
mapArray(combine(extractCharacterString(), extractUrl())),
|
|
241
|
+
mapArray(([text, url]) => ({
|
|
242
|
+
...(url && { url }),
|
|
243
|
+
text,
|
|
244
|
+
}))
|
|
234
245
|
)
|
|
235
246
|
}
|
|
236
247
|
|
|
237
248
|
// from gmd:resourceConstraints
|
|
238
|
-
function extractLicenses(): ChainableFunction<XmlElement, Array<
|
|
249
|
+
function extractLicenses(): ChainableFunction<XmlElement, Array<Constraint>> {
|
|
239
250
|
return pipe(
|
|
240
251
|
findChildrenElement('gmd:MD_LegalConstraints', false),
|
|
241
252
|
filterArray(
|
|
@@ -246,15 +257,18 @@ function extractLicenses(): ChainableFunction<XmlElement, Array<License>> {
|
|
|
246
257
|
)
|
|
247
258
|
),
|
|
248
259
|
mapArray(
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
map(([text, url]) => ({
|
|
253
|
-
...(url && { url }),
|
|
254
|
-
text,
|
|
255
|
-
}))
|
|
260
|
+
combine(
|
|
261
|
+
findChildrenElement('gmd:otherConstraints'),
|
|
262
|
+
findChildrenElement('gmd:useLimitation')
|
|
256
263
|
)
|
|
257
|
-
)
|
|
264
|
+
),
|
|
265
|
+
flattenArray(),
|
|
266
|
+
flattenArray(),
|
|
267
|
+
mapArray(combine(extractCharacterString(), extractUrl())),
|
|
268
|
+
mapArray(([text, url]) => ({
|
|
269
|
+
...(url && { url }),
|
|
270
|
+
text,
|
|
271
|
+
}))
|
|
258
272
|
)
|
|
259
273
|
}
|
|
260
274
|
|
|
@@ -436,7 +450,7 @@ function findIdentification() {
|
|
|
436
450
|
}
|
|
437
451
|
}
|
|
438
452
|
|
|
439
|
-
function extractCitationDate(type: 'creation' | 'revision') {
|
|
453
|
+
function extractCitationDate(type: 'creation' | 'revision' | 'publication') {
|
|
440
454
|
return pipe(
|
|
441
455
|
findIdentification(),
|
|
442
456
|
findNestedElements('gmd:citation', 'gmd:CI_Citation', 'gmd:date'),
|
|
@@ -503,6 +517,10 @@ export function readRecordUpdated(rootEl: XmlElement): Date {
|
|
|
503
517
|
return pipe(findChildElement('gmd:dateStamp'), extractDateTime())(rootEl)
|
|
504
518
|
}
|
|
505
519
|
|
|
520
|
+
export function readRecordPublished(rootEl: XmlElement): Date {
|
|
521
|
+
return pipe(findChildElement('gmd:dateStamp'), extractDateTime())(rootEl)
|
|
522
|
+
}
|
|
523
|
+
|
|
506
524
|
export function readTitle(rootEl: XmlElement): string {
|
|
507
525
|
return pipe(
|
|
508
526
|
findIdentification(),
|
|
@@ -541,29 +559,60 @@ export function readContacts(rootEl: XmlElement): Individual[] {
|
|
|
541
559
|
)(rootEl)
|
|
542
560
|
}
|
|
543
561
|
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
)
|
|
554
|
-
),
|
|
555
|
-
mapArray(findChildrenElement('gmd:keyword')),
|
|
556
|
-
flattenArray(),
|
|
557
|
-
mapArray(extractCharacterString())
|
|
562
|
+
// from gmd:thesaurusName
|
|
563
|
+
function readThesaurus(rootEl: XmlElement): KeywordThesaurus {
|
|
564
|
+
if (!rootEl) return null
|
|
565
|
+
|
|
566
|
+
const findIdentifier = findNestedElement(
|
|
567
|
+
'gmd:CI_Citation',
|
|
568
|
+
'gmd:identifier',
|
|
569
|
+
'gmd:MD_Identifier',
|
|
570
|
+
'gmd:code'
|
|
558
571
|
)
|
|
572
|
+
const id = pipe(findIdentifier, extractCharacterString())(rootEl)
|
|
573
|
+
const url = pipe(findIdentifier, extractUrl())(rootEl)
|
|
574
|
+
const name = pipe(
|
|
575
|
+
findNestedElement('gmd:CI_Citation', 'gmd:title'),
|
|
576
|
+
extractCharacterString()
|
|
577
|
+
)(rootEl)
|
|
578
|
+
return {
|
|
579
|
+
id,
|
|
580
|
+
...(name && { name }),
|
|
581
|
+
...(url && { url }),
|
|
582
|
+
}
|
|
559
583
|
}
|
|
560
584
|
|
|
561
|
-
|
|
562
|
-
|
|
585
|
+
// from gmd:MD_Keywords
|
|
586
|
+
function readKeywordGroup(rootEl: XmlElement): Keyword[] {
|
|
587
|
+
const type = pipe(
|
|
588
|
+
findChildrenElement('gmd:MD_KeywordTypeCode'),
|
|
589
|
+
mapArray(readAttribute('codeListValue')),
|
|
590
|
+
map((values) => getKeywordTypeFromKeywordTypeCode(values[0]))
|
|
591
|
+
)(rootEl)
|
|
592
|
+
const thesaurus = pipe(
|
|
593
|
+
findNestedElement('gmd:thesaurusName'),
|
|
594
|
+
readThesaurus
|
|
595
|
+
)(rootEl)
|
|
596
|
+
return pipe(
|
|
597
|
+
findChildrenElement('gmd:keyword'),
|
|
598
|
+
mapArray((el) => {
|
|
599
|
+
const label = extractCharacterString()(el)
|
|
600
|
+
return {
|
|
601
|
+
...(thesaurus ? { thesaurus } : {}),
|
|
602
|
+
label,
|
|
603
|
+
type,
|
|
604
|
+
} as Keyword
|
|
605
|
+
})
|
|
606
|
+
)(rootEl)
|
|
563
607
|
}
|
|
564
608
|
|
|
565
|
-
export function
|
|
566
|
-
return
|
|
609
|
+
export function readKeywords(rootEl: XmlElement): Keyword[] {
|
|
610
|
+
return pipe(
|
|
611
|
+
findIdentification(),
|
|
612
|
+
findNestedElements('gmd:descriptiveKeywords', 'gmd:MD_Keywords'),
|
|
613
|
+
mapArray(readKeywordGroup),
|
|
614
|
+
flattenArray()
|
|
615
|
+
)(rootEl)
|
|
567
616
|
}
|
|
568
617
|
|
|
569
618
|
export function readStatus(rootEl: XmlElement): RecordStatus {
|
|
@@ -579,24 +628,32 @@ const getConstraints = pipe(
|
|
|
579
628
|
findChildrenElement('gmd:resourceConstraints', false)
|
|
580
629
|
)
|
|
581
630
|
|
|
582
|
-
export function
|
|
631
|
+
export function readLegalConstraints(rootEl: XmlElement): Constraint[] {
|
|
583
632
|
return pipe(
|
|
584
633
|
getConstraints,
|
|
585
|
-
mapArray(
|
|
634
|
+
mapArray(extractLegalConstraints()),
|
|
586
635
|
flattenArray(),
|
|
587
636
|
flattenArray()
|
|
588
637
|
)(rootEl)
|
|
589
638
|
}
|
|
590
639
|
|
|
591
|
-
export function
|
|
640
|
+
export function readSecurityConstraints(rootEl: XmlElement): Constraint[] {
|
|
641
|
+
return pipe(
|
|
642
|
+
getConstraints,
|
|
643
|
+
mapArray(extractSecurityConstraints()),
|
|
644
|
+
flattenArray()
|
|
645
|
+
)(rootEl)
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
export function readOtherConstraints(rootEl: XmlElement): Constraint[] {
|
|
592
649
|
return pipe(
|
|
593
650
|
getConstraints,
|
|
594
|
-
mapArray(
|
|
651
|
+
mapArray(extractOtherConstraints()),
|
|
595
652
|
flattenArray()
|
|
596
653
|
)(rootEl)
|
|
597
654
|
}
|
|
598
655
|
|
|
599
|
-
export function readLicenses(rootEl: XmlElement):
|
|
656
|
+
export function readLicenses(rootEl: XmlElement): Constraint[] {
|
|
600
657
|
return pipe(
|
|
601
658
|
getConstraints,
|
|
602
659
|
mapArray(extractLicenses()),
|
|
@@ -608,7 +665,7 @@ export function readLicenses(rootEl: XmlElement): License[] {
|
|
|
608
665
|
export function readIsoTopics(rootEl: XmlElement): string[] {
|
|
609
666
|
return pipe(
|
|
610
667
|
findIdentification(),
|
|
611
|
-
findChildrenElement('gmd:MD_TopicCategoryCode',
|
|
668
|
+
findChildrenElement('gmd:MD_TopicCategoryCode', true),
|
|
612
669
|
mapArray(readText())
|
|
613
670
|
)(rootEl)
|
|
614
671
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
-
AccessConstraint,
|
|
3
2
|
CatalogRecord,
|
|
3
|
+
Constraint,
|
|
4
4
|
DatasetDistribution,
|
|
5
5
|
DatasetRecord,
|
|
6
6
|
DatasetServiceDistribution,
|
|
7
7
|
Individual,
|
|
8
|
-
|
|
8
|
+
Keyword,
|
|
9
|
+
KeywordThesaurus,
|
|
9
10
|
RecordStatus,
|
|
10
11
|
Role,
|
|
11
12
|
ServiceEndpoint,
|
|
@@ -26,6 +27,7 @@ import {
|
|
|
26
27
|
findNestedElement,
|
|
27
28
|
findNestedElements,
|
|
28
29
|
readAttribute,
|
|
30
|
+
readText,
|
|
29
31
|
removeAllChildren,
|
|
30
32
|
removeChildren,
|
|
31
33
|
removeChildrenByName,
|
|
@@ -289,7 +291,10 @@ function appendResponsibleParty(contact: Individual) {
|
|
|
289
291
|
)
|
|
290
292
|
}
|
|
291
293
|
|
|
292
|
-
function updateCitationDate(
|
|
294
|
+
function updateCitationDate(
|
|
295
|
+
date: Date,
|
|
296
|
+
type: 'revision' | 'creation' | 'publication'
|
|
297
|
+
) {
|
|
293
298
|
return pipe(
|
|
294
299
|
findNestedElements('gmd:date', 'gmd:CI_Date'),
|
|
295
300
|
filterArray(
|
|
@@ -306,7 +311,10 @@ function updateCitationDate(date: Date, type: 'revision' | 'creation') {
|
|
|
306
311
|
)
|
|
307
312
|
}
|
|
308
313
|
|
|
309
|
-
function appendCitationDate(
|
|
314
|
+
function appendCitationDate(
|
|
315
|
+
date,
|
|
316
|
+
type: 'revision' | 'creation' | 'publication'
|
|
317
|
+
) {
|
|
310
318
|
return appendChildren(
|
|
311
319
|
pipe(
|
|
312
320
|
createElement('gmd:date'),
|
|
@@ -327,82 +335,89 @@ function appendCitationDate(date, type: 'revision' | 'creation') {
|
|
|
327
335
|
)
|
|
328
336
|
}
|
|
329
337
|
|
|
330
|
-
function removeKeywords(
|
|
331
|
-
return removeChildren(
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
338
|
+
function removeKeywords() {
|
|
339
|
+
return removeChildren(pipe(findNestedElements('gmd:descriptiveKeywords')))
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// returns a <gmd:thesaurusName> element
|
|
343
|
+
function createThesaurus(thesaurus: KeywordThesaurus) {
|
|
344
|
+
return pipe(
|
|
345
|
+
createElement('gmd:thesaurusName'),
|
|
346
|
+
createChild('gmd:CI_Citation'),
|
|
347
|
+
appendChildren(
|
|
348
|
+
pipe(
|
|
349
|
+
createElement('gmd:title'),
|
|
350
|
+
writeCharacterString(thesaurus.name || thesaurus.id)
|
|
351
|
+
),
|
|
352
|
+
pipe(
|
|
353
|
+
createElement('gmd:identifier'),
|
|
354
|
+
createChild('gmd:MD_Identifier'),
|
|
355
|
+
appendChildren(
|
|
356
|
+
pipe(
|
|
357
|
+
createElement('gmd:code'),
|
|
358
|
+
thesaurus.url
|
|
359
|
+
? writeAnchor(thesaurus.url, thesaurus.id)
|
|
360
|
+
: writeCharacterString(thesaurus.id)
|
|
361
|
+
)
|
|
344
362
|
)
|
|
345
363
|
)
|
|
346
364
|
)
|
|
347
365
|
)
|
|
348
366
|
}
|
|
349
367
|
|
|
350
|
-
function appendKeywords(keywords:
|
|
368
|
+
function appendKeywords(keywords: Keyword[]) {
|
|
369
|
+
const keywordsByThesaurus: Keyword[][] = keywords.reduce((acc, keyword) => {
|
|
370
|
+
const thesaurusId = keyword.thesaurus?.id
|
|
371
|
+
const type = keyword.type
|
|
372
|
+
let existingGroup = acc.find((group) =>
|
|
373
|
+
group[0].thesaurus
|
|
374
|
+
? group[0].thesaurus.id === thesaurusId
|
|
375
|
+
: group[0].type === type
|
|
376
|
+
)
|
|
377
|
+
if (!existingGroup) {
|
|
378
|
+
existingGroup = []
|
|
379
|
+
acc.push(existingGroup)
|
|
380
|
+
}
|
|
381
|
+
existingGroup.push(keyword)
|
|
382
|
+
return acc
|
|
383
|
+
}, [])
|
|
351
384
|
return appendChildren(
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
385
|
+
...keywordsByThesaurus.map((keywords) =>
|
|
386
|
+
pipe(
|
|
387
|
+
createElement('gmd:descriptiveKeywords'),
|
|
388
|
+
createChild('gmd:MD_Keywords'),
|
|
389
|
+
appendChildren(
|
|
390
|
+
pipe(
|
|
391
|
+
createElement('gmd:type'),
|
|
392
|
+
createChild('gmd:MD_KeywordTypeCode'),
|
|
393
|
+
addAttribute(
|
|
394
|
+
'codeList',
|
|
395
|
+
'http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_KeywordTypeCode'
|
|
396
|
+
),
|
|
397
|
+
addAttribute('codeListValue', keywords[0].type)
|
|
398
|
+
)
|
|
399
|
+
),
|
|
400
|
+
keywords[0].thesaurus
|
|
401
|
+
? appendChildren(createThesaurus(keywords[0].thesaurus))
|
|
402
|
+
: noop,
|
|
403
|
+
appendChildren(
|
|
404
|
+
...keywords.map((keyword) =>
|
|
357
405
|
pipe(
|
|
358
|
-
createElement('gmd:
|
|
359
|
-
|
|
360
|
-
addAttribute(
|
|
361
|
-
'codeList',
|
|
362
|
-
'http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_KeywordTypeCode'
|
|
363
|
-
),
|
|
364
|
-
addAttribute('codeListValue', type)
|
|
406
|
+
createElement('gmd:keyword'),
|
|
407
|
+
writeCharacterString(keyword.label)
|
|
365
408
|
)
|
|
366
409
|
)
|
|
367
|
-
: noop,
|
|
368
|
-
appendChildren(
|
|
369
|
-
...keywords.map((keyword) =>
|
|
370
|
-
pipe(createElement('gmd:keyword'), writeCharacterString(keyword))
|
|
371
410
|
)
|
|
372
411
|
)
|
|
373
412
|
)
|
|
374
413
|
)
|
|
375
414
|
}
|
|
376
415
|
|
|
377
|
-
function
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
)
|
|
382
|
-
|
|
383
|
-
// remove legal constraints that *only* have 'otherRestrictions'
|
|
384
|
-
const otherConstraintsFilter = pipe(
|
|
385
|
-
findNestedElements(
|
|
386
|
-
'gmd:MD_LegalConstraints',
|
|
387
|
-
'gmd:accessConstraints',
|
|
388
|
-
'gmd:MD_RestrictionCode'
|
|
389
|
-
),
|
|
390
|
-
mapArray(readAttribute('codeListValue')),
|
|
391
|
-
(restrictionCodes) =>
|
|
392
|
-
restrictionCodes.every((code) => code === 'otherRestrictions')
|
|
393
|
-
)
|
|
394
|
-
return removeChildren(
|
|
395
|
-
pipe(
|
|
396
|
-
findChildrenElement('gmd:resourceConstraints'),
|
|
397
|
-
filterArray(
|
|
398
|
-
(el) => securityConstraintsFilter(el) || otherConstraintsFilter(el)
|
|
399
|
-
)
|
|
400
|
-
)
|
|
401
|
-
)
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
function createAccessConstraint(constraint: AccessConstraint) {
|
|
405
|
-
if (constraint.type === 'security') {
|
|
416
|
+
function createConstraint(
|
|
417
|
+
constraint: Constraint,
|
|
418
|
+
type: 'legal' | 'security' | 'other'
|
|
419
|
+
) {
|
|
420
|
+
if (type === 'security') {
|
|
406
421
|
return pipe(
|
|
407
422
|
createElement('gmd:resourceConstraints'),
|
|
408
423
|
createChild('gmd:MD_SecurityConstraints'),
|
|
@@ -422,29 +437,41 @@ function createAccessConstraint(constraint: AccessConstraint) {
|
|
|
422
437
|
)
|
|
423
438
|
)
|
|
424
439
|
)
|
|
440
|
+
} else if (type === 'legal') {
|
|
441
|
+
return pipe(
|
|
442
|
+
createElement('gmd:resourceConstraints'),
|
|
443
|
+
createChild('gmd:MD_LegalConstraints'),
|
|
444
|
+
appendChildren(
|
|
445
|
+
pipe(
|
|
446
|
+
createElement('gmd:accessConstraints'),
|
|
447
|
+
createChild('gmd:MD_RestrictionCode'),
|
|
448
|
+
addAttribute(
|
|
449
|
+
'codeList',
|
|
450
|
+
'http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_RestrictionCode'
|
|
451
|
+
),
|
|
452
|
+
addAttribute('codeListValue', 'otherRestrictions')
|
|
453
|
+
),
|
|
454
|
+
pipe(
|
|
455
|
+
createElement('gmd:otherConstraints'),
|
|
456
|
+
writeCharacterString(constraint.text)
|
|
457
|
+
)
|
|
458
|
+
)
|
|
459
|
+
)
|
|
425
460
|
}
|
|
461
|
+
|
|
426
462
|
return pipe(
|
|
427
463
|
createElement('gmd:resourceConstraints'),
|
|
428
|
-
createChild('gmd:
|
|
464
|
+
createChild('gmd:MD_Constraints'),
|
|
429
465
|
appendChildren(
|
|
430
466
|
pipe(
|
|
431
|
-
createElement('gmd:
|
|
432
|
-
createChild('gmd:MD_RestrictionCode'),
|
|
433
|
-
addAttribute(
|
|
434
|
-
'codeList',
|
|
435
|
-
'http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_RestrictionCode'
|
|
436
|
-
),
|
|
437
|
-
addAttribute('codeListValue', 'otherRestrictions')
|
|
438
|
-
),
|
|
439
|
-
pipe(
|
|
440
|
-
createElement('gmd:otherConstraints'),
|
|
467
|
+
createElement('gmd:useLimitation'),
|
|
441
468
|
writeCharacterString(constraint.text)
|
|
442
469
|
)
|
|
443
470
|
)
|
|
444
471
|
)
|
|
445
472
|
}
|
|
446
473
|
|
|
447
|
-
function
|
|
474
|
+
function removeOtherConstraints() {
|
|
448
475
|
return removeChildren(
|
|
449
476
|
pipe(
|
|
450
477
|
findChildrenElement('gmd:resourceConstraints'),
|
|
@@ -458,12 +485,37 @@ function removeUseLimitations() {
|
|
|
458
485
|
)
|
|
459
486
|
}
|
|
460
487
|
|
|
461
|
-
function
|
|
462
|
-
return
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
488
|
+
function removeSecurityConstraints() {
|
|
489
|
+
return removeChildren(
|
|
490
|
+
pipe(
|
|
491
|
+
findChildrenElement('gmd:resourceConstraints'),
|
|
492
|
+
filterArray(
|
|
493
|
+
pipe(
|
|
494
|
+
findNestedElements('gmd:MD_SecurityConstraints', 'gmd:useLimitation'),
|
|
495
|
+
(array) => array.length > 0
|
|
496
|
+
)
|
|
497
|
+
)
|
|
498
|
+
)
|
|
499
|
+
)
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
function removeLegalConstraints() {
|
|
503
|
+
return removeChildren(
|
|
504
|
+
pipe(
|
|
505
|
+
findChildrenElement('gmd:resourceConstraints'),
|
|
506
|
+
filterArray(
|
|
507
|
+
pipe(
|
|
508
|
+
findNestedElements(
|
|
509
|
+
'gmd:MD_LegalConstraints',
|
|
510
|
+
'gmd:accessConstraints',
|
|
511
|
+
'gmd:MD_RestrictionCode'
|
|
512
|
+
),
|
|
513
|
+
mapArray(readAttribute('codeListValue')),
|
|
514
|
+
(restrictionCodes) =>
|
|
515
|
+
restrictionCodes.every((code) => code !== 'license')
|
|
516
|
+
)
|
|
517
|
+
)
|
|
518
|
+
)
|
|
467
519
|
)
|
|
468
520
|
}
|
|
469
521
|
|
|
@@ -487,7 +539,7 @@ function removeLicenses() {
|
|
|
487
539
|
)
|
|
488
540
|
}
|
|
489
541
|
|
|
490
|
-
function createLicense(license:
|
|
542
|
+
function createLicense(license: Constraint) {
|
|
491
543
|
return pipe(
|
|
492
544
|
createElement('gmd:resourceConstraints'),
|
|
493
545
|
createChild('gmd:MD_LegalConstraints'),
|
|
@@ -728,43 +780,71 @@ export function writeContacts(record: CatalogRecord, rootEl: XmlElement) {
|
|
|
728
780
|
export function writeKeywords(record: CatalogRecord, rootEl: XmlElement) {
|
|
729
781
|
pipe(
|
|
730
782
|
findOrCreateIdentification(),
|
|
731
|
-
removeKeywords(
|
|
732
|
-
appendKeywords(record.keywords
|
|
783
|
+
removeKeywords(),
|
|
784
|
+
appendKeywords(record.keywords)
|
|
785
|
+
)(rootEl)
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
export function writeTopics(record: CatalogRecord, rootEl: XmlElement) {
|
|
789
|
+
pipe(
|
|
790
|
+
findOrCreateIdentification(),
|
|
791
|
+
removeChildrenByName('gmd:topicCategory'),
|
|
792
|
+
appendChildren(
|
|
793
|
+
...record.topics.map((topic) =>
|
|
794
|
+
pipe(
|
|
795
|
+
createElement('gmd:topicCategory'),
|
|
796
|
+
createChild('gmd:MD_TopicCategoryCode'),
|
|
797
|
+
setTextContent(topic)
|
|
798
|
+
)
|
|
799
|
+
)
|
|
800
|
+
)
|
|
733
801
|
)(rootEl)
|
|
734
802
|
}
|
|
735
803
|
|
|
736
|
-
export function
|
|
804
|
+
export function writeLicenses(record: CatalogRecord, rootEl: XmlElement) {
|
|
737
805
|
pipe(
|
|
738
806
|
findOrCreateIdentification(),
|
|
739
|
-
|
|
740
|
-
|
|
807
|
+
removeLicenses(),
|
|
808
|
+
appendChildren(...record.licenses.map(createLicense))
|
|
741
809
|
)(rootEl)
|
|
742
810
|
}
|
|
743
811
|
|
|
744
|
-
export function
|
|
812
|
+
export function writeLegalConstraints(
|
|
745
813
|
record: CatalogRecord,
|
|
746
814
|
rootEl: XmlElement
|
|
747
815
|
) {
|
|
748
816
|
pipe(
|
|
749
817
|
findOrCreateIdentification(),
|
|
750
|
-
|
|
751
|
-
appendChildren(
|
|
818
|
+
removeLegalConstraints(),
|
|
819
|
+
appendChildren(
|
|
820
|
+
...record.legalConstraints.map((c) => createConstraint(c, 'legal'))
|
|
821
|
+
)
|
|
752
822
|
)(rootEl)
|
|
753
823
|
}
|
|
754
824
|
|
|
755
|
-
export function
|
|
825
|
+
export function writeSecurityConstraints(
|
|
826
|
+
record: CatalogRecord,
|
|
827
|
+
rootEl: XmlElement
|
|
828
|
+
) {
|
|
756
829
|
pipe(
|
|
757
830
|
findOrCreateIdentification(),
|
|
758
|
-
|
|
759
|
-
appendChildren(
|
|
831
|
+
removeSecurityConstraints(),
|
|
832
|
+
appendChildren(
|
|
833
|
+
...record.securityConstraints.map((c) => createConstraint(c, 'security'))
|
|
834
|
+
)
|
|
760
835
|
)(rootEl)
|
|
761
836
|
}
|
|
762
837
|
|
|
763
|
-
export function
|
|
838
|
+
export function writeOtherConstraints(
|
|
839
|
+
record: CatalogRecord,
|
|
840
|
+
rootEl: XmlElement
|
|
841
|
+
) {
|
|
764
842
|
pipe(
|
|
765
843
|
findOrCreateIdentification(),
|
|
766
|
-
|
|
767
|
-
appendChildren(
|
|
844
|
+
removeOtherConstraints(),
|
|
845
|
+
appendChildren(
|
|
846
|
+
...record.otherConstraints.map((c) => createConstraint(c, 'other'))
|
|
847
|
+
)
|
|
768
848
|
)(rootEl)
|
|
769
849
|
}
|
|
770
850
|
|