diff --git a/schemas/iso19139/src/main/plugin/iso19139/extract-relations.xsl b/schemas/iso19139/src/main/plugin/iso19139/extract-relations.xsl
index 2b27b5e2140..dd87f5281bf 100644
--- a/schemas/iso19139/src/main/plugin/iso19139/extract-relations.xsl
+++ b/schemas/iso19139/src/main/plugin/iso19139/extract-relations.xsl
@@ -34,6 +34,7 @@
xmlns:gmx="http://www.isotc211.org/2005/gmx"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:util="java:org.fao.geonet.util.XslUtil"
+ xmlns:uuid="java:java.util.UUID"
xmlns:gn-fn-rel="http://geonetwork-opensource.org/xsl/functions/relations"
version="2.0"
exclude-result-prefixes="#all">
@@ -126,8 +127,9 @@
+
-
+
+
@@ -42,12 +43,12 @@ Stylesheet used to remove a reference to a online resource.
diff --git a/web-ui/src/main/resources/catalog/components/edit/onlinesrc/OnlineSrcService.js b/web-ui/src/main/resources/catalog/components/edit/onlinesrc/OnlineSrcService.js
index 6d0003da1dd..faafd0e186c 100644
--- a/web-ui/src/main/resources/catalog/components/edit/onlinesrc/OnlineSrcService.js
+++ b/web-ui/src/main/resources/catalog/components/edit/onlinesrc/OnlineSrcService.js
@@ -712,7 +712,16 @@
*
* @param {Object} onlinesrc the online resource to remove
*/
- removeOnlinesrc: function (onlinesrc) {
+ removeOnlinesrc: function (onlinesrc, onlines) {
+ //Passing the index of the xml/xpath into the remove process xsl
+ var xslIndex = -1;
+ for (var i = 0; i < onlines.length; i++) {
+ if (onlinesrc.id === onlines[i].id) {
+ xslIndex = i+1;
+ break;
+ }
+ }
+
var url = onlinesrc.lUrl || onlinesrc.url;
if (
url.match(".*/api/records/' + gnCurrentEdit.uuid + '/attachments/.*") != null
@@ -724,6 +733,7 @@
this,
setParams("onlinesrc-remove", {
id: gnCurrentEdit.id,
+ resourceIndex: xslIndex,
url: url,
name: $filter("gnLocalized")(onlinesrc.title)
})
diff --git a/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/onlinesrcList.html b/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/onlinesrcList.html
index bde4ba3f9aa..b326c7a2b1b 100644
--- a/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/onlinesrcList.html
+++ b/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/onlinesrcList.html
@@ -219,7 +219,7 @@
aria-label="{{'remove' | translate}} {{resource.title | gnLocalized: lang}}"
data-ng-if="readonly !== true"
data-gn-confirm-click="{{'removeOnlinesrcConfirm' | translate:{url: resource.lUrl} }}"
- data-gn-click-and-spin="onlinesrcService.removeOnlinesrc(resource)"
+ data-gn-click-and-spin="onlinesrcService.removeOnlinesrc(resource, relations.onlines)"
>