From 2fdd17c268d24005eb6f471aa6184f332fb0adda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Prunayre?= Date: Wed, 17 May 2017 16:31:40 +0200 Subject: [PATCH 01/26] ISO19139 / Add thumbnail / Improve support for services and ISO profiles. --- .../main/plugin/iso19139/process/thumbnail-add.xsl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/schemas/iso19139/src/main/plugin/iso19139/process/thumbnail-add.xsl b/schemas/iso19139/src/main/plugin/iso19139/process/thumbnail-add.xsl index bfa842a662db..052a59a7fc2f 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/process/thumbnail-add.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/process/thumbnail-add.xsl @@ -24,8 +24,10 @@ - + @@ -73,6 +75,11 @@ + + + + From e6e6fecef5004f025f0c5bd2c535d26a4961a39b Mon Sep 17 00:00:00 2001 From: Francois Prunayre Date: Thu, 18 May 2017 10:46:27 +0200 Subject: [PATCH 02/26] ISO19139 / CSW / Improve response and better support profiles #1986. --- .../plugin/iso19139/present/csw/csw-brief.xsl | 8 +-- .../plugin/iso19139/present/csw/gmd-brief.xsl | 30 ++++++----- .../plugin/iso19139/present/csw/gmd-full.xsl | 30 ++++++----- .../iso19139/present/csw/gmd-summary.xsl | 53 ++++++------------- 4 files changed, 55 insertions(+), 66 deletions(-) diff --git a/schemas/iso19139/src/main/plugin/iso19139/present/csw/csw-brief.xsl b/schemas/iso19139/src/main/plugin/iso19139/present/csw/csw-brief.xsl index 2a0349d587bf..6583ef2905f3 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/present/csw/csw-brief.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/present/csw/csw-brief.xsl @@ -50,9 +50,11 @@ - + diff --git a/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-brief.xsl b/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-brief.xsl index 2f353d6410b3..b21f646215fe 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-brief.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-brief.xsl @@ -23,11 +23,13 @@ ~ Rome - Italy. email: geonetwork@osgeo.org --> - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + version="2.0" exclude-result-prefixes="#all"> @@ -35,7 +37,7 @@ - + @@ -45,24 +47,22 @@ - + - - + + - + - + @@ -106,7 +106,9 @@ - + + diff --git a/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-full.xsl b/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-full.xsl index 2f99c00eca10..2db066e16022 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-full.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-full.xsl @@ -23,20 +23,23 @@ ~ Rome - Italy. email: geonetwork@osgeo.org --> - + - - - + + + + + + @@ -49,6 +52,7 @@ - - + + diff --git a/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-summary.xsl b/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-summary.xsl index 29c53292c6e8..13eebf20073a 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-summary.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/present/csw/gmd-summary.xsl @@ -23,11 +23,14 @@ ~ Rome - Italy. email: geonetwork@osgeo.org --> - + exclude-result-prefixes="#all" + version="2.0"> @@ -35,7 +38,7 @@ - + @@ -56,7 +59,7 @@ - + @@ -157,13 +160,13 @@ - - - - + + @@ -179,35 +182,12 @@ - - - - - - - - - - - - - - - - - - - - - + - + @@ -230,8 +210,9 @@ - - + + From eab5400ff92c70cd153434851549f34c110f1cf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Prunayre?= Date: Thu, 18 May 2017 12:11:37 +0200 Subject: [PATCH 03/26] Xsl / Add utility for creating random id --- core/src/main/java/org/fao/geonet/util/XslUtil.java | 7 +++++++ 1 file changed, 7 insertions(+) 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 7074ef4ee6a8..172044559a9d 100644 --- a/core/src/main/java/org/fao/geonet/util/XslUtil.java +++ b/core/src/main/java/org/fao/geonet/util/XslUtil.java @@ -70,6 +70,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +import java.util.Random; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -682,4 +683,10 @@ public static String encodeForURL(String str) { return str; } } + + private static final Random RANDOM = new Random(); + + public static String randomId() { + return "N" + RANDOM.nextInt(Integer.MAX_VALUE); + } } From b1738137b3592db1392688fd0e0b44f4565566fb Mon Sep 17 00:00:00 2001 From: Florent gravin Date: Thu, 18 May 2017 14:06:26 +0200 Subject: [PATCH 04/26] gn - deep merge of db js ui config in default one --- web-ui/src/main/resources/catalog/js/CatController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web-ui/src/main/resources/catalog/js/CatController.js b/web-ui/src/main/resources/catalog/js/CatController.js index f027433ea0e8..6b47239dfc0a 100644 --- a/web-ui/src/main/resources/catalog/js/CatController.js +++ b/web-ui/src/main/resources/catalog/js/CatController.js @@ -206,7 +206,7 @@ current: null, init: function(config, gnUrl, gnViewerSettings, gnSearchSettings) { // Remap some old settings with new one - angular.extend(this.gnCfg, config, {}); + angular.merge(this.gnCfg, config, {}); this.gnUrl = gnUrl || '../'; this.proxyUrl = this.gnUrl + '../proxy?url='; gnViewerSettings.mapConfig = this.gnCfg.mods.map; From 7f62c06e5172775255743ca91edff2995de5f95e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Prunayre?= Date: Thu, 18 May 2017 14:23:58 +0200 Subject: [PATCH 05/26] ISO19139 profiles can now easily override date type code codelist if needed. --- .../main/plugin/iso19139/layout/layout-custom-fields-date.xsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/schemas/iso19139/src/main/plugin/iso19139/layout/layout-custom-fields-date.xsl b/schemas/iso19139/src/main/plugin/iso19139/layout/layout-custom-fields-date.xsl index 78c076e127c4..a91aa4300a98 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/layout/layout-custom-fields-date.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/layout/layout-custom-fields-date.xsl @@ -79,6 +79,7 @@ match="gmd:CI_Date/gmd:date"> + @@ -97,7 +98,7 @@ From bc2a9caf3b2a80756f48e679cc2d5d3c062a0b71 Mon Sep 17 00:00:00 2001 From: Francois Prunayre Date: Thu, 18 May 2017 16:18:19 +0200 Subject: [PATCH 06/26] ISO19139 profiles codelists details & description API does not fallback to iso19139 #1988. --- .../geonet/api/standards/StandardsApi.java | 20 ++++++------------ .../geonet/api/standards/StandardsUtils.java | 21 +++++++++++++++++++ 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/services/src/main/java/org/fao/geonet/api/standards/StandardsApi.java b/services/src/main/java/org/fao/geonet/api/standards/StandardsApi.java index 980f78957870..c089255cda1e 100644 --- a/services/src/main/java/org/fao/geonet/api/standards/StandardsApi.java +++ b/services/src/main/java/org/fao/geonet/api/standards/StandardsApi.java @@ -202,13 +202,9 @@ public Map getSchemaTranslations( Locale language = languageUtils.parseAcceptLanguage(request.getLocales()); context.setLanguage(language.getISO3Language()); - String elementName = StandardsUtils.findNamespace(codelist, schemaManager, schema); - Element e = StandardsUtils.getHelp(schemaManager, "codelists.xml", - schema, elementName, parent, xpath, isoType, context); - if (e == null) { - throw new ResourceNotFoundException(String.format( - "'%s' not found.", codelist)); - } + Element e = StandardsUtils.getCodelists(codelist, schemaManager, + schema, parent, xpath, isoType, context); + List listOfEntry = e.getChildren("entry"); for (Element entry : listOfEntry) { response.put(entry.getChildText("code"), entry.getChildText("label")); @@ -243,13 +239,9 @@ public Codelists.Codelist getSchemaCodelistsWithDetails( Locale language = languageUtils.parseAcceptLanguage(request.getLocales()); context.setLanguage(language.getISO3Language()); - String elementName = StandardsUtils.findNamespace(codelist, schemaManager, schema); - Element e = StandardsUtils.getHelp(schemaManager, "codelists.xml", - schema, elementName, parent, xpath, isoType, context); - if (e == null) { - throw new ResourceNotFoundException(String.format( - "'%s' not found.", codelist)); - } + Element e = StandardsUtils.getCodelists(codelist, schemaManager, + schema, parent, xpath, isoType, context); + return (Codelists.Codelist) Xml.unmarshall(e, Codelists.Codelist.class); } diff --git a/services/src/main/java/org/fao/geonet/api/standards/StandardsUtils.java b/services/src/main/java/org/fao/geonet/api/standards/StandardsUtils.java index ab3391755561..01655b876076 100644 --- a/services/src/main/java/org/fao/geonet/api/standards/StandardsUtils.java +++ b/services/src/main/java/org/fao/geonet/api/standards/StandardsUtils.java @@ -25,6 +25,7 @@ import jeeves.server.context.ServiceContext; import jeeves.server.dispatchers.guiservices.XmlFile; +import org.fao.geonet.api.exception.ResourceNotFoundException; import org.fao.geonet.constants.Geonet; import org.fao.geonet.exceptions.OperationAbortedEx; import org.fao.geonet.kernel.SchemaManager; @@ -37,6 +38,26 @@ * Created by francois on 23/06/16. */ public class StandardsUtils { + public static Element getCodelists(String codelist, SchemaManager schemaManager, + String schema, + String parent, String xpath, + String isoType, ServiceContext context) + throws Exception { + String elementName = StandardsUtils.findNamespace(codelist, schemaManager, schema); + Element e = StandardsUtils.getHelp(schemaManager, "codelists.xml", + schema, elementName, parent, xpath, isoType, context); + if (e == null) { + if (schema.startsWith("iso19139.")) { + e = StandardsUtils.getHelp(schemaManager, "codelists.xml", + "iso19139", elementName, parent, xpath, isoType, context); + } + if (e == null) { + throw new ResourceNotFoundException(String.format( + "'%s' not found.", codelist)); + } + } + return e; + } public static Element getHelp(SchemaManager scm, String fileName, String schema, String name, String parent, String xpath, String isoType, ServiceContext context) throws Exception { From 4347e8e83a441c0c97c2300f1fc830700fc83125 Mon Sep 17 00:00:00 2001 From: Francois Prunayre Date: Thu, 18 May 2017 17:02:32 +0200 Subject: [PATCH 07/26] ISO19139 profiles label API does not fallback to iso19139 #1988. --- .../geonet/api/standards/StandardsApi.java | 14 ++++----- .../geonet/api/standards/StandardsUtils.java | 30 +++++++++++++++---- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/services/src/main/java/org/fao/geonet/api/standards/StandardsApi.java b/services/src/main/java/org/fao/geonet/api/standards/StandardsApi.java index c089255cda1e..ba2eb4e955e8 100644 --- a/services/src/main/java/org/fao/geonet/api/standards/StandardsApi.java +++ b/services/src/main/java/org/fao/geonet/api/standards/StandardsApi.java @@ -202,7 +202,7 @@ public Map getSchemaTranslations( Locale language = languageUtils.parseAcceptLanguage(request.getLocales()); context.setLanguage(language.getISO3Language()); - Element e = StandardsUtils.getCodelists(codelist, schemaManager, + Element e = StandardsUtils.getCodelist(codelist, schemaManager, schema, parent, xpath, isoType, context); List listOfEntry = e.getChildren("entry"); @@ -239,7 +239,7 @@ public Codelists.Codelist getSchemaCodelistsWithDetails( Locale language = languageUtils.parseAcceptLanguage(request.getLocales()); context.setLanguage(language.getISO3Language()); - Element e = StandardsUtils.getCodelists(codelist, schemaManager, + Element e = StandardsUtils.getCodelist(codelist, schemaManager, schema, parent, xpath, isoType, context); return (Codelists.Codelist) Xml.unmarshall(e, Codelists.Codelist.class); @@ -273,13 +273,9 @@ public org.fao.geonet.kernel.schema.labels.Element getElementDetails( Locale language = languageUtils.parseAcceptLanguage(request.getLocales()); context.setLanguage(language.getISO3Language()); - String elementName = StandardsUtils.findNamespace(element, schemaManager, schema); - Element e = StandardsUtils.getHelp(schemaManager, "labels.xml", - schema, elementName, parent, xpath, isoType, context); - if (e == null) { - throw new ResourceNotFoundException(String.format( - "'%s' not found.", element)); - } + Element e = StandardsUtils.getLabel(element, schemaManager, + schema, parent, xpath, isoType, context); + return (org.fao.geonet.kernel.schema.labels.Element) Xml.unmarshall(e, org.fao.geonet.kernel.schema.labels.Element.class); } } diff --git a/services/src/main/java/org/fao/geonet/api/standards/StandardsUtils.java b/services/src/main/java/org/fao/geonet/api/standards/StandardsUtils.java index 01655b876076..c0f3e709ffca 100644 --- a/services/src/main/java/org/fao/geonet/api/standards/StandardsUtils.java +++ b/services/src/main/java/org/fao/geonet/api/standards/StandardsUtils.java @@ -38,26 +38,46 @@ * Created by francois on 23/06/16. */ public class StandardsUtils { - public static Element getCodelists(String codelist, SchemaManager schemaManager, + public static Element getCodelist(String codelist, SchemaManager schemaManager, String schema, String parent, String xpath, String isoType, ServiceContext context) throws Exception { - String elementName = StandardsUtils.findNamespace(codelist, schemaManager, schema); - Element e = StandardsUtils.getHelp(schemaManager, "codelists.xml", + return getCodelistOrLabel(codelist, schemaManager, schema, + parent, xpath, isoType, context, "codelists.xml"); + } + + public static Element getLabel(String element, SchemaManager schemaManager, + String schema, + String parent, String xpath, + String isoType, ServiceContext context) + throws Exception { + return getCodelistOrLabel(element, schemaManager, schema, + parent, xpath, isoType, context, "labels.xml"); + } + + private static Element getCodelistOrLabel(String element, SchemaManager schemaManager, + String schema, String parent, String xpath, + String isoType, ServiceContext context, + String fileName) throws Exception { + String elementName = StandardsUtils.findNamespace(element, schemaManager, schema); + Element e = StandardsUtils.getHelp(schemaManager, fileName, schema, elementName, parent, xpath, isoType, context); if (e == null) { if (schema.startsWith("iso19139.")) { - e = StandardsUtils.getHelp(schemaManager, "codelists.xml", + e = StandardsUtils.getHelp(schemaManager, fileName, "iso19139", elementName, parent, xpath, isoType, context); } if (e == null) { throw new ResourceNotFoundException(String.format( - "'%s' not found.", codelist)); + "Element '%s' from schema '%s' not found in '%s'.", + elementName, schema, fileName)); } } return e; } + + public static Element getHelp(SchemaManager scm, String fileName, String schema, String name, String parent, String xpath, String isoType, ServiceContext context) throws Exception { From 1654b053be6f41c8198f9c5d28a8d12cb6fd5d34 Mon Sep 17 00:00:00 2001 From: Francois Prunayre Date: Fri, 19 May 2017 12:18:12 +0200 Subject: [PATCH 08/26] ISO19139 / Associated resources / Better support of ISO profiles. --- .../plugin/iso19139/process/dataset-add.xsl | 164 ++++++++---------- .../plugin/iso19139/process/source-add.xsl | 6 +- 2 files changed, 78 insertions(+), 92 deletions(-) diff --git a/schemas/iso19139/src/main/plugin/iso19139/process/dataset-add.xsl b/schemas/iso19139/src/main/plugin/iso19139/process/dataset-add.xsl index f7260aab3209..9e3306d4d51e 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/process/dataset-add.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/process/dataset-add.xsl @@ -33,8 +33,6 @@ attached it to the metadata for data. version="2.0" > - - @@ -42,28 +40,26 @@ attached it to the metadata for data. - - + gmd:language| + gmd:characterSet| + gmd:parentIdentifier| + gmd:hierarchyLevel| + gmd:hierarchyLevelName| + gmd:contact| + gmd:dateStamp| + gmd:metadataStandardName| + gmd:metadataStandardVersion| + gmd:dataSetURI| + gmd:locale| + gmd:spatialRepresentationInfo| + gmd:referenceSystemInfo| + gmd:metadataExtensionInfo"/> @@ -74,49 +70,49 @@ attached it to the metadata for data. + select="gmd:identificationInfo/*/gmd:citation| + gmd:identificationInfo/*/gmd:abstract| + gmd:identificationInfo/*/gmd:purpose| + gmd:identificationInfo/*/gmd:credit| + gmd:identificationInfo/*/gmd:statut| + gmd:identificationInfo/*/gmd:pointOfContact| + gmd:identificationInfo/*/gmd:resourceMaintenance| + gmd:identificationInfo/*/gmd:graphicOverview| + gmd:identificationInfo/*/gmd:resourceFormat| + gmd:identificationInfo/*/gmd:descriptiveKeywords| + gmd:identificationInfo/*/gmd:resourceSpecificUsage| + gmd:identificationInfo/*/gmd:resourceConstraints| + gmd:identificationInfo/*/gmd:aggregationInfo| + gmd:identificationInfo/*/srv:serviceType| + gmd:identificationInfo/*/srv:serviceTypeVersion| + gmd:identificationInfo/*/srv:accessProperties| + gmd:identificationInfo/*/srv:restrictions| + gmd:identificationInfo/*/srv:keywords| + gmd:identificationInfo/*/srv:extent"/> - + + + + + + GetCapabilities + + + + + + + + + + + + + + @@ -127,21 +123,16 @@ attached it to the metadata for data. - - - - + + test="gmd:identificationInfo/*/srv:coupledResource"> + select="gmd:identificationInfo/*/srv:coupledResource"> + select="gmd:identificationInfo/*/srv:couplingType| + gmd:identificationInfo/*/srv:containsOperations| + gmd:identificationInfo/*/srv:operatesOn[@uuidref!=$uuidref]"/> + // TODO : it looks like the dataset identifier and not the + // metadata UUID should be set in the operatesOn element of + // the service metadata record. + --> + @@ -195,7 +185,7 @@ attached it to the metadata for data. + gmd:identificationInfo/*[@gco:isoType='srv:SV_ServiceIdentification']"> @@ -259,19 +249,15 @@ attached it to the metadata for data. - - + gmd:portrayalCatalogueInfo| + gmd:metadataConstraints| + gmd:applicationSchemaInfo| + gmd:metadataMaintenance| + gmd:series| + gmd:describes| + gmd:propertyType| + gmd:featureType| + gmd:featureAttribute"/> - - diff --git a/schemas/iso19139/src/main/plugin/iso19139/process/source-add.xsl b/schemas/iso19139/src/main/plugin/iso19139/process/source-add.xsl index 3a87c276cd6c..38d25ac60bff 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/process/source-add.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/process/source-add.xsl @@ -67,6 +67,9 @@ Stylesheet used to update metadata adding a reference to a source record. + + @@ -86,9 +89,6 @@ Stylesheet used to update metadata adding a reference to a source record. - - From 9de51d610b47b40dc535ae6e963a3b404f55a93a Mon Sep 17 00:00:00 2001 From: Francois Prunayre Date: Fri, 19 May 2017 18:37:32 +0200 Subject: [PATCH 09/26] ISO19139 / Associated resources / Better support of ISO profiles. --- .../plugin/iso19139/process/dataset-add.xsl | 22 ++++- .../iso19139/process/datasets-remove.xsl | 4 +- .../plugin/iso19139/process/fcats-add.xsl | 84 +++++++++++-------- .../plugin/iso19139/process/fcats-remove.xsl | 6 +- .../plugin/iso19139/process/sibling-add.xsl | 10 ++- .../plugin/iso19139/process/source-add.xsl | 6 +- 6 files changed, 83 insertions(+), 49 deletions(-) diff --git a/schemas/iso19139/src/main/plugin/iso19139/process/dataset-add.xsl b/schemas/iso19139/src/main/plugin/iso19139/process/dataset-add.xsl index 9e3306d4d51e..3e2bb197f26c 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/process/dataset-add.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/process/dataset-add.xsl @@ -26,12 +26,14 @@ Stylesheet used to update metadata for a service and attached it to the metadata for data. --> - + exclude-result-prefixes="#all"> @@ -258,6 +260,22 @@ attached it to the metadata for data. gmd:propertyType| gmd:featureType| gmd:featureAttribute"/> + + + + + + + + + + + + + + + diff --git a/schemas/iso19139/src/main/plugin/iso19139/process/datasets-remove.xsl b/schemas/iso19139/src/main/plugin/iso19139/process/datasets-remove.xsl index bf53637fc512..7b96175c21e3 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/process/datasets-remove.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/process/datasets-remove.xsl @@ -40,7 +40,9 @@ Stylesheet used to remove a reference to a online resource. diff --git a/schemas/iso19139/src/main/plugin/iso19139/process/fcats-add.xsl b/schemas/iso19139/src/main/plugin/iso19139/process/fcats-add.xsl index ace837ea8f6d..f55716d68ab4 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/process/fcats-add.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/process/fcats-add.xsl @@ -26,39 +26,37 @@ Stylesheet used to update metadata for a service and attached it to the metadata for data. --> - - - + exclude-result-prefixes="#all"> - - + gmd:language| + gmd:characterSet| + gmd:parentIdentifier| + gmd:hierarchyLevel| + gmd:hierarchyLevelName| + gmd:contact| + gmd:dateStamp| + gmd:metadataStandardName| + gmd:metadataStandardVersion| + gmd:dataSetURI| + gmd:locale| + gmd:spatialRepresentationInfo| + gmd:referenceSystemInfo| + gmd:metadataExtensionInfo| + gmd:identificationInfo"/> @@ -68,13 +66,13 @@ attached it to the metadata for data. + gmd:contentInfo/gmd:MD_FeatureCatalogueDescription/gmd:featureCatalogueCitation[@uuidref = $uuidref]/../gmd:language| + gmd:contentInfo/gmd:MD_FeatureCatalogueDescription/gmd:featureCatalogueCitation[@uuidref = $uuidref]/../gmd:includedWithDataset| + gmd:contentInfo/gmd:MD_FeatureCatalogueDescription/gmd:featureCatalogueCitation[@uuidref = $uuidref]/../gmd:featureTypes"/> + xlink:href="{$siteUrl}csw?service=CSW&request=GetRecordById&version=2.0.2&outputSchema=http://www.isotc211.org/2005/gmd&elementSetName=full&id={$uuidref}"> @@ -82,33 +80,45 @@ attached it to the metadata for data. - + xlink:href="{$siteUrl}csw?service=CSW&request=GetRecordById&version=2.0.2&outputSchema=http://www.isotc211.org/2005/gmd&elementSetName=full&id={$uuidref}"/> + gmd:dataQualityInfo| + gmd:portrayalCatalogueInfo| + gmd:metadataConstraints| + gmd:applicationSchemaInfo| + gmd:metadataMaintenance| + gmd:series| + gmd:describes| + gmd:propertyType| + gmd:featureType| + gmd:featureAttribute"/> + + + + + + + + + + + + diff --git a/schemas/iso19139/src/main/plugin/iso19139/process/fcats-remove.xsl b/schemas/iso19139/src/main/plugin/iso19139/process/fcats-remove.xsl index 8aa0f8b60942..2ccc603495ec 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/process/fcats-remove.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/process/fcats-remove.xsl @@ -23,13 +23,11 @@ --> + version="2.0"> diff --git a/schemas/iso19139/src/main/plugin/iso19139/process/sibling-add.xsl b/schemas/iso19139/src/main/plugin/iso19139/process/sibling-add.xsl index b6c82444212d..d0c4712aa5a4 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/process/sibling-add.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/process/sibling-add.xsl @@ -25,7 +25,9 @@ - @@ -43,7 +45,7 @@ Stylesheet used to add a reference to a related record using aggregation info. - + @@ -72,6 +74,10 @@ Stylesheet used to add a reference to a related record using aggregation info. + + + diff --git a/schemas/iso19139/src/main/plugin/iso19139/process/source-add.xsl b/schemas/iso19139/src/main/plugin/iso19139/process/source-add.xsl index 38d25ac60bff..3a87c276cd6c 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/process/source-add.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/process/source-add.xsl @@ -67,9 +67,6 @@ Stylesheet used to update metadata adding a reference to a source record. - - @@ -89,6 +86,9 @@ Stylesheet used to update metadata adding a reference to a source record. + + From ba60edeb38cb450b10210c4c9140b8943cf44531 Mon Sep 17 00:00:00 2001 From: Florent gravin Date: Thu, 6 Apr 2017 16:20:56 +0200 Subject: [PATCH 10/26] Typo in codelist --- schemas/iso19139/src/main/plugin/iso19139/loc/fre/codelists.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/iso19139/src/main/plugin/iso19139/loc/fre/codelists.xml b/schemas/iso19139/src/main/plugin/iso19139/loc/fre/codelists.xml index 5d3ff2cf1217..915011ec1600 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/loc/fre/codelists.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/loc/fre/codelists.xml @@ -1351,7 +1351,7 @@ onGoing - + Ressource continuellement mise à jour From 0a6ab382294f88215a0126adc608aed4c5f13f83 Mon Sep 17 00:00:00 2001 From: Florent gravin Date: Thu, 6 Apr 2017 17:50:37 +0200 Subject: [PATCH 11/26] Fix bug in region picker if geonames --- .../resources/catalog/components/utility/UtilityDirective.js | 2 +- .../catalog/components/utility/partials/regionpicker.html | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js b/web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js index fc6b236e4054..c5219ec0eb1b 100644 --- a/web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js +++ b/web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js @@ -127,7 +127,7 @@ id: 'geonames' }); } - scope.regionType = data[0]; + scope.regionType = scope.regionTypes[0]; }); scope.setRegion = function(regionType) { diff --git a/web-ui/src/main/resources/catalog/components/utility/partials/regionpicker.html b/web-ui/src/main/resources/catalog/components/utility/partials/regionpicker.html index fd33bf1ca5d8..70ecc6e72b36 100644 --- a/web-ui/src/main/resources/catalog/components/utility/partials/regionpicker.html +++ b/web-ui/src/main/resources/catalog/components/utility/partials/regionpicker.html @@ -2,7 +2,6 @@
From 1c0ce228e73d8c6e307e38a8710d08aee2b783a7 Mon Sep 17 00:00:00 2001 From: Florent gravin Date: Thu, 20 Apr 2017 10:15:46 +0200 Subject: [PATCH 12/26] Use proxy for geonames in editor fix http https policy --- .../catalog/components/utility/UtilityDirective.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js b/web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js index c5219ec0eb1b..eb3037e8eb41 100644 --- a/web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js +++ b/web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js @@ -171,8 +171,8 @@ * to catch event from selection. */ module.directive('gnRegionPickerInput', [ - 'gnRegionService', 'gnUrlUtils', - function(gnRegionService, gnUrlUtils) { + 'gnRegionService', 'gnUrlUtils', 'gnGlobalSettings', + function(gnRegionService, gnUrlUtils, gnGlobalSettings) { return { restrict: 'A', link: function(scope, element, attrs) { @@ -201,6 +201,8 @@ username: 'georchestra' })); + url = gnGlobalSettings.proxyUrl + encodeURIComponent(url); + var autocompleter = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), queryTokenizer: Bloodhound.tokenizers.whitespace, From e59bdad0817fbd099e19299c4404bae512bfe26d Mon Sep 17 00:00:00 2001 From: Francois Prunayre Date: Mon, 22 May 2017 21:44:27 +0200 Subject: [PATCH 13/26] Add a context to the map fails #1992. --- .../src/main/java/org/fao/geonet/services/mef/ImportWebMap.java | 2 +- .../catalog/components/viewer/owscontext/OwsContextService.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/src/main/java/org/fao/geonet/services/mef/ImportWebMap.java b/services/src/main/java/org/fao/geonet/services/mef/ImportWebMap.java index f87539e813af..c110f0f31a16 100644 --- a/services/src/main/java/org/fao/geonet/services/mef/ImportWebMap.java +++ b/services/src/main/java/org/fao/geonet/services/mef/ImportWebMap.java @@ -143,7 +143,7 @@ public Element serviceSpecificExec(Element params, ServiceContext context) throw // Update the MD Map onlineSrcParams = new HashMap(); onlineSrcParams.put("protocol", "WWW:DOWNLOAD-OGC:OWS-C"); - onlineSrcParams.put("url", sm.getSiteURL(context) + String.format("/resources.get?uuid=%s&fname=%s&access=public", uuid, mapFileName)); + onlineSrcParams.put("url", sm.getNodeURL() + String.format("api/records/%s/attachments/%s", uuid, mapFileName)); onlineSrcParams.put("name", mapFileName); onlineSrcParams.put("desc", title); Element mdWithOLRes = Xml.transform(transformedMd, schemaMan.getSchemaDir("iso19139").resolve("process").resolve("onlinesrc-add.xsl"), onlineSrcParams); diff --git a/web-ui/src/main/resources/catalog/components/viewer/owscontext/OwsContextService.js b/web-ui/src/main/resources/catalog/components/viewer/owscontext/OwsContextService.js index e9d32d936c8e..b5504f2591dd 100644 --- a/web-ui/src/main/resources/catalog/components/viewer/owscontext/OwsContextService.js +++ b/web-ui/src/main/resources/catalog/components/viewer/owscontext/OwsContextService.js @@ -307,7 +307,7 @@ // if (/^(f|ht)tps?:\/\//i.test(url)) { // url = gnGlobalSettings.proxyUrl + encodeURIComponent(url); // } - $http.get(url).then(function(r) { + $http.get(url, {headers: {accept: 'application/xml'}}).then(function(r) { if (r.data === '') { var msg = $translate.instant('emptyMapLoadError', { url: url From f0d856ac8ec2abb1e2b83c63cd6314186166b242 Mon Sep 17 00:00:00 2001 From: Francois Prunayre Date: Tue, 23 May 2017 08:06:28 +0200 Subject: [PATCH 14/26] Add (or restore?) capability to load a map context from URL parameter #1993. --- web-ui/src/main/resources/catalog/views/default/config.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web-ui/src/main/resources/catalog/views/default/config.js b/web-ui/src/main/resources/catalog/views/default/config.js index a6b83ef11c09..3442df08c56a 100644 --- a/web-ui/src/main/resources/catalog/views/default/config.js +++ b/web-ui/src/main/resources/catalog/views/default/config.js @@ -38,13 +38,14 @@ 'gnMap', 'gnNcWms', 'gnGlobalSettings', + '$location', function(searchSettings, viewerSettings, gnOwsContextService, - gnMap, gnNcWms, gnGlobalSettings) { + gnMap, gnNcWms, gnGlobalSettings, $location) { // Load the context defined in the configuration viewerSettings.defaultContext = - viewerSettings.mapConfig.map || - '../../map/config-viewer.xml'; + (viewerSettings.mapConfig.map || '../../map/config-viewer.xml'); + viewerSettings.owsContext = $location.search().map; // Keep one layer in the background // while the context is not yet loaded. From 9f82eec5b2a83682d1da8218e7d9b5e1af57feb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Prunayre?= Date: Tue, 23 May 2017 16:23:12 +0200 Subject: [PATCH 15/26] ISO19139 / Remove duplicated map editor introduce by bad merge --- .../common/map/partials/drawbbox.html | 74 ------------------- 1 file changed, 74 deletions(-) diff --git a/web-ui/src/main/resources/catalog/components/common/map/partials/drawbbox.html b/web-ui/src/main/resources/catalog/components/common/map/partials/drawbbox.html index db48cfdcb417..50c46f11a4d8 100644 --- a/web-ui/src/main/resources/catalog/components/common/map/partials/drawbbox.html +++ b/web-ui/src/main/resources/catalog/components/common/map/partials/drawbbox.html @@ -17,80 +17,6 @@
- - - - - - - - - - - - - - - - - - -
- - -
- - -
- -
-
- -
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
From 631142e72846a3b8e8496384877733e0232d0f09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Prunayre?= Date: Wed, 24 May 2017 09:13:26 +0200 Subject: [PATCH 16/26] CSW GetRecords returns an exception if no matches are found instead of empty response #1998 --- .../geonet/kernel/csw/services/getrecords/SearchController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/SearchController.java b/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/SearchController.java index c1a91f538ea9..ccd28ab7d8fc 100644 --- a/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/SearchController.java +++ b/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/SearchController.java @@ -472,7 +472,7 @@ public Pair search(ServiceContext context, int startPos, int m Element summary = summaryAndSearchResults.one(); int numMatches = Integer.parseInt(summary.getAttributeValue("count")); - if (startPos > numMatches) { + if (numMatches != 0 && startPos > numMatches) { throw new InvalidParameterValueEx("startPosition", String.format( "Start position (%d) can't be greater than number of matching records (%d for current search).", startPos, numMatches From 6a296828b6a8e8fc8aae34dd4ad2e702a05bd6a7 Mon Sep 17 00:00:00 2001 From: Francois Prunayre Date: Wed, 24 May 2017 13:52:21 +0200 Subject: [PATCH 17/26] Facet tree / Handle double click to expand all subtree children #1999. --- .../search/facets/FacetDimensionDirective.js | 28 +++++++++++++++++-- .../partials/dimension-facet-category.html | 1 + 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/web-ui/src/main/resources/catalog/components/search/facets/FacetDimensionDirective.js b/web-ui/src/main/resources/catalog/components/search/facets/FacetDimensionDirective.js index 35546df3d210..ac8861b08aa7 100644 --- a/web-ui/src/main/resources/catalog/components/search/facets/FacetDimensionDirective.js +++ b/web-ui/src/main/resources/catalog/components/search/facets/FacetDimensionDirective.js @@ -236,12 +236,12 @@ $event.preventDefault(); }; - scope.isOnDrillDownPath = function(category, $event) { + scope.isOnDrillDownPath = function(category) { return gnFacetConfigService .isOnDrillDownPath(scope, category); }; - scope.isInFilter = function(category, $event) { + scope.isInFilter = function(category) { return gnFacetConfigService.isInFilter(scope, category); }; @@ -256,6 +256,30 @@ !evt || evt.preventDefault(); return false; }; + + scope.toggleAllNode = function(evt) { + el = evt ? + $(evt.currentTarget).parent() : + element.find('span.fa'); + var isExpanded = undefined; + el.find('.fa').each(function (idx, e) { + e = $(e); + if (angular.isUndefined(isExpanded)) { + isExpanded = !e.hasClass('fa-plus-square'); + } + e.removeClass(isExpanded ? 'fa-minus-square' : 'fa-plus-square'); + e.addClass(isExpanded ? 'fa-plus-square' : 'fa-minus-square'); + }); + el.find('div[data-gn-facet-dimension-category]').each(function (idx, e) { + if(isExpanded) { + $(e).addClass('hidden'); + } else { + $(e).removeClass('hidden'); + } + }); + !evt || evt.preventDefault(); + return false; + }; }); } }; diff --git a/web-ui/src/main/resources/catalog/components/search/facets/partials/dimension-facet-category.html b/web-ui/src/main/resources/catalog/components/search/facets/partials/dimension-facet-category.html index 292388f1ac8d..0aa39fdd705f 100644 --- a/web-ui/src/main/resources/catalog/components/search/facets/partials/dimension-facet-category.html +++ b/web-ui/src/main/resources/catalog/components/search/facets/partials/dimension-facet-category.html @@ -4,6 +4,7 @@ data-ng-if="$index < maxItems" class="list-group-item"> From 6370080fb2fbe4eaa22ebefbe92ccf90d34c62df Mon Sep 17 00:00:00 2001 From: Francois Prunayre Date: Wed, 24 May 2017 15:45:06 +0200 Subject: [PATCH 18/26] Editor / Extent selection from RegionsDao does not display concept with no # in id #2000. --- .../catalog/components/utility/UtilityService.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/web-ui/src/main/resources/catalog/components/utility/UtilityService.js b/web-ui/src/main/resources/catalog/components/utility/UtilityService.js index ae6462b50a0b..d16c9895e8e7 100644 --- a/web-ui/src/main/resources/catalog/components/utility/UtilityService.js +++ b/web-ui/src/main/resources/catalog/components/utility/UtilityService.js @@ -418,11 +418,14 @@ listDefer = $q.defer(); $http.get('../api/regions/types').success(function(data) { angular.forEach(data, function(value, key) { - if (value.id && value.id.indexOf('#') >= 0) { + if (value.id) { + var tokens = value.id.split('#'), + asHash = tokens.length > 0, + name = asHash ? tokens[1] : value.id; regionsList.push({ id: value.id, - name: value.id.split('#')[1], - label: value.label || value.id.split('#')[1] + name: name, + label: value.label || name }); } }); From 28cb99f72434062371ed048c6e04c710c0e2b6e0 Mon Sep 17 00:00:00 2001 From: Francois Prunayre Date: Wed, 24 May 2017 16:16:25 +0200 Subject: [PATCH 19/26] ISO19139 / Related directive / Add capability to filter on any associated resource properties #1983. --- .../metadataactions/RelatedDirective.js | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/web-ui/src/main/resources/catalog/components/metadataactions/RelatedDirective.js b/web-ui/src/main/resources/catalog/components/metadataactions/RelatedDirective.js index cc5295241ec5..32b5ab13c248 100644 --- a/web-ui/src/main/resources/catalog/components/metadataactions/RelatedDirective.js +++ b/web-ui/src/main/resources/catalog/components/metadataactions/RelatedDirective.js @@ -100,6 +100,7 @@ types: '@', title: '@', list: '@', + filter: '@', user: '=', hasResults: '=?' }, @@ -112,12 +113,28 @@ (promise = gnRelatedService.get( scope.uuid, scope.types) ).then(function(data) { - scope.relations = data; - angular.forEach(data, function(value) { + scope.relations = {}; + angular.forEach(data, function(value, idx) { if (value) { scope.relationFound = true; scope.hasResults = true; } + if (!scope.relations[idx]) { + scope.relations[idx] = []; + } + if (scope.filter && angular.isArray(value)) { + var tokens = scope.filter.split(':'), + field = tokens[0], + filter = tokens[1]; + scope.relations[idx] = []; + for (var i = 0; i < value.length; i++) { + if (value[i][field] === filter) { + scope.relations[idx].push(value[i]); + } + } + } else { + scope.relations[idx] = value; + } }); }); } From 282f54cd77209cd1b2bbabaaf07ef0ab49142bd3 Mon Sep 17 00:00:00 2001 From: Francois Prunayre Date: Thu, 25 May 2017 08:46:59 +0200 Subject: [PATCH 20/26] Editor / No "just created" flag for new records in Geonetwork 3.0.x #1668 --- .../components/catalog/CatalogService.js | 2 +- .../catalog/js/edit/EditorController.js | 55 +++++++++++++------ 2 files changed, 39 insertions(+), 18 deletions(-) diff --git a/web-ui/src/main/resources/catalog/components/catalog/CatalogService.js b/web-ui/src/main/resources/catalog/components/catalog/CatalogService.js index 24d1cb55fd86..3fa86a34b117 100644 --- a/web-ui/src/main/resources/catalog/components/catalog/CatalogService.js +++ b/web-ui/src/main/resources/catalog/components/catalog/CatalogService.js @@ -169,7 +169,7 @@ if (tab) { path += '/tab/' + tab; } - $location.path(path); + $location.path(path).search('justcreated'); }); }, diff --git a/web-ui/src/main/resources/catalog/js/edit/EditorController.js b/web-ui/src/main/resources/catalog/js/edit/EditorController.js index c72c720bcc49..426e609eb3d2 100644 --- a/web-ui/src/main/resources/catalog/js/edit/EditorController.js +++ b/web-ui/src/main/resources/catalog/js/edit/EditorController.js @@ -456,23 +456,44 @@ $scope.cancel = function(refreshForm) { $scope.savedStatus = gnCurrentEdit.savedStatus; - return gnEditor.cancel(refreshForm) - .then(function(form) { - // Refresh editor form after cancel - // $scope.savedStatus = gnCurrentEdit.savedStatus; - // $rootScope.$broadcast('StatusUpdated', { - // title: $translate.instant('cancelMetadataSuccess') - // }); - // gnEditor.refreshEditorForm(null, true); - closeEditor(); - }, function(error) { - $scope.savedStatus = gnCurrentEdit.savedStatus; - $rootScope.$broadcast('StatusUpdated', { - title: $translate.instant('cancelMetadataError'), - error: error, - timeout: 0, - type: 'danger'}); - }); + if ($location.search()['justcreated']) { + // Remove newly created record + var md = gnCurrentEdit.metadata; + gnMetadataActions.deleteMd(md). + then(function(data) { + $rootScope.$broadcast('StatusUpdated', { + title: $translate.instant('metadataRemoved', + {title: md.title || md.defaultTitle}), + timeout: 2 + }); + closeEditor(); + }, function(reason) { + $rootScope.$broadcast('StatusUpdated', { + title: $translate.instant(reason.data.error.message), + timeout: 0, + type: 'danger' + }); + }); + + } else { + return gnEditor.cancel(refreshForm) + .then(function(form) { + // Refresh editor form after cancel + // $scope.savedStatus = gnCurrentEdit.savedStatus; + // $rootScope.$broadcast('StatusUpdated', { + // title: $translate.instant('cancelMetadataSuccess') + // }); + // gnEditor.refreshEditorForm(null, true); + closeEditor(); + }, function(error) { + $scope.savedStatus = gnCurrentEdit.savedStatus; + $rootScope.$broadcast('StatusUpdated', { + title: $translate.instant('cancelMetadataError'), + error: error, + timeout: 0, + type: 'danger'}); + }); + } }; $scope.close = function() { From 083ebd08cee24a97e7240ac2817714e9394f058d Mon Sep 17 00:00:00 2001 From: Francois Prunayre Date: Thu, 25 May 2017 08:47:28 +0200 Subject: [PATCH 21/26] ISO19139 / Related directive / Add capability to filter on any associated resource properties #1983. --- .../catalog/components/metadataactions/RelatedDirective.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web-ui/src/main/resources/catalog/components/metadataactions/RelatedDirective.js b/web-ui/src/main/resources/catalog/components/metadataactions/RelatedDirective.js index 32b5ab13c248..dbfc2f02d77b 100644 --- a/web-ui/src/main/resources/catalog/components/metadataactions/RelatedDirective.js +++ b/web-ui/src/main/resources/catalog/components/metadataactions/RelatedDirective.js @@ -128,7 +128,7 @@ filter = tokens[1]; scope.relations[idx] = []; for (var i = 0; i < value.length; i++) { - if (value[i][field] === filter) { + if (filter.indexOf(value[i][field]) !== -1) { scope.relations[idx].push(value[i]); } } From 9b499ffbdd6c9b6503412784c93e9704c44b6488 Mon Sep 17 00:00:00 2001 From: Francois Prunayre Date: Thu, 25 May 2017 10:14:11 +0200 Subject: [PATCH 22/26] Formatter / XSLT / Add capability to customize tab ordering. --- schemas/config-editor.xsd | 7 +++++++ .../WEB-INF/data/data/formatter/xslt/render-layout.xsl | 10 +++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/schemas/config-editor.xsd b/schemas/config-editor.xsd index 9409c708498d..758e822022fd 100644 --- a/schemas/config-editor.xsd +++ b/schemas/config-editor.xsd @@ -596,6 +596,13 @@ section which is not used often by the end-user. More than one tab could be grou ]]> + + + + + diff --git a/web/src/main/webapp/WEB-INF/data/data/formatter/xslt/render-layout.xsl b/web/src/main/webapp/WEB-INF/data/data/formatter/xslt/render-layout.xsl index 14f27de4e8f5..370cc6308811 100644 --- a/web/src/main/webapp/WEB-INF/data/data/formatter/xslt/render-layout.xsl +++ b/web/src/main/webapp/WEB-INF/data/data/formatter/xslt/render-layout.xsl @@ -63,7 +63,15 @@ - + + + + + + +