-
Notifications
You must be signed in to change notification settings - Fork 1
/
patch-core-for-dcat-plugin.patch
609 lines (577 loc) · 27.4 KB
/
patch-core-for-dcat-plugin.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
From 961428a6ad2825385f0c84a6171dc54bcce2b5b3 Mon Sep 17 00:00:00 2001
From: Mathieu Chaussier <mathieu.chaussier@gim.be>
Date: Thu, 20 Jun 2024 09:48:09 +0200
Subject: [PATCH] Patch core for DCAT2 plugin
---
.../geonet/kernel/search/EsSearchManager.java | 1 +
.../java/org/fao/geonet/util/XslUtil.java | 84 ++++++++++++++++++-
.../HarvesterSettingRepository.java | 11 +++
.../harvest/harvester/csw/CswHarvester.java | 2 +
.../harvest/harvester/csw/CswParams.java | 11 +++
.../harvester/geonet/GeonetHarvester.java | 3 +
.../harvester/geonet/GeonetParams.java | 12 +++
.../plugin/iso19139/index-fields/index.xsl | 71 ++++++++++++++++
.../fao/geonet/api/records/MetadataUtils.java | 22 +++--
.../resources/catalog/locales/en-admin.json | 6 +-
.../resources/catalog/locales/fr-admin.json | 9 +-
.../resources/catalog/locales/nl-admin.json | 8 +-
.../templates/admin/harvest/type/csw.html | 17 ++++
.../templates/admin/harvest/type/csw.js | 4 +-
.../admin/harvest/type/geonetwork.html | 16 ++++
.../admin/harvest/type/geonetwork.js | 4 +-
.../main/webapp/xsl/xml/harvesting/csw.xsl | 3 +
.../webapp/xsl/xml/harvesting/geonetwork.xsl | 3 +
18 files changed, 271 insertions(+), 16 deletions(-)
diff --git a/core/src/main/java/org/fao/geonet/kernel/search/EsSearchManager.java b/core/src/main/java/org/fao/geonet/kernel/search/EsSearchManager.java
index 978ab63a75..13d7cfd9e5 100644
--- a/core/src/main/java/org/fao/geonet/kernel/search/EsSearchManager.java
+++ b/core/src/main/java/org/fao/geonet/kernel/search/EsSearchManager.java
@@ -137,6 +137,7 @@ public class EsSearchManager implements ISearchManager {
.add(Geonet.IndexFieldNames.RESOURCEABSTRACT)
.add(Geonet.IndexFieldNames.RESOURCEABSTRACT + "Object")
.add("operatesOn")
+ .add("rdfResourceIdentifier")
.build();
FIELDLIST_RELATED_SCRIPTED = ImmutableMap.<String, String>builder()
diff --git a/core/src/main/java/org/fao/geonet/util/XslUtil.java b/core/src/main/java/org/fao/geonet/util/XslUtil.java
index 34b9ae272e..438ea0d8ef 100644
--- a/core/src/main/java/org/fao/geonet/util/XslUtil.java
+++ b/core/src/main/java/org/fao/geonet/util/XslUtil.java
@@ -23,6 +23,7 @@
package org.fao.geonet.util;
+import co.elastic.clients.elasticsearch.core.SearchResponse;
import co.elastic.clients.elasticsearch.core.search.Hit;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -54,6 +55,7 @@ import org.fao.geonet.api.records.attachments.Store;
import org.fao.geonet.constants.Geonet;
import org.fao.geonet.domain.*;
import org.fao.geonet.kernel.*;
+import org.fao.geonet.kernel.datamanager.IMetadataUtils;
import org.fao.geonet.kernel.datamanager.base.BaseMetadataUtils;
import org.fao.geonet.kernel.search.CodeListTranslator;
import org.fao.geonet.kernel.search.EsSearchManager;
@@ -61,13 +63,11 @@ import org.fao.geonet.kernel.search.Translator;
import org.fao.geonet.kernel.security.SecurityProviderConfiguration;
import org.fao.geonet.kernel.setting.SettingInfo;
import org.fao.geonet.kernel.setting.SettingManager;
+import org.fao.geonet.kernel.setting.Settings;
import org.fao.geonet.kernel.url.UrlChecker;
import org.fao.geonet.languages.IsoLanguagesMapper;
import org.fao.geonet.lib.Lib;
-import org.fao.geonet.repository.IsoLanguageRepository;
-import org.fao.geonet.repository.SourceRepository;
-import org.fao.geonet.repository.UiSettingsRepository;
-import org.fao.geonet.repository.UserRepository;
+import org.fao.geonet.repository.*;
import org.fao.geonet.schema.iso19139.ISO19139Namespaces;
import org.fao.geonet.utils.Log;
import org.fao.geonet.utils.Xml;
@@ -1608,4 +1608,80 @@ public final class XslUtil {
return webAnalyticsConfiguration.getJavascriptCode();
}
+
+ // DCAT Custom
+ public static String getThesaurusTitleByName(String id) {
+ ApplicationContext applicationContext = ApplicationContextHolder.get();
+ ThesaurusManager thesaurusManager = applicationContext.getBean(ThesaurusManager.class);
+ Thesaurus thesaurus = thesaurusManager.getThesaurusByName(id);
+ return thesaurus == null ? "" : thesaurus.getTitle();
+ }
+
+ /**
+ * DCAT custom
+ * Generate a UUID based off a string for consistent results
+ *
+ * @param str
+ * @return UUID string
+ */
+ public static String uuidFromString(String str) {
+ return UUID.nameUUIDFromBytes(str.getBytes()).toString();
+ }
+
+ // DCAT Custom
+ public static String getRecordResourceURI(String uuid) {
+ var searchManager = ApplicationContextHolder.get().getBean(EsSearchManager.class);
+
+ try {
+ Set<String> source = new HashSet<>();
+ source.add("rdfResourceIdentifier");
+ SearchResponse response = searchManager.query(String.format("+uuid:%s", uuid), null, source, 0, 1);
+
+ if (response.hits().hits().isEmpty()) {
+ return null;
+ }
+ ObjectMapper objectMapper = new ObjectMapper();
+
+ Hit h = (Hit) response.hits().hits().get(0);
+ Object rdfResourceIdentifier = objectMapper.convertValue(h.source(), Map.class).get("rdfResourceIdentifier");
+ if (rdfResourceIdentifier instanceof String) {
+ return (String) rdfResourceIdentifier;
+ } else if (rdfResourceIdentifier instanceof ArrayList) {
+ return ((ArrayList<String>) rdfResourceIdentifier).get(0);
+ } else {
+ throw new Exception("Cannot obtain resource URI from " + rdfResourceIdentifier.toString());
+ }
+
+ } catch (Exception e) {
+ Log.error(Log.JEEVES, "GET Record resource identifier '" + uuid + "' error: " + e.getMessage(), e);
+ }
+ return null;
+ }
+
+ /**
+ * DCAT Custom
+ * Get the metadata URI build pattern based on the source catalog
+ *
+ * @param uuid
+ */
+ public static String getUriPattern(String uuid) {
+ ApplicationContext context = ApplicationContextHolder.get();
+ IMetadataUtils metadataUtils = context.getBean(IMetadataUtils.class);
+
+ AbstractMetadata metadata = metadataUtils.findOneByUuid(uuid);
+
+ if (metadata != null && metadata.getHarvestInfo().isHarvested()) {
+ HarvesterSettingRepository harvesterSetting = context.getBean(HarvesterSettingRepository.class);
+ HarvesterSetting uuidSetting = harvesterSetting.findOneByNameAndStoredValueLike("uuid", metadata.getHarvestInfo().getUuid());
+ if (uuidSetting != null && uuidSetting.getParent() != null) {
+ List<HarvesterSetting> resourceUriPatternSetting = harvesterSetting.findChildrenByName(uuidSetting.getParent().getId(), "resourceUriPattern");
+ if (resourceUriPatternSetting.size() > 0 && StringUtils.isNotEmpty(resourceUriPatternSetting.get(0).getValue())) {
+ return resourceUriPatternSetting.get(0).getValue();
+ }
+ }
+ }
+
+ SettingManager sm = context.getBean(SettingManager.class);
+ return sm.getValue(Settings.SYSTEM_RESOURCE_PREFIX) + "/{resourceType}/{resourceUuid}";
+ }
}
diff --git a/domain/src/main/java/org/fao/geonet/repository/HarvesterSettingRepository.java b/domain/src/main/java/org/fao/geonet/repository/HarvesterSettingRepository.java
index c28295c8b6..88bfc88c97 100644
--- a/domain/src/main/java/org/fao/geonet/repository/HarvesterSettingRepository.java
+++ b/domain/src/main/java/org/fao/geonet/repository/HarvesterSettingRepository.java
@@ -74,4 +74,15 @@ public interface HarvesterSettingRepository extends GeonetRepository<HarvesterSe
*/
@Nullable
HarvesterSetting findOneByNameAndStoredValue(@Nonnull String name, @Nonnull String value);
+
+ /**
+ * DCAT custom
+ * Find the settings with the given name and value. Null is returned if not found.
+ *
+ * @param name the setting name.
+ * @param value the setting value.
+ * @return The setting with the given name and value.
+ */
+ @Nullable
+ HarvesterSetting findOneByNameAndStoredValueLike(@Nonnull String name, @Nonnull String value);
}
diff --git a/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/csw/CswHarvester.java b/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/csw/CswHarvester.java
index 97a5b2fae7..a6db09fee5 100644
--- a/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/csw/CswHarvester.java
+++ b/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/csw/CswHarvester.java
@@ -60,6 +60,8 @@ public class CswHarvester extends AbstractHarvester<HarvestResult, CswParams> {
harvesterSettingsManager.add("id:" + siteId, "xslfilter", params.xslfilter);
harvesterSettingsManager.add("id:" + siteId, "outputSchema", params.outputSchema);
harvesterSettingsManager.add("id:" + siteId, "sortBy", params.sortBy);
+ // DCAT custom
+ harvesterSettingsManager.add("id:" + siteId, "resourceUriPattern", params.resourceUriPattern);
//--- store dynamic filter nodes
String filtersID = harvesterSettingsManager.add(path, "filters", "");
diff --git a/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/csw/CswParams.java b/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/csw/CswParams.java
index 624a62e0f8..e5f677c8b6 100644
--- a/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/csw/CswParams.java
+++ b/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/csw/CswParams.java
@@ -53,6 +53,9 @@ public class CswParams extends AbstractParams {
public Integer hopCount;
+ // DCAT custom
+ public String resourceUriPattern;
+
/**
* The filter is a process (see schema/process folder) which depends on the schema. It could be
* composed of parameter which will be sent to XSL transformation using the following syntax :
@@ -105,6 +108,8 @@ public class CswParams extends AbstractParams {
bboxFilter = node.getChild("bboxFilter");
+ // DCAT custom
+ resourceUriPattern = Util.getParam(site, "resourceUriPattern", "");
}
/**
@@ -136,6 +141,9 @@ public class CswParams extends AbstractParams {
}
bboxFilter = node.getChild("bboxFilter");
+
+ // DCAT custom
+ resourceUriPattern = Util.getParam(site, "resourceUriPattern", "");
}
/**
@@ -159,6 +167,9 @@ public class CswParams extends AbstractParams {
copy.eltFilters = eltFilters;
copy.bboxFilter = bboxFilter;
+ // DCAT custom
+ copy.resourceUriPattern = resourceUriPattern;
+
return copy;
}
diff --git a/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/geonet/GeonetHarvester.java b/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/geonet/GeonetHarvester.java
index b7c42e7d36..85b5560470 100644
--- a/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/geonet/GeonetHarvester.java
+++ b/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/geonet/GeonetHarvester.java
@@ -75,6 +75,9 @@ public class GeonetHarvester extends AbstractHarvester<HarvestResult, GeonetPara
harvesterSettingsManager.add("id:" + groupID, "name", g.name);
harvesterSettingsManager.add("id:" + groupID, "policy", g.policy);
}
+
+ // DCAT custom
+ harvesterSettingsManager.add("id:" + siteId, "resourceUriPattern", params.resourceUriPattern);
}
public void addHarvestInfo(Element info, String id, String uuid) {
diff --git a/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/geonet/GeonetParams.java b/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/geonet/GeonetParams.java
index 4a8efadb75..ef034be719 100644
--- a/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/geonet/GeonetParams.java
+++ b/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/geonet/GeonetParams.java
@@ -60,6 +60,9 @@ public class GeonetParams extends AbstractParams {
private ArrayList<Group> alCopyPolicy = new ArrayList<Group>();
+ // VL
+ public String resourceUriPattern;
+
public GeonetParams(DataManager dm) {
super(dm);
}
@@ -80,6 +83,9 @@ public class GeonetParams extends AbstractParams {
mefFormatFull = Util.getParam(site, "mefFormatFull", false);
xslfilter = Util.getParam(site, "xslfilter", "");
+ // VL
+ resourceUriPattern = Util.getParam(site, "resourceUriPattern", "");
+
//checkPort(port);
addSearches(searches);
addCopyPolicy(policy);
@@ -109,6 +115,9 @@ public class GeonetParams extends AbstractParams {
if (policy != null)
addCopyPolicy(policy);
+
+ // DCAT custom
+ resourceUriPattern = Util.getParam(site, "resourceUriPattern", "");
}
public Iterable<Search> getSearches() {
@@ -152,6 +161,9 @@ public class GeonetParams extends AbstractParams {
for (Group g : alCopyPolicy)
copy.alCopyPolicy.add(g.copy());
+ // VL
+ copy.resourceUriPattern = resourceUriPattern;
+
return copy;
}
diff --git a/schemas/iso19139/src/main/plugin/iso19139/index-fields/index.xsl b/schemas/iso19139/src/main/plugin/iso19139/index-fields/index.xsl
index 6f711e9680..ebe93b0ce8 100644
--- a/schemas/iso19139/src/main/plugin/iso19139/index-fields/index.xsl
+++ b/schemas/iso19139/src/main/plugin/iso19139/index-fields/index.xsl
@@ -31,6 +31,7 @@
xmlns:gml="http://www.opengis.net/gml/3.2"
xmlns:gml320="http://www.opengis.net/gml"
xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:geonet="http://www.fao.org/geonetwork"
xmlns:gn-fn-index="http://geonetwork-opensource.org/xsl/functions/index"
xmlns:index="java:org.fao.geonet.kernel.search.EsSearchManager"
xmlns:digestUtils="java:org.apache.commons.codec.digest.DigestUtils"
@@ -72,6 +73,8 @@
<xsl:variable name="parentAssociatedResourceType" select="'partOfSeamlessDatabase'"/>
<xsl:variable name="childrenAssociatedResourceType" select="'isComposedOf'"/>
+ <xsl:variable name="uuidRegex" select="'([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}){1}'"/>
+
<xsl:template match="/">
<xsl:apply-templates mode="index"/>
</xsl:template>
@@ -1436,4 +1439,72 @@
</xsl:for-each>
</xsl:for-each>
</xsl:template>
+
+
+ <!-- RDF URI functions -->
+ <xsl:template mode="index-extra-fields" match="gmd:MD_Metadata">
+ <rdfResourceIdentifier>
+ <xsl:value-of select="geonet:getRDFResourceURI(.)"/>
+ </rdfResourceIdentifier>
+ </xsl:template>
+
+ <xsl:function name="geonet:getRDFResourceURI">
+ <xsl:param name="md" as="node()"/>
+
+ <xsl:variable name="isoScopeCode">
+ <xsl:value-of select="normalize-space($md/gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue)"/>
+ </xsl:variable>
+ <xsl:variable name="resourceType">
+ <xsl:choose>
+ <xsl:when test="$isoScopeCode = 'dataset' or $isoScopeCode = 'nonGeographicDataset'">
+ <xsl:text>dataset</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$isoScopeCode"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="uriPattern" select="util:getUriPattern($md/gmd:fileIdentifier/gco:CharacterString)"/>
+ <xsl:variable name="resourceUUID" select="geonet:getResourceBaseURIOrUUID($md)"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($resourceUUID, 'http://') or starts-with($resourceUUID, 'https://')">
+ <xsl:value-of select="geonet:escapeURI($resourceUUID)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="geonet:escapeURI(replace(replace($uriPattern, '\{resourceType\}', concat($resourceType, 's')), '\{resourceUuid\}', $resourceUUID))"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:function>
+
+ <xsl:function name="geonet:getResourceBaseURIOrUUID">
+ <xsl:param name="md" as="node()"/>
+ <xsl:variable name="resourceIdentifiers">
+ <xsl:for-each select="$md/gmd:identificationInfo[1]/*/gmd:citation/*/gmd:identifier/*">
+ <xsl:choose>
+ <xsl:when test="gmd:codeSpace/gco:CharacterString/text() != ''">
+ <xsl:value-of select="concat(gmd:codeSpace/gco:CharacterString/text(), gmd:code/gco:CharacterString/text())"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="gmd:code/gco:CharacterString/text()"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$resourceIdentifiers[matches(., $uuidRegex)][1]">
+ <xsl:value-of select="$resourceIdentifiers[matches(., $uuidRegex)][1]"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="util:uuidFromString($md/gmd:fileIdentifier/gco:CharacterString)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:function>
+
+ <xsl:function name="geonet:escapeURI">
+ <xsl:param name="uri"/>
+ <xsl:if test="$uri">
+ <xsl:value-of select="replace(replace(replace(replace(normalize-space($uri), ' ', '%20'), '<', '%3C'), '>', '%3E'), '\\', '%5C')"/>
+ </xsl:if>
+ </xsl:function>
</xsl:stylesheet>
diff --git a/services/src/main/java/org/fao/geonet/api/records/MetadataUtils.java b/services/src/main/java/org/fao/geonet/api/records/MetadataUtils.java
index 76bb7f594f..8100604bc5 100644
--- a/services/src/main/java/org/fao/geonet/api/records/MetadataUtils.java
+++ b/services/src/main/java/org/fao/geonet/api/records/MetadataUtils.java
@@ -59,6 +59,7 @@ import org.fao.geonet.repository.MetadataValidationRepository;
import org.fao.geonet.repository.SourceRepository;
import org.fao.geonet.repository.specification.MetadataValidationSpecs;
import org.fao.geonet.services.relations.Get;
+import org.fao.geonet.util.XslUtil;
import org.fao.geonet.utils.Log;
import org.jdom.Content;
import org.jdom.Element;
@@ -173,16 +174,27 @@ public class MetadataUtils {
// brothers&sisters
//
// * All of them could be remote records
+ String mdURI = XslUtil.getRecordResourceURI(md.getUuid());
Arrays.stream(types).forEach(type -> {
if (type == RelatedItemType.associated
|| type == RelatedItemType.hasfeaturecats
|| type == RelatedItemType.services
|| type == RelatedItemType.hassources) {
- queries.put(type,
- new RelatedTypeDetails(
- String.format("+%s:\"%s\"",
- RELATED_INDEX_FIELDS.get(type.value()), md.getUuid())
- ));
+ // VL Custom
+ String luceneQuery;
+ if (mdURI != null) {
+ luceneQuery = String.format(
+ "%s:\"%s\" OR %s:\"%s\"",
+ RELATED_INDEX_FIELDS.get(type.value()),
+ md.getUuid(),
+ RELATED_INDEX_FIELDS.get(type.value()),
+ mdURI
+ );
+ } else {
+ luceneQuery = String.format("+%s:\"%s\"", RELATED_INDEX_FIELDS.get(type.value()), md.getUuid());
+ }
+
+ queries.put(type, new RelatedTypeDetails(luceneQuery));
} else if (schemaPlugin != null
&& (type == RelatedItemType.siblings
|| type == RelatedItemType.parent
diff --git a/web-ui/src/main/resources/catalog/locales/en-admin.json b/web-ui/src/main/resources/catalog/locales/en-admin.json
index 7f3cd11fd3..11f1d4a215 100644
--- a/web-ui/src/main/resources/catalog/locales/en-admin.json
+++ b/web-ui/src/main/resources/catalog/locales/en-admin.json
@@ -1525,6 +1525,10 @@
"doiserver-euApiText": "Publication Office of the European Union",
"confirmDoiServerDelete": "Are you sure you want to delete this DOI server?",
"NoTranslationProvider": "No translation provider",
- "LibreTranslate": "Libretranslate"
+ "LibreTranslate": "Libretranslate",
+
+ "==== DCAT custom ====": "",
+ "resourceUriPattern": "Resource URI pattern",
+ "resourceUriPatternHelp": "Pattern used to generate URI of the resources during the RDF export. Example of value: https://metadata.vlaanderen.be/srv/resources/{resourceType}/{resourceUuid}"
}
diff --git a/web-ui/src/main/resources/catalog/locales/fr-admin.json b/web-ui/src/main/resources/catalog/locales/fr-admin.json
index a6d8d318c5..abcf30b00e 100644
--- a/web-ui/src/main/resources/catalog/locales/fr-admin.json
+++ b/web-ui/src/main/resources/catalog/locales/fr-admin.json
@@ -1507,5 +1507,10 @@
"fieldEmailNotValid": "Un email valide est requis",
"formConfirmExit": "Le formulaire comporte des modifications, si vous quittez, les modifications seront perdues. Voulez-vous quitter la page ?",
"NoTranslationProvider": "No translation provider",
- "LibreTranslate": "Libretranslate"
-}
\ No newline at end of file
+ "LibreTranslate": "Libretranslate",
+
+ "==== DCAT custom ====": "",
+ "resourceUriPattern": "Patterne de l'URI des resources",
+ "resourceUriPatternHelp": "Patterne utilisé pour générer les URI des resources lors de l'export RDF. Exemple de valeur: https://metadata.vlaanderen.be/srv/resources/{resourceType}/{resourceUuid}"
+
+}
diff --git a/web-ui/src/main/resources/catalog/locales/nl-admin.json b/web-ui/src/main/resources/catalog/locales/nl-admin.json
index 11871c726b..90d711a2e6 100644
--- a/web-ui/src/main/resources/catalog/locales/nl-admin.json
+++ b/web-ui/src/main/resources/catalog/locales/nl-admin.json
@@ -1507,5 +1507,9 @@
"fieldEmailNotValid": "Een geldig email adres is vereist",
"formConfirmExit": "The form has changes, if you exit the changes will be lost. Do you want to exit on the page?",
"NoTranslationProvider": "No translation provider",
- "LibreTranslate": "Libretranslate"
-}
\ No newline at end of file
+ "LibreTranslate": "Libretranslate",
+
+ "==== DCAT custom ====": "",
+ "resourceUriPattern": "Resource URI pattern",
+ "resourceUriPatternHelp": "Pattern gebruikt om URI van de bronnen te genereren tijdens de RDF export. Bv: https://metadata.vlaanderen.be/srv/resources/{resourceType}/{resourceUuid}"
+}
diff --git a/web-ui/src/main/resources/catalog/templates/admin/harvest/type/csw.html b/web-ui/src/main/resources/catalog/templates/admin/harvest/type/csw.html
index 03bee12552..827103ef87 100644
--- a/web-ui/src/main/resources/catalog/templates/admin/harvest/type/csw.html
+++ b/web-ui/src/main/resources/catalog/templates/admin/harvest/type/csw.html
@@ -337,6 +337,23 @@
data-lang="{{lang}}"
data-label="csw-category"
></div>
+
+ <div>
+ <label
+ id="gn-harvest-settings-gn-advanced-resource-uri-pattern-label"
+ class="control-label"
+ data-translate=""
+ >resourceUriPattern</label
+ >
+ <input
+ id="gn-harvest-settings-gn-advanced-resource-uri-pattern-input"
+ type="text"
+ class="form-control gn-csw-criteria"
+ data-ng-model="harvesterSelected.site.resourceUriPattern"
+ />
+
+ <p class="help-block" data-translate="">resourceUriPatternHelp</p>
+ </div>
</fieldset>
<div
diff --git a/web-ui/src/main/resources/catalog/templates/admin/harvest/type/csw.js b/web-ui/src/main/resources/catalog/templates/admin/harvest/type/csw.js
index bc6eb3e163..e126119172 100644
--- a/web-ui/src/main/resources/catalog/templates/admin/harvest/type/csw.js
+++ b/web-ui/src/main/resources/catalog/templates/admin/harvest/type/csw.js
@@ -24,7 +24,8 @@ var gnHarvestercsw = {
"outputSchema": "http://www.isotc211.org/2005/gmd",
"sortBy": "identifier:A",
"queryScope": "local",
- "hopCount": 2
+ "hopCount": 2,
+ "resourceUriPattern": ""
},
"content" : {
"validate" : "NOVALIDATION",
@@ -113,6 +114,7 @@ var gnHarvestercsw = {
+ ' <sortBy>' + h.site.sortBy + '</sortBy>'
+ ' <queryScope>' + h.site.queryScope + '</queryScope>'
+ ' <hopCount>' + h.site.hopCount + '</hopCount>'
+ + ' <resourceUriPattern>' + h.site.resourceUriPattern + '</resourceUriPattern>'
+ ' </site>'
+ gnHarvestercsw.buildResponseCSWBBOXFilter($scope)
+ gnHarvestercsw.buildResponseCSWFilter($scope)
diff --git a/web-ui/src/main/resources/catalog/templates/admin/harvest/type/geonetwork.html b/web-ui/src/main/resources/catalog/templates/admin/harvest/type/geonetwork.html
index d7a36ee29a..c47ddc3f57 100644
--- a/web-ui/src/main/resources/catalog/templates/admin/harvest/type/geonetwork.html
+++ b/web-ui/src/main/resources/catalog/templates/admin/harvest/type/geonetwork.html
@@ -266,6 +266,22 @@
></div>
<p class="help-block" data-translate="">harvesterValidateHelp</p>
</div>
+ <div>
+ <label
+ id="gn-harvest-settings-gn-advanced-resource-uri-pattern-label"
+ class="control-label"
+ data-translate=""
+ >resourceUriPattern</label
+ >
+ <input
+ id="gn-harvest-settings-gn-advanced-resource-uri-pattern-input"
+ type="text"
+ class="form-control gn-csw-criteria"
+ data-ng-model="harvesterSelected.site.resourceUriPattern"
+ />
+
+ <p class="help-block" data-translate="">resourceUriPatternHelp</p>
+ </div>
</fieldset>
<div data-gn-harvester-translate-content-configurator="harvesterSelected.content"></div>
diff --git a/web-ui/src/main/resources/catalog/templates/admin/harvest/type/geonetwork.js b/web-ui/src/main/resources/catalog/templates/admin/harvest/type/geonetwork.js
index 8ca175afcd..a3c9441323 100644
--- a/web-ui/src/main/resources/catalog/templates/admin/harvest/type/geonetwork.js
+++ b/web-ui/src/main/resources/catalog/templates/admin/harvest/type/geonetwork.js
@@ -21,7 +21,8 @@ var gnHarvestergeonetwork = {
"useChangeDateForUpdate": false,
"createRemoteCategory": false,
"mefFormatFull": false,
- "xslfilter": []
+ "xslfilter": [],
+ "resourceUriPattern": ""
},
"content": {
"validate": "NOVALIDATION",
@@ -87,6 +88,7 @@ var gnHarvestergeonetwork = {
+ ' <username>' + h.site.account.username + '</username>'
+ ' <password>' + h.site.account.password + '</password>'
+ ' </account>'
+ + ' <resourceUriPattern>' + h.site.resourceUriPattern + '</resourceUriPattern>'
+ ' </site>'
+ ' <searches>'
+ ' <search>'
diff --git a/web/src/main/webapp/xsl/xml/harvesting/csw.xsl b/web/src/main/webapp/xsl/xml/harvesting/csw.xsl
index afbd470d75..33b6e31d5b 100644
--- a/web/src/main/webapp/xsl/xml/harvesting/csw.xsl
+++ b/web/src/main/webapp/xsl/xml/harvesting/csw.xsl
@@ -31,6 +31,9 @@
<sortBy>
<xsl:value-of select="sortBy/value"/>
</sortBy>
+ <resourceUriPattern>
+ <xsl:value-of select="resourceUriPattern/value"/>
+ </resourceUriPattern>
</xsl:template>
diff --git a/web/src/main/webapp/xsl/xml/harvesting/geonetwork.xsl b/web/src/main/webapp/xsl/xml/harvesting/geonetwork.xsl
index ecfc880f24..db96a7ca0d 100644
--- a/web/src/main/webapp/xsl/xml/harvesting/geonetwork.xsl
+++ b/web/src/main/webapp/xsl/xml/harvesting/geonetwork.xsl
@@ -22,6 +22,9 @@
<xslfilter>
<xsl:value-of select="xslfilter"/>
</xslfilter>
+ <resourceUriPattern>
+ <xsl:value-of select="resourceUriPattern/value"/>
+ </resourceUriPattern>
</xsl:template>
<xsl:template match="*" mode="searches">
--
2.45.2.windows.1