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.
Files changed (222) hide show
  1. package/esm2022/libs/api/metadata-converter/src/lib/gn4/atomic-operations.mjs +27 -1
  2. package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +64 -61
  3. package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.mjs +7 -4
  4. package/esm2022/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.mjs +1 -1
  5. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/codelists/keyword.mapper.mjs +14 -0
  6. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/converter.mjs +25 -17
  7. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +55 -23
  8. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +52 -32
  9. package/esm2022/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.mjs +2 -2
  10. package/esm2022/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.mjs +10 -3
  11. package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.mjs +14 -5
  12. package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.mjs +33 -8
  13. package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
  14. package/esm2022/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.mjs +1 -1
  15. package/esm2022/libs/common/domain/src/lib/platform.service.interface.mjs +1 -1
  16. package/esm2022/libs/feature/editor/src/index.mjs +6 -1
  17. package/esm2022/libs/feature/editor/src/lib/+state/editor.actions.mjs +8 -0
  18. package/esm2022/libs/feature/editor/src/lib/+state/editor.effects.mjs +26 -0
  19. package/esm2022/libs/feature/editor/src/lib/+state/editor.facade.mjs +30 -0
  20. package/esm2022/libs/feature/editor/src/lib/+state/editor.models.mjs +2 -0
  21. package/esm2022/libs/feature/editor/src/lib/+state/editor.reducer.mjs +42 -0
  22. package/esm2022/libs/feature/editor/src/lib/+state/editor.selectors.mjs +13 -0
  23. package/esm2022/libs/feature/editor/src/lib/expressions.mjs +13 -0
  24. package/esm2022/libs/feature/editor/src/lib/feature-editor.module.mjs +16 -4
  25. package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +34 -0
  26. package/esm2022/libs/feature/editor/src/lib/models/fields.model.mjs +2 -0
  27. package/esm2022/libs/feature/editor/src/lib/record-form/record-form.component.mjs +15 -11
  28. package/esm2022/libs/feature/editor/src/lib/services/editor.service.mjs +22 -44
  29. package/esm2022/libs/feature/map/src/lib/map-context/map-context.service.mjs +9 -1
  30. package/esm2022/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.mjs +13 -13
  31. package/esm2022/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.mjs +3 -3
  32. package/esm2022/libs/feature/search/src/lib/utils/service/fields.mjs +41 -26
  33. package/esm2022/libs/feature/search/src/lib/utils/service/fields.service.mjs +11 -9
  34. package/esm2022/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.mjs +3 -3
  35. package/esm2022/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.mjs +3 -3
  36. package/esm2022/libs/ui/elements/src/lib/max-lines/max-lines.component.mjs +5 -3
  37. package/esm2022/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.mjs +3 -3
  38. package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +47 -22
  39. package/esm2022/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.mjs +3 -4
  40. package/esm2022/libs/ui/elements/src/lib/thumbnail/thumbnail.component.mjs +3 -3
  41. package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +4 -4
  42. package/esm2022/libs/ui/inputs/src/lib/button/button.component.mjs +9 -9
  43. package/esm2022/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.mjs +3 -3
  44. package/esm2022/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.mjs +3 -3
  45. package/esm2022/libs/ui/inputs/src/lib/form-field/form-field.component.mjs +4 -2
  46. package/esm2022/libs/ui/inputs/src/lib/form-field/form-field.model.mjs +1 -1
  47. package/esm2022/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.mjs +3 -3
  48. package/esm2022/libs/ui/inputs/src/lib/text-area/text-area.component.mjs +3 -3
  49. package/esm2022/libs/ui/inputs/src/lib/ui-inputs.module.mjs +6 -6
  50. package/esm2022/libs/ui/layout/src/lib/carousel/carousel.component.mjs +3 -3
  51. package/esm2022/libs/ui/widgets/src/lib/badge/badge.component.mjs +3 -3
  52. package/esm2022/libs/util/i18n/src/lib/i18n.constants.mjs +18 -1
  53. package/esm2022/libs/util/shared/src/lib/utils/index.mjs +2 -1
  54. package/esm2022/libs/util/shared/src/lib/utils/temporal-extent-union.mjs +32 -0
  55. package/esm2022/translations/de.json +37 -27
  56. package/esm2022/translations/en.json +32 -22
  57. package/esm2022/translations/es.json +27 -17
  58. package/esm2022/translations/fr.json +50 -40
  59. package/esm2022/translations/it.json +44 -34
  60. package/esm2022/translations/nl.json +28 -18
  61. package/esm2022/translations/pt.json +27 -17
  62. package/fesm2022/geonetwork-ui.mjs +972 -527
  63. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  64. package/libs/api/metadata-converter/src/lib/gn4/atomic-operations.d.ts +2 -0
  65. package/libs/api/metadata-converter/src/lib/gn4/atomic-operations.d.ts.map +1 -1
  66. package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts +0 -1
  67. package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
  68. package/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.d.ts.map +1 -1
  69. package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts +4 -5
  70. package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts.map +1 -1
  71. package/libs/api/metadata-converter/src/lib/iso19139/codelists/keyword.mapper.d.ts +3 -0
  72. package/libs/api/metadata-converter/src/lib/iso19139/codelists/keyword.mapper.d.ts.map +1 -0
  73. package/libs/api/metadata-converter/src/lib/iso19139/converter.d.ts.map +1 -1
  74. package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts +7 -6
  75. package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts.map +1 -1
  76. package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts +4 -3
  77. package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
  78. package/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.d.ts.map +1 -1
  79. package/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.d.ts.map +1 -1
  80. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.d.ts +1 -1
  81. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.d.ts.map +1 -1
  82. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts +9 -2
  83. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts.map +1 -1
  84. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +21 -12
  85. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
  86. package/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.d.ts +1 -0
  87. package/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.d.ts.map +1 -1
  88. package/libs/common/domain/src/lib/platform.service.interface.d.ts +1 -1
  89. package/libs/common/domain/src/lib/platform.service.interface.d.ts.map +1 -1
  90. package/libs/feature/editor/src/index.d.ts +5 -0
  91. package/libs/feature/editor/src/index.d.ts.map +1 -1
  92. package/libs/feature/editor/src/lib/+state/editor.actions.d.ts +23 -0
  93. package/libs/feature/editor/src/lib/+state/editor.actions.d.ts.map +1 -0
  94. package/libs/feature/editor/src/lib/+state/editor.effects.d.ts +15 -0
  95. package/libs/feature/editor/src/lib/+state/editor.effects.d.ts.map +1 -0
  96. package/libs/feature/editor/src/lib/+state/editor.facade.d.ts +19 -0
  97. package/libs/feature/editor/src/lib/+state/editor.facade.d.ts.map +1 -0
  98. package/libs/feature/editor/src/lib/+state/editor.models.d.ts +2 -0
  99. package/libs/feature/editor/src/lib/+state/editor.models.d.ts.map +1 -0
  100. package/libs/feature/editor/src/lib/+state/editor.reducer.d.ts +18 -0
  101. package/libs/feature/editor/src/lib/+state/editor.reducer.d.ts.map +1 -0
  102. package/libs/feature/editor/src/lib/+state/editor.selectors.d.ts +15 -0
  103. package/libs/feature/editor/src/lib/+state/editor.selectors.d.ts.map +1 -0
  104. package/libs/feature/editor/src/lib/expressions.d.ts +4 -0
  105. package/libs/feature/editor/src/lib/expressions.d.ts.map +1 -0
  106. package/libs/feature/editor/src/lib/feature-editor.module.d.ts +3 -1
  107. package/libs/feature/editor/src/lib/feature-editor.module.d.ts.map +1 -1
  108. package/libs/feature/editor/src/lib/fields.config.d.ts +3 -0
  109. package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -0
  110. package/libs/feature/editor/src/lib/models/fields.model.d.ts +15 -0
  111. package/libs/feature/editor/src/lib/models/fields.model.d.ts.map +1 -0
  112. package/libs/feature/editor/src/lib/record-form/record-form.component.d.ts +10 -5
  113. package/libs/feature/editor/src/lib/record-form/record-form.component.d.ts.map +1 -1
  114. package/libs/feature/editor/src/lib/services/editor.service.d.ts +3 -13
  115. package/libs/feature/editor/src/lib/services/editor.service.d.ts.map +1 -1
  116. package/libs/feature/map/src/lib/map-context/map-context.service.d.ts +1 -0
  117. package/libs/feature/map/src/lib/map-context/map-context.service.d.ts.map +1 -1
  118. package/libs/feature/search/src/lib/utils/service/fields.d.ts +21 -8
  119. package/libs/feature/search/src/lib/utils/service/fields.d.ts.map +1 -1
  120. package/libs/feature/search/src/lib/utils/service/fields.service.d.ts.map +1 -1
  121. package/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.d.ts +1 -1
  122. package/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.d.ts.map +1 -1
  123. package/libs/ui/elements/src/lib/max-lines/max-lines.component.d.ts.map +1 -1
  124. package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts +16 -6
  125. package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts.map +1 -1
  126. package/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.d.ts.map +1 -1
  127. package/libs/ui/elements/src/lib/ui-elements.module.d.ts +13 -13
  128. package/libs/ui/inputs/src/lib/button/button.component.d.ts +1 -1
  129. package/libs/ui/inputs/src/lib/button/button.component.d.ts.map +1 -1
  130. package/libs/ui/inputs/src/lib/form-field/form-field.component.d.ts.map +1 -1
  131. package/libs/ui/inputs/src/lib/form-field/form-field.model.d.ts +0 -1
  132. package/libs/ui/inputs/src/lib/form-field/form-field.model.d.ts.map +1 -1
  133. package/libs/ui/inputs/src/lib/text-area/text-area.component.d.ts +1 -1
  134. package/libs/ui/inputs/src/lib/text-area/text-area.component.d.ts.map +1 -1
  135. package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts +40 -40
  136. package/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.d.ts +1 -1
  137. package/libs/util/i18n/src/lib/i18n.constants.d.ts +17 -0
  138. package/libs/util/i18n/src/lib/i18n.constants.d.ts.map +1 -1
  139. package/libs/util/shared/src/lib/utils/index.d.ts +1 -0
  140. package/libs/util/shared/src/lib/utils/index.d.ts.map +1 -1
  141. package/libs/util/shared/src/lib/utils/temporal-extent-union.d.ts +5 -0
  142. package/libs/util/shared/src/lib/utils/temporal-extent-union.d.ts.map +1 -0
  143. package/package.json +1 -1
  144. package/src/libs/api/metadata-converter/src/lib/fixtures/generic.records.ts +63 -8
  145. package/src/libs/api/metadata-converter/src/lib/fixtures/geo2france.records.ts +57 -9
  146. package/src/libs/api/metadata-converter/src/lib/fixtures/geocat-ch.records.ts +229 -24
  147. package/src/libs/api/metadata-converter/src/lib/gn4/atomic-operations.ts +29 -0
  148. package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +99 -76
  149. package/src/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.ts +6 -3
  150. package/src/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.ts +4 -5
  151. package/src/libs/api/metadata-converter/src/lib/iso19139/codelists/keyword.mapper.ts +16 -0
  152. package/src/libs/api/metadata-converter/src/lib/iso19139/converter.ts +30 -21
  153. package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +120 -63
  154. package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +177 -97
  155. package/src/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +1 -1
  156. package/src/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.ts +22 -2
  157. package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.ts +15 -4
  158. package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +47 -8
  159. package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +25 -14
  160. package/src/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.ts +1 -0
  161. package/src/libs/common/domain/src/lib/platform.service.interface.ts +1 -4
  162. package/src/libs/common/fixtures/src/lib/elasticsearch/full-response.ts +1 -1
  163. package/src/libs/common/fixtures/src/lib/gn4/groups.fixtures.ts +1 -1
  164. package/src/libs/common/fixtures/src/lib/records.fixtures.ts +52 -10
  165. package/src/libs/feature/editor/src/index.ts +5 -0
  166. package/src/libs/feature/editor/src/lib/+state/editor.actions.ts +24 -0
  167. package/src/libs/feature/editor/src/lib/+state/editor.effects.ts +49 -0
  168. package/src/libs/feature/editor/src/lib/+state/editor.facade.ts +30 -0
  169. package/src/libs/feature/editor/src/lib/+state/editor.models.ts +1 -0
  170. package/src/libs/feature/editor/src/lib/+state/editor.reducer.ts +68 -0
  171. package/src/libs/feature/editor/src/lib/+state/editor.selectors.ts +39 -0
  172. package/src/libs/feature/editor/src/lib/expressions.ts +16 -0
  173. package/src/libs/feature/editor/src/lib/feature-editor.module.ts +11 -0
  174. package/src/libs/feature/editor/src/lib/fields.config.ts +35 -0
  175. package/src/libs/feature/editor/src/lib/models/fields.model.ts +29 -0
  176. package/src/libs/feature/editor/src/lib/record-form/record-form.component.html +9 -7
  177. package/src/libs/feature/editor/src/lib/record-form/record-form.component.ts +11 -5
  178. package/src/libs/feature/editor/src/lib/services/editor.service.ts +34 -73
  179. package/src/libs/feature/map/src/lib/map-context/map-context.service.ts +10 -0
  180. package/src/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.ts +12 -12
  181. package/src/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.html +3 -4
  182. package/src/libs/feature/search/src/lib/utils/service/fields.service.ts +21 -16
  183. package/src/libs/feature/search/src/lib/utils/service/fields.ts +43 -34
  184. package/src/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.html +1 -1
  185. package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.css +5 -0
  186. package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.html +39 -0
  187. package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.ts +58 -0
  188. package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.css +2 -2
  189. package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.ts +1 -0
  190. package/src/libs/ui/elements/src/lib/max-lines/max-lines.component.html +5 -1
  191. package/src/libs/ui/elements/src/lib/max-lines/max-lines.component.ts +1 -0
  192. package/src/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.html +1 -1
  193. package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +169 -52
  194. package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.ts +51 -15
  195. package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.ts +2 -3
  196. package/src/libs/ui/elements/src/lib/thumbnail/thumbnail.component.html +2 -2
  197. package/src/libs/ui/elements/src/lib/ui-elements.module.ts +1 -1
  198. package/src/libs/ui/inputs/src/lib/button/button.component.css +0 -5
  199. package/src/libs/ui/inputs/src/lib/button/button.component.html +0 -1
  200. package/src/libs/ui/inputs/src/lib/button/button.component.ts +7 -6
  201. package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.html +1 -1
  202. package/src/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.html +3 -1
  203. package/src/libs/ui/inputs/src/lib/form-field/form-field.component.ts +3 -1
  204. package/src/libs/ui/inputs/src/lib/form-field/form-field.model.ts +0 -1
  205. package/src/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.css +3 -0
  206. package/src/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.html +1 -1
  207. package/src/libs/ui/inputs/src/lib/text-area/text-area.component.ts +1 -0
  208. package/src/libs/ui/inputs/src/lib/ui-inputs.module.ts +2 -2
  209. package/src/libs/ui/layout/src/lib/carousel/carousel.component.html +1 -0
  210. package/src/libs/ui/widgets/src/lib/badge/badge.component.html +3 -1
  211. package/src/libs/util/i18n/src/lib/i18n.constants.ts +18 -0
  212. package/src/libs/util/shared/src/lib/utils/index.ts +1 -0
  213. package/src/libs/util/shared/src/lib/utils/temporal-extent-union.ts +32 -0
  214. package/tailwind.base.css +44 -15
  215. package/translations/de.json +37 -27
  216. package/translations/en.json +32 -22
  217. package/translations/es.json +27 -17
  218. package/translations/fr.json +50 -40
  219. package/translations/it.json +44 -34
  220. package/translations/nl.json +28 -18
  221. package/translations/pt.json +27 -17
  222. 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 { LangService } from '../../../../../../libs/util/i18n/src'
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
- themes: [
96
- ...(output.themes || []),
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
- tag: (output, source) => ({
192
+ allKeywords: (output, source) => ({
175
193
  ...output,
176
- keywords: getAsArray(
177
- selectField<SourceWithUnknownProps[]>(source, 'tag')
178
- ).map((tag) => selectTranslatedValue<string>(tag, this.lang3)),
194
+ keywords: mapKeywords(
195
+ selectField<Thesaurus[]>(source, 'allKeywords'),
196
+ this.lang3
197
+ ),
179
198
  }),
180
199
  inspireTheme: (output, source) => ({
181
200
  ...output,
182
- themes: [
183
- ...(output.themes || []),
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('MD_ConstraintsUseLimitationObject', output, source),
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
- 'MD_LegalConstraintsUseLimitationObject',
214
+ 'legal',
192
215
  output,
193
- source
216
+ getAsArray(
217
+ selectField(source, 'MD_LegalConstraintsUseLimitationObject')
218
+ )
194
219
  ),
195
220
  MD_LegalConstraintsOtherConstraintsObject: (output, source) =>
196
221
  this.constraintField(
197
- 'MD_LegalConstraintsOtherConstraintsObject',
222
+ 'legal',
198
223
  output,
199
- source
224
+ getAsArray(
225
+ selectField(source, 'MD_LegalConstraintsOtherConstraintsObject')
226
+ )
200
227
  ),
201
228
  MD_SecurityConstraintsUseLimitationObject: (output, source) =>
202
229
  this.constraintField(
203
- 'MD_SecurityConstraintsUseLimitationObject',
230
+ 'security',
204
231
  output,
205
- source
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
- resourceTemporalDateRange: (output, source) => {
311
+ resourceTemporalExtentDateRange: (output, source) => {
289
312
  const ranges = getAsArray(
290
- selectField(source, 'resourceTemporalDateRange')
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 = (fieldName: string, output, source) => ({
309
- ...output,
310
- ...(fieldName.endsWith('UseLimitationObject')
311
- ? {
312
- legalConstraints:
313
- fieldName === 'MD_LegalConstraintsUseLimitationObject'
314
- ? [
315
- ...(output.legalConstraints || []),
316
- ...selectField<SourceWithUnknownProps[]>(
317
- source,
318
- fieldName
319
- ).map((source: SourceWithUnknownProps) =>
320
- selectTranslatedValue(source, this.lang3)
321
- ),
322
- ]
323
- : output.legalConstraints || [],
324
- useLimitations: [
325
- ...(output.useLimitations || []),
326
- ...selectField<SourceWithUnknownProps[]>(source, fieldName).map(
327
- (source: SourceWithUnknownProps) =>
328
- selectTranslatedValue(source, this.lang3)
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
- accessConstraints: [
334
- ...(output.accessConstraints || []),
335
- ...selectField<SourceWithUnknownProps[]>(source, fieldName).map(
336
- (field) => ({
337
- text: selectTranslatedValue(field, this.lang3),
338
- type: this.getConstraintsType(fieldName),
339
- })
340
- ),
341
- ],
342
- }),
343
- })
344
-
345
- private getConstraintsType(indexField: string): AccessConstraintType {
346
- switch (indexField) {
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
- themes: [],
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: 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: Keywords
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
- writeThemes,
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 themes = readThemes(rootEl)
78
- const accessConstraints = readAccessConstraints(rootEl)
79
- const useLimitations = readUseLimitations(rootEl)
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
- themes,
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
- themes,
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('themes') && writeThemes(record, rootEl)
167
- fieldChanged('accessConstraints') && writeAccessConstraints(record, rootEl)
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('useLimitations') && writeUseLimitations(record, rootEl)
178
+ fieldChanged('otherConstraints') && writeOtherConstraints(record, rootEl)
170
179
 
171
180
  if (record.kind === 'dataset') {
172
181
  writeStatus(record, rootEl)