From df6a7708d404c3bae9cdef198eb0973633221bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Garc=C3=ADa?= Date: Tue, 30 Jan 2024 16:41:25 +0100 Subject: [PATCH] Editor / Distribution improvements (#7468) * Metadata editor / distributions * Editor / Distribution / Quick selection or upload from filestore. * Editor / Distribution / Extract URL alert template. To be discussed if we move more URL validation logic in a service and if we simplify the layout to a simple green/orange/red icon + message. * Editor / Distribution / Add possibility to customize label per field depending on the type of resource linked. * Editor / Distribution / Do not set filename in resource name. * Editor / Distribution / update the directives so can be used in the record view also. Improved conversion of metadata links to the format required by the online resources dialog * Editor / Distribution / Simplify and add documentation for gnDistributionResourcesContainer directive * Editor / Distribution / Simplify distributions configurations and cleanup gnRelatedDistribution * Editor / Distribution / Labels. * Clean console log. * Editor / Distribution / Type is required to make distinction of various type of links. The type is used to find the proper process to use. * Editor / Distribution / Change order - API - legend - download - dq - fcats - link. * Editor / Distribution / Fix refresh of distributions in the metadata editor after updating the online resources * Editor / Distribution / Generate thumbnail - set the url automatically with the url of the thumbnail generated * Editor / Distribution / Synch config between view and edit mode. Add OGC API choices. * Editor / Distribution / Add group filter. * Editor / Distribution / Add DOI and WFS component. Move DOI utility to DOIService. * List styling for related records in the editor sidebar * Style related distribution lists when displayed in the main column as well as in the side column. Add an icon before the link * Harvesting / WFS / Add timeout for displaying alert if WFS service not found. By default, no alert displayed. * Editor / Distributions / Fix on edit existing link. * Editor / Distribution / Suggestion / Add info from WMS. * Editor / Distribution / Remove data downloader in edit mode for WFS and ATOM. * Editor / Distribution / Suggest data model creation when WFS available. * Editor / Distribution / More consistent config for ISO schema with same config on all tabs. * Prettier. * Editor / Distributions / Avoid refresh call. Convert once. * Editor / Distributions / Add support for multilingual links. * Editor / Distribution / Dublin core configuration. * Add `type` label to the related link in the editor * Improve whitespace in the related records list * Display the URL check message inline and not in the footer * Standard / ISO19115-3 / Suggestion / Avoid error on multilinugal record * Editor / Distribution / Add configuration for associated panel. * Editor / Distribution / Add configuration for associated panel / Editor config to default. * Editor / Distribution / Add some extra space between link and edit action * Standard / ISO19115-3 / Suggestion / Avoid exception on multilingual records * Standard / ISO19115-3 / Suggestion / WMS bbox improvements Better support of adding bbox from WMS from various layers in same record. Avoid to add multiple time the extent. * Fix 'External links without noopener/noreferrer are a potential security risk' and Prettier formatting * Editor / Distribution / Fix JS error in non debug mode due to missing var declaration. --------- Co-authored-by: Francois Prunayre Co-authored-by: Michel Gabriel --- .../dublin-core/layout/config-editor.xml | 45 ++- .../dublin-core/process/thumbnail-add.xsl | 48 +++ .../config/associated-panel/default.json | 286 +++++++++++++--- .../iso19115-3.2018/layout/config-editor.xml | 113 ++++++- .../process/add-info-from-wms.xsl | 95 +++--- .../create-featurecatalogue-from-wfs.xsl | 15 +- .../plugin/iso19139/index-fields/index.xsl | 4 +- .../plugin/iso19139/layout/config-editor.xml | 111 ++++++- .../iso19139/process/add-info-from-wms.xsl | 40 +-- .../catalog/components/doi/DoiService.js | 49 ++- .../edit/onlinesrc/OnlineSrcDirective.js | 84 +++-- .../edit/onlinesrc/partials/addOnlinesrc.html | 116 ++++--- .../onlinesrc/partials/onlinesrcList.html | 2 +- .../partials/remote-record-selector.html | 49 +-- .../edit/onlinesrc/partials/urlValidator.html | 14 + .../edit/suggestion/SuggestionDirective.js | 20 +- .../edit/suggestion/partials/list.html | 2 +- .../suggestion/partials/suggestbutton.html | 9 +- .../filestore/FileStoreDirective.js | 34 +- .../filestore/partials/filestore.html | 177 +++++----- .../metadataactions/RelatedDirective.js | 312 ++++++++++++++++++ .../distributionResourcesContainer.html | 67 ++++ .../partials/distributionResourcesPanel.html | 21 ++ .../partials/relatedDistribution.html | 278 ++++++++++++++++ .../viewer/wfsfilter/WfsFilterDirective.js | 7 +- .../resources/catalog/js/CatController.js | 16 +- .../catalog/js/edit/EditorController.js | 33 ++ .../resources/catalog/locales/en-core.json | 6 +- .../resources/catalog/locales/en-editor.json | 26 +- .../resources/catalog/locales/en-search.json | 5 +- .../main/resources/catalog/locales/en-v4.json | 4 + .../src/main/resources/catalog/style/gn.less | 6 + .../views/default/less/gn_editor_default.less | 106 ++++-- .../templates/recordView/downloads.html | 5 +- 34 files changed, 1793 insertions(+), 412 deletions(-) create mode 100644 schemas/dublin-core/src/main/plugin/dublin-core/process/thumbnail-add.xsl create mode 100644 web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/urlValidator.html create mode 100644 web-ui/src/main/resources/catalog/components/metadataactions/partials/distributionResourcesContainer.html create mode 100644 web-ui/src/main/resources/catalog/components/metadataactions/partials/distributionResourcesPanel.html create mode 100644 web-ui/src/main/resources/catalog/components/metadataactions/partials/relatedDistribution.html diff --git a/schemas/dublin-core/src/main/plugin/dublin-core/layout/config-editor.xml b/schemas/dublin-core/src/main/plugin/dublin-core/layout/config-editor.xml index 9a234c424ad..70484726a72 100644 --- a/schemas/dublin-core/src/main/plugin/dublin-core/layout/config-editor.xml +++ b/schemas/dublin-core/src/main/plugin/dublin-core/layout/config-editor.xml @@ -54,8 +54,21 @@ + + + + + + data-types="parent"/>
@@ -68,8 +81,21 @@ + + + + + + data-types="parent"/>
@@ -79,8 +105,21 @@ + + + + + + data-types="parent"/> diff --git a/schemas/dublin-core/src/main/plugin/dublin-core/process/thumbnail-add.xsl b/schemas/dublin-core/src/main/plugin/dublin-core/process/thumbnail-add.xsl new file mode 100644 index 00000000000..b430b19e703 --- /dev/null +++ b/schemas/dublin-core/src/main/plugin/dublin-core/process/thumbnail-add.xsl @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/config/associated-panel/default.json b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/config/associated-panel/default.json index c15c53fc2b5..85d23855aed 100644 --- a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/config/associated-panel/default.json +++ b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/config/associated-panel/default.json @@ -3,7 +3,7 @@ "display": "select", "types": [ { - "group": "onlineDiscover", + "group": "overview", "label": "onlineDiscoverThumbnail", "sources": { "filestore": true, @@ -15,38 +15,44 @@ "fields": { "url": { "isMultilingual": false, - "param": "thumbnail_url" + "param": "thumbnail_url", + "label": "overviewUrl" }, "name": { + "label": "overviewDescription", "param": "thumbnail_desc" } } }, { - "group": "onlineDiscover", - "label": "onlineDiscoverInApp", - "copyLabel": "name", + "group": "API", + "label": "onlineDiscoverWMS", + "copyLabel": "desc", + "icon": "fa gn-icon-onlinesrc", "sources": { "metadataStore": { - "label": "searchAnApplication", + "label": "searchAservice", "params": { - "resourceType": "application", + "serviceType": ["OGC:WMS", "WMS", "view"], "isTemplate": "n" } } }, - "icon": "fa gn-icon-map", "process": "onlinesrc-add", "fields": { "url": { - "isMultilingual": false + "isMultilingual": false, + "label": "ogcServiceUrl" }, "protocol": { - "value": "WWW:LINK", + "value": "OGC:WMS", "hidden": true, "isMultilingual": false }, - "name": {}, + "name": { + "label": "layerName", + "tooltip": "layerNameTooltip" + }, "desc": {}, "function": { "value": "browsing", @@ -56,15 +62,15 @@ } }, { - "group": "onlineDiscover", - "label": "onlineDiscoverWMS", + "group": "API", + "label": "onlineDiscoverINSPIREView", "copyLabel": "desc", "icon": "fa gn-icon-onlinesrc", "sources": { "metadataStore": { "label": "searchAservice", "params": { - "serviceType": ["OGC:WMS", "WMS", "view"], + "serviceType": "view", "isTemplate": "n" } } @@ -72,7 +78,8 @@ "process": "onlinesrc-add", "fields": { "url": { - "isMultilingual": false + "isMultilingual": false, + "label": "ogcServiceUrl" }, "protocol": { "value": "OGC:WMS", @@ -85,19 +92,24 @@ "value": "browsing", "hidden": true, "isMultilingual": false + }, + "applicationProfile": { + "value": "inspire-view", + "hidden": true, + "isMultilingual": false } } }, { - "group": "onlineDiscover", - "label": "onlineDiscoverINSPIREView", + "group": "API", + "label": "onlineDiscoverWMTS", "copyLabel": "desc", "icon": "fa gn-icon-onlinesrc", "sources": { "metadataStore": { "label": "searchAservice", "params": { - "serviceType": "view", + "serviceType": ["OGC:WMTS", "WMTS"], "isTemplate": "n" } } @@ -105,10 +117,11 @@ "process": "onlinesrc-add", "fields": { "url": { - "isMultilingual": false + "isMultilingual": false, + "label": "ogcServiceUrl" }, "protocol": { - "value": "OGC:WMS", + "value": "OGC:WMTS", "hidden": true, "isMultilingual": false }, @@ -118,24 +131,19 @@ "value": "browsing", "hidden": true, "isMultilingual": false - }, - "applicationProfile": { - "value": "inspire-view", - "hidden": true, - "isMultilingual": false } } }, { - "group": "onlineDiscover", - "label": "onlineDiscoverWMTS", + "group": "API", + "label": "onlineDiscoverArcGIS", "copyLabel": "desc", "icon": "fa gn-icon-onlinesrc", "sources": { "metadataStore": { "label": "searchAservice", "params": { - "serviceType": ["OGC:WMTS", "WMTS"], + "serviceType": "ESRI:REST", "isTemplate": "n" } } @@ -146,7 +154,7 @@ "isMultilingual": false }, "protocol": { - "value": "OGC:WMTS", + "value": "ESRI:REST", "hidden": true, "isMultilingual": false }, @@ -160,8 +168,8 @@ } }, { - "group": "onlineDiscover", - "label": "onlineDiscoverArcGIS", + "group": "API", + "label": "onlineDiscoverArcGISTiled", "copyLabel": "desc", "icon": "fa gn-icon-onlinesrc", "sources": { @@ -179,7 +187,7 @@ "isMultilingual": false }, "protocol": { - "value": "ESRI:REST", + "value": "ESRI:REST-TILED", "hidden": true, "isMultilingual": false }, @@ -193,15 +201,15 @@ } }, { - "group": "onlineDiscover", - "label": "onlineDiscoverArcGISTiled", + "group": "API", + "label": "OGC API Maps", "copyLabel": "desc", "icon": "fa gn-icon-onlinesrc", "sources": { "metadataStore": { "label": "searchAservice", "params": { - "serviceType": "ESRI:REST", + "serviceType": ["OGC API Maps"], "isTemplate": "n" } } @@ -209,10 +217,11 @@ "process": "onlinesrc-add", "fields": { "url": { - "isMultilingual": false + "isMultilingual": false, + "label": "ogcServiceUrl" }, "protocol": { - "value": "ESRI:REST-TILED", + "value": "OGC API Maps", "hidden": true, "isMultilingual": false }, @@ -226,20 +235,52 @@ } }, { - "group": "onlineDiscover", - "label": "onlineDiscoverMap", - "copyLabel": "name", + "group": "API", + "label": "OGC API Records", + "copyLabel": "desc", + "icon": "fa gn-icon-onlinesrc", "sources": { - "filestore": true + "metadataStore": { + "label": "searchAservice", + "params": { + "serviceType": ["OGC API Records"], + "isTemplate": "n" + } + } }, - "icon": "fa gn-icon-map", "process": "onlinesrc-add", "fields": { "url": { + "isMultilingual": false, + "label": "ogcServiceUrl" + }, + "protocol": { + "value": "OGC API Records", + "hidden": true, "isMultilingual": false }, + "name": {}, + "desc": {}, + "function": { + "value": "search", + "hidden": true, + "isMultilingual": false + } + } + }, + { + "group": "API", + "label": "REST API", + "copyLabel": "name", + "icon": "fa gn-icon-onlinesrc", + "process": "onlinesrc-add", + "fields": { + "url": { + "isMultilingual": false, + "label": "restApiUrl" + }, "protocol": { - "value": "WWW:LINK", + "value": "REST", "hidden": true, "isMultilingual": false }, @@ -324,7 +365,8 @@ "process": "onlinesrc-add", "fields": { "url": { - "isMultilingual": false + "isMultilingual": false, + "label": "ogcServiceUrl" }, "protocol": { "value": "OGC:WFS", @@ -357,7 +399,8 @@ "process": "onlinesrc-add", "fields": { "url": { - "isMultilingual": false + "isMultilingual": false, + "label": "ogcServiceUrl" }, "protocol": { "value": "OGC:WCS", @@ -390,7 +433,8 @@ "process": "onlinesrc-add", "fields": { "url": { - "isMultilingual": false + "isMultilingual": false, + "label": "ogcServiceUrl" }, "protocol": { "value": "OGC:WFS", @@ -449,6 +493,74 @@ } } }, + { + "group": "onlineDownload", + "label": "OGC API Features", + "copyLabel": "desc", + "icon": "fa gn-icon-onlinesrc", + "sources": { + "metadataStore": { + "label": "searchAservice", + "params": { + "serviceType": ["OGC API Features"], + "isTemplate": "n" + } + } + }, + "process": "onlinesrc-add", + "fields": { + "url": { + "isMultilingual": false, + "label": "ogcServiceUrl" + }, + "protocol": { + "value": "OGC API Features", + "hidden": true, + "isMultilingual": false + }, + "name": {}, + "desc": {}, + "function": { + "value": "download", + "hidden": true, + "isMultilingual": false + } + } + }, + { + "group": "onlineDownload", + "label": "OGC API Coverages", + "copyLabel": "desc", + "icon": "fa gn-icon-onlinesrc", + "sources": { + "metadataStore": { + "label": "searchAservice", + "params": { + "serviceType": ["OGC API Coverages"], + "isTemplate": "n" + } + } + }, + "process": "onlinesrc-add", + "fields": { + "url": { + "isMultilingual": false, + "label": "ogcServiceUrl" + }, + "protocol": { + "value": "OGC API Coverages", + "hidden": true, + "isMultilingual": false + }, + "name": {}, + "desc": {}, + "function": { + "value": "download", + "hidden": true, + "isMultilingual": false + } + } + }, { "group": "localNetwork", "label": "localNetworkVectorFile", @@ -562,12 +674,13 @@ } }, { - "group": "onlineUse", + "group": "onlineUseFcats", "label": "onlineUseFcats", "copyLabel": "name", "sources": { "filestore": true }, + "fileStoreFilter": "*.{pdf,PDF,xls,XLS,ods,ODS,csv,CSV,txt,TXT}", "icon": "fa fa-table", "process": "fcats-file-add", "fields": { @@ -588,12 +701,13 @@ } }, { - "group": "onlineUse", + "group": "quality", "label": "onlineUseDQReport", "copyLabel": "name", "sources": { "filestore": true }, + "fileStoreFilter": "*.{pdf,PDF}", "icon": "fa fa-table", "process": "dq-report-add", "fields": { @@ -620,12 +734,13 @@ } }, { - "group": "onlineUse", + "group": "quality", "label": "onlineUseDQTOR", "copyLabel": "name", "sources": { "filestore": true }, + "fileStoreFilter": "*.{pdf,PDF}", "icon": "fa fa-table", "process": "dq-report-add", "fields": { @@ -652,12 +767,13 @@ } }, { - "group": "onlineUse", + "group": "quality", "label": "onlineUseDQProdReport", "copyLabel": "name", "sources": { "filestore": true }, + "fileStoreFilter": "*.{pdf,PDF}", "icon": "fa fa-table", "process": "dq-report-add", "fields": { @@ -684,7 +800,7 @@ } }, { - "group": "onlineUse", + "group": "onlineUseLegend", "label": "onlineUseLegendLYR", "copyLabel": "name", "sources": { @@ -711,7 +827,7 @@ } }, { - "group": "onlineUse", + "group": "onlineUseLegend", "label": "onlineUseStyleSLD", "copyLabel": "name", "sources": { @@ -738,7 +854,7 @@ } }, { - "group": "onlineUse", + "group": "onlineUseLegend", "label": "onlineUseStyleQML", "copyLabel": "name", "sources": { @@ -765,7 +881,67 @@ } }, { - "group": "onlineMore", + "group": "links", + "label": "onlineDiscoverInApp", + "copyLabel": "name", + "sources": { + "metadataStore": { + "label": "searchAnApplication", + "params": { + "resourceType": "application", + "isTemplate": "n" + } + } + }, + "icon": "fa gn-icon-map", + "process": "onlinesrc-add", + "fields": { + "url": { + "isMultilingual": false + }, + "protocol": { + "value": "WWW:LINK", + "hidden": true, + "isMultilingual": false + }, + "name": {}, + "desc": {}, + "function": { + "value": "browsing", + "hidden": true, + "isMultilingual": false + } + } + }, + { + "group": "links", + "label": "onlineDiscoverMap", + "copyLabel": "name", + "sources": { + "filestore": true + }, + "icon": "fa gn-icon-map", + "process": "onlinesrc-add", + "fields": { + "url": { + "isMultilingual": false + }, + "protocol": { + "value": "WWW:LINK", + "hidden": true, + "isMultilingual": false + }, + "name": {}, + "desc": {}, + "function": { + "value": "browsing", + "hidden": true, + "isMultilingual": false + } + } + }, + { + "group": "links", "label": "onlineMoreWWW", "copyLabel": "name", "icon": "fa gn-icon-onlinesrc", @@ -789,7 +965,7 @@ } }, { - "group": "onlineMore", + "group": "links", "label": "onlineMoreFile", "copyLabel": "name", "sources": { diff --git a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/layout/config-editor.xml b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/layout/config-editor.xml index 2fd90f1191c..9f13d94f2e3 100644 --- a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/layout/config-editor.xml +++ b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/layout/config-editor.xml @@ -621,11 +621,38 @@ - + + data-types="sibling|associated|source|dataset|service|fcats"/> - + + + + + data-types="sibling|associated|source|dataset|service|fcats"/> + + + + @@ -800,13 +863,49 @@ - + + + + + data-types="sibling|associated|source|dataset|service|fcats"/> + + + + diff --git a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/process/add-info-from-wms.xsl b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/process/add-info-from-wms.xsl index 5a585fba608..81b658f1007 100644 --- a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/process/add-info-from-wms.xsl +++ b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/process/add-info-from-wms.xsl @@ -62,14 +62,10 @@ WMS service - is described in online resource section. Run to update extent, CRS or - graphic overview - for this WMS service for the layer named: + is described in online resource section. Run to update extent, CRS or graphic overview for this WMS service for the layer named: Le service de visualisation - est décrit dans la section resource en ligne. Exécuter cette action - pour mettre à jour l'étendue, les systèmes de projection - ou les aperçus pour ce service et la couche nommée : + est décrit dans la section resource en ligne. Exécuter cette action pour mettre à jour l'étendue, les systèmes de projection ou les aperçus pour ce service et la couche nommée : Er is een verwijzing gevonden naar de WMS service . Gebruik deze functie om de dekking, de projectie of thumbnail af te leiden of bij te werken vanuit deze WMS-service voor de laag met de naam: @@ -87,6 +83,7 @@ + @@ -100,8 +97,7 @@ - + select="//cit:CI_OnlineResource[contains(cit:protocol/gco:CharacterString, 'OGC:WMS') and normalize-space(cit:linkage/*[1]/text()) = $wmsServiceUrl]"/> @@ -132,13 +128,15 @@ + + target="link#{cit:protocol/gco:CharacterString}#{$url}#{$layerName}"> . + select="$layerName"/>. true { @@ -157,7 +155,9 @@ "defaultValue":""}, "wmsServiceUrl":{"type":"string", "defaultValue":""} + select="$url"/>"}, + "wmsLayerName":{"type":"string", "defaultValue":""} } @@ -211,42 +211,43 @@ + - - - - + + + + + + - - - + + + + + + + + - - - - - - - - - @@ -254,16 +255,16 @@ + and $wmsLayerName != ''"> + select="$capabilitiesDoc//Layer[Name=$wmsLayerName]/LatLonBoundingBox"/> @@ -412,8 +413,6 @@ - - @@ -426,8 +425,20 @@ - + + + + + + @@ -436,8 +447,6 @@ - - diff --git a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/process/create-featurecatalogue-from-wfs.xsl b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/process/create-featurecatalogue-from-wfs.xsl index 8c4f3dfa9a2..bc2f6cfd34b 100644 --- a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/process/create-featurecatalogue-from-wfs.xsl +++ b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/process/create-featurecatalogue-from-wfs.xsl @@ -64,21 +64,23 @@ + select="$root[count(.//srv:SV_ServiceIdentification) = 0]//mdb:distributionInfo//mrd:onLine/*[contains(cit:protocol/*, 'WFS') or contains(cit:protocol/*, 'ESRI:REST')]"/> + + + - + target="link#{$protocol}#{$url[1]}#{$featureType[1]}"> + true - {"featureCatWfsUrl":{"type":"text", "defaultValue":""}, - "featureCatWfsFeatureType":{"type":"text", "defaultValue":""}, + {"featureCatWfsUrl":{"type":"text", "defaultValue":""}, + "featureCatWfsFeatureType":{"type":"text", "defaultValue":""}, "featureCatReplace":{"type":"boolean", "defaultValue":""}} @@ -109,7 +111,6 @@ mdb:defaultLocale| mdb:parentMetadata| mdb:metadataScope| - mdb:contact| mdb:dateInfo| mdb:metadataStandard| mdb:metadataProfile| 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 82b2fa89ece..dea611efe42 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/index-fields/index.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/index-fields/index.xsl @@ -1111,7 +1111,9 @@ else if (starts-with(gmd:protocol/gco:CharacterString, 'WWW:DOWNLOAD:')) then util:escapeForJson(replace(gmd:protocol/gco:CharacterString, 'WWW:DOWNLOAD:', '')) else ''"/>", - "urlObject":{"default": ""}, + "urlObject":{ + "default": "", + "lang": ""}, "nameObject": , diff --git a/schemas/iso19139/src/main/plugin/iso19139/layout/config-editor.xml b/schemas/iso19139/src/main/plugin/iso19139/layout/config-editor.xml index 36f1b0be42b..1960dec2f57 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/layout/config-editor.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/layout/config-editor.xml @@ -518,12 +518,37 @@ + - + + + + + + + + @@ -3176,31 +3201,39 @@ - + + - + + data-types="parent|dataset|service|source|sibling|associated|fcats"/> - - - @@ -3305,12 +3338,37 @@ class="gn-label-above-input gn-indent-bluescale"> + - + + + + + + + + @@ -3381,12 +3439,37 @@ + - + + + + + + + + diff --git a/schemas/iso19139/src/main/plugin/iso19139/process/add-info-from-wms.xsl b/schemas/iso19139/src/main/plugin/iso19139/process/add-info-from-wms.xsl index 5ebfc4bc509..f70c6d75919 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/process/add-info-from-wms.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/process/add-info-from-wms.xsl @@ -35,14 +35,10 @@ WMS service - is described in online resource section. Run to update extent, CRS or - graphic overview - for this WMS service for the layer named: + is described in online resource section. Run to update extent, CRS or graphic overview for this WMS service for the layer named: Le service de visualisation - est décrit dans la section resource en ligne. Exécuter cette action - pour mettre à jour l'étendue, les systèmes de projection - ou les aperçus pour ce service et la couche nommée : + est décrit dans la section resource en ligne. Exécuter cette action pour mettre à jour l'étendue, les systèmes de projection ou les aperçus pour ce service et la couche nommée : Er is een verwijzing gevonden naar de WMS service . Gebruik deze functie om de dekking, de projectie of thumbnail af te leiden of bij te werken vanuit deze WMS-service voor de laag met de naam: @@ -60,6 +56,7 @@ + @@ -74,7 +71,7 @@ --> - + @@ -105,13 +102,15 @@ + + target="link#{gmd:protocol/gco:CharacterString}#{$url}#{$layerName}"> . + select="$layerName"/>. true {"setExtent":{"type":"boolean", "defaultValue":""}, @@ -128,7 +127,9 @@ "defaultValue":""}, "wmsServiceUrl":{"type":"string", "defaultValue":""} + select="$url"/>"}, + "wmsLayerName":{"type":"string", "defaultValue":""} } @@ -173,26 +174,21 @@ gmd:graphicOverview "/> - + + select="$capabilitiesDoc//Layer[Name=$wmsLayerName]/LatLonBoundingBox"/> + - - - - - - @@ -415,8 +411,6 @@ - - @@ -429,7 +423,7 @@ - diff --git a/web-ui/src/main/resources/catalog/components/doi/DoiService.js b/web-ui/src/main/resources/catalog/components/doi/DoiService.js index 87d9457c1d7..e21427f8c31 100644 --- a/web-ui/src/main/resources/catalog/components/doi/DoiService.js +++ b/web-ui/src/main/resources/catalog/components/doi/DoiService.js @@ -31,14 +31,49 @@ */ module.service("gnDoiService", [ "$http", - function ($http) { + "gnConfig", + function ($http, gnConfig) { + function check(id) { + return $http.get("../api/records/" + id + "/doi/checkPreConditions"); + } + function create(id) { + return $http.put("../api/records/" + id + "/doi"); + } + + function isDoiApplicableForMetadata(md) { + return ( + gnConfig["system.publication.doi.doienabled"] && + md.isTemplate === "n" && + md.isPublished() && + JSON.parse(md.isHarvested) === false + ); + } + + /** + * Doi can be published for a resource if: + * - Doi publication is enabled. + * - The resource matches doi.org url + * - The workflow is not enabled for the metadata and + * the metadata is published. + * + */ + function canPublishDoiForResource(md, resource) { + var doiKey = gnConfig["system.publication.doi.doikey"]; + var isMdWorkflowEnableForMetadata = + gnConfig["metadata.workflow.enable"] && md.draft === "y"; + return ( + isDoiApplicableForMetadata(md) && + resource.lUrl !== null && + resource.lUrl.match("doi.org/" + doiKey) !== null && + !isMdWorkflowEnableForMetadata + ); + } + return { - check: function (id) { - return $http.get("../api/records/" + id + "/doi/checkPreConditions"); - }, - create: function (id) { - return $http.put("../api/records/" + id + "/doi"); - } + check: check, + create: create, + isDoiApplicableForMetadata: isDoiApplicableForMetadata, + canPublishDoiForResource: canPublishDoiForResource }; } ]); diff --git a/web-ui/src/main/resources/catalog/components/edit/onlinesrc/OnlineSrcDirective.js b/web-ui/src/main/resources/catalog/components/edit/onlinesrc/OnlineSrcDirective.js index ec8b4098706..5337f868778 100644 --- a/web-ui/src/main/resources/catalog/components/edit/onlinesrc/OnlineSrcDirective.js +++ b/web-ui/src/main/resources/catalog/components/edit/onlinesrc/OnlineSrcDirective.js @@ -179,6 +179,15 @@ "gn_urlutils_service", "gn_related_directive" ]) + .directive("gnUrlValidator", [ + function () { + return { + restrict: "A", + templateUrl: + "../../catalog/components/edit/onlinesrc/partials/urlValidator.html" + }; + } + ]) .directive("gnRemoteRecordSelector", [ "$http", "gnGlobalSettings", @@ -397,13 +406,15 @@ "gnConfigService", "$filter", "gnConfig", + "gnDoiService", function ( gnOnlinesrc, gnCurrentEdit, gnRelatedResources, gnConfigService, $filter, - gnConfig + gnConfig, + gnDoiService ) { return { restrict: "A", @@ -425,11 +436,10 @@ scope.isMdWorkflowEnableForMetadata = gnConfig["metadata.workflow.enable"] && scope.gnCurrentEdit.metadata.draft === "y"; - scope.isDoiApplicableForMetadata = - gnConfig["system.publication.doi.doienabled"] && - scope.gnCurrentEdit.metadata.isTemplate === "n" && - scope.gnCurrentEdit.metadata.isPublished() && - JSON.parse(scope.gnCurrentEdit.metadata.isHarvested) === false; + scope.isDoiApplicableForMetadata = gnDoiService.isDoiApplicableForMetadata( + scope.gnCurrentEdit.metadata + ); + scope.canPublishDoiForResource = gnDoiService.canPublishDoiForResource; /** * Calls service 'relations.get' to load @@ -453,24 +463,6 @@ : category.match(scope.types) !== null; }; - /** - * Doi can be published for a resource if: - * - Doi publication is enabled. - * - The resource matches doi.org url - * - The workflow is not enabled for the metadata and - * the metadata is published. - * - */ - scope.canPublishDoiForResource = function (resource) { - var doiKey = gnConfig["system.publication.doi.doikey"]; - return ( - scope.isDoiApplicableForMetadata && - resource.lUrl !== null && - resource.lUrl.match("doi.org/" + doiKey) !== null && - !scope.isMdWorkflowEnableForMetadata - ); - }; - /** * Builds metadata url checking if the resource points to internal or external url. * @@ -589,7 +581,7 @@ return { restrict: "A", templateUrl: - "../../catalog/components/edit/onlinesrc/" + "partials/addOnlinesrc.html", + "../../catalog/components/edit/onlinesrc/partials/addOnlinesrc.html", link: { pre: function preLink(scope) { scope.searchObj = { @@ -612,7 +604,7 @@ scope.config = null; scope.linkType = null; - + scope.linkTypeGroupFilter = null; scope.loaded = false; scope.layers = null; scope.capabilitiesLayers = null; @@ -628,6 +620,13 @@ } }; + scope.filterTypeChoices = function (type) { + if (!scope.linkTypeGroupFilter) { + return true; + } + return type.group.match(new RegExp(scope.linkTypeGroupFilter)) != null; + }; + // This object is used to share value between this // directive and the SearchFormController scope that // is contained by the directive @@ -742,8 +741,8 @@ } } ) - .then(function () { - $rootScope.$broadcast("gnFileStoreUploadDone"); + .then(function (response) { + $rootScope.$broadcast("gnFileStoreUploadDone", response.data.url); }); }; @@ -873,6 +872,7 @@ gnOnlinesrc.register("onlinesrc", function (linkToEditOrType) { var linkToEdit = undefined, linkType = undefined; + if (angular.isDefined(linkToEditOrType)) { if (angular.isObject(linkToEditOrType)) { linkToEdit = linkToEditOrType; @@ -882,6 +882,14 @@ } scope.isEditing = angular.isDefined(linkToEdit); + + // In edit mode or in add mode when the link type is provided and + // it's not the default addOnlinesrc value, can't be edited + scope.isEditableLinkType = + !scope.isEditing && + (!angular.isDefined(linkType) || + linkType.indexOf("addOnlinesrc") === 0); + // Flag used when editing an online resource to prevent the watcher to update the online // resource description when loading the dialog. scope.processSelectedWMSLayer = false; @@ -900,7 +908,14 @@ return t; } } - return scope.config.types[0]; + return scope.config.types.filter(scope.filterTypeChoices)[0]; + } + + // LinkType may describe an additional group filter + if (linkType && linkType.indexOf("#")) { + var linkTypeConfig = linkType.split("#"); + linkType = linkTypeConfig[0]; + scope.linkTypeGroupFilter = linkTypeConfig[1]; } var typeConfig = linkToEdit @@ -1237,6 +1252,14 @@ scope.onlinesrcService.reload = true; }; + scope.isUrlEmpty = function () { + var url = scope.params.url; + if (angular.isObject(url)) { + url = url[scope.ctrl.urlCurLang]; + } + return (url || "") === ""; + }; + /** * loadCurrentLink * @@ -1578,10 +1601,9 @@ scope.selectUploadedResource = function (res) { if (res && res.url) { var o = { - name: decodeURI(res.id.split("/").splice(2).join("/")), url: res.url }; - ["url", "name"].forEach(function (pName) { + ["url"].forEach(function (pName) { setParameterValue(pName, o[pName]); }); scope.params.protocol = scope.params.protocol || "WWW:DOWNLOAD"; diff --git a/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/addOnlinesrc.html b/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/addOnlinesrc.html index 405682e079b..b344fc0f810 100644 --- a/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/addOnlinesrc.html +++ b/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/addOnlinesrc.html @@ -18,7 +18,7 @@ @@ -36,8 +36,8 @@
url{{(params.linkType.fields.url.label || 'url') | translate}}
+ +
+
+ +
+
@@ -300,7 +321,8 @@ class="col-sm-2 control-label" data-translate="" data-gn-field-tooltip="{{schema}}|{{params.linkType.fields.name.tooltip}}" - >onlineResourceName{{(params.linkType.fields.name.label || 'onlineResourceName') | + translate}}
description + {{(params.linkType.fields.desc.label || 'description') | translate}} +
applicationProfile + {{(params.linkType.fields.applicationProfile.label || + 'applicationProfile') | translate}} +
-
-
- fileStore - - - -
-
-
-
-
-
+ +
+
+ fileStore + + + +
+
+
+
+
@@ -620,21 +644,5 @@
data-gn-need-help="linking-documents" class="pull-right" >
-
-
- areYouSureToAddALinkWithError - - {{params.url[ctrl.urlCurLang]}} - -
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..904c7804228 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 @@ -183,7 +183,7 @@
orUseRemoteRecordUrl -
+
+ +
+ remoteRecordUrlReturnedError + + {{remoteRecord.remoteUrl}} + +
+
+ remoteRecordPropertiesError + + {{remoteRecord.remoteUrl}} + +
+ remoteRecordUrl-help @@ -31,7 +53,7 @@
-
+
  • ({{remoteRecord.uuid}})
  • -
- -
- remoteRecordUrlReturnedError - - {{remoteRecord.remoteUrl}} - -
-
- remoteRecordPropertiesError - - {{remoteRecord.remoteUrl}} - -
+
diff --git a/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/urlValidator.html b/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/urlValidator.html new file mode 100644 index 00000000000..bf84194e9cf --- /dev/null +++ b/web-ui/src/main/resources/catalog/components/edit/onlinesrc/partials/urlValidator.html @@ -0,0 +1,14 @@ +
+ areYouSureToAddALinkWithError + + {{params.url || params.url[ctrl.urlCurLang]}} + +
diff --git a/web-ui/src/main/resources/catalog/components/edit/suggestion/SuggestionDirective.js b/web-ui/src/main/resources/catalog/components/edit/suggestion/SuggestionDirective.js index 660c2d15fac..041c3ec9b18 100644 --- a/web-ui/src/main/resources/catalog/components/edit/suggestion/SuggestionDirective.js +++ b/web-ui/src/main/resources/catalog/components/edit/suggestion/SuggestionDirective.js @@ -109,12 +109,11 @@ params: "@", name: "@", help: "@", - icon: "@" + icon: "@", + target: "@?" }, templateUrl: - "../../catalog/components/edit/" + - "suggestion/partials/" + - "suggestbutton.html", + "../../catalog/components/edit/suggestion/partials/suggestbutton.html", link: function (scope, element, attrs) { scope.sugg = undefined; scope.gnSuggestion = gnSuggestion; @@ -125,8 +124,15 @@ scope.suggestions = data; for (var i = 0; i < data.length; i++) { if (data[i].process === scope.processId) { - scope.sugg = data[i]; - break; + if (scope.target) { + if (data[i].target === scope.target) { + scope.sugg = data[i]; + break; + } + } else { + scope.sugg = data[i]; + break; + } } } } @@ -142,7 +148,7 @@ return { restrict: "A", templateUrl: - "../../catalog/components/edit/suggestion/" + "partials/runprocess.html", + "../../catalog/components/edit/suggestion/partials/runprocess.html", link: function (scope, element, attrs) { scope.gnSuggestion = gnSuggestion; // Indicate if processing is running diff --git a/web-ui/src/main/resources/catalog/components/edit/suggestion/partials/list.html b/web-ui/src/main/resources/catalog/components/edit/suggestion/partials/list.html index 4231c64b298..586cec2c9a9 100644 --- a/web-ui/src/main/resources/catalog/components/edit/suggestion/partials/list.html +++ b/web-ui/src/main/resources/catalog/components/edit/suggestion/partials/list.html @@ -1,6 +1,6 @@
-   suggestions  +   suggestions