geonetwork-ui 2.11.0-dev.8442dae6e → 2.11.0-dev.a2881de31
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/fesm2022/geonetwork-ui.mjs +127 -149
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/index.d.ts +4 -6
- package/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/libs/api/metadata-converter/src/lib/fixtures/generic.records.ts +5 -5
- package/src/libs/api/metadata-converter/src/lib/fixtures/metawal.records.ts +5 -5
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.ts +2 -2
- package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +5 -9
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +2 -2
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +2 -18
- package/src/libs/api/metadata-converter/src/lib/iso19139/utils/association-type.mapper.ts +0 -12
|
@@ -587,7 +587,7 @@ export function writeAssociatedRecords(
|
|
|
587
587
|
removeChildrenByName('mri:associatedResource'),
|
|
588
588
|
appendChildren(
|
|
589
589
|
...record.associatedRecords
|
|
590
|
-
.filter((assoc) => assoc.
|
|
590
|
+
.filter((assoc) => assoc.uuid && assoc.associationType)
|
|
591
591
|
.map((assoc) =>
|
|
592
592
|
pipe(
|
|
593
593
|
createNestedElement(
|
|
@@ -608,7 +608,7 @@ export function writeAssociatedRecords(
|
|
|
608
608
|
),
|
|
609
609
|
pipe(
|
|
610
610
|
createElement('mri:metadataReference'),
|
|
611
|
-
writeAttribute('uuidref', assoc.
|
|
611
|
+
writeAttribute('uuidref', assoc.uuid)
|
|
612
612
|
)
|
|
613
613
|
)
|
|
614
614
|
)
|
|
@@ -51,7 +51,6 @@ import {
|
|
|
51
51
|
readText,
|
|
52
52
|
XmlElement,
|
|
53
53
|
} from '../xml-utils'
|
|
54
|
-
import { getAssociationTypeFromCode } from './utils/association-type.mapper'
|
|
55
54
|
import { readGeometry } from './utils/geometry'
|
|
56
55
|
import { fullNameToParts } from './utils/individual-name'
|
|
57
56
|
import { getKeywordTypeFromKeywordTypeCode } from './utils/keyword.mapper'
|
|
@@ -932,22 +931,19 @@ export function readSourceRecords(rootEl: XmlElement): SourceRecord[] {
|
|
|
932
931
|
export function extractAssociatedRecords(
|
|
933
932
|
containerName: string,
|
|
934
933
|
aggregateName: string,
|
|
935
|
-
|
|
934
|
+
readUuid: ChainableFunction<XmlElement, string>
|
|
936
935
|
): ChainableFunction<XmlElement, AssociatedRecord[]> {
|
|
937
936
|
return pipe(
|
|
938
937
|
findChildrenElement(containerName, false),
|
|
939
938
|
mapArray((el) => {
|
|
940
939
|
const aggregateEl = findChildElement(aggregateName, false)(el)
|
|
941
|
-
const
|
|
942
|
-
const
|
|
940
|
+
const uuid = readUuid(aggregateEl)
|
|
941
|
+
const associationType = pipe(
|
|
943
942
|
findNestedElement('gmd:associationType', 'gmd:DS_AssociationTypeCode'),
|
|
944
943
|
readAttribute('codeListValue')
|
|
945
944
|
)(aggregateEl)
|
|
946
|
-
if (!
|
|
947
|
-
return {
|
|
948
|
-
uniqueIdentifier,
|
|
949
|
-
associationType: getAssociationTypeFromCode(associationTypeCode),
|
|
950
|
-
}
|
|
945
|
+
if (!uuid || !associationType) return null
|
|
946
|
+
return { uuid, associationType }
|
|
951
947
|
}),
|
|
952
948
|
filterArray((r): r is AssociatedRecord => r !== null)
|
|
953
949
|
)
|
|
@@ -1276,7 +1276,7 @@ export function writeAssociatedRecords(
|
|
|
1276
1276
|
removeChildrenByName('gmd:aggregationInfo'),
|
|
1277
1277
|
appendChildren(
|
|
1278
1278
|
...record.associatedRecords
|
|
1279
|
-
.filter((assoc) => assoc.
|
|
1279
|
+
.filter((assoc) => assoc.uuid && assoc.associationType)
|
|
1280
1280
|
.map((assoc) =>
|
|
1281
1281
|
pipe(
|
|
1282
1282
|
createNestedElement(
|
|
@@ -1290,7 +1290,7 @@ export function writeAssociatedRecords(
|
|
|
1290
1290
|
'gmd:MD_Identifier',
|
|
1291
1291
|
'gmd:code'
|
|
1292
1292
|
),
|
|
1293
|
-
writeCharacterString(assoc.
|
|
1293
|
+
writeCharacterString(assoc.uuid)
|
|
1294
1294
|
),
|
|
1295
1295
|
pipe(
|
|
1296
1296
|
createNestedElement(
|
|
@@ -260,28 +260,12 @@ export interface SourceRecord {
|
|
|
260
260
|
href?: string
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
-
// DS_AssociationTypeCode values of the ISO19115-3 codelist, any unrecognized value
|
|
264
|
-
// being mapped to 'crossReference'
|
|
265
|
-
export const associationTypeValues = [
|
|
266
|
-
'crossReference',
|
|
267
|
-
'largerWorkCitation',
|
|
268
|
-
'partOfSeamlessDatabase',
|
|
269
|
-
'stereoMate',
|
|
270
|
-
'isComposedOf',
|
|
271
|
-
'collectiveTitle',
|
|
272
|
-
'series',
|
|
273
|
-
'dependency',
|
|
274
|
-
'revisionOf',
|
|
275
|
-
] as const
|
|
276
|
-
|
|
277
|
-
export type AssociationType = (typeof associationTypeValues)[number]
|
|
278
|
-
|
|
279
263
|
/**
|
|
280
264
|
* Represents another record associated with this one (e.g. a parent/sibling dataset).
|
|
281
265
|
*/
|
|
282
266
|
export interface AssociatedRecord {
|
|
283
|
-
|
|
284
|
-
associationType:
|
|
267
|
+
uuid: string
|
|
268
|
+
associationType: string
|
|
285
269
|
}
|
|
286
270
|
|
|
287
271
|
export interface DatasetRecord extends BaseRecord {
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AssociationType,
|
|
3
|
-
associationTypeValues,
|
|
4
|
-
} from '../../../../../../../libs/common/domain/src/lib/model/record'
|
|
5
|
-
|
|
6
|
-
export function getAssociationTypeFromCode(
|
|
7
|
-
associationTypeCode: string
|
|
8
|
-
): AssociationType {
|
|
9
|
-
return associationTypeValues.includes(associationTypeCode as AssociationType)
|
|
10
|
-
? (associationTypeCode as AssociationType)
|
|
11
|
-
: 'crossReference'
|
|
12
|
-
}
|